diff --git a/src/main/java/ebf/tim/utility/TransportSlotManager.java b/src/main/java/ebf/tim/utility/TransportSlotManager.java index aa60a7318..6e6808872 100644 --- a/src/main/java/ebf/tim/utility/TransportSlotManager.java +++ b/src/main/java/ebf/tim/utility/TransportSlotManager.java @@ -643,13 +643,16 @@ public void onContainerClosed(EntityPlayer p_75134_1_) { */ @Override public boolean canInteractWith(EntityPlayer player) { - if (((GenericRailTransport) hostInventory).seats.size() > 0) { //TODO: this feels super janky and it feels like this should be added in getPermissions - for(EntitySeat seat : ((GenericRailTransport) hostInventory).seats) { - if (seat.getPassenger() == player && ((GenericRailTransport) hostInventory).seats.indexOf(seat) != 0) { - return true; + if(hostInventory instanceof GenericRailTransport) { + if (((GenericRailTransport) hostInventory).seats.size() > 0) { //TODO: this feels super janky and it feels like this should be added in getPermissions + for (EntitySeat seat : ((GenericRailTransport) hostInventory).seats) { + if (seat.getPassenger() == player && ((GenericRailTransport) hostInventory).seats.indexOf(seat) != 0) { + return true; + } } } + return ((GenericRailTransport)hostInventory).getPermissions(player, hostInventory instanceof EntityTrainCore, false); } - return (hostInventory instanceof GenericRailTransport?((GenericRailTransport)hostInventory).getPermissions(player, hostInventory instanceof EntityTrainCore, false): hostInventory!=null); + return hostInventory!=null; } }