mirror of
https://github.com/GTNewHorizons/AE2FluidCraft-Rework.git
synced 2026-11-23 13:30:04 +00:00
Universal GUI (#340)
Co-authored-by: Kogepan229 <[email protected]> Co-authored-by: Martin Robertz <[email protected]>
This commit is contained in:
213 files changed
+1859
-19432
No files matched your search
@@ -0,0 +1,39 @@
|
||||
package com.glodblock.github.util;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import com.glodblock.github.inventory.InventoryHandler;
|
||||
import com.glodblock.github.inventory.gui.GuiType;
|
||||
|
||||
import appeng.container.PrimaryGui;
|
||||
|
||||
public class FluidPrimaryGui extends PrimaryGui {
|
||||
|
||||
public FluidPrimaryGui(Object gui, ItemStack guiIcon, TileEntity te, ForgeDirection side) {
|
||||
super(gui, guiIcon, te, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void open(EntityPlayer p) {
|
||||
if (gui instanceof GuiType gt) {
|
||||
if (te != null) {
|
||||
InventoryHandler.openGui(p, te.getWorldObj(), new BlockPos(te), Objects.requireNonNull(side), gt);
|
||||
} else {
|
||||
InventoryHandler.openGui(
|
||||
p,
|
||||
p.worldObj,
|
||||
new BlockPos(
|
||||
this.slotIndex == Integer.MIN_VALUE ? p.inventory.currentItem : this.slotIndex,
|
||||
Util.GuiHelper.encodeType(0, Util.GuiHelper.GuiType.ITEM),
|
||||
0),
|
||||
Objects.requireNonNull(side),
|
||||
gt);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user