Moved open method to Sky Chest Container.

This commit is contained in:
Sebastian Hartte
2020-06-02 18:57:05 +02:00
parent 2f50568237
commit 3e78c713d1
5 changed files with 22 additions and 6 deletions
@@ -27,10 +27,15 @@ import net.minecraft.entity.player.PlayerInventory;
import appeng.container.AEBaseContainer;
import appeng.container.slot.SlotNormal;
import appeng.tile.storage.TileSkyChest;
import net.minecraft.entity.player.ServerPlayerEntity;
import net.minecraft.inventory.container.ContainerType;
import net.minecraft.inventory.container.INamedContainerProvider;
import net.minecraft.inventory.container.SimpleNamedContainerProvider;
import net.minecraft.network.PacketBuffer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.ITextComponent;
import net.minecraftforge.fml.network.NetworkHooks;
public class ContainerSkyChest extends AEBaseContainer
@@ -66,6 +71,14 @@ public class ContainerSkyChest extends AEBaseContainer
return null;
}
public static void open(ServerPlayerEntity player, TileSkyChest tile, ITextComponent title) {
BlockPos pos = tile.getPos();
INamedContainerProvider container = new SimpleNamedContainerProvider(
(wnd, p, pl) -> new ContainerSkyChest(wnd, p, tile), title
);
NetworkHooks.openGui(player, container, pos);
}
@Override
public void onContainerClosed( final PlayerEntity par1PlayerEntity )
{