Skip to content

Commit

Permalink
compatibility for the last TM version
Browse files Browse the repository at this point in the history
  • Loading branch information
LotuxPunk committed Jun 12, 2020
1 parent 0bf4d3f commit a1740ea
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,17 @@ public Object[] getDimension() throws NotATardisException {
public Object[] setDoors(String status) throws NotATardisException {
ConsoleTile tardis = getTardis();
this.getWorld().getServer().enqueue(new TickDelayedTask(1, ()->{
tardis.getDoor().setOpenState(EnumDoorState.valueOf(status));
tardis.getDoor().openOther();
tardis.getDoor().ifPresent(doorEntity -> {
doorEntity.setOpenState(EnumDoorState.valueOf(status));
doorEntity.openOther();
});

}));
return null;
}

public Object[] getDoors() throws NotATardisException {
return new String[]{getTardis().getDoor().getOpenState().name()};
return new String[]{getTardis().getDoor().orElseThrow(NullPointerException::new).getOpenState().name()};
}

public Object[] setFacing(String status) throws NotATardisException {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package com.vandendaelen.handles.misc;

import com.vandendaelen.handles.blocks.tiles.TardisInterfaceTile;
import com.vandendaelen.handles.exceptions.NoSubsystemException;
import com.vandendaelen.handles.exceptions.NotATardisException;
import dan200.computercraft.api.lua.ILuaContext;
import dan200.computercraft.api.lua.LuaException;
import dan200.computercraft.api.peripheral.IComputerAccess;
Expand Down Expand Up @@ -90,7 +88,7 @@ public Object[] callMethod(@Nonnull IComputerAccess iComputerAccess, @Nonnull IL
}
return null;
}
catch (NotATardisException | NoSubsystemException e) {
catch (Exception e) {
return null;
}
}
Expand Down

0 comments on commit a1740ea

Please sign in to comment.