This commit is contained in:
PrototypeTrousers
2023-02-02 16:19:56 -03:00
parent 58a6dabb20
commit 17c38a6418
6 changed files with 32 additions and 13 deletions
+10 -2
View File
@@ -45,6 +45,7 @@ import appeng.api.storage.data.IItemList;
import appeng.api.util.AEColor;
import appeng.api.util.AEPartLocation;
import appeng.api.util.DimensionalCoord;
import appeng.container.interfaces.IInventorySlotAware;
import appeng.core.AEConfig;
import appeng.core.AELog;
import appeng.core.AppEng;
@@ -322,18 +323,25 @@ public class Platform {
return;
}
int x = (int) p.posX;
int x;
int y = (int) p.posY;
int z = (int) p.posZ;
if (tile != null) {
x = tile.getPos().getX();
y = tile.getPos().getY();
z = tile.getPos().getZ();
} else {
if (p.openContainer instanceof IInventorySlotAware) {
x = ((IInventorySlotAware) p.openContainer).getInventorySlot();
y = ((IInventorySlotAware)p.openContainer).isBaubleSlot() ? 1 : 0;
} else {
x = p.inventory.currentItem;
}
}
if ((type.getType().isItem() && tile == null) || type.hasPermissions(tile, x, y, z, side, p)) {
if (tile == null && type.getType() == GuiHostType.ITEM) {
p.openGui(AppEng.instance(), type.ordinal() << 4, p.getEntityWorld(), p.inventory.currentItem, 0, 0);
p.openGui(AppEng.instance(), type.ordinal() << 4, p.getEntityWorld(), x, 0, 0);
} else if (tile == null || type.getType() == GuiHostType.ITEM) {
p.openGui(AppEng.instance(), type.ordinal() << 4 | (1 << 3), p.getEntityWorld(), x, y, z);
} else {