Skip to content

Commit

Permalink
fix inventory crash
Browse files Browse the repository at this point in the history
  • Loading branch information
EternalBlueFlame committed Sep 18, 2023
1 parent 77063b6 commit 03332db
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/main/java/ebf/tim/utility/TransportSlotManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

0 comments on commit 03332db

Please sign in to comment.