diff --git a/gradle.properties b/gradle.properties index 842bb16..e884456 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,15 +4,15 @@ org.gradle.jvmargs=-Xmx3G org.gradle.daemon=false # Mod Version Information -mod_version=8.0 +mod_version=9.0 # Minecraft Version Information -minecraft_version=1.13.2 -minecraft_version_toml=13 +minecraft_version=1.14.2 +minecraft_version_toml=14 # Forge Version Information -forge_version=25.0.34 -forge_version_toml=25 +forge_version=26.0.16 +forge_version_toml=26 # Mappings Information -mappings_version=20190215-1.13.1 +mappings_version=20190609-1.14.2 diff --git a/src/main/java/com/progwml6/ironchest/IronChest.java b/src/main/java/com/progwml6/ironchest/IronChest.java index 1d97c08..60056b3 100644 --- a/src/main/java/com/progwml6/ironchest/IronChest.java +++ b/src/main/java/com/progwml6/ironchest/IronChest.java @@ -12,13 +12,12 @@ package com.progwml6.ironchest; import com.progwml6.ironchest.client.ClientProxy; import com.progwml6.ironchest.common.ServerProxy; -import com.progwml6.ironchest.common.ai.OcelotsSitOnChestsHandler; +import com.progwml6.ironchest.common.ai.CatsSitOnChestsHandler; +import com.progwml6.ironchest.common.inventory.ChestContainerType; import com.progwml6.ironchest.common.network.PacketHandler; -import com.progwml6.ironchest.common.gui.GuiHandler; +import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.fml.DistExecutor; -import net.minecraftforge.fml.ExtensionPoint; -import net.minecraftforge.fml.ModLoadingContext; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; @@ -36,14 +35,15 @@ public class IronChest { instance = this; FMLJavaModLoadingContext.get().getModEventBus().addListener(this::preInit); - MinecraftForge.EVENT_BUS.register(new OcelotsSitOnChestsHandler()); - ModLoadingContext.get().registerExtensionPoint(ExtensionPoint.GUIFACTORY, () -> GuiHandler::openGui); + MinecraftForge.EVENT_BUS.register(new CatsSitOnChestsHandler()); } private void preInit(final FMLCommonSetupEvent event) { proxy.preInit(); + DistExecutor.runWhenOn(Dist.CLIENT, () -> ChestContainerType::registerScreenFactories); + PacketHandler.register(); } } diff --git a/src/main/java/com/progwml6/ironchest/client/ClientProxy.java b/src/main/java/com/progwml6/ironchest/client/ClientProxy.java index 10775f4..7114bf0 100644 --- a/src/main/java/com/progwml6/ironchest/client/ClientProxy.java +++ b/src/main/java/com/progwml6/ironchest/client/ClientProxy.java @@ -10,9 +10,9 @@ ******************************************************************************/ package com.progwml6.ironchest.client; -import com.progwml6.ironchest.client.renderer.TileEntityIronChestRenderer; +import com.progwml6.ironchest.client.renderer.IronChestTileEntityRenderer; import com.progwml6.ironchest.common.ServerProxy; -import com.progwml6.ironchest.common.blocks.IronChestType; +import com.progwml6.ironchest.common.blocks.ChestType; import net.minecraft.client.Minecraft; import net.minecraft.world.World; import net.minecraftforge.fml.client.registry.ClientRegistry; @@ -30,11 +30,11 @@ public class ClientProxy extends ServerProxy { super.preInit(); - for (IronChestType type : IronChestType.values()) + for (ChestType type : ChestType.values()) { if (type.clazz != null) { - ClientRegistry.bindTileEntitySpecialRenderer(type.clazz, new TileEntityIronChestRenderer()); + ClientRegistry.bindTileEntitySpecialRenderer(type.clazz, new IronChestTileEntityRenderer()); } } } diff --git a/src/main/java/com/progwml6/ironchest/client/gui/GUIChest.java b/src/main/java/com/progwml6/ironchest/client/gui/GUIChest.java deleted file mode 100644 index 3d5392a..0000000 --- a/src/main/java/com/progwml6/ironchest/client/gui/GUIChest.java +++ /dev/null @@ -1,137 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2012 cpw. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the GNU Public License v3.0 - * which accompanies this distribution, and is available at - * http://www.gnu.org/licenses/gpl.html - *
- * Contributors: - * cpw - initial API and implementation - ******************************************************************************/ -package com.progwml6.ironchest.client.gui; - -import com.progwml6.ironchest.common.blocks.IronChestType; -import com.progwml6.ironchest.common.gui.ContainerIronChest; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.IInventory; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; - -@OnlyIn(Dist.CLIENT) -public class GUIChest extends GuiContainer -{ - public enum ResourceList - { - IRON(new ResourceLocation("ironchest", "textures/gui/iron_container.png")), - COPPER(new ResourceLocation("ironchest", "textures/gui/copper_container.png")), - SILVER(new ResourceLocation("ironchest", "textures/gui/silver_container.png")), - GOLD(new ResourceLocation("ironchest", "textures/gui/gold_container.png")), - DIAMOND(new ResourceLocation("ironchest", "textures/gui/diamond_container.png")), - DIRT(new ResourceLocation("ironchest", "textures/gui/dirt_container.png")); - - public final ResourceLocation location; - - ResourceList(ResourceLocation loc) - { - this.location = loc; - } - } - - public enum GUI - { - IRON(184, 202, ResourceList.IRON, IronChestType.IRON, new ResourceLocation("ironchest:iron")), - GOLD(184, 256, ResourceList.GOLD, IronChestType.GOLD, new ResourceLocation("ironchest:gold")), - DIAMOND(238, 256, ResourceList.DIAMOND, IronChestType.DIAMOND, new ResourceLocation("ironchest:diamond")), - COPPER(184, 184, ResourceList.COPPER, IronChestType.COPPER, new ResourceLocation("ironchest:copper")), - SILVER(184, 238, ResourceList.SILVER, IronChestType.SILVER, new ResourceLocation("ironchest:silver")), - CRYSTAL(238, 256, ResourceList.DIAMOND, IronChestType.CRYSTAL, new ResourceLocation("ironchest:diamond")), - OBSIDIAN(238, 256, ResourceList.DIAMOND, IronChestType.OBSIDIAN, new ResourceLocation("ironchest:obsidian")), - DIRTCHEST9000(184, 184, ResourceList.DIRT, IronChestType.DIRTCHEST9000, new ResourceLocation("ironchest:dirt")); - - private int xSize; - - private int ySize; - - private ResourceList guiResourceList; - - private IronChestType mainType; - - private ResourceLocation guiId; - - GUI(int xSize, int ySize, ResourceList guiResourceList, IronChestType mainType, ResourceLocation guiId) - { - this.xSize = xSize; - this.ySize = ySize; - this.guiResourceList = guiResourceList; - this.mainType = mainType; - this.guiId = guiId; - } - - protected Container makeContainer(IInventory playerInventory, IInventory chestInventory, EntityPlayer player) - { - return new ContainerIronChest(playerInventory, chestInventory, this.mainType, player, this.xSize, this.ySize); - } - - public ResourceLocation getGuiId() - { - return this.guiId; - } - } - - private GUI type; - - private final IInventory upperChestInventory; - - private final IInventory lowerChestInventory; - - public GUIChest(GUI type, IInventory playerInventory, IInventory chestInventory) - { - super(type.makeContainer(playerInventory, chestInventory, Minecraft.getInstance().player)); - this.type = type; - this.xSize = type.xSize; - this.ySize = type.ySize; - this.upperChestInventory = playerInventory; - this.lowerChestInventory = chestInventory; - this.allowUserInput = false; - } - - /** - * Draws the screen and all the components in it. - */ - @Override - public void render(int mouseX, int mouseY, float partialTicks) - { - this.drawDefaultBackground(); - super.render(mouseX, mouseY, partialTicks); - this.renderHoveredToolTip(mouseX, mouseY); - } - - /* - @Override - protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) - { - this.fontRenderer.drawString(this.lowerChestInventory.getDisplayName().getString(), 8.0F, 6.0F, 4210752); - this.fontRenderer.drawString(this.upperChestInventory.getDisplayName().getString(), 8.0F, this.ySize - 96 + 2, 4210752); - }*/ - - /** - * Draws the background layer of this container (behind the items). - */ - @Override - protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) - { - GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F); - - this.mc.getTextureManager().bindTexture(this.type.guiResourceList.location); - - int x = (this.width - this.xSize) / 2; - int y = (this.height - this.ySize) / 2; - - this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize); - } -} diff --git a/src/main/java/com/progwml6/ironchest/client/inventory/ChestScreen.java b/src/main/java/com/progwml6/ironchest/client/inventory/ChestScreen.java new file mode 100644 index 0000000..5b3f1cc --- /dev/null +++ b/src/main/java/com/progwml6/ironchest/client/inventory/ChestScreen.java @@ -0,0 +1,72 @@ +/******************************************************************************* + * Copyright (c) 2012 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Public License v3.0 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/gpl.html + *
+ * Contributors:
+ * cpw - initial API and implementation
+ ******************************************************************************/
+package com.progwml6.ironchest.client.inventory;
+
+import com.mojang.blaze3d.platform.GlStateManager;
+import com.progwml6.ironchest.common.blocks.ChestType;
+import com.progwml6.ironchest.common.inventory.ChestContainer;
+import net.minecraft.client.gui.IHasContainer;
+import net.minecraft.client.gui.screen.inventory.ContainerScreen;
+import net.minecraft.entity.player.PlayerInventory;
+import net.minecraft.util.text.ITextComponent;
+import net.minecraftforge.api.distmarker.Dist;
+import net.minecraftforge.api.distmarker.OnlyIn;
+
+@OnlyIn(Dist.CLIENT)
+public class ChestScreen extends ContainerScreen
+ * Contributors:
+ * cpw - initial API and implementation
+ ******************************************************************************/
+package com.progwml6.ironchest.client.renderer;
+
+import com.progwml6.ironchest.common.blocks.ChestBlock;
+import com.progwml6.ironchest.common.blocks.ChestType;
+import com.progwml6.ironchest.common.tileentity.CopperChestTileEntity;
+import com.progwml6.ironchest.common.tileentity.CrystalChestTileEntity;
+import com.progwml6.ironchest.common.tileentity.DiamondChestTileEntity;
+import com.progwml6.ironchest.common.tileentity.DirtChestTileEntity;
+import com.progwml6.ironchest.common.tileentity.GoldChestTileEntity;
+import com.progwml6.ironchest.common.tileentity.IronChestTileEntity;
+import com.progwml6.ironchest.common.tileentity.ObsidianChestTileEntity;
+import com.progwml6.ironchest.common.tileentity.SilverChestTileEntity;
+import net.minecraft.block.Block;
+import net.minecraft.client.renderer.tileentity.ItemStackTileEntityRenderer;
+import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+
+public class IronChestItemStackTileEntityRenderer extends ItemStackTileEntityRenderer
+{
+ private static final IronChestTileEntity IRON_CHEST = new IronChestTileEntity();
+
+ private static final GoldChestTileEntity GOLD_CHEST = new GoldChestTileEntity();
+
+ private static final DiamondChestTileEntity DIAMOND_CHEST = new DiamondChestTileEntity();
+
+ private static final CopperChestTileEntity COPPER_CHEST = new CopperChestTileEntity();
+
+ private static final SilverChestTileEntity SILVER_CHEST = new SilverChestTileEntity();
+
+ private static final CrystalChestTileEntity CRYSTAL_CHEST = new CrystalChestTileEntity();
+
+ private static final ObsidianChestTileEntity OBSIDIAN_CHEST = new ObsidianChestTileEntity();
+
+ private static final DirtChestTileEntity DIRT_CHEST = new DirtChestTileEntity();
+
+ private static final IronChestTileEntity[] CHESTS = { IRON_CHEST, GOLD_CHEST, DIAMOND_CHEST, COPPER_CHEST, SILVER_CHEST, CRYSTAL_CHEST, OBSIDIAN_CHEST, DIRT_CHEST };
+
+ public static IronChestItemStackTileEntityRenderer instance = new IronChestItemStackTileEntityRenderer();
+
+ @Override
+ public void renderByItem(ItemStack itemStackIn)
+ {
+ Item item = itemStackIn.getItem();
+
+ if (Block.getBlockFromItem(item) instanceof ChestBlock)
+ {
+ ChestType typeOut = ChestBlock.getTypeFromItem(item);
+ if (typeOut == null)
+ {
+ TileEntityRendererDispatcher.instance.renderAsItem(IRON_CHEST);
+ }
+ else
+ {
+ TileEntityRendererDispatcher.instance.renderAsItem(CHESTS[typeOut.ordinal()]);
+ }
+ }
+ else
+ {
+ super.renderByItem(itemStackIn);
+ }
+ }
+}
diff --git a/src/main/java/com/progwml6/ironchest/client/renderer/IronChestTileEntityRenderer.java b/src/main/java/com/progwml6/ironchest/client/renderer/IronChestTileEntityRenderer.java
new file mode 100644
index 0000000..02c3300
--- /dev/null
+++ b/src/main/java/com/progwml6/ironchest/client/renderer/IronChestTileEntityRenderer.java
@@ -0,0 +1,216 @@
+/*******************************************************************************
+ * Copyright (c) 2012 cpw.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the GNU Public License v3.0
+ * which accompanies this distribution, and is available at
+ * http://www.gnu.org/licenses/gpl.html
+ *
+ * Contributors:
+ * cpw - initial API and implementation
+ ******************************************************************************/
+package com.progwml6.ironchest.client.renderer;
+
+import com.google.common.primitives.SignedBytes;
+import com.mojang.blaze3d.platform.GlStateManager;
+import com.progwml6.ironchest.common.blocks.ChestBlock;
+import com.progwml6.ironchest.common.blocks.ChestType;
+import com.progwml6.ironchest.common.tileentity.CrystalChestTileEntity;
+import com.progwml6.ironchest.common.tileentity.IronChestTileEntity;
+import net.minecraft.block.BlockState;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.renderer.entity.ItemRenderer;
+import net.minecraft.client.renderer.tileentity.TileEntityRenderer;
+import net.minecraft.client.renderer.tileentity.model.ChestModel;
+import net.minecraft.entity.EntityType;
+import net.minecraft.entity.item.ItemEntity;
+import net.minecraft.item.ItemStack;
+import net.minecraft.tileentity.IChestLid;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.Direction;
+import net.minecraft.util.ResourceLocation;
+import net.minecraftforge.api.distmarker.Dist;
+import net.minecraftforge.api.distmarker.OnlyIn;
+
+import java.util.Random;
+
+@OnlyIn(Dist.CLIENT)
+public class IronChestTileEntityRenderer
- * Contributors:
- * cpw - initial API and implementation
- ******************************************************************************/
-package com.progwml6.ironchest.client.renderer;
-
-import com.progwml6.ironchest.common.blocks.BlockChest;
-import com.progwml6.ironchest.common.blocks.IronChestType;
-import com.progwml6.ironchest.common.tileentity.TileEntityCopperChest;
-import com.progwml6.ironchest.common.tileentity.TileEntityCrystalChest;
-import com.progwml6.ironchest.common.tileentity.TileEntityDiamondChest;
-import com.progwml6.ironchest.common.tileentity.TileEntityDirtChest;
-import com.progwml6.ironchest.common.tileentity.TileEntityGoldChest;
-import com.progwml6.ironchest.common.tileentity.TileEntityIronChest;
-import com.progwml6.ironchest.common.tileentity.TileEntityObsidianChest;
-import com.progwml6.ironchest.common.tileentity.TileEntitySilverChest;
-import net.minecraft.block.Block;
-import net.minecraft.client.renderer.tileentity.TileEntityItemStackRenderer;
-import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-
-public class TileEntityIronChestItemRenderer extends TileEntityItemStackRenderer
-{
- private static final TileEntityIronChest IRON_CHEST = new TileEntityIronChest();
-
- private static final TileEntityGoldChest GOLD_CHEST = new TileEntityGoldChest();
-
- private static final TileEntityDiamondChest DIAMOND_CHEST = new TileEntityDiamondChest();
-
- private static final TileEntityCopperChest COPPER_CHEST = new TileEntityCopperChest();
-
- private static final TileEntitySilverChest SILVER_CHEST = new TileEntitySilverChest();
-
- private static final TileEntityCrystalChest CRYSTAL_CHEST = new TileEntityCrystalChest();
-
- private static final TileEntityObsidianChest OBSIDIAN_CHEST = new TileEntityObsidianChest();
-
- private static final TileEntityDirtChest DIRT_CHEST = new TileEntityDirtChest();
-
- private static final TileEntityIronChest[] CHESTS = { IRON_CHEST, GOLD_CHEST, DIAMOND_CHEST, COPPER_CHEST, SILVER_CHEST, CRYSTAL_CHEST, OBSIDIAN_CHEST, DIRT_CHEST };
-
- public static TileEntityIronChestItemRenderer instance = new TileEntityIronChestItemRenderer();
-
- @Override
- public void renderByItem(ItemStack itemStackIn)
- {
- Item item = itemStackIn.getItem();
-
- if (Block.getBlockFromItem(item) instanceof BlockChest)
- {
- IronChestType typeOut = BlockChest.getTypeFromItem(item);
- if (typeOut == null)
- {
- TileEntityRendererDispatcher.instance.renderAsItem(IRON_CHEST);
- }
- else
- {
- TileEntityRendererDispatcher.instance.renderAsItem(CHESTS[typeOut.ordinal()]);
- }
- }
- else
- {
- super.renderByItem(itemStackIn);
- }
- }
-}
diff --git a/src/main/java/com/progwml6/ironchest/client/renderer/TileEntityIronChestRenderer.java b/src/main/java/com/progwml6/ironchest/client/renderer/TileEntityIronChestRenderer.java
deleted file mode 100644
index 3161055..0000000
--- a/src/main/java/com/progwml6/ironchest/client/renderer/TileEntityIronChestRenderer.java
+++ /dev/null
@@ -1,224 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 cpw.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the GNU Public License v3.0
- * which accompanies this distribution, and is available at
- * http://www.gnu.org/licenses/gpl.html
- *
- * Contributors:
- * cpw - initial API and implementation
- ******************************************************************************/
-package com.progwml6.ironchest.client.renderer;
-
-import com.google.common.primitives.SignedBytes;
-import com.progwml6.ironchest.common.blocks.BlockChest;
-import com.progwml6.ironchest.common.blocks.IronChestType;
-import com.progwml6.ironchest.common.tileentity.TileEntityCrystalChest;
-import com.progwml6.ironchest.common.tileentity.TileEntityIronChest;
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.client.Minecraft;
-import net.minecraft.client.renderer.GlStateManager;
-import net.minecraft.client.renderer.entity.RenderEntityItem;
-import net.minecraft.client.renderer.entity.model.ModelChest;
-import net.minecraft.client.renderer.tileentity.TileEntityRenderer;
-import net.minecraft.entity.item.EntityItem;
-import net.minecraft.item.ItemStack;
-import net.minecraft.tileentity.IChestLid;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.EnumFacing;
-
-import java.util.Random;
-
-public class TileEntityIronChestRenderer
+ * Contributors:
+ * cpw - initial API and implementation
+ ******************************************************************************/
+package com.progwml6.ironchest.common.ai;
+
+import net.minecraft.entity.ai.goal.CatSitOnBlockGoal;
+import net.minecraft.entity.ai.goal.PrioritizedGoal;
+import net.minecraft.entity.passive.CatEntity;
+import net.minecraftforge.event.entity.living.LivingEvent;
+import net.minecraftforge.eventbus.api.SubscribeEvent;
+
+import java.util.HashSet;
+
+public class CatsSitOnChestsHandler
+{
+ @SubscribeEvent
+ public void changeSittingTaskForOcelots(final LivingEvent.LivingUpdateEvent evt)
+ {
+ /*
+ if (evt.getEntityLiving().ticksExisted < 5 && evt.getEntityLiving() instanceof CatEntity)
+ {
+ HashSet
- * Contributors:
- * cpw - initial API and implementation
- ******************************************************************************/
-package com.progwml6.ironchest.common.ai;
-
-import net.minecraft.entity.ai.EntityAIOcelotSit;
-import net.minecraft.entity.ai.EntityAITasks.EntityAITaskEntry;
-import net.minecraft.entity.passive.EntityOcelot;
-import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent;
-import net.minecraftforge.eventbus.api.SubscribeEvent;
-
-import java.util.HashSet;
-
-public class OcelotsSitOnChestsHandler
-{
- @SubscribeEvent
- public void changeSittingTaskForOcelots(final LivingUpdateEvent evt)
- {
- if (evt.getEntityLiving().ticksExisted < 5 && evt.getEntityLiving() instanceof EntityOcelot)
- {
- HashSet
- * Contributors:
- * cpw - initial API and implementation
- ******************************************************************************/
-package com.progwml6.ironchest.common.blocks;
-
-import com.progwml6.ironchest.common.tileentity.TileEntityIronChest;
-import net.minecraft.block.Block;
-import net.minecraft.block.BlockHorizontal;
-import net.minecraft.block.state.BlockFaceShape;
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.enchantment.EnchantmentHelper;
-import net.minecraft.entity.EntityLivingBase;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.EntityPlayerMP;
-import net.minecraft.init.Enchantments;
-import net.minecraft.init.Items;
-import net.minecraft.inventory.Container;
-import net.minecraft.inventory.InventoryHelper;
-import net.minecraft.item.BlockItemUseContext;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.pathfinding.PathType;
-import net.minecraft.state.DirectionProperty;
-import net.minecraft.state.StateContainer;
-import net.minecraft.stats.StatList;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.EnumBlockRenderType;
-import net.minecraft.util.EnumFacing;
-import net.minecraft.util.EnumHand;
-import net.minecraft.util.INameable;
-import net.minecraft.util.Mirror;
-import net.minecraft.util.ResourceLocation;
-import net.minecraft.util.Rotation;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.util.math.shapes.VoxelShape;
-import net.minecraft.world.IBlockReader;
-import net.minecraft.world.ILockableContainer;
-import net.minecraft.world.World;
-import net.minecraftforge.api.distmarker.Dist;
-import net.minecraftforge.api.distmarker.OnlyIn;
-import net.minecraftforge.common.util.FakePlayer;
-import net.minecraftforge.fml.network.NetworkHooks;
-
-import javax.annotation.Nullable;
-
-public abstract class BlockChest extends Block
-{
- public static final DirectionProperty FACING = BlockHorizontal.HORIZONTAL_FACING;
-
- protected static final VoxelShape IRON_CHEST_SHAPE = Block.makeCuboidShape(1.0D, 0.0D, 1.0D, 15.0D, 14.0D, 15.0D);
-
- private final IronChestType type;
-
- public BlockChest(Properties propertiesIn, IronChestType typeIn)
- {
- super(propertiesIn);
-
- this.type = typeIn;
-
- this.setDefaultState((IBlockState) ((IBlockState) this.stateContainer.getBaseState()).with(FACING, EnumFacing.NORTH));
-
- this.setRegistryName(new ResourceLocation(type.itemName));
- }
-
- @Override
- public VoxelShape getShape(IBlockState state, IBlockReader worldIn, BlockPos pos)
- {
- return IRON_CHEST_SHAPE;
- }
-
- @Override
- public boolean isSolid(IBlockState state)
- {
- return false;
- }
-
- @Override
- public boolean isFullCube(IBlockState state)
- {
- return false;
- }
-
- @Override
- @OnlyIn(Dist.CLIENT)
- public boolean hasCustomBreakingProgress(IBlockState state)
- {
- return true;
- }
-
- @Override
- public EnumBlockRenderType getRenderType(IBlockState state)
- {
- return EnumBlockRenderType.ENTITYBLOCK_ANIMATED;
- }
-
- @Override
- public IBlockState getStateForPlacement(BlockItemUseContext context)
- {
- EnumFacing enumfacing = context.getPlacementHorizontalFacing().getOpposite();
-
- return this.getDefaultState().with(FACING, enumfacing);
- }
-
- @Override
- public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack)
- {
- TileEntity tileentity = worldIn.getTileEntity(pos);
-
- if (tileentity != null && tileentity instanceof TileEntityIronChest)
- {
- TileEntityIronChest teic = (TileEntityIronChest) tileentity;
-
- teic.wasPlaced(placer, stack);
-
- if (stack.hasDisplayName())
- {
- teic.setCustomName(stack.getDisplayName());
- }
- }
- }
-
- public boolean onBlockActivated(IBlockState state, World worldIn, BlockPos pos, EntityPlayer player, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ)
- {
- if (worldIn.isRemote)
- {
- return true;
- }
- else
- {
- ILockableContainer ilockablecontainer = this.getContainer(state, worldIn, pos);
-
- if (ilockablecontainer != null)
- {
- if (player instanceof EntityPlayerMP && !(player instanceof FakePlayer))
- {
- EntityPlayerMP entityPlayerMP = (EntityPlayerMP) player;
-
- NetworkHooks.openGui(entityPlayerMP, ilockablecontainer, buf -> buf.writeBlockPos(pos));
- }
-
- player.addStat(StatList.OPEN_CHEST);
- }
-
- return true;
- }
- }
-
- @SuppressWarnings("deprecation")
- @Override
- public void onReplaced(IBlockState state, World worldIn, BlockPos pos, IBlockState newState, boolean isMoving)
- {
- if (state.getBlock() != newState.getBlock())
- {
- TileEntityIronChest tileentity = (TileEntityIronChest) worldIn.getTileEntity(pos);
-
- if (tileentity != null)
- {
- tileentity.removeAdornments();
-
- InventoryHelper.dropInventoryItems(worldIn, pos, tileentity);
- worldIn.updateComparatorOutputLevel(pos, this);
- }
-
- super.onReplaced(state, worldIn, pos, newState, isMoving);
- }
- }
-
- @SuppressWarnings("deprecation")
- @Override
- public boolean eventReceived(IBlockState state, World worldIn, BlockPos pos, int id, int param)
- {
- super.eventReceived(state, worldIn, pos, id, param);
- TileEntity tileentity = worldIn.getTileEntity(pos);
- return tileentity == null ? false : tileentity.receiveClientEvent(id, param);
- }
-
- @Override
- public boolean hasTileEntity(IBlockState state)
- {
- return true;
- }
-
- @Nullable
- public ILockableContainer getContainer(IBlockState state, World worldIn, BlockPos pos)
- {
- TileEntity tileentity = worldIn.getTileEntity(pos);
-
- if (!(tileentity instanceof TileEntityIronChest))
- {
- return null;
- }
- else
- {
- return (ILockableContainer) tileentity;
- }
- }
-
- @SuppressWarnings("deprecation")
- @Override
- public void harvestBlock(World worldIn, EntityPlayer player, BlockPos pos, IBlockState state, @Nullable TileEntity te, ItemStack stack)
- {
- if (te instanceof INameable && ((INameable) te).hasCustomName())
- {
- player.addStat(StatList.BLOCK_MINED.get(this));
- player.addExhaustion(0.005F);
-
- if (worldIn.isRemote)
- {
- return;
- }
-
- int i = EnchantmentHelper.getEnchantmentLevel(Enchantments.FORTUNE, stack);
- Item item = this.getItemDropped(state, worldIn, pos, i).asItem();
-
- if (item == Items.AIR)
- {
- return;
- }
-
- ItemStack itemstack = new ItemStack(item, this.quantityDropped(state, worldIn.rand));
- itemstack.setDisplayName(((INameable) te).getCustomName());
- spawnAsEntity(worldIn, pos, itemstack);
- }
- else
- {
- super.harvestBlock(worldIn, player, pos, state, (TileEntity) null, stack);
- }
- }
-
- @Override
- public boolean hasComparatorInputOverride(IBlockState state)
- {
- return true;
- }
-
- @Override
- public int getComparatorInputOverride(IBlockState blockState, World worldIn, BlockPos pos)
- {
- return Container.calcRedstoneFromInventory(this.getContainer(blockState, worldIn, pos));
- }
-
- @Override
- public IBlockState rotate(IBlockState state, Rotation rot)
- {
- return (IBlockState) state.with(FACING, rot.rotate((EnumFacing) state.get(FACING)));
- }
-
- @Override
- public IBlockState mirror(IBlockState state, Mirror mirrorIn)
- {
- return state.rotate(mirrorIn.toRotation((EnumFacing) state.get(FACING)));
- }
-
- @Override
- protected void fillStateContainer(StateContainer.Builder
- * Contributors:
- * cpw - initial API and implementation
- ******************************************************************************/
-package com.progwml6.ironchest.common.blocks;
-
-import com.progwml6.ironchest.common.tileentity.TileEntityDirtChest;
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagByte;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.world.IBlockReader;
-import net.minecraft.world.World;
-
-public class BlockDirtChest extends BlockChest
-{
- public BlockDirtChest(Properties properties)
- {
- super(properties, IronChestType.DIRTCHEST9000);
- }
-
- @SuppressWarnings("deprecation")
- @Override
- public void getDrops(IBlockState state, net.minecraft.util.NonNullList
- * Contributors:
- * cpw - initial API and implementation
- ******************************************************************************/
-package com.progwml6.ironchest.common.blocks;
-
-import com.progwml6.ironchest.common.tileentity.TileEntityObsidianChest;
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.world.IBlockReader;
-
-public class BlockObsidianChest extends BlockChest
-{
- public BlockObsidianChest(Properties properties)
- {
- super(properties, IronChestType.OBSIDIAN);
- }
-
- @Override
- public TileEntity createTileEntity(IBlockState state, IBlockReader world)
- {
- return new TileEntityObsidianChest();
- }
-}
diff --git a/src/main/java/com/progwml6/ironchest/common/blocks/BlockSilverChest.java b/src/main/java/com/progwml6/ironchest/common/blocks/BlockSilverChest.java
deleted file mode 100644
index ebe9f7c..0000000
--- a/src/main/java/com/progwml6/ironchest/common/blocks/BlockSilverChest.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 cpw.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the GNU Public License v3.0
- * which accompanies this distribution, and is available at
- * http://www.gnu.org/licenses/gpl.html
- *
- * Contributors:
- * cpw - initial API and implementation
- ******************************************************************************/
-package com.progwml6.ironchest.common.blocks;
-
-import com.progwml6.ironchest.common.tileentity.TileEntitySilverChest;
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.world.IBlockReader;
-
-public class BlockSilverChest extends BlockChest
-{
- public BlockSilverChest(Properties properties)
- {
- super(properties, IronChestType.SILVER);
- }
-
- @Override
- public TileEntity createTileEntity(IBlockState state, IBlockReader world)
- {
- return new TileEntitySilverChest();
- }
-}
diff --git a/src/main/java/com/progwml6/ironchest/common/blocks/ChestBlock.java b/src/main/java/com/progwml6/ironchest/common/blocks/ChestBlock.java
new file mode 100644
index 0000000..7048607
--- /dev/null
+++ b/src/main/java/com/progwml6/ironchest/common/blocks/ChestBlock.java
@@ -0,0 +1,282 @@
+/*******************************************************************************
+ * Copyright (c) 2012 cpw.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the GNU Public License v3.0
+ * which accompanies this distribution, and is available at
+ * http://www.gnu.org/licenses/gpl.html
+ *
+ * Contributors:
+ * cpw - initial API and implementation
+ ******************************************************************************/
+package com.progwml6.ironchest.common.blocks;
+
+import com.progwml6.ironchest.common.tileentity.IronChestTileEntity;
+import net.minecraft.block.Block;
+import net.minecraft.block.BlockRenderType;
+import net.minecraft.block.BlockState;
+import net.minecraft.block.HorizontalBlock;
+import net.minecraft.block.IWaterLoggable;
+import net.minecraft.entity.LivingEntity;
+import net.minecraft.entity.passive.CatEntity;
+import net.minecraft.entity.player.PlayerEntity;
+import net.minecraft.fluid.Fluids;
+import net.minecraft.fluid.IFluidState;
+import net.minecraft.inventory.IInventory;
+import net.minecraft.inventory.InventoryHelper;
+import net.minecraft.inventory.container.Container;
+import net.minecraft.inventory.container.INamedContainerProvider;
+import net.minecraft.item.BlockItemUseContext;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.pathfinding.PathType;
+import net.minecraft.state.BooleanProperty;
+import net.minecraft.state.DirectionProperty;
+import net.minecraft.state.StateContainer;
+import net.minecraft.state.properties.BlockStateProperties;
+import net.minecraft.stats.Stat;
+import net.minecraft.stats.Stats;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.Direction;
+import net.minecraft.util.Hand;
+import net.minecraft.util.Mirror;
+import net.minecraft.util.ResourceLocation;
+import net.minecraft.util.Rotation;
+import net.minecraft.util.math.AxisAlignedBB;
+import net.minecraft.util.math.BlockPos;
+import net.minecraft.util.math.BlockRayTraceResult;
+import net.minecraft.util.math.shapes.ISelectionContext;
+import net.minecraft.util.math.shapes.VoxelShape;
+import net.minecraft.world.IBlockReader;
+import net.minecraft.world.IWorld;
+import net.minecraft.world.World;
+import net.minecraftforge.api.distmarker.Dist;
+import net.minecraftforge.api.distmarker.OnlyIn;
+
+import javax.annotation.Nullable;
+import java.util.List;
+
+public class ChestBlock extends Block implements IWaterLoggable
+{
+ public static final DirectionProperty FACING = HorizontalBlock.HORIZONTAL_FACING;
+
+ public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED;
+
+ protected static final VoxelShape IRON_CHEST_SHAPE = Block.makeCuboidShape(1.0D, 0.0D, 1.0D, 15.0D, 14.0D, 15.0D);
+
+ private final ChestType type;
+
+ public ChestBlock(Properties properties, ChestType type)
+ {
+ super(properties);
+
+ this.type = type;
+
+ this.setDefaultState(this.stateContainer.getBaseState().with(FACING, Direction.NORTH).with(WATERLOGGED, Boolean.valueOf(false)));
+ this.setRegistryName(new ResourceLocation(type.itemName));
+ }
+
+ @Override
+ @OnlyIn(Dist.CLIENT)
+ public boolean hasCustomBreakingProgress(BlockState state)
+ {
+ return true;
+ }
+
+ @Override
+ public BlockRenderType getRenderType(BlockState state)
+ {
+ return BlockRenderType.ENTITYBLOCK_ANIMATED;
+ }
+
+ @Override
+ public BlockState updatePostPlacement(BlockState stateIn, Direction facing, BlockState facingState, IWorld worldIn, BlockPos currentPos, BlockPos facingPos)
+ {
+ if (stateIn.get(WATERLOGGED))
+ {
+ worldIn.getPendingFluidTicks().scheduleTick(currentPos, Fluids.WATER, Fluids.WATER.getTickRate(worldIn));
+ }
+
+ return super.updatePostPlacement(stateIn, facing, facingState, worldIn, currentPos, facingPos);
+ }
+
+ @Override
+ public VoxelShape getShape(BlockState state, IBlockReader iBlockReader, BlockPos pos, ISelectionContext selectionContext)
+ {
+ return IRON_CHEST_SHAPE;
+ }
+
+ @Override
+ public BlockState getStateForPlacement(BlockItemUseContext context)
+ {
+ Direction direction = context.getPlacementHorizontalFacing().getOpposite();
+ IFluidState ifluidstate = context.getWorld().getFluidState(context.getPos());
+
+ return this.getDefaultState().with(FACING, direction).with(WATERLOGGED, Boolean.valueOf(ifluidstate.getFluid() == Fluids.WATER));
+ }
+
+ @Override
+ public IFluidState getFluidState(BlockState state)
+ {
+ return state.get(WATERLOGGED) ? Fluids.WATER.getStillFluidState(false) : super.getFluidState(state);
+ }
+
+ @Override
+ public void onBlockPlacedBy(World worldIn, BlockPos pos, BlockState state, LivingEntity placer, ItemStack stack)
+ {
+ TileEntity tileentity = worldIn.getTileEntity(pos);
+
+ if (tileentity instanceof IronChestTileEntity)
+ {
+ ((IronChestTileEntity) tileentity).wasPlaced(placer, stack);
+
+ if (stack.hasDisplayName())
+ {
+ ((IronChestTileEntity) tileentity).setCustomName(stack.getDisplayName());
+ }
+ }
+ }
+
+ @Override
+ public void onReplaced(BlockState state, World worldIn, BlockPos pos, BlockState newState, boolean isMoving)
+ {
+ if (state.getBlock() != newState.getBlock())
+ {
+ TileEntity tileentity = worldIn.getTileEntity(pos);
+
+ if (tileentity instanceof IronChestTileEntity)
+ {
+ ((IronChestTileEntity) tileentity).removeAdornments();
+ InventoryHelper.dropInventoryItems(worldIn, pos, (IronChestTileEntity) tileentity);
+ worldIn.updateComparatorOutputLevel(pos, this);
+ }
+
+ super.onReplaced(state, worldIn, pos, newState, isMoving);
+ }
+ }
+
+ @Override
+ public boolean onBlockActivated(BlockState state, World worldIn, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit)
+ {
+ if (worldIn.isRemote)
+ {
+ return true;
+ }
+ else
+ {
+ INamedContainerProvider inamedcontainerprovider = this.getContainer(state, worldIn, pos);
+ if (inamedcontainerprovider != null)
+ {
+ player.openContainer(inamedcontainerprovider);
+ player.addStat(this.getOpenStat());
+ }
+
+ return true;
+ }
+ }
+
+ protected Stat
+ * Contributors:
+ * cpw - initial API and implementation
+ ******************************************************************************/
+package com.progwml6.ironchest.common.blocks;
+
+import com.progwml6.ironchest.common.tileentity.DiamondChestTileEntity;
+import net.minecraft.block.Block;
+import net.minecraft.block.BlockState;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.world.IBlockReader;
+
+public class DiamondChestBlock extends ChestBlock
+{
+ public DiamondChestBlock(Block.Properties properties)
+ {
+ super(properties, ChestType.DIAMOND);
+ }
+
+ @Override
+ public TileEntity createTileEntity(BlockState state, IBlockReader world)
+ {
+ return new DiamondChestTileEntity();
+ }
+}
diff --git a/src/main/java/com/progwml6/ironchest/common/blocks/BlockCrystalChest.java b/src/main/java/com/progwml6/ironchest/common/blocks/DirtChestBlock.java
similarity index 61%
rename from src/main/java/com/progwml6/ironchest/common/blocks/BlockCrystalChest.java
rename to src/main/java/com/progwml6/ironchest/common/blocks/DirtChestBlock.java
index 3af9589..4e5d874 100644
--- a/src/main/java/com/progwml6/ironchest/common/blocks/BlockCrystalChest.java
+++ b/src/main/java/com/progwml6/ironchest/common/blocks/DirtChestBlock.java
@@ -10,21 +10,22 @@
******************************************************************************/
package com.progwml6.ironchest.common.blocks;
-import com.progwml6.ironchest.common.tileentity.TileEntityCrystalChest;
-import net.minecraft.block.state.IBlockState;
+import com.progwml6.ironchest.common.tileentity.DirtChestTileEntity;
+import net.minecraft.block.Block;
+import net.minecraft.block.BlockState;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.IBlockReader;
-public class BlockCrystalChest extends BlockChest
+public class DirtChestBlock extends ChestBlock
{
- public BlockCrystalChest(Properties properties)
+ public DirtChestBlock(Block.Properties properties)
{
- super(properties, IronChestType.CRYSTAL);
+ super(properties, ChestType.DIRTCHEST9000);
}
@Override
- public TileEntity createTileEntity(IBlockState state, IBlockReader world)
+ public TileEntity createTileEntity(BlockState state, IBlockReader world)
{
- return new TileEntityCrystalChest();
+ return new DirtChestTileEntity();
}
}
diff --git a/src/main/java/com/progwml6/ironchest/common/blocks/BlockDiamondChest.java b/src/main/java/com/progwml6/ironchest/common/blocks/GoldChestBlock.java
similarity index 62%
rename from src/main/java/com/progwml6/ironchest/common/blocks/BlockDiamondChest.java
rename to src/main/java/com/progwml6/ironchest/common/blocks/GoldChestBlock.java
index 241e03c..d1544ff 100644
--- a/src/main/java/com/progwml6/ironchest/common/blocks/BlockDiamondChest.java
+++ b/src/main/java/com/progwml6/ironchest/common/blocks/GoldChestBlock.java
@@ -10,22 +10,22 @@
******************************************************************************/
package com.progwml6.ironchest.common.blocks;
-import com.progwml6.ironchest.common.tileentity.TileEntityDiamondChest;
-import net.minecraft.block.state.IBlockState;
+import com.progwml6.ironchest.common.tileentity.GoldChestTileEntity;
+import net.minecraft.block.Block;
+import net.minecraft.block.BlockState;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.IBlockReader;
-public class BlockDiamondChest extends BlockChest
+public class GoldChestBlock extends ChestBlock
{
- public BlockDiamondChest(Properties properties)
+ public GoldChestBlock(Block.Properties properties)
{
- super(properties, IronChestType.DIAMOND);
+ super(properties, ChestType.GOLD);
}
@Override
- public TileEntity createTileEntity(IBlockState state, IBlockReader world)
+ public TileEntity createTileEntity(BlockState state, IBlockReader world)
{
- return new TileEntityDiamondChest();
+ return new GoldChestTileEntity();
}
-
}
diff --git a/src/main/java/com/progwml6/ironchest/common/blocks/BlockCopperChest.java b/src/main/java/com/progwml6/ironchest/common/blocks/IronChestBlock.java
similarity index 62%
rename from src/main/java/com/progwml6/ironchest/common/blocks/BlockCopperChest.java
rename to src/main/java/com/progwml6/ironchest/common/blocks/IronChestBlock.java
index 7a46523..ef7714c 100644
--- a/src/main/java/com/progwml6/ironchest/common/blocks/BlockCopperChest.java
+++ b/src/main/java/com/progwml6/ironchest/common/blocks/IronChestBlock.java
@@ -10,21 +10,22 @@
******************************************************************************/
package com.progwml6.ironchest.common.blocks;
-import com.progwml6.ironchest.common.tileentity.TileEntityCopperChest;
-import net.minecraft.block.state.IBlockState;
+import com.progwml6.ironchest.common.tileentity.IronChestTileEntity;
+import net.minecraft.block.Block;
+import net.minecraft.block.BlockState;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.IBlockReader;
-public class BlockCopperChest extends BlockChest
+public class IronChestBlock extends ChestBlock
{
- public BlockCopperChest(Properties properties)
+ public IronChestBlock(Block.Properties properties)
{
- super(properties, IronChestType.COPPER);
+ super(properties, ChestType.IRON);
}
@Override
- public TileEntity createTileEntity(IBlockState state, IBlockReader world)
+ public TileEntity createTileEntity(BlockState state, IBlockReader world)
{
- return new TileEntityCopperChest();
+ return new IronChestTileEntity();
}
}
diff --git a/src/main/java/com/progwml6/ironchest/common/blocks/ObsidianChestBlock.java b/src/main/java/com/progwml6/ironchest/common/blocks/ObsidianChestBlock.java
new file mode 100644
index 0000000..9eb64ad
--- /dev/null
+++ b/src/main/java/com/progwml6/ironchest/common/blocks/ObsidianChestBlock.java
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2012 cpw.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the GNU Public License v3.0
+ * which accompanies this distribution, and is available at
+ * http://www.gnu.org/licenses/gpl.html
+ *
+ * Contributors:
+ * cpw - initial API and implementation
+ ******************************************************************************/
+package com.progwml6.ironchest.common.blocks;
+
+import com.progwml6.ironchest.common.tileentity.ObsidianChestTileEntity;
+import net.minecraft.block.Block;
+import net.minecraft.block.BlockState;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.world.IBlockReader;
+
+public class ObsidianChestBlock extends ChestBlock
+{
+ public ObsidianChestBlock(Block.Properties properties)
+ {
+ super(properties, ChestType.OBSIDIAN);
+ }
+
+ @Override
+ public TileEntity createTileEntity(BlockState state, IBlockReader world)
+ {
+ return new ObsidianChestTileEntity();
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/com/progwml6/ironchest/common/blocks/SilverChestBlock.java b/src/main/java/com/progwml6/ironchest/common/blocks/SilverChestBlock.java
new file mode 100644
index 0000000..679cc79
--- /dev/null
+++ b/src/main/java/com/progwml6/ironchest/common/blocks/SilverChestBlock.java
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2012 cpw.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the GNU Public License v3.0
+ * which accompanies this distribution, and is available at
+ * http://www.gnu.org/licenses/gpl.html
+ *
+ * Contributors:
+ * cpw - initial API and implementation
+ ******************************************************************************/
+package com.progwml6.ironchest.common.blocks;
+
+import com.progwml6.ironchest.common.tileentity.SilverChestTileEntity;
+import net.minecraft.block.Block;
+import net.minecraft.block.BlockState;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.world.IBlockReader;
+
+public class SilverChestBlock extends ChestBlock
+{
+ public SilverChestBlock(Block.Properties properties)
+ {
+ super(properties, ChestType.SILVER);
+ }
+
+ @Override
+ public TileEntity createTileEntity(BlockState state, IBlockReader world)
+ {
+ return new SilverChestTileEntity();
+ }
+}
diff --git a/src/main/java/com/progwml6/ironchest/common/core/IronChestBlocks.java b/src/main/java/com/progwml6/ironchest/common/core/IronChestBlocks.java
index 76f9b0d..2936d5b 100644
--- a/src/main/java/com/progwml6/ironchest/common/core/IronChestBlocks.java
+++ b/src/main/java/com/progwml6/ironchest/common/core/IronChestBlocks.java
@@ -10,18 +10,18 @@
******************************************************************************/
package com.progwml6.ironchest.common.core;
-import com.progwml6.ironchest.client.renderer.TileEntityIronChestItemRenderer;
import com.progwml6.ironchest.IronChest;
-import com.progwml6.ironchest.common.blocks.BlockChest;
-import com.progwml6.ironchest.common.blocks.BlockCopperChest;
-import com.progwml6.ironchest.common.blocks.BlockCrystalChest;
-import com.progwml6.ironchest.common.blocks.BlockDiamondChest;
-import com.progwml6.ironchest.common.blocks.BlockDirtChest;
-import com.progwml6.ironchest.common.blocks.BlockGoldChest;
-import com.progwml6.ironchest.common.blocks.BlockIronChest;
-import com.progwml6.ironchest.common.blocks.BlockObsidianChest;
-import com.progwml6.ironchest.common.blocks.BlockSilverChest;
-import com.progwml6.ironchest.common.items.ItemChest;
+import com.progwml6.ironchest.client.renderer.IronChestItemStackTileEntityRenderer;
+import com.progwml6.ironchest.common.blocks.ChestBlock;
+import com.progwml6.ironchest.common.blocks.CopperChestBlock;
+import com.progwml6.ironchest.common.blocks.CrystalChestBlock;
+import com.progwml6.ironchest.common.blocks.DiamondChestBlock;
+import com.progwml6.ironchest.common.blocks.DirtChestBlock;
+import com.progwml6.ironchest.common.blocks.GoldChestBlock;
+import com.progwml6.ironchest.common.blocks.IronChestBlock;
+import com.progwml6.ironchest.common.blocks.ObsidianChestBlock;
+import com.progwml6.ironchest.common.blocks.SilverChestBlock;
+import com.progwml6.ironchest.common.items.ChestItem;
import com.progwml6.ironchest.common.util.BlockNames;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
@@ -38,49 +38,49 @@ public class IronChestBlocks
public static Properties itemBuilder;
@ObjectHolder(BlockNames.IRON_CHEST)
- public static BlockChest ironChestBlock;
+ public static ChestBlock ironChestBlock;
@ObjectHolder(BlockNames.IRON_CHEST)
public static Item ironChestItemBlock;
@ObjectHolder(BlockNames.GOLD_CHEST)
- public static BlockChest goldChestBlock;
+ public static ChestBlock goldChestBlock;
@ObjectHolder(BlockNames.GOLD_CHEST)
public static Item goldChestItemBlock;
@ObjectHolder(BlockNames.DIAMOND_CHEST)
- public static BlockChest diamondChestBlock;
+ public static ChestBlock diamondChestBlock;
@ObjectHolder(BlockNames.DIAMOND_CHEST)
public static Item diamondChestItemBlock;
@ObjectHolder(BlockNames.COPPER_CHEST)
- public static BlockChest copperChestBlock;
+ public static ChestBlock copperChestBlock;
@ObjectHolder(BlockNames.COPPER_CHEST)
public static Item copperChestItemBlock;
@ObjectHolder(BlockNames.SILVER_CHEST)
- public static BlockChest silverChestBlock;
+ public static ChestBlock silverChestBlock;
@ObjectHolder(BlockNames.SILVER_CHEST)
public static Item silverChestItemBlock;
@ObjectHolder(BlockNames.CRYSTAL_CHEST)
- public static BlockChest crystalChestBlock;
+ public static ChestBlock crystalChestBlock;
@ObjectHolder(BlockNames.CRYSTAL_CHEST)
public static Item crystalChestItemBlock;
@ObjectHolder(BlockNames.OBSIDIAN_CHEST)
- public static BlockChest obsidianChestBlock;
+ public static ChestBlock obsidianChestBlock;
@ObjectHolder(BlockNames.OBSIDIAN_CHEST)
public static Item obsidianChestItemBlock;
@ObjectHolder(BlockNames.DIRT_CHEST)
- public static BlockChest dirtChestBlock;
+ public static ChestBlock dirtChestBlock;
@ObjectHolder(BlockNames.DIRT_CHEST)
public static Item dirtChestItemBlock;
@@ -98,14 +98,14 @@ public class IronChestBlocks
{
IForgeRegistry
- * Contributors:
- * cpw - initial API and implementation
- ******************************************************************************/
-package com.progwml6.ironchest.common.gui;
-
-import com.progwml6.ironchest.common.blocks.IronChestType;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.inventory.Container;
-import net.minecraft.inventory.IInventory;
-import net.minecraft.inventory.Slot;
-import net.minecraft.item.ItemStack;
-
-public class ContainerIronChest extends Container
-{
- private IronChestType type;
-
- private EntityPlayer player;
-
- private IInventory chest;
-
- public ContainerIronChest(IInventory playerInventory, IInventory chestInventory, IronChestType type, EntityPlayer player, int xSize, int ySize)
- {
- this.chest = chestInventory;
- this.player = player;
- this.type = type;
- chestInventory.openInventory(this.player);
- this.layoutContainer(playerInventory, chestInventory, type, xSize, ySize);
- }
-
- @Override
- public boolean canInteractWith(EntityPlayer playerIn)
- {
- return this.chest.isUsableByPlayer(playerIn);
- }
-
- @Override
- public ItemStack transferStackInSlot(EntityPlayer playerIn, int index)
- {
- ItemStack itemStack = ItemStack.EMPTY;
- Slot slot = this.inventorySlots.get(index);
-
- if (slot != null && slot.getHasStack())
- {
- ItemStack itemStack1 = slot.getStack();
- itemStack = itemStack1.copy();
-
- if (index < this.type.size)
- {
- if (!this.mergeItemStack(itemStack1, this.type.size, this.inventorySlots.size(), true))
- {
- return ItemStack.EMPTY;
- }
- }
- else if (!this.type.acceptsStack(itemStack1))
- {
- return ItemStack.EMPTY;
- }
- else if (!this.mergeItemStack(itemStack1, 0, this.type.size, false))
- {
- return ItemStack.EMPTY;
- }
-
- if (itemStack1.isEmpty())
- {
- slot.putStack(ItemStack.EMPTY);
- }
- else
- {
- slot.onSlotChanged();
- }
- }
-
- return itemStack;
- }
-
- protected void layoutContainer(IInventory playerInventory, IInventory chestInventory, IronChestType type, int xSize, int ySize)
- {
- if (type == IronChestType.DIRTCHEST9000)
- {
- this.addSlot(type.makeSlot(chestInventory, 0, 12 + 4 * 18, 8 + 2 * 18));
- }
- else
- {
- for (int chestRow = 0; chestRow < type.getRowCount(); chestRow++)
- {
- for (int chestCol = 0; chestCol < type.rowLength; chestCol++)
- {
- this.addSlot(type.makeSlot(chestInventory, chestCol + chestRow * type.rowLength, 12 + chestCol * 18, 8 + chestRow * 18));
- }
- }
- }
-
- int leftCol = (xSize - 162) / 2 + 1;
-
- for (int playerInvRow = 0; playerInvRow < 3; playerInvRow++)
- {
- for (int playerInvCol = 0; playerInvCol < 9; playerInvCol++)
- {
- this.addSlot(new Slot(playerInventory, playerInvCol + playerInvRow * 9 + 9, leftCol + playerInvCol * 18, ySize - (4 - playerInvRow) * 18 - 10));
- }
-
- }
-
- for (int hotbarSlot = 0; hotbarSlot < 9; hotbarSlot++)
- {
- this.addSlot(new Slot(playerInventory, hotbarSlot, leftCol + hotbarSlot * 18, ySize - 24));
- }
- }
-
- public EntityPlayer getPlayer()
- {
- return this.player;
- }
-
- @Override
- public void onContainerClosed(EntityPlayer playerIn)
- {
- super.onContainerClosed(playerIn);
- this.chest.closeInventory(playerIn);
- }
-
- public IInventory getChestInventory()
- {
- return this.chest;
- }
-}
diff --git a/src/main/java/com/progwml6/ironchest/common/gui/GuiHandler.java b/src/main/java/com/progwml6/ironchest/common/gui/GuiHandler.java
deleted file mode 100644
index db2e947..0000000
--- a/src/main/java/com/progwml6/ironchest/common/gui/GuiHandler.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package com.progwml6.ironchest.common.gui;
-
-import com.progwml6.ironchest.client.gui.GUIChest;
-import net.minecraft.client.Minecraft;
-import net.minecraft.client.gui.GuiScreen;
-import net.minecraft.inventory.IInventory;
-import net.minecraft.util.math.BlockPos;
-import net.minecraftforge.fml.network.FMLPlayMessages;
-
-public class GuiHandler
-{
- public static GuiScreen openGui(FMLPlayMessages.OpenContainer openContainer)
- {
- BlockPos pos = openContainer.getAdditionalData().readBlockPos();
-
- for (GUIChest.GUI type : GUIChest.GUI.values())
- {
- if (type.getGuiId().equals(openContainer.getId()))
- {
- return new GUIChest(type, (IInventory) Minecraft.getInstance().player.inventory, (IInventory) Minecraft.getInstance().world.getTileEntity(pos));
- }
- }
-
- return null;
- }
-}
diff --git a/src/main/java/com/progwml6/ironchest/common/inventory/ChestContainer.java b/src/main/java/com/progwml6/ironchest/common/inventory/ChestContainer.java
new file mode 100644
index 0000000..0f6e2dc
--- /dev/null
+++ b/src/main/java/com/progwml6/ironchest/common/inventory/ChestContainer.java
@@ -0,0 +1,212 @@
+/*******************************************************************************
+ * Copyright (c) 2012 cpw.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the GNU Public License v3.0
+ * which accompanies this distribution, and is available at
+ * http://www.gnu.org/licenses/gpl.html
+ *
+ * Contributors:
+ * cpw - initial API and implementation
+ ******************************************************************************/
+package com.progwml6.ironchest.common.inventory;
+
+import com.progwml6.ironchest.common.blocks.ChestType;
+import net.minecraft.entity.player.PlayerEntity;
+import net.minecraft.entity.player.PlayerInventory;
+import net.minecraft.inventory.IInventory;
+import net.minecraft.inventory.Inventory;
+import net.minecraft.inventory.container.Container;
+import net.minecraft.inventory.container.ContainerType;
+import net.minecraft.inventory.container.Slot;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.api.distmarker.Dist;
+import net.minecraftforge.api.distmarker.OnlyIn;
+
+public class ChestContainer extends Container
+{
+ private final IInventory inventory;
+
+ private final ChestType chestType;
+
+ private ChestContainer(ContainerType> containerType, int windowId, PlayerInventory playerInventory)
+ {
+ this(containerType, windowId, playerInventory, new Inventory(ChestType.WOOD.size), ChestType.WOOD);
+ }
+
+ public static ChestContainer createIronContainer(int windowId, PlayerInventory playerInventory)
+ {
+ return new ChestContainer(ChestContainerType.IRON_CHEST, windowId, playerInventory, new Inventory(ChestType.IRON.size), ChestType.IRON);
+ }
+
+ public static ChestContainer createIronContainer(int windowId, PlayerInventory playerInventory, IInventory inventory)
+ {
+ return new ChestContainer(ChestContainerType.IRON_CHEST, windowId, playerInventory, inventory, ChestType.IRON);
+ }
+
+ public static ChestContainer createGoldContainer(int windowId, PlayerInventory playerInventory)
+ {
+ return new ChestContainer(ChestContainerType.GOLD_CHEST, windowId, playerInventory, new Inventory(ChestType.GOLD.size), ChestType.GOLD);
+ }
+
+ public static ChestContainer createGoldContainer(int windowId, PlayerInventory playerInventory, IInventory inventory)
+ {
+ return new ChestContainer(ChestContainerType.GOLD_CHEST, windowId, playerInventory, inventory, ChestType.GOLD);
+ }
+
+ public static ChestContainer createDiamondContainer(int windowId, PlayerInventory playerInventory)
+ {
+ return new ChestContainer(ChestContainerType.DIAMOND_CHEST, windowId, playerInventory, new Inventory(ChestType.DIAMOND.size), ChestType.DIAMOND);
+ }
+
+ public static ChestContainer createDiamondContainer(int windowId, PlayerInventory playerInventory, IInventory inventory)
+ {
+ return new ChestContainer(ChestContainerType.DIAMOND_CHEST, windowId, playerInventory, inventory, ChestType.DIAMOND);
+ }
+
+ public static ChestContainer createCrystalContainer(int windowId, PlayerInventory playerInventory)
+ {
+ return new ChestContainer(ChestContainerType.CRYSTAL_CHEST, windowId, playerInventory, new Inventory(ChestType.CRYSTAL.size), ChestType.CRYSTAL);
+ }
+
+ public static ChestContainer createCrystalContainer(int windowId, PlayerInventory playerInventory, IInventory inventory)
+ {
+ return new ChestContainer(ChestContainerType.CRYSTAL_CHEST, windowId, playerInventory, inventory, ChestType.CRYSTAL);
+ }
+
+ public static ChestContainer createCopperContainer(int windowId, PlayerInventory playerInventory)
+ {
+ return new ChestContainer(ChestContainerType.COPPER_CHEST, windowId, playerInventory, new Inventory(ChestType.COPPER.size), ChestType.COPPER);
+ }
+
+ public static ChestContainer createCopperContainer(int windowId, PlayerInventory playerInventory, IInventory inventory)
+ {
+ return new ChestContainer(ChestContainerType.COPPER_CHEST, windowId, playerInventory, inventory, ChestType.COPPER);
+ }
+
+ public static ChestContainer createSilverContainer(int windowId, PlayerInventory playerInventory)
+ {
+ return new ChestContainer(ChestContainerType.SILVER_CHEST, windowId, playerInventory, new Inventory(ChestType.CRYSTAL.size), ChestType.SILVER);
+ }
+
+ public static ChestContainer createSilverContainer(int windowId, PlayerInventory playerInventory, IInventory inventory)
+ {
+ return new ChestContainer(ChestContainerType.SILVER_CHEST, windowId, playerInventory, inventory, ChestType.SILVER);
+ }
+
+ public static ChestContainer createObsidianContainer(int windowId, PlayerInventory playerInventory)
+ {
+ return new ChestContainer(ChestContainerType.OBSIDIAN_CHEST, windowId, playerInventory, new Inventory(ChestType.OBSIDIAN.size), ChestType.OBSIDIAN);
+ }
+
+ public static ChestContainer createObsidianContainer(int windowId, PlayerInventory playerInventory, IInventory inventory)
+ {
+ return new ChestContainer(ChestContainerType.OBSIDIAN_CHEST, windowId, playerInventory, inventory, ChestType.OBSIDIAN);
+ }
+
+ public static ChestContainer createDirtContainer(int windowId, PlayerInventory playerInventory)
+ {
+ return new ChestContainer(ChestContainerType.DIRT_CHEST, windowId, playerInventory, new Inventory(ChestType.DIRTCHEST9000.size), ChestType.DIRTCHEST9000);
+ }
+
+ public static ChestContainer createDirtContainer(int windowId, PlayerInventory playerInventory, IInventory inventory)
+ {
+ return new ChestContainer(ChestContainerType.DIRT_CHEST, windowId, playerInventory, inventory, ChestType.DIRTCHEST9000);
+ }
+
+ public ChestContainer(ContainerType> containerType, int windowId, PlayerInventory playerInventory, IInventory inventory, ChestType chestType)
+ {
+ super(containerType, windowId);
+ func_216962_a(inventory, chestType.size);
+
+ this.inventory = inventory;
+ this.chestType = chestType;
+
+ inventory.openInventory(playerInventory.player);
+
+ if (chestType == ChestType.DIRTCHEST9000)
+ {
+ this.addSlot(new DirtChestSlot(inventory, 0, 12 + 4 * 18, 8 + 2 * 18));
+ }
+ else
+ {
+ for (int chestRow = 0; chestRow < chestType.getRowCount(); chestRow++)
+ {
+ for (int chestCol = 0; chestCol < chestType.rowLength; chestCol++)
+ {
+ this.addSlot(new Slot(inventory, chestCol + chestRow * chestType.rowLength, 12 + chestCol * 18, 18 + chestRow * 18));
+ }
+ }
+ }
+
+ int leftCol = (chestType.xSize - 162) / 2 + 1;
+
+ for (int playerInvRow = 0; playerInvRow < 3; playerInvRow++)
+ {
+ for (int playerInvCol = 0; playerInvCol < 9; playerInvCol++)
+ {
+ this.addSlot(new Slot(playerInventory, playerInvCol + playerInvRow * 9 + 9, leftCol + playerInvCol * 18, chestType.ySize - (4 - playerInvRow) * 18 - 10));
+ }
+
+ }
+
+ for (int hotbarSlot = 0; hotbarSlot < 9; hotbarSlot++)
+ {
+ this.addSlot(new Slot(playerInventory, hotbarSlot, leftCol + hotbarSlot * 18, chestType.ySize - 24));
+ }
+ }
+
+ @Override
+ public boolean canInteractWith(PlayerEntity playerIn)
+ {
+ return this.inventory.isUsableByPlayer(playerIn);
+ }
+
+ @Override
+ public ItemStack transferStackInSlot(PlayerEntity playerIn, int index)
+ {
+ ItemStack itemstack = ItemStack.EMPTY;
+ Slot slot = this.inventorySlots.get(index);
+
+ if (slot != null && slot.getHasStack())
+ {
+ ItemStack itemstack1 = slot.getStack();
+ itemstack = itemstack1.copy();
+
+ if (index < this.chestType.size)
+ {
+ if (!this.mergeItemStack(itemstack1, this.chestType.size, this.inventorySlots.size(), true))
+ {
+ return ItemStack.EMPTY;
+ }
+ }
+ else if (!this.mergeItemStack(itemstack1, 0, this.chestType.size, false))
+ {
+ return ItemStack.EMPTY;
+ }
+
+ if (itemstack1.isEmpty())
+ {
+ slot.putStack(ItemStack.EMPTY);
+ }
+ else
+ {
+ slot.onSlotChanged();
+ }
+ }
+
+ return itemstack;
+ }
+
+ @Override
+ public void onContainerClosed(PlayerEntity playerIn)
+ {
+ super.onContainerClosed(playerIn);
+ this.inventory.closeInventory(playerIn);
+ }
+
+ @OnlyIn(Dist.CLIENT)
+ public ChestType getChestType()
+ {
+ return this.chestType;
+ }
+}
diff --git a/src/main/java/com/progwml6/ironchest/common/inventory/ChestContainerType.java b/src/main/java/com/progwml6/ironchest/common/inventory/ChestContainerType.java
new file mode 100644
index 0000000..7c4a37c
--- /dev/null
+++ b/src/main/java/com/progwml6/ironchest/common/inventory/ChestContainerType.java
@@ -0,0 +1,82 @@
+/*******************************************************************************
+ * Copyright (c) 2012 cpw.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the GNU Public License v3.0
+ * which accompanies this distribution, and is available at
+ * http://www.gnu.org/licenses/gpl.html
+ *
+ * Contributors:
+ * cpw - initial API and implementation
+ ******************************************************************************/
+package com.progwml6.ironchest.common.inventory;
+
+import com.progwml6.ironchest.IronChest;
+import com.progwml6.ironchest.client.inventory.ChestScreen;
+import com.progwml6.ironchest.common.util.ContainerNames;
+import net.minecraft.client.gui.ScreenManager;
+import net.minecraft.inventory.container.ContainerType;
+import net.minecraftforge.api.distmarker.Dist;
+import net.minecraftforge.api.distmarker.OnlyIn;
+import net.minecraftforge.event.RegistryEvent;
+import net.minecraftforge.eventbus.api.SubscribeEvent;
+import net.minecraftforge.fml.common.Mod;
+import net.minecraftforge.registries.ObjectHolder;
+
+public class ChestContainerType
+{
+ @ObjectHolder(ContainerNames.IRON_CHEST)
+ public static ContainerType
+ * Contributors:
+ * cpw - initial API and implementation
+ ******************************************************************************/
+package com.progwml6.ironchest.common.tileentity;
+
+import com.progwml6.ironchest.IronChest;
+import com.progwml6.ironchest.common.core.IronChestBlocks;
+import com.progwml6.ironchest.common.util.TileEntityNames;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.tileentity.TileEntityType;
+import net.minecraftforge.event.RegistryEvent;
+import net.minecraftforge.eventbus.api.SubscribeEvent;
+import net.minecraftforge.fml.common.Mod;
+import net.minecraftforge.registries.ObjectHolder;
+
+import java.util.function.Supplier;
+
+public class ChestTileEntityType
+{
+ @ObjectHolder(TileEntityNames.IRON_CHEST)
+ public static TileEntityType> IRON_CHEST;
+
+ @ObjectHolder(TileEntityNames.GOLD_CHEST)
+ public static TileEntityType> GOLD_CHEST;
+
+ @ObjectHolder(TileEntityNames.DIAMOND_CHEST)
+ public static TileEntityType> DIAMOND_CHEST;
+
+ @ObjectHolder(TileEntityNames.CRYSTAL_CHEST)
+ public static TileEntityType> CRYSTAL_CHEST;
+
+ @ObjectHolder(TileEntityNames.DIRT_CHEST)
+ public static TileEntityType> DIRT_CHEST;
+
+ @ObjectHolder(TileEntityNames.COPPER_CHEST)
+ public static TileEntityType> COPPER_CHEST;
+
+ @ObjectHolder(TileEntityNames.SILVER_CHEST)
+ public static TileEntityType> SILVER_CHEST;
+
+ @ObjectHolder(TileEntityNames.OBSIDIAN_CHEST)
+ public static TileEntityType> OBSIDIAN_CHEST;
+
+ public ChestTileEntityType()
+ {
+
+ }
+
+ @Mod.EventBusSubscriber(modid = IronChest.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD)
+ public static class Registration
+ {
+ @SubscribeEvent
+ public static void onTileEntityRegistry(final RegistryEvent.Register
+ * Contributors:
+ * cpw - initial API and implementation
+ ******************************************************************************/
+package com.progwml6.ironchest.common.tileentity;
+
+import com.progwml6.ironchest.common.blocks.ChestType;
+import com.progwml6.ironchest.common.core.IronChestBlocks;
+import com.progwml6.ironchest.common.inventory.ChestContainer;
+import net.minecraft.client.resources.I18n;
+import net.minecraft.entity.LivingEntity;
+import net.minecraft.entity.player.PlayerInventory;
+import net.minecraft.inventory.container.Container;
+import net.minecraft.item.ItemStack;
+import net.minecraft.item.Items;
+import net.minecraft.nbt.ListNBT;
+import net.minecraft.nbt.StringNBT;
+import net.minecraft.util.text.ITextComponent;
+import net.minecraft.util.text.TranslationTextComponent;
+
+public class DirtChestTileEntity extends IronChestTileEntity
+{
+ private static ItemStack dirtChest9000GuideBook = new ItemStack(Items.WRITTEN_BOOK);
+
+ private static boolean bookDataCreated = false;
+
+ public DirtChestTileEntity()
+ {
+ super(ChestTileEntityType.DIRT_CHEST, ChestType.DIRTCHEST9000, IronChestBlocks.dirtChestBlock);
+ }
+
+ @Override
+ protected Container createMenu(int id, PlayerInventory playerInventory)
+ {
+ return ChestContainer.createDirtContainer(id, playerInventory, this);
+ }
+
+ @Override
+ public void wasPlaced(LivingEntity entityLivingBase, ItemStack itemStack)
+ {
+ if (!(itemStack.hasTag() && itemStack.getTag().getBoolean("been_placed")))
+ {
+ this.setInventorySlotContents(0, dirtChest9000GuideBook.copy());
+ }
+
+ if (!bookDataCreated)
+ {
+ createBookData();
+ }
+ }
+
+ @Override
+ public void removeAdornments()
+ {
+ if (!this.getItems().get(0).isEmpty() && this.getItems().get(0).isItemEqual(dirtChest9000GuideBook))
+ {
+ this.getItems().set(0, ItemStack.EMPTY);
+ }
+ }
+
+ private static void createBookData()
+ {
+ dirtChest9000GuideBook.setTagInfo("author", new StringNBT("cpw"));
+
+ dirtChest9000GuideBook.setTagInfo("title", new StringNBT(I18n.format("book.ironchest.dirtchest9000.title")));
+
+ ListNBT pages = new ListNBT();
+ pages.add(new StringNBT(ITextComponent.Serializer.toJson(new TranslationTextComponent("book.ironchest.dirtchest9000.page1"))));
+ pages.add(new StringNBT(ITextComponent.Serializer.toJson(new TranslationTextComponent("book.ironchest.dirtchest9000.page2"))));
+ pages.add(new StringNBT(ITextComponent.Serializer.toJson(new TranslationTextComponent("book.ironchest.dirtchest9000.page3"))));
+ pages.add(new StringNBT(ITextComponent.Serializer.toJson(new TranslationTextComponent("book.ironchest.dirtchest9000.page4"))));
+ pages.add(new StringNBT(ITextComponent.Serializer.toJson(new TranslationTextComponent("book.ironchest.dirtchest9000.page5"))));
+
+ dirtChest9000GuideBook.setTagInfo("pages", pages);
+
+ bookDataCreated = true;
+ }
+}
diff --git a/src/main/java/com/progwml6/ironchest/common/tileentity/TileEntityCopperChest.java b/src/main/java/com/progwml6/ironchest/common/tileentity/GoldChestTileEntity.java
similarity index 53%
rename from src/main/java/com/progwml6/ironchest/common/tileentity/TileEntityCopperChest.java
rename to src/main/java/com/progwml6/ironchest/common/tileentity/GoldChestTileEntity.java
index 72c6336..32bfd31 100644
--- a/src/main/java/com/progwml6/ironchest/common/tileentity/TileEntityCopperChest.java
+++ b/src/main/java/com/progwml6/ironchest/common/tileentity/GoldChestTileEntity.java
@@ -10,20 +10,22 @@
******************************************************************************/
package com.progwml6.ironchest.common.tileentity;
-import com.progwml6.ironchest.client.gui.GUIChest;
-import com.progwml6.ironchest.common.blocks.IronChestType;
+import com.progwml6.ironchest.common.blocks.ChestType;
import com.progwml6.ironchest.common.core.IronChestBlocks;
+import com.progwml6.ironchest.common.inventory.ChestContainer;
+import net.minecraft.entity.player.PlayerInventory;
+import net.minecraft.inventory.container.Container;
-public class TileEntityCopperChest extends TileEntityIronChest
+public class GoldChestTileEntity extends IronChestTileEntity
{
- public TileEntityCopperChest()
+ public GoldChestTileEntity()
{
- super(IronChestEntityType.COPPER_CHEST, IronChestType.COPPER, IronChestBlocks.copperChestBlock);
+ super(ChestTileEntityType.GOLD_CHEST, ChestType.GOLD, IronChestBlocks.goldChestBlock);
}
@Override
- public String getGuiID()
+ protected Container createMenu(int id, PlayerInventory playerInventory)
{
- return GUIChest.GUI.COPPER.getGuiId().toString();
+ return ChestContainer.createGoldContainer(id, playerInventory, this);
}
}
diff --git a/src/main/java/com/progwml6/ironchest/common/tileentity/IronChestEntityType.java b/src/main/java/com/progwml6/ironchest/common/tileentity/IronChestEntityType.java
deleted file mode 100644
index 380d5f4..0000000
--- a/src/main/java/com/progwml6/ironchest/common/tileentity/IronChestEntityType.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 cpw.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the GNU Public License v3.0
- * which accompanies this distribution, and is available at
- * http://www.gnu.org/licenses/gpl.html
- *
- * Contributors:
- * cpw - initial API and implementation
- ******************************************************************************/
-package com.progwml6.ironchest.common.tileentity;
-
-import com.mojang.datafixers.DataFixUtils;
-import com.mojang.datafixers.types.Type;
-import com.progwml6.ironchest.common.util.TileEntityNames;
-import com.progwml6.ironchest.IronChest;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.tileentity.TileEntityType;
-import net.minecraft.util.ResourceLocation;
-import net.minecraft.util.SharedConstants;
-import net.minecraft.util.datafix.DataFixesManager;
-import net.minecraft.util.datafix.TypeReferences;
-import net.minecraftforge.event.RegistryEvent;
-import net.minecraftforge.eventbus.api.SubscribeEvent;
-import net.minecraftforge.fml.common.Mod;
-import net.minecraftforge.registries.IForgeRegistry;
-import net.minecraftforge.registries.IForgeRegistryEntry;
-import net.minecraftforge.registries.ObjectHolder;
-
-public class IronChestEntityType
-{
- @ObjectHolder(TileEntityNames.IRON_CHEST)
- public static TileEntityType> IRON_CHEST;
-
- @ObjectHolder(TileEntityNames.GOLD_CHEST)
- public static TileEntityType> GOLD_CHEST;
-
- @ObjectHolder(TileEntityNames.DIAMOND_CHEST)
- public static TileEntityType> DIAMOND_CHEST;
-
- @ObjectHolder(TileEntityNames.CRYSTAL_CHEST)
- public static TileEntityType> CRYSTAL_CHEST;
-
- @ObjectHolder(TileEntityNames.DIRT_CHEST)
- public static TileEntityType> DIRT_CHEST;
-
- @ObjectHolder(TileEntityNames.COPPER_CHEST)
- public static TileEntityType> COPPER_CHEST;
-
- @ObjectHolder(TileEntityNames.SILVER_CHEST)
- public static TileEntityType> SILVER_CHEST;
-
- @ObjectHolder(TileEntityNames.OBSIDIAN_CHEST)
- public static TileEntityType> OBSIDIAN_CHEST;
-
- public IronChestEntityType()
- {
-
- }
-
- @Mod.EventBusSubscriber(modid = IronChest.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD)
- public static class Registration
- {
- @SubscribeEvent
- public static void onTileEntityRegistry(final RegistryEvent.Register
+ * Contributors:
+ * cpw - initial API and implementation
+ ******************************************************************************/
+package com.progwml6.ironchest.common.tileentity;
+
+import com.progwml6.ironchest.common.blocks.ChestType;
+import com.progwml6.ironchest.common.core.IronChestBlocks;
+import com.progwml6.ironchest.common.inventory.ChestContainer;
+import net.minecraft.entity.player.PlayerInventory;
+import net.minecraft.inventory.container.Container;
+
+public class ObsidianChestTileEntity extends IronChestTileEntity
+{
+ public ObsidianChestTileEntity()
+ {
+ super(ChestTileEntityType.OBSIDIAN_CHEST, ChestType.OBSIDIAN, IronChestBlocks.obsidianChestBlock);
+ }
+
+ @Override
+ protected Container createMenu(int id, PlayerInventory playerInventory)
+ {
+ return ChestContainer.createObsidianContainer(id, playerInventory, this);
+ }
+}
diff --git a/src/main/java/com/progwml6/ironchest/common/tileentity/TileEntityGoldChest.java b/src/main/java/com/progwml6/ironchest/common/tileentity/SilverChestTileEntity.java
similarity index 52%
rename from src/main/java/com/progwml6/ironchest/common/tileentity/TileEntityGoldChest.java
rename to src/main/java/com/progwml6/ironchest/common/tileentity/SilverChestTileEntity.java
index dfe597f..dba55e6 100644
--- a/src/main/java/com/progwml6/ironchest/common/tileentity/TileEntityGoldChest.java
+++ b/src/main/java/com/progwml6/ironchest/common/tileentity/SilverChestTileEntity.java
@@ -10,20 +10,22 @@
******************************************************************************/
package com.progwml6.ironchest.common.tileentity;
-import com.progwml6.ironchest.client.gui.GUIChest;
-import com.progwml6.ironchest.common.blocks.IronChestType;
+import com.progwml6.ironchest.common.blocks.ChestType;
import com.progwml6.ironchest.common.core.IronChestBlocks;
+import com.progwml6.ironchest.common.inventory.ChestContainer;
+import net.minecraft.entity.player.PlayerInventory;
+import net.minecraft.inventory.container.Container;
-public class TileEntityGoldChest extends TileEntityIronChest
+public class SilverChestTileEntity extends IronChestTileEntity
{
- public TileEntityGoldChest()
+ public SilverChestTileEntity()
{
- super(IronChestEntityType.GOLD_CHEST, IronChestType.GOLD, IronChestBlocks.goldChestBlock);
+ super(ChestTileEntityType.SILVER_CHEST, ChestType.SILVER, IronChestBlocks.silverChestBlock);
}
@Override
- public String getGuiID()
+ protected Container createMenu(int id, PlayerInventory playerInventory)
{
- return GUIChest.GUI.GOLD.getGuiId().toString();
+ return ChestContainer.createSilverContainer(id, playerInventory, this);
}
-}
+}
\ No newline at end of file
diff --git a/src/main/java/com/progwml6/ironchest/common/tileentity/TileEntityDirtChest.java b/src/main/java/com/progwml6/ironchest/common/tileentity/TileEntityDirtChest.java
deleted file mode 100644
index 31ceab4..0000000
--- a/src/main/java/com/progwml6/ironchest/common/tileentity/TileEntityDirtChest.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 cpw.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the GNU Public License v3.0
- * which accompanies this distribution, and is available at
- * http://www.gnu.org/licenses/gpl.html
- *
- * Contributors:
- * cpw - initial API and implementation
- ******************************************************************************/
-package com.progwml6.ironchest.common.tileentity;
-
-import com.progwml6.ironchest.client.gui.GUIChest;
-import com.progwml6.ironchest.common.blocks.IronChestType;
-import com.progwml6.ironchest.common.core.IronChestBlocks;
-import net.minecraft.client.resources.I18n;
-import net.minecraft.entity.EntityLivingBase;
-import net.minecraft.init.Items;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagList;
-import net.minecraft.nbt.NBTTagString;
-import net.minecraft.util.text.ITextComponent;
-import net.minecraft.util.text.TextComponentTranslation;
-
-public class TileEntityDirtChest extends TileEntityIronChest
-{
- private static ItemStack dirtChest9000GuideBook = new ItemStack(Items.WRITTEN_BOOK);
-
- private static boolean bookDataCreated = false;
-
- public TileEntityDirtChest()
- {
- super(IronChestEntityType.DIRT_CHEST, IronChestType.DIRTCHEST9000, IronChestBlocks.dirtChestBlock);
- }
-
- @Override
- public void wasPlaced(EntityLivingBase entityLivingBase, ItemStack itemStack)
- {
- if (!(itemStack.hasTag() && itemStack.getTag().getBoolean("dirtchest")))
- {
- this.setInventorySlotContents(0, dirtChest9000GuideBook.copy());
- }
-
- if (!bookDataCreated)
- {
- createBookData();
- }
- }
-
- @Override
- public void removeAdornments()
- {
- if (!this.getItems().get(0).isEmpty() && this.getItems().get(0).isItemEqual(dirtChest9000GuideBook))
- {
- this.getItems().set(0, ItemStack.EMPTY);
- }
- }
-
- public static void createBookData()
- {
- dirtChest9000GuideBook.setTagInfo("author", new NBTTagString("cpw"));
-
- dirtChest9000GuideBook.setTagInfo("title", new NBTTagString(I18n.format("book.ironchest.dirtchest9000.title")));
-
- NBTTagList pages = new NBTTagList();
- pages.add(new NBTTagString(ITextComponent.Serializer.toJson(new TextComponentTranslation("book.ironchest.dirtchest9000.page1"))));
- pages.add(new NBTTagString(ITextComponent.Serializer.toJson(new TextComponentTranslation("book.ironchest.dirtchest9000.page2"))));
- pages.add(new NBTTagString(ITextComponent.Serializer.toJson(new TextComponentTranslation("book.ironchest.dirtchest9000.page3"))));
- pages.add(new NBTTagString(ITextComponent.Serializer.toJson(new TextComponentTranslation("book.ironchest.dirtchest9000.page4"))));
- pages.add(new NBTTagString(ITextComponent.Serializer.toJson(new TextComponentTranslation("book.ironchest.dirtchest9000.page5"))));
-
- dirtChest9000GuideBook.setTagInfo("pages", pages);
-
- bookDataCreated = true;
- }
-
- @Override
- public String getGuiID()
- {
- return GUIChest.GUI.DIRTCHEST9000.getGuiId().toString();
- }
-}
diff --git a/src/main/java/com/progwml6/ironchest/common/tileentity/TileEntitySilverChest.java b/src/main/java/com/progwml6/ironchest/common/tileentity/TileEntitySilverChest.java
deleted file mode 100644
index 3704401..0000000
--- a/src/main/java/com/progwml6/ironchest/common/tileentity/TileEntitySilverChest.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 cpw.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the GNU Public License v3.0
- * which accompanies this distribution, and is available at
- * http://www.gnu.org/licenses/gpl.html
- *
- * Contributors:
- * cpw - initial API and implementation
- ******************************************************************************/
-package com.progwml6.ironchest.common.tileentity;
-
-import com.progwml6.ironchest.client.gui.GUIChest;
-import com.progwml6.ironchest.common.blocks.IronChestType;
-import com.progwml6.ironchest.common.core.IronChestBlocks;
-
-public class TileEntitySilverChest extends TileEntityIronChest
-{
- public TileEntitySilverChest()
- {
- super(IronChestEntityType.SILVER_CHEST, IronChestType.SILVER, IronChestBlocks.silverChestBlock);
- }
-
- @Override
- public String getGuiID()
- {
- return GUIChest.GUI.SILVER.getGuiId().toString();
- }
-}
diff --git a/src/main/java/com/progwml6/ironchest/common/util/ContainerNames.java b/src/main/java/com/progwml6/ironchest/common/util/ContainerNames.java
new file mode 100644
index 0000000..e80c3ff
--- /dev/null
+++ b/src/main/java/com/progwml6/ironchest/common/util/ContainerNames.java
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2012 cpw.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the GNU Public License v3.0
+ * which accompanies this distribution, and is available at
+ * http://www.gnu.org/licenses/gpl.html
+ *
+ * Contributors:
+ * cpw - initial API and implementation
+ ******************************************************************************/
+package com.progwml6.ironchest.common.util;
+
+import com.progwml6.ironchest.IronChest;
+
+public class ContainerNames
+{
+ public static final String IRON_CHEST = IronChest.MOD_ID + ":iron_chest";
+
+ public static final String GOLD_CHEST = IronChest.MOD_ID + ":gold_chest";
+
+ public static final String DIAMOND_CHEST = IronChest.MOD_ID + ":diamond_chest";
+
+ public static final String COPPER_CHEST = IronChest.MOD_ID + ":copper_chest";
+
+ public static final String SILVER_CHEST = IronChest.MOD_ID + ":silver_chest";
+
+ public static final String CRYSTAL_CHEST = IronChest.MOD_ID + ":crystal_chest";
+
+ public static final String OBSIDIAN_CHEST = IronChest.MOD_ID + ":obsidian_chest";
+
+ public static final String DIRT_CHEST = IronChest.MOD_ID + ":dirt_chest";
+}
diff --git a/src/main/resources/assets/ironchest/textures/gui/copper_container.png b/src/main/resources/assets/ironchest/textures/gui/copper_container.png
index 2fdb824..41197b8 100644
Binary files a/src/main/resources/assets/ironchest/textures/gui/copper_container.png and b/src/main/resources/assets/ironchest/textures/gui/copper_container.png differ
diff --git a/src/main/resources/assets/ironchest/textures/gui/diamond_container.png b/src/main/resources/assets/ironchest/textures/gui/diamond_container.png
index b53f472..cdcafc9 100644
Binary files a/src/main/resources/assets/ironchest/textures/gui/diamond_container.png and b/src/main/resources/assets/ironchest/textures/gui/diamond_container.png differ
diff --git a/src/main/resources/assets/ironchest/textures/gui/gold_container.png b/src/main/resources/assets/ironchest/textures/gui/gold_container.png
index 27f506f..37c35b4 100644
Binary files a/src/main/resources/assets/ironchest/textures/gui/gold_container.png and b/src/main/resources/assets/ironchest/textures/gui/gold_container.png differ
diff --git a/src/main/resources/assets/ironchest/textures/gui/iron_container.png b/src/main/resources/assets/ironchest/textures/gui/iron_container.png
index 1c48eed..d95c78a 100644
Binary files a/src/main/resources/assets/ironchest/textures/gui/iron_container.png and b/src/main/resources/assets/ironchest/textures/gui/iron_container.png differ
diff --git a/src/main/resources/assets/ironchest/textures/gui/silver_container.png b/src/main/resources/assets/ironchest/textures/gui/silver_container.png
index 65179f2..b182f90 100644
Binary files a/src/main/resources/assets/ironchest/textures/gui/silver_container.png and b/src/main/resources/assets/ironchest/textures/gui/silver_container.png differ
diff --git a/src/main/resources/data/ironchest/loot_tables/blocks/copper_chest.json b/src/main/resources/data/ironchest/loot_tables/blocks/copper_chest.json
new file mode 100644
index 0000000..27d00f0
--- /dev/null
+++ b/src/main/resources/data/ironchest/loot_tables/blocks/copper_chest.json
@@ -0,0 +1,26 @@
+{
+ "type": "minecraft:block",
+ "pools": [
+ {
+ "name": "ironchest:copper_chest",
+ "rolls": 1,
+ "entries": [
+ {
+ "type": "minecraft:item",
+ "functions": [
+ {
+ "function": "minecraft:copy_name",
+ "source": "block_entity"
+ }
+ ],
+ "name": "ironchest:copper_chest"
+ }
+ ],
+ "conditions": [
+ {
+ "condition": "minecraft:survives_explosion"
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/main/resources/data/ironchest/loot_tables/blocks/crystal_chest.json b/src/main/resources/data/ironchest/loot_tables/blocks/crystal_chest.json
new file mode 100644
index 0000000..9613472
--- /dev/null
+++ b/src/main/resources/data/ironchest/loot_tables/blocks/crystal_chest.json
@@ -0,0 +1,26 @@
+{
+ "type": "minecraft:block",
+ "pools": [
+ {
+ "name": "ironchest:crystal_chest",
+ "rolls": 1,
+ "entries": [
+ {
+ "type": "minecraft:item",
+ "functions": [
+ {
+ "function": "minecraft:copy_name",
+ "source": "block_entity"
+ }
+ ],
+ "name": "ironchest:crystal_chest"
+ }
+ ],
+ "conditions": [
+ {
+ "condition": "minecraft:survives_explosion"
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/main/resources/data/ironchest/loot_tables/blocks/diamond_chest.json b/src/main/resources/data/ironchest/loot_tables/blocks/diamond_chest.json
new file mode 100644
index 0000000..00ee9e4
--- /dev/null
+++ b/src/main/resources/data/ironchest/loot_tables/blocks/diamond_chest.json
@@ -0,0 +1,26 @@
+{
+ "type": "minecraft:block",
+ "pools": [
+ {
+ "name": "ironchest:diamond_chest",
+ "rolls": 1,
+ "entries": [
+ {
+ "type": "minecraft:item",
+ "functions": [
+ {
+ "function": "minecraft:copy_name",
+ "source": "block_entity"
+ }
+ ],
+ "name": "ironchest:diamond_chest"
+ }
+ ],
+ "conditions": [
+ {
+ "condition": "minecraft:survives_explosion"
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/main/resources/data/ironchest/loot_tables/blocks/dirt_chest.json b/src/main/resources/data/ironchest/loot_tables/blocks/dirt_chest.json
new file mode 100644
index 0000000..c8db1bf
--- /dev/null
+++ b/src/main/resources/data/ironchest/loot_tables/blocks/dirt_chest.json
@@ -0,0 +1,30 @@
+{
+ "type": "minecraft:block",
+ "pools": [
+ {
+ "name": "ironchest:dirt_chest",
+ "rolls": 1,
+ "entries": [
+ {
+ "type": "minecraft:item",
+ "functions": [
+ {
+ "function": "minecraft:copy_name",
+ "source": "block_entity"
+ },
+ {
+ "function": "minecraft:set_nbt",
+ "tag": "{been_placed:1}"
+ }
+ ],
+ "name": "ironchest:dirt_chest"
+ }
+ ],
+ "conditions": [
+ {
+ "condition": "minecraft:survives_explosion"
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/main/resources/data/ironchest/loot_tables/blocks/gold_chest.json b/src/main/resources/data/ironchest/loot_tables/blocks/gold_chest.json
new file mode 100644
index 0000000..9691196
--- /dev/null
+++ b/src/main/resources/data/ironchest/loot_tables/blocks/gold_chest.json
@@ -0,0 +1,26 @@
+{
+ "type": "minecraft:block",
+ "pools": [
+ {
+ "name": "ironchest:gold_chest",
+ "rolls": 1,
+ "entries": [
+ {
+ "type": "minecraft:item",
+ "functions": [
+ {
+ "function": "minecraft:copy_name",
+ "source": "block_entity"
+ }
+ ],
+ "name": "ironchest:gold_chest"
+ }
+ ],
+ "conditions": [
+ {
+ "condition": "minecraft:survives_explosion"
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/main/resources/data/ironchest/loot_tables/blocks/iron_chest.json b/src/main/resources/data/ironchest/loot_tables/blocks/iron_chest.json
new file mode 100644
index 0000000..f1448bc
--- /dev/null
+++ b/src/main/resources/data/ironchest/loot_tables/blocks/iron_chest.json
@@ -0,0 +1,26 @@
+{
+ "type": "minecraft:block",
+ "pools": [
+ {
+ "name": "ironchest:iron_chest",
+ "rolls": 1,
+ "entries": [
+ {
+ "type": "minecraft:item",
+ "functions": [
+ {
+ "function": "minecraft:copy_name",
+ "source": "block_entity"
+ }
+ ],
+ "name": "ironchest:iron_chest"
+ }
+ ],
+ "conditions": [
+ {
+ "condition": "minecraft:survives_explosion"
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/main/resources/data/ironchest/loot_tables/blocks/obsidian_chest.json b/src/main/resources/data/ironchest/loot_tables/blocks/obsidian_chest.json
new file mode 100644
index 0000000..f348abe
--- /dev/null
+++ b/src/main/resources/data/ironchest/loot_tables/blocks/obsidian_chest.json
@@ -0,0 +1,26 @@
+{
+ "type": "minecraft:block",
+ "pools": [
+ {
+ "name": "ironchest:obsidian_chest",
+ "rolls": 1,
+ "entries": [
+ {
+ "type": "minecraft:item",
+ "functions": [
+ {
+ "function": "minecraft:copy_name",
+ "source": "block_entity"
+ }
+ ],
+ "name": "ironchest:obsidian_chest"
+ }
+ ],
+ "conditions": [
+ {
+ "condition": "minecraft:survives_explosion"
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/main/resources/data/ironchest/loot_tables/blocks/silver_chest.json b/src/main/resources/data/ironchest/loot_tables/blocks/silver_chest.json
new file mode 100644
index 0000000..6d53666
--- /dev/null
+++ b/src/main/resources/data/ironchest/loot_tables/blocks/silver_chest.json
@@ -0,0 +1,26 @@
+{
+ "type": "minecraft:block",
+ "pools": [
+ {
+ "name": "ironchest:silver_chest",
+ "rolls": 1,
+ "entries": [
+ {
+ "type": "minecraft:item",
+ "functions": [
+ {
+ "function": "minecraft:copy_name",
+ "source": "block_entity"
+ }
+ ],
+ "name": "ironchest:silver_chest"
+ }
+ ],
+ "conditions": [
+ {
+ "condition": "minecraft:survives_explosion"
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/main/resources/data/ironchest/recipes/_constants.json b/src/main/resources/data/ironchest/recipes/_constants.json
deleted file mode 100644
index 109ccd2..0000000
--- a/src/main/resources/data/ironchest/recipes/_constants.json
+++ /dev/null
@@ -1,57 +0,0 @@
-[
- {
- "name": "ironchest:iron",
- "tag": "forge:ingots/iron"
- },
- {
- "name": "ironchest:gold",
- "tag": "forge:ingots/gold"
- },
- {
- "name": "ironchest:diamond",
- "tag": "forge:gems/diamond"
- },
- {
- "name": "ironchest:copper",
- "tag": "forge:gems/lapis",
- "_comment": "replaceme"
- },
- {
- "name": "ironchest:silver",
- "tag": "forge:ingots/nether_brick",
- "_comment": "replaceme"
- },
- {
- "name": "ironchest:glass",
- "tag": "forge:storage_blocks",
- "_comment": "replaceme"
- },
- {
- "name": "ironchest:planks",
- "tag": "minecraft:planks"
- },
- {
- "name": "ironchest:chest",
- "tag": "forge:chests/wooden"
- },
- {
- "name": "ironchest:obsidian",
- "item": {
- "item": "minecraft:obsidian"
- }
- },
- {
- "name": "ironchest:dirt",
- "items": [
- {
- "item": "minecraft:dirt"
- },
- {
- "item": "minecraft:coarse_dirt"
- },
- {
- "item": "minecraft:podzol"
- }
- ]
- }
-]
\ No newline at end of file
diff --git a/src/main/resources/data/ironchest/recipes/chests/copper_iron_chest.json b/src/main/resources/data/ironchest/recipes/chests/copper_iron_chest.json
index 71f6097..6b899eb 100644
--- a/src/main/resources/data/ironchest/recipes/chests/copper_iron_chest.json
+++ b/src/main/resources/data/ironchest/recipes/chests/copper_iron_chest.json
@@ -7,16 +7,67 @@
],
"key": {
"M": {
- "constant": "ironchest:iron"
- },
- "G": {
- "constant": "ironchest:glass"
+ "tag": "forge:ingots/iron"
},
"S": {
"item": "ironchest:copper_chest"
- }
+ },
+ "G": [
+ {
+ "item": "minecraft:glass"
+ },
+ {
+ "item": "minecraft:white_stained_glass"
+ },
+ {
+ "item": "minecraft:orange_stained_glass"
+ },
+ {
+ "item": "minecraft:magenta_stained_glass"
+ },
+ {
+ "item": "minecraft:light_blue_stained_glass"
+ },
+ {
+ "item": "minecraft:yellow_stained_glass"
+ },
+ {
+ "item": "minecraft:lime_stained_glass"
+ },
+ {
+ "item": "minecraft:pink_stained_glass"
+ },
+ {
+ "item": "minecraft:gray_stained_glass"
+ },
+ {
+ "item": "minecraft:light_gray_stained_glass"
+ },
+ {
+ "item": "minecraft:cyan_stained_glass"
+ },
+ {
+ "item": "minecraft:purple_stained_glass"
+ },
+ {
+ "item": "minecraft:blue_stained_glass"
+ },
+ {
+ "item": "minecraft:brown_stained_glass"
+ },
+ {
+ "item": "minecraft:green_stained_glass"
+ },
+ {
+ "item": "minecraft:red_stained_glass"
+ },
+ {
+ "item": "minecraft:black_stained_glass"
+ }
+ ]
},
"result": {
"item": "ironchest:iron_chest"
- }
+ },
+ "_comment": "replaceme with tag forge:glass when out."
}
\ No newline at end of file
diff --git a/src/main/resources/data/ironchest/recipes/chests/copper_silver_chest.json b/src/main/resources/data/ironchest/recipes/chests/copper_silver_chest.json
index 2c6d10d..0ca6764 100644
--- a/src/main/resources/data/ironchest/recipes/chests/copper_silver_chest.json
+++ b/src/main/resources/data/ironchest/recipes/chests/copper_silver_chest.json
@@ -7,7 +7,7 @@
],
"key": {
"M": {
- "constant": "ironchest:silver"
+ "tag": "forge:ingots/silver"
},
"S": {
"item": "ironchest:copper_chest"
diff --git a/src/main/resources/data/ironchest/recipes/chests/diamond_crystal_chest.json b/src/main/resources/data/ironchest/recipes/chests/diamond_crystal_chest.json
index f74893d..ed56158 100644
--- a/src/main/resources/data/ironchest/recipes/chests/diamond_crystal_chest.json
+++ b/src/main/resources/data/ironchest/recipes/chests/diamond_crystal_chest.json
@@ -6,14 +6,65 @@
"GGG"
],
"key": {
- "G": {
- "constant": "ironchest:glass"
- },
"S": {
"item": "ironchest:diamond_chest"
- }
+ },
+ "G": [
+ {
+ "item": "minecraft:glass"
+ },
+ {
+ "item": "minecraft:white_stained_glass"
+ },
+ {
+ "item": "minecraft:orange_stained_glass"
+ },
+ {
+ "item": "minecraft:magenta_stained_glass"
+ },
+ {
+ "item": "minecraft:light_blue_stained_glass"
+ },
+ {
+ "item": "minecraft:yellow_stained_glass"
+ },
+ {
+ "item": "minecraft:lime_stained_glass"
+ },
+ {
+ "item": "minecraft:pink_stained_glass"
+ },
+ {
+ "item": "minecraft:gray_stained_glass"
+ },
+ {
+ "item": "minecraft:light_gray_stained_glass"
+ },
+ {
+ "item": "minecraft:cyan_stained_glass"
+ },
+ {
+ "item": "minecraft:purple_stained_glass"
+ },
+ {
+ "item": "minecraft:blue_stained_glass"
+ },
+ {
+ "item": "minecraft:brown_stained_glass"
+ },
+ {
+ "item": "minecraft:green_stained_glass"
+ },
+ {
+ "item": "minecraft:red_stained_glass"
+ },
+ {
+ "item": "minecraft:black_stained_glass"
+ }
+ ]
},
"result": {
"item": "ironchest:crystal_chest"
- }
+ },
+ "_comment": "replaceme with tag forge:glass when out."
}
\ No newline at end of file
diff --git a/src/main/resources/data/ironchest/recipes/chests/diamond_obsidian_chest.json b/src/main/resources/data/ironchest/recipes/chests/diamond_obsidian_chest.json
index 0acffba..ed9417c 100644
--- a/src/main/resources/data/ironchest/recipes/chests/diamond_obsidian_chest.json
+++ b/src/main/resources/data/ironchest/recipes/chests/diamond_obsidian_chest.json
@@ -7,7 +7,7 @@
],
"key": {
"M": {
- "constant": "ironchest:obsidian"
+ "item": "minecraft:obsidian"
},
"S": {
"item": "ironchest:diamond_chest"
diff --git a/src/main/resources/data/ironchest/recipes/chests/gold_diamond_chest.json b/src/main/resources/data/ironchest/recipes/chests/gold_diamond_chest.json
index 11270b1..2d5d36b 100644
--- a/src/main/resources/data/ironchest/recipes/chests/gold_diamond_chest.json
+++ b/src/main/resources/data/ironchest/recipes/chests/gold_diamond_chest.json
@@ -7,16 +7,67 @@
],
"key": {
"M": {
- "constant": "ironchest:diamond"
- },
- "G": {
- "constant": "ironchest:glass"
+ "tag": "forge:gems/diamond"
},
"S": {
"item": "ironchest:gold_chest"
- }
+ },
+ "G": [
+ {
+ "item": "minecraft:glass"
+ },
+ {
+ "item": "minecraft:white_stained_glass"
+ },
+ {
+ "item": "minecraft:orange_stained_glass"
+ },
+ {
+ "item": "minecraft:magenta_stained_glass"
+ },
+ {
+ "item": "minecraft:light_blue_stained_glass"
+ },
+ {
+ "item": "minecraft:yellow_stained_glass"
+ },
+ {
+ "item": "minecraft:lime_stained_glass"
+ },
+ {
+ "item": "minecraft:pink_stained_glass"
+ },
+ {
+ "item": "minecraft:gray_stained_glass"
+ },
+ {
+ "item": "minecraft:light_gray_stained_glass"
+ },
+ {
+ "item": "minecraft:cyan_stained_glass"
+ },
+ {
+ "item": "minecraft:purple_stained_glass"
+ },
+ {
+ "item": "minecraft:blue_stained_glass"
+ },
+ {
+ "item": "minecraft:brown_stained_glass"
+ },
+ {
+ "item": "minecraft:green_stained_glass"
+ },
+ {
+ "item": "minecraft:red_stained_glass"
+ },
+ {
+ "item": "minecraft:black_stained_glass"
+ }
+ ]
},
"result": {
"item": "ironchest:diamond_chest"
- }
+ },
+ "_comment": "replaceme with tag forge:glass when out."
}
\ No newline at end of file
diff --git a/src/main/resources/data/ironchest/recipes/chests/iron_gold_chest.json b/src/main/resources/data/ironchest/recipes/chests/iron_gold_chest.json
index e82f7bb..d2d477b 100644
--- a/src/main/resources/data/ironchest/recipes/chests/iron_gold_chest.json
+++ b/src/main/resources/data/ironchest/recipes/chests/iron_gold_chest.json
@@ -7,7 +7,7 @@
],
"key": {
"M": {
- "constant": "ironchest:gold"
+ "tag": "forge:ingots/gold"
},
"S": {
"item": "ironchest:iron_chest"
diff --git a/src/main/resources/data/ironchest/recipes/chests/iron_silver_chest.json b/src/main/resources/data/ironchest/recipes/chests/iron_silver_chest.json
index 02c8d76..1ad9072 100644
--- a/src/main/resources/data/ironchest/recipes/chests/iron_silver_chest.json
+++ b/src/main/resources/data/ironchest/recipes/chests/iron_silver_chest.json
@@ -7,16 +7,67 @@
],
"key": {
"M": {
- "constant": "ironchest:silver"
- },
- "G": {
- "constant": "ironchest:glass"
+ "tag": "forge:ingots/silver"
},
"S": {
"item": "ironchest:iron_chest"
- }
+ },
+ "G": [
+ {
+ "item": "minecraft:glass"
+ },
+ {
+ "item": "minecraft:white_stained_glass"
+ },
+ {
+ "item": "minecraft:orange_stained_glass"
+ },
+ {
+ "item": "minecraft:magenta_stained_glass"
+ },
+ {
+ "item": "minecraft:light_blue_stained_glass"
+ },
+ {
+ "item": "minecraft:yellow_stained_glass"
+ },
+ {
+ "item": "minecraft:lime_stained_glass"
+ },
+ {
+ "item": "minecraft:pink_stained_glass"
+ },
+ {
+ "item": "minecraft:gray_stained_glass"
+ },
+ {
+ "item": "minecraft:light_gray_stained_glass"
+ },
+ {
+ "item": "minecraft:cyan_stained_glass"
+ },
+ {
+ "item": "minecraft:purple_stained_glass"
+ },
+ {
+ "item": "minecraft:blue_stained_glass"
+ },
+ {
+ "item": "minecraft:brown_stained_glass"
+ },
+ {
+ "item": "minecraft:green_stained_glass"
+ },
+ {
+ "item": "minecraft:red_stained_glass"
+ },
+ {
+ "item": "minecraft:black_stained_glass"
+ }
+ ]
},
"result": {
"item": "ironchest:silver_chest"
- }
+ },
+ "_comment": "replaceme with tag forge:glass when out."
}
\ No newline at end of file
diff --git a/src/main/resources/data/ironchest/recipes/chests/silver_diamond_chest.json b/src/main/resources/data/ironchest/recipes/chests/silver_diamond_chest.json
index 3e246cb..4507e1a 100644
--- a/src/main/resources/data/ironchest/recipes/chests/silver_diamond_chest.json
+++ b/src/main/resources/data/ironchest/recipes/chests/silver_diamond_chest.json
@@ -7,16 +7,67 @@
],
"key": {
"M": {
- "constant": "ironchest:diamond"
- },
- "G": {
- "constant": "ironchest:glass"
+ "tag": "forge:gems/diamond"
},
"S": {
"item": "ironchest:silver_chest"
- }
+ },
+ "G": [
+ {
+ "item": "minecraft:glass"
+ },
+ {
+ "item": "minecraft:white_stained_glass"
+ },
+ {
+ "item": "minecraft:orange_stained_glass"
+ },
+ {
+ "item": "minecraft:magenta_stained_glass"
+ },
+ {
+ "item": "minecraft:light_blue_stained_glass"
+ },
+ {
+ "item": "minecraft:yellow_stained_glass"
+ },
+ {
+ "item": "minecraft:lime_stained_glass"
+ },
+ {
+ "item": "minecraft:pink_stained_glass"
+ },
+ {
+ "item": "minecraft:gray_stained_glass"
+ },
+ {
+ "item": "minecraft:light_gray_stained_glass"
+ },
+ {
+ "item": "minecraft:cyan_stained_glass"
+ },
+ {
+ "item": "minecraft:purple_stained_glass"
+ },
+ {
+ "item": "minecraft:blue_stained_glass"
+ },
+ {
+ "item": "minecraft:brown_stained_glass"
+ },
+ {
+ "item": "minecraft:green_stained_glass"
+ },
+ {
+ "item": "minecraft:red_stained_glass"
+ },
+ {
+ "item": "minecraft:black_stained_glass"
+ }
+ ]
},
"result": {
"item": "ironchest:diamond_chest"
- }
+ },
+ "_comment": "replaceme with tag forge:glass when out."
}
\ No newline at end of file
diff --git a/src/main/resources/data/ironchest/recipes/chests/silver_gold_chest.json b/src/main/resources/data/ironchest/recipes/chests/silver_gold_chest.json
index d01a430..90d007f 100644
--- a/src/main/resources/data/ironchest/recipes/chests/silver_gold_chest.json
+++ b/src/main/resources/data/ironchest/recipes/chests/silver_gold_chest.json
@@ -7,16 +7,67 @@
],
"key": {
"M": {
- "constant": "ironchest:gold"
- },
- "G": {
- "constant": "ironchest:glass"
+ "tag": "forge:ingots/gold"
},
"S": {
"item": "ironchest:silver_chest"
- }
+ },
+ "G": [
+ {
+ "item": "minecraft:glass"
+ },
+ {
+ "item": "minecraft:white_stained_glass"
+ },
+ {
+ "item": "minecraft:orange_stained_glass"
+ },
+ {
+ "item": "minecraft:magenta_stained_glass"
+ },
+ {
+ "item": "minecraft:light_blue_stained_glass"
+ },
+ {
+ "item": "minecraft:yellow_stained_glass"
+ },
+ {
+ "item": "minecraft:lime_stained_glass"
+ },
+ {
+ "item": "minecraft:pink_stained_glass"
+ },
+ {
+ "item": "minecraft:gray_stained_glass"
+ },
+ {
+ "item": "minecraft:light_gray_stained_glass"
+ },
+ {
+ "item": "minecraft:cyan_stained_glass"
+ },
+ {
+ "item": "minecraft:purple_stained_glass"
+ },
+ {
+ "item": "minecraft:blue_stained_glass"
+ },
+ {
+ "item": "minecraft:brown_stained_glass"
+ },
+ {
+ "item": "minecraft:green_stained_glass"
+ },
+ {
+ "item": "minecraft:red_stained_glass"
+ },
+ {
+ "item": "minecraft:black_stained_glass"
+ }
+ ]
},
"result": {
"item": "ironchest:gold_chest"
- }
+ },
+ "_comment": "replaceme with tag forge:glass when out."
}
\ No newline at end of file
diff --git a/src/main/resources/data/ironchest/recipes/chests/vanilla_copper_chest.json b/src/main/resources/data/ironchest/recipes/chests/vanilla_copper_chest.json
index b45428d..1dcc25f 100644
--- a/src/main/resources/data/ironchest/recipes/chests/vanilla_copper_chest.json
+++ b/src/main/resources/data/ironchest/recipes/chests/vanilla_copper_chest.json
@@ -7,10 +7,10 @@
],
"key": {
"M": {
- "constant": "ironchest:copper"
+ "tag": "forge:ingots/copper"
},
"S": {
- "constant": "ironchest:chest"
+ "tag": "forge:chests/wooden"
}
},
"result": {
diff --git a/src/main/resources/data/ironchest/recipes/chests/vanilla_dirt_chest.json b/src/main/resources/data/ironchest/recipes/chests/vanilla_dirt_chest.json
index 026f54b..ee107df 100644
--- a/src/main/resources/data/ironchest/recipes/chests/vanilla_dirt_chest.json
+++ b/src/main/resources/data/ironchest/recipes/chests/vanilla_dirt_chest.json
@@ -6,14 +6,23 @@
"MMM"
],
"key": {
- "M": {
- "constant": "ironchest:dirt"
- },
"S": {
- "constant": "ironchest:chest"
- }
+ "tag": "forge:chests/wooden"
+ },
+ "M": [
+ {
+ "item": "minecraft:dirt"
+ },
+ {
+ "item": "minecraft:coarse_dirt"
+ },
+ {
+ "item": "minecraft:podzol"
+ }
+ ]
},
"result": {
"item": "ironchest:dirt_chest"
- }
+ },
+ "_comment": "replaceme with tag forge:dirt when out."
}
\ No newline at end of file
diff --git a/src/main/resources/data/ironchest/recipes/chests/vanilla_iron_chest.json b/src/main/resources/data/ironchest/recipes/chests/vanilla_iron_chest.json
index 3e365a2..45f6275 100644
--- a/src/main/resources/data/ironchest/recipes/chests/vanilla_iron_chest.json
+++ b/src/main/resources/data/ironchest/recipes/chests/vanilla_iron_chest.json
@@ -7,10 +7,10 @@
],
"key": {
"M": {
- "constant": "ironchest:iron"
+ "tag": "forge:ingots/iron"
},
"S": {
- "constant": "ironchest:chest"
+ "tag": "forge:chests/wooden"
}
},
"result": {
diff --git a/src/main/resources/data/ironchest/recipes/upgrades/copper_iron_chest_upgrade.json b/src/main/resources/data/ironchest/recipes/upgrades/copper_iron_chest_upgrade.json
index 106638b..e621d63 100644
--- a/src/main/resources/data/ironchest/recipes/upgrades/copper_iron_chest_upgrade.json
+++ b/src/main/resources/data/ironchest/recipes/upgrades/copper_iron_chest_upgrade.json
@@ -7,16 +7,67 @@
],
"key": {
"M": {
- "constant": "ironchest:iron"
+ "tag": "forge:ingots/iron"
},
"S": {
- "constant": "ironchest:copper"
+ "tag": "forge:ingots/copper"
},
- "G": {
- "constant": "ironchest:glass"
- }
+ "G": [
+ {
+ "item": "minecraft:glass"
+ },
+ {
+ "item": "minecraft:white_stained_glass"
+ },
+ {
+ "item": "minecraft:orange_stained_glass"
+ },
+ {
+ "item": "minecraft:magenta_stained_glass"
+ },
+ {
+ "item": "minecraft:light_blue_stained_glass"
+ },
+ {
+ "item": "minecraft:yellow_stained_glass"
+ },
+ {
+ "item": "minecraft:lime_stained_glass"
+ },
+ {
+ "item": "minecraft:pink_stained_glass"
+ },
+ {
+ "item": "minecraft:gray_stained_glass"
+ },
+ {
+ "item": "minecraft:light_gray_stained_glass"
+ },
+ {
+ "item": "minecraft:cyan_stained_glass"
+ },
+ {
+ "item": "minecraft:purple_stained_glass"
+ },
+ {
+ "item": "minecraft:blue_stained_glass"
+ },
+ {
+ "item": "minecraft:brown_stained_glass"
+ },
+ {
+ "item": "minecraft:green_stained_glass"
+ },
+ {
+ "item": "minecraft:red_stained_glass"
+ },
+ {
+ "item": "minecraft:black_stained_glass"
+ }
+ ]
},
"result": {
"item": "ironchest:copper_iron_chest_upgrade"
- }
+ },
+ "_comment": "replaceme with tag forge:glass when out."
}
\ No newline at end of file
diff --git a/src/main/resources/data/ironchest/recipes/upgrades/copper_silver_chest_upgrade.json b/src/main/resources/data/ironchest/recipes/upgrades/copper_silver_chest_upgrade.json
index bb27459..c477be0 100644
--- a/src/main/resources/data/ironchest/recipes/upgrades/copper_silver_chest_upgrade.json
+++ b/src/main/resources/data/ironchest/recipes/upgrades/copper_silver_chest_upgrade.json
@@ -7,10 +7,10 @@
],
"key": {
"M": {
- "constant": "ironchest:silver"
+ "tag": "forge:ingots/silver"
},
"S": {
- "constant": "ironchest:copper"
+ "tag": "forge:ingots/copper"
}
},
"result": {
diff --git a/src/main/resources/data/ironchest/recipes/upgrades/diamond_crystal_chest_upgrade.json b/src/main/resources/data/ironchest/recipes/upgrades/diamond_crystal_chest_upgrade.json
index 318add9..c6e9b00 100644
--- a/src/main/resources/data/ironchest/recipes/upgrades/diamond_crystal_chest_upgrade.json
+++ b/src/main/resources/data/ironchest/recipes/upgrades/diamond_crystal_chest_upgrade.json
@@ -6,14 +6,65 @@
"GGG"
],
"key": {
- "G": {
- "constant": "ironchest:glass"
- },
"S": {
- "constant": "ironchest:obsidian"
- }
+ "item": "minecraft:obsidian"
+ },
+ "G": [
+ {
+ "item": "minecraft:glass"
+ },
+ {
+ "item": "minecraft:white_stained_glass"
+ },
+ {
+ "item": "minecraft:orange_stained_glass"
+ },
+ {
+ "item": "minecraft:magenta_stained_glass"
+ },
+ {
+ "item": "minecraft:light_blue_stained_glass"
+ },
+ {
+ "item": "minecraft:yellow_stained_glass"
+ },
+ {
+ "item": "minecraft:lime_stained_glass"
+ },
+ {
+ "item": "minecraft:pink_stained_glass"
+ },
+ {
+ "item": "minecraft:gray_stained_glass"
+ },
+ {
+ "item": "minecraft:light_gray_stained_glass"
+ },
+ {
+ "item": "minecraft:cyan_stained_glass"
+ },
+ {
+ "item": "minecraft:purple_stained_glass"
+ },
+ {
+ "item": "minecraft:blue_stained_glass"
+ },
+ {
+ "item": "minecraft:brown_stained_glass"
+ },
+ {
+ "item": "minecraft:green_stained_glass"
+ },
+ {
+ "item": "minecraft:red_stained_glass"
+ },
+ {
+ "item": "minecraft:black_stained_glass"
+ }
+ ]
},
"result": {
"item": "ironchest:diamond_crystal_chest_upgrade"
- }
+ },
+ "_comment": "replaceme with tag forge:glass when out."
}
\ No newline at end of file
diff --git a/src/main/resources/data/ironchest/recipes/upgrades/diamond_obsidian_chest_upgrade.json b/src/main/resources/data/ironchest/recipes/upgrades/diamond_obsidian_chest_upgrade.json
index c3849cd..32a7f19 100644
--- a/src/main/resources/data/ironchest/recipes/upgrades/diamond_obsidian_chest_upgrade.json
+++ b/src/main/resources/data/ironchest/recipes/upgrades/diamond_obsidian_chest_upgrade.json
@@ -7,13 +7,64 @@
],
"key": {
"M": {
- "constant": "ironchest:obsidian"
+ "item": "minecraft:obsidian"
},
- "G": {
- "constant": "ironchest:glass"
- }
+ "G": [
+ {
+ "item": "minecraft:glass"
+ },
+ {
+ "item": "minecraft:white_stained_glass"
+ },
+ {
+ "item": "minecraft:orange_stained_glass"
+ },
+ {
+ "item": "minecraft:magenta_stained_glass"
+ },
+ {
+ "item": "minecraft:light_blue_stained_glass"
+ },
+ {
+ "item": "minecraft:yellow_stained_glass"
+ },
+ {
+ "item": "minecraft:lime_stained_glass"
+ },
+ {
+ "item": "minecraft:pink_stained_glass"
+ },
+ {
+ "item": "minecraft:gray_stained_glass"
+ },
+ {
+ "item": "minecraft:light_gray_stained_glass"
+ },
+ {
+ "item": "minecraft:cyan_stained_glass"
+ },
+ {
+ "item": "minecraft:purple_stained_glass"
+ },
+ {
+ "item": "minecraft:blue_stained_glass"
+ },
+ {
+ "item": "minecraft:brown_stained_glass"
+ },
+ {
+ "item": "minecraft:green_stained_glass"
+ },
+ {
+ "item": "minecraft:red_stained_glass"
+ },
+ {
+ "item": "minecraft:black_stained_glass"
+ }
+ ]
},
"result": {
"item": "ironchest:diamond_obsidian_chest_upgrade"
- }
+ },
+ "_comment": "replaceme with tag forge:glass when out."
}
\ No newline at end of file
diff --git a/src/main/resources/data/ironchest/recipes/upgrades/gold_diamond_chest_upgrade.json b/src/main/resources/data/ironchest/recipes/upgrades/gold_diamond_chest_upgrade.json
index 6f9fd52..fe3034d 100644
--- a/src/main/resources/data/ironchest/recipes/upgrades/gold_diamond_chest_upgrade.json
+++ b/src/main/resources/data/ironchest/recipes/upgrades/gold_diamond_chest_upgrade.json
@@ -7,16 +7,67 @@
],
"key": {
"M": {
- "constant": "ironchest:diamond"
+ "tag": "forge:gems/diamond"
},
"S": {
- "constant": "ironchest:gold"
+ "tag": "forge:ingots/gold"
},
- "G": {
- "constant": "ironchest:glass"
- }
+ "G": [
+ {
+ "item": "minecraft:glass"
+ },
+ {
+ "item": "minecraft:white_stained_glass"
+ },
+ {
+ "item": "minecraft:orange_stained_glass"
+ },
+ {
+ "item": "minecraft:magenta_stained_glass"
+ },
+ {
+ "item": "minecraft:light_blue_stained_glass"
+ },
+ {
+ "item": "minecraft:yellow_stained_glass"
+ },
+ {
+ "item": "minecraft:lime_stained_glass"
+ },
+ {
+ "item": "minecraft:pink_stained_glass"
+ },
+ {
+ "item": "minecraft:gray_stained_glass"
+ },
+ {
+ "item": "minecraft:light_gray_stained_glass"
+ },
+ {
+ "item": "minecraft:cyan_stained_glass"
+ },
+ {
+ "item": "minecraft:purple_stained_glass"
+ },
+ {
+ "item": "minecraft:blue_stained_glass"
+ },
+ {
+ "item": "minecraft:brown_stained_glass"
+ },
+ {
+ "item": "minecraft:green_stained_glass"
+ },
+ {
+ "item": "minecraft:red_stained_glass"
+ },
+ {
+ "item": "minecraft:black_stained_glass"
+ }
+ ]
},
"result": {
"item": "ironchest:gold_diamond_chest_upgrade"
- }
+ },
+ "_comment": "replaceme with tag forge:glass when out."
}
\ No newline at end of file
diff --git a/src/main/resources/data/ironchest/recipes/upgrades/iron_gold_chest_upgrade.json b/src/main/resources/data/ironchest/recipes/upgrades/iron_gold_chest_upgrade.json
index 56b9706..d71746a 100644
--- a/src/main/resources/data/ironchest/recipes/upgrades/iron_gold_chest_upgrade.json
+++ b/src/main/resources/data/ironchest/recipes/upgrades/iron_gold_chest_upgrade.json
@@ -7,10 +7,10 @@
],
"key": {
"M": {
- "constant": "ironchest:gold"
+ "tag": "forge:ingots/gold"
},
"S": {
- "constant": "ironchest:iron"
+ "tag": "forge:ingots/iron"
}
},
"result": {
diff --git a/src/main/resources/data/ironchest/recipes/upgrades/silver_gold_chest_upgrade.json b/src/main/resources/data/ironchest/recipes/upgrades/silver_gold_chest_upgrade.json
index dd0f7cc..ead75af 100644
--- a/src/main/resources/data/ironchest/recipes/upgrades/silver_gold_chest_upgrade.json
+++ b/src/main/resources/data/ironchest/recipes/upgrades/silver_gold_chest_upgrade.json
@@ -7,16 +7,67 @@
],
"key": {
"M": {
- "constant": "ironchest:gold"
+ "tag": "forge:ingots/gold"
},
"S": {
- "constant": "ironchest:silver"
+ "tag": "forge:ingots/silver"
},
- "G": {
- "constant": "ironchest:glass"
- }
+ "G": [
+ {
+ "item": "minecraft:glass"
+ },
+ {
+ "item": "minecraft:white_stained_glass"
+ },
+ {
+ "item": "minecraft:orange_stained_glass"
+ },
+ {
+ "item": "minecraft:magenta_stained_glass"
+ },
+ {
+ "item": "minecraft:light_blue_stained_glass"
+ },
+ {
+ "item": "minecraft:yellow_stained_glass"
+ },
+ {
+ "item": "minecraft:lime_stained_glass"
+ },
+ {
+ "item": "minecraft:pink_stained_glass"
+ },
+ {
+ "item": "minecraft:gray_stained_glass"
+ },
+ {
+ "item": "minecraft:light_gray_stained_glass"
+ },
+ {
+ "item": "minecraft:cyan_stained_glass"
+ },
+ {
+ "item": "minecraft:purple_stained_glass"
+ },
+ {
+ "item": "minecraft:blue_stained_glass"
+ },
+ {
+ "item": "minecraft:brown_stained_glass"
+ },
+ {
+ "item": "minecraft:green_stained_glass"
+ },
+ {
+ "item": "minecraft:red_stained_glass"
+ },
+ {
+ "item": "minecraft:black_stained_glass"
+ }
+ ]
},
"result": {
"item": "ironchest:silver_gold_chest_upgrade"
- }
+ },
+ "_comment": "replaceme with tag forge:glass when out."
}
\ No newline at end of file
diff --git a/src/main/resources/data/ironchest/recipes/upgrades/wood_copper_chest_upgrade.json b/src/main/resources/data/ironchest/recipes/upgrades/wood_copper_chest_upgrade.json
index cffd038..f9e34b1 100644
--- a/src/main/resources/data/ironchest/recipes/upgrades/wood_copper_chest_upgrade.json
+++ b/src/main/resources/data/ironchest/recipes/upgrades/wood_copper_chest_upgrade.json
@@ -7,10 +7,10 @@
],
"key": {
"M": {
- "constant": "ironchest:copper"
+ "tag": "forge:ingots/copper"
},
"S": {
- "constant": "ironchest:planks"
+ "tag": "minecraft:planks"
}
},
"result": {
diff --git a/src/main/resources/data/ironchest/recipes/upgrades/wood_iron_chest_upgrade.json b/src/main/resources/data/ironchest/recipes/upgrades/wood_iron_chest_upgrade.json
index 4ae7095..cb196a3 100644
--- a/src/main/resources/data/ironchest/recipes/upgrades/wood_iron_chest_upgrade.json
+++ b/src/main/resources/data/ironchest/recipes/upgrades/wood_iron_chest_upgrade.json
@@ -7,10 +7,10 @@
],
"key": {
"M": {
- "constant": "ironchest:iron"
+ "tag": "forge:ingots/iron"
},
"S": {
- "constant": "ironchest:planks"
+ "tag": "minecraft:planks"
}
},
"result": {