Skip to content

Commit

Permalink
Added method
Browse files Browse the repository at this point in the history
  • Loading branch information
kill05 committed Jun 17, 2024
1 parent 3c97694 commit 243b27e
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.player.EntityPlayerSP;
import net.minecraft.core.block.entity.TileEntity;
import net.minecraft.core.entity.player.EntityPlayer;
import net.minecraft.core.item.ItemStack;
import net.minecraft.core.player.inventory.Container;
Expand All @@ -13,6 +14,7 @@
import turniplabs.halplibe.helper.gui.factory.IGuiFactory;
import turniplabs.halplibe.helper.gui.factory.base.GuiFactory;
import turniplabs.halplibe.helper.gui.factory.block.BlockGuiFactory;
import turniplabs.halplibe.helper.gui.factory.block.TileGuiFactory;
import turniplabs.halplibe.helper.gui.factory.item.ItemGuiFactory;
import turniplabs.halplibe.helper.gui.packet.PacketOpenGui;

Expand Down Expand Up @@ -63,6 +65,13 @@ public void open(@NotNull EntityPlayer player, int x, int y, int z) {
open(player, null, x, y, z);
}

public void open(@NotNull EntityPlayer player, TileEntity tile) {
if(!(factory instanceof TileGuiFactory))
throw new IllegalStateException("Gui is not a tile gui!");

open(player, null, tile.x, tile.y, tile.z);
}

protected void open(@NotNull EntityPlayer player, @Nullable ItemStack itemStack, int x, int y, int z) {
if (player.world.isClientSide && serverSide) return;

Expand Down

0 comments on commit 243b27e

Please sign in to comment.