Open double-chest directly
This commit is contained in:
parent
5e8a0ebc54
commit
f3a061a942
@ -94,15 +94,10 @@ public class SearchCommandExecutor implements CommandExecutor {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (result instanceof DoubleChest) {
|
// Issue with double-chest: lid stays open after inventory is closed
|
||||||
final DoubleChest dChest = (DoubleChest) result;
|
// Solution requires reflection and probably breaks backward compatibility
|
||||||
|
// TODO: Replace with EntityPlayer.openContainer (?)
|
||||||
//final InventoryView view = player.openInventory(dChest.getInventory());
|
player.openInventory(result.getInventory());
|
||||||
System.out.println("Opened inventory");
|
|
||||||
player.openInventory(new SearchInventoryView(dChest, player, ((Chest)dChest.getLeftSide()).getCustomName() == null ? "Large Chest" : Objects.requireNonNull(((Container) result).getCustomName())));
|
|
||||||
} else {
|
|
||||||
player.openInventory(result.getInventory());
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user