From 466af3d98630c9c20c726ab5b35d524d32180d31 Mon Sep 17 00:00:00 2001 From: DragonsLover Date: Sun, 3 May 2015 00:45:29 -0400 Subject: [PATCH 001/105] Adding French Canadian language --- .../assets/ironchest/lang/fr_CA.lang | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/main/resources/assets/ironchest/lang/fr_CA.lang diff --git a/src/main/resources/assets/ironchest/lang/fr_CA.lang b/src/main/resources/assets/ironchest/lang/fr_CA.lang new file mode 100644 index 00000000..d6095136 --- /dev/null +++ b/src/main/resources/assets/ironchest/lang/fr_CA.lang @@ -0,0 +1,25 @@ +tile.ironchest:IRON.name=Coffre en fer +tile.ironchest:GOLD.name=Coffre en or +tile.ironchest:DIAMOND.name=Coffre en diamant +tile.ironchest:COPPER.name=Coffre en cuivre +tile.ironchest:SILVER.name=Coffre en argent +tile.ironchest:CRYSTAL.name=Coffre en cristal +tile.ironchest:OBSIDIAN.name=Coffre en obsidienne +tile.ironchest:DIRTCHEST9000.name=DirtChest 9000 ! + +item.ironchest:IRONGOLD.name=Upgrade de coffre en fer à l'or +item.ironchest:GOLDDIAMOND.name=Upgrade de coffre en or au diamant +item.ironchest:COPPERSILVER.name=Upgrade de coffre en cuivre à l'argent +item.ironchest:SILVERGOLD.name=Upgrade de coffre en argent à l'or +item.ironchest:COPPERIRON.name=Upgrade de coffre en cuivre au fer +item.ironchest:DIAMONDCRYSTAL.name=Upgrade de coffre en diamant au cristal +item.ironchest:WOODIRON.name=Upgrade de coffre en bois au fer +item.ironchest:WOODCOPPER.name=Upgrade de coffre en bois au cuivre +item.ironchest:DIAMONDOBSIDIAN.name=Upgrade de coffre en diamant à l'obsidienne + +book.ironchest:dirtchest9000.title=Comment utiliser votre DirtChest 9000 ! +book.ironchest:dirtchest9000.page1=Bienvenue à votre nouveau DirtChest 9000 ! Nous espérons que vous apprécierez les innombrables années heureuses à emmagasiner votre stack de terre dans notre utilitaire de stockage. +book.ironchest:dirtchest9000.page2=Utilisation : insérez tout simplement le stack de terre de votre choix dans la case hautement réceptive et appréciez l'immense commodité d'avoir cette terre disponible à portée de la main, à tout moment où vous passez devant ce coffre ! +book.ironchest:dirtchest9000.page3=Nous espérons que vous avez apprécié faire la critique de ce manuel d'instruction, et espérons que vous allez considérer utiliser nos produits dans le futur ! Nos meilleures salutations, les rédacteurs du manuel DirtChest 9000 inc. +book.ironchest:dirtchest9000.page4=Garantie : ce produit n'a aucune garantie quelconque. Votre terre peut ne pas être stockée, elle peut se fondre lentement dans l'environnement, ou encore, elle peut ne rien faire du tout. +book.ironchest:dirtchest9000.page5=DirtChest 9000 respecte l'environnement. Veuillez disposer de ce guide de manière responsable, et quoique vous fassiez, ne le balancez juste pas dans de la lave. Nous en serions attristés. From f11148c97f7f23691df9a15b66b731704be3819f Mon Sep 17 00:00:00 2001 From: Progwml6 Date: Tue, 12 Jan 2016 13:20:34 -0500 Subject: [PATCH 002/105] update to 1.8.9 --- build.gradle | 2 +- src/main/java/cpw/mods/ironchest/CommonProxy.java | 2 +- src/main/java/cpw/mods/ironchest/IronChest.java | 4 ++-- src/main/java/cpw/mods/ironchest/client/ClientProxy.java | 4 ++-- .../mods/ironchest/client/TileEntityIronChestRenderer.java | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/build.gradle b/build.gradle index 22071f31..dafa3c67 100755 --- a/build.gradle +++ b/build.gradle @@ -34,8 +34,8 @@ archivesBaseName = "ironchest" // Setup the forge minecraft plugin data. Specify the preferred forge/minecraft version here minecraft { - version = "1.8.8-11.14.4.1576-1.8.8" mappings = "snapshot_20151122" + version = "1.8.9-11.15.0.1663" runDir = "run" } diff --git a/src/main/java/cpw/mods/ironchest/CommonProxy.java b/src/main/java/cpw/mods/ironchest/CommonProxy.java index 4e86f81e..8660f334 100755 --- a/src/main/java/cpw/mods/ironchest/CommonProxy.java +++ b/src/main/java/cpw/mods/ironchest/CommonProxy.java @@ -22,7 +22,7 @@ public void registerRenderInformation() } - public void registerTileEntitySpecialRenderer(IronChestType typ) + public void registerTileEntitySpecialRenderer(Class typ) { } diff --git a/src/main/java/cpw/mods/ironchest/IronChest.java b/src/main/java/cpw/mods/ironchest/IronChest.java index 1218a8ad..d801b349 100755 --- a/src/main/java/cpw/mods/ironchest/IronChest.java +++ b/src/main/java/cpw/mods/ironchest/IronChest.java @@ -20,7 +20,7 @@ import net.minecraftforge.fml.common.network.NetworkRegistry; import net.minecraftforge.fml.common.registry.GameRegistry; -@Mod(modid = "IronChest", name = "Iron Chests", dependencies = "required-after:Forge@[11.14.4,]", acceptedMinecraftVersions="[1.8,1.8.8]") +@Mod(modid = "IronChest", name = "Iron Chests", dependencies = "required-after:Forge@[11.14.4,]") public class IronChest { public static BlockIronChest ironChestBlock; @@ -48,7 +48,7 @@ public void load(FMLInitializationEvent evt) for (IronChestType typ : IronChestType.values()) { GameRegistry.registerTileEntityWithAlternatives(typ.clazz, "IronChest." + typ.name(), typ.name()); - proxy.registerTileEntitySpecialRenderer(typ); + proxy.registerTileEntitySpecialRenderer(typ.clazz); } IronChestType.registerBlocksAndRecipes(ironChestBlock); ChestChangerType.generateRecipes(); diff --git a/src/main/java/cpw/mods/ironchest/client/ClientProxy.java b/src/main/java/cpw/mods/ironchest/client/ClientProxy.java index 1967404b..9bc2ba02 100755 --- a/src/main/java/cpw/mods/ironchest/client/ClientProxy.java +++ b/src/main/java/cpw/mods/ironchest/client/ClientProxy.java @@ -46,9 +46,9 @@ public void registerRenderInformation() } @Override - public void registerTileEntitySpecialRenderer(IronChestType typ) + public void registerTileEntitySpecialRenderer(Class type) { - ClientRegistry.bindTileEntitySpecialRenderer(typ.clazz, new TileEntityIronChestRenderer()); + ClientRegistry.bindTileEntitySpecialRenderer(type, new TileEntityIronChestRenderer(type)); } @Override diff --git a/src/main/java/cpw/mods/ironchest/client/TileEntityIronChestRenderer.java b/src/main/java/cpw/mods/ironchest/client/TileEntityIronChestRenderer.java index 4095173e..b9940fdc 100755 --- a/src/main/java/cpw/mods/ironchest/client/TileEntityIronChestRenderer.java +++ b/src/main/java/cpw/mods/ironchest/client/TileEntityIronChestRenderer.java @@ -31,7 +31,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; -public class TileEntityIronChestRenderer extends TileEntitySpecialRenderer +public class TileEntityIronChestRenderer extends TileEntitySpecialRenderer { private static Map locations; @@ -50,7 +50,7 @@ public class TileEntityIronChestRenderer extends TileEntitySpecialRenderer type) { model = new ModelChest(); random = new Random(); From b50c6eb126005070480a3bb3777b77627743849b Mon Sep 17 00:00:00 2001 From: Progwml6 Date: Mon, 18 Jan 2016 15:39:18 -0500 Subject: [PATCH 003/105] add curse support --- build.gradle | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/build.gradle b/build.gradle index f9cac83c..d27eaaa9 100755 --- a/build.gradle +++ b/build.gradle @@ -11,6 +11,10 @@ buildscript { classpath 'net.minecraftforge.gradle:ForgeGradle:2.1-SNAPSHOT' } } +plugins { + id "com.matthewprenger.cursegradle" version "1.0.7" +} + apply plugin: 'net.minecraftforge.gradle.forge' apply plugin: 'maven' apply plugin: 'eclipse' @@ -39,6 +43,17 @@ minecraft { runDir = "run" } + +curseforge { + apiKey = project.hasProperty('curseforge_apikey') ? project.curseforge_apikey : '0' + project { + id = '228756' + changelog = 'Empty' + releaseType = 'beta' + } +} + + // This wrangles the resources for the jar files- stuff like textures and languages processResources { From c2646a5d692a81687ce1b536d92ba27e3a282b56 Mon Sep 17 00:00:00 2001 From: Progwml6 Date: Tue, 19 Jan 2016 01:21:35 -0500 Subject: [PATCH 004/105] change versioning code so that curse forge builds are labeled the same as ones from files --- build.gradle | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index d27eaaa9..86271b00 100755 --- a/build.gradle +++ b/build.gradle @@ -27,9 +27,6 @@ repositories { dirs "repo" } } -// IronChest uses git tagging to mark major versions. This sets up the project version to that version data -def versionInfo = getGitVersion() -version = "${versionInfo['IronChest.version']}" // This is our group. I'm cpw.mods group= "cpw.mods" // http://maven.apache.org/guides/mini/guide-naming-conventions.html @@ -43,6 +40,9 @@ minecraft { runDir = "run" } +// IronChest uses git tagging to mark major versions. This sets up the project version to that version data +def versionInfo = getGitVersion() +version = "${project.minecraft.version}-${versionInfo['IronChest.version']}" curseforge { apiKey = project.hasProperty('curseforge_apikey') ? project.curseforge_apikey : '0' @@ -103,7 +103,7 @@ uploadArchives { pom { groupId = project.group // Force the maven upload to use the - syntax preferred at files - version = "${project.minecraft.version}-${project.version}" + version = "${project.version}" artifactId = project.archivesBaseName project { name project.archivesBaseName From 0277783f5edf7dcef2dcbc6bc89ad27bd4758f6a Mon Sep 17 00:00:00 2001 From: cabralRodrigo Date: Thu, 28 Jan 2016 12:38:25 -0200 Subject: [PATCH 005/105] Added support for Inventory Tweaks --- src/main/java/cpw/mods/ironchest/ContainerIronChest.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/cpw/mods/ironchest/ContainerIronChest.java b/src/main/java/cpw/mods/ironchest/ContainerIronChest.java index c5f4904d..6c32bebb 100755 --- a/src/main/java/cpw/mods/ironchest/ContainerIronChest.java +++ b/src/main/java/cpw/mods/ironchest/ContainerIronChest.java @@ -10,6 +10,7 @@ ******************************************************************************/ package cpw.mods.ironchest; +import invtweaks.api.container.ChestContainer; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; @@ -17,6 +18,7 @@ import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; +@ChestContainer(isLargeChest = true) public class ContainerIronChest extends Container { private IronChestType type; private EntityPlayer player; @@ -116,6 +118,7 @@ public EntityPlayer getPlayer() return player; } + @ChestContainer.RowSizeCallback public int getNumColumns() { return type.getRowLength(); } From 1b527d4ae499a08d9eb8ee0897914929b70bb3a1 Mon Sep 17 00:00:00 2001 From: 61352151511 Date: Wed, 3 Feb 2016 21:21:40 -0400 Subject: [PATCH 006/105] Add thirdperson display tag. Fixes #57 --- .../assets/ironchest/models/item/chest_copper.json | 9 ++++++++- .../assets/ironchest/models/item/chest_crystal.json | 9 ++++++++- .../assets/ironchest/models/item/chest_diamond.json | 9 ++++++++- .../ironchest/models/item/chest_dirtchest9000.json | 9 ++++++++- .../assets/ironchest/models/item/chest_gold.json | 9 ++++++++- .../assets/ironchest/models/item/chest_iron.json | 9 ++++++++- .../assets/ironchest/models/item/chest_obsidian.json | 9 ++++++++- .../assets/ironchest/models/item/chest_silver.json | 9 ++++++++- 8 files changed, 64 insertions(+), 8 deletions(-) diff --git a/src/main/resources/assets/ironchest/models/item/chest_copper.json b/src/main/resources/assets/ironchest/models/item/chest_copper.json index 488cab4f..b66cd972 100755 --- a/src/main/resources/assets/ironchest/models/item/chest_copper.json +++ b/src/main/resources/assets/ironchest/models/item/chest_copper.json @@ -36,5 +36,12 @@ "east": { "uv": [ 0, 0.25, 0.25, 1.25 ], "texture": "#texture" } } } - ] + ], + "display": { + "thirdperson": { + "rotation": [ 0, 45, 190 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } } diff --git a/src/main/resources/assets/ironchest/models/item/chest_crystal.json b/src/main/resources/assets/ironchest/models/item/chest_crystal.json index ff0c8239..d70bd034 100755 --- a/src/main/resources/assets/ironchest/models/item/chest_crystal.json +++ b/src/main/resources/assets/ironchest/models/item/chest_crystal.json @@ -36,5 +36,12 @@ "east": { "uv": [ 0, 0.25, 0.25, 1.25 ], "texture": "#texture" } } } - ] + ], + "display": { + "thirdperson": { + "rotation": [ 0, 45, 190 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } } diff --git a/src/main/resources/assets/ironchest/models/item/chest_diamond.json b/src/main/resources/assets/ironchest/models/item/chest_diamond.json index 89505152..4843b884 100755 --- a/src/main/resources/assets/ironchest/models/item/chest_diamond.json +++ b/src/main/resources/assets/ironchest/models/item/chest_diamond.json @@ -36,5 +36,12 @@ "east": { "uv": [ 0, 0.25, 0.25, 1.25 ], "texture": "#texture" } } } - ] + ], + "display": { + "thirdperson": { + "rotation": [ 0, 45, 190 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } } diff --git a/src/main/resources/assets/ironchest/models/item/chest_dirtchest9000.json b/src/main/resources/assets/ironchest/models/item/chest_dirtchest9000.json index d2947cdb..a88a880f 100755 --- a/src/main/resources/assets/ironchest/models/item/chest_dirtchest9000.json +++ b/src/main/resources/assets/ironchest/models/item/chest_dirtchest9000.json @@ -36,5 +36,12 @@ "east": { "uv": [ 0, 0.25, 0.25, 1.25 ], "texture": "#texture" } } } - ] + ], + "display": { + "thirdperson": { + "rotation": [ 0, 45, 190 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } } diff --git a/src/main/resources/assets/ironchest/models/item/chest_gold.json b/src/main/resources/assets/ironchest/models/item/chest_gold.json index 5260625c..bd8b1fd8 100755 --- a/src/main/resources/assets/ironchest/models/item/chest_gold.json +++ b/src/main/resources/assets/ironchest/models/item/chest_gold.json @@ -36,5 +36,12 @@ "east": { "uv": [ 0, 0.25, 0.25, 1.25 ], "texture": "#texture" } } } - ] + ], + "display": { + "thirdperson": { + "rotation": [ 0, 45, 190 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } } diff --git a/src/main/resources/assets/ironchest/models/item/chest_iron.json b/src/main/resources/assets/ironchest/models/item/chest_iron.json index 2c63365f..e2e69ca0 100755 --- a/src/main/resources/assets/ironchest/models/item/chest_iron.json +++ b/src/main/resources/assets/ironchest/models/item/chest_iron.json @@ -36,5 +36,12 @@ "east": { "uv": [ 0, 0.25, 0.25, 1.25 ], "texture": "#texture" } } } - ] + ], + "display": { + "thirdperson": { + "rotation": [ 0, 45, 190 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } } diff --git a/src/main/resources/assets/ironchest/models/item/chest_obsidian.json b/src/main/resources/assets/ironchest/models/item/chest_obsidian.json index b13d0189..2a544e59 100755 --- a/src/main/resources/assets/ironchest/models/item/chest_obsidian.json +++ b/src/main/resources/assets/ironchest/models/item/chest_obsidian.json @@ -36,5 +36,12 @@ "east": { "uv": [ 0, 0.25, 0.25, 1.25 ], "texture": "#texture" } } } - ] + ], + "display": { + "thirdperson": { + "rotation": [ 0, 45, 190 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } } diff --git a/src/main/resources/assets/ironchest/models/item/chest_silver.json b/src/main/resources/assets/ironchest/models/item/chest_silver.json index 43fdd95b..74a7268b 100755 --- a/src/main/resources/assets/ironchest/models/item/chest_silver.json +++ b/src/main/resources/assets/ironchest/models/item/chest_silver.json @@ -36,5 +36,12 @@ "east": { "uv": [ 0, 0.25, 0.25, 1.25 ], "texture": "#texture" } } } - ] + ], + "display": { + "thirdperson": { + "rotation": [ 0, 45, 190 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } } From 2b95aab95f15b85d00866a940c319131e65e1185 Mon Sep 17 00:00:00 2001 From: Alexander Date: Mon, 21 Mar 2016 12:44:27 -0400 Subject: [PATCH 007/105] Update IronChests to 1.9! --- .gitignore | 1 + build.gradle | 4 +- .../api/container/ChestContainer.java | 12 +- .../cpw/mods/ironchest/BlockIronChest.java | 52 ++-- .../cpw/mods/ironchest/ChestChangerType.java | 32 +- .../java/cpw/mods/ironchest/CommonProxy.java | 7 +- .../mods/ironchest/ContainerIronChest.java | 51 ++-- .../java/cpw/mods/ironchest/IronChest.java | 14 +- .../mods/ironchest/IronChestAIOcelotSit.java | 2 +- .../cpw/mods/ironchest/IronChestType.java | 34 ++- .../cpw/mods/ironchest/ItemChestChanger.java | 94 ++++-- .../cpw/mods/ironchest/ItemIronChest.java | 4 +- .../ironchest/OcelotsSitOnChestsHandler.java | 23 +- .../mods/ironchest/TileEntityCopperChest.java | 5 +- .../ironchest/TileEntityCrystalChest.java | 5 +- .../ironchest/TileEntityDiamondChest.java | 4 +- .../mods/ironchest/TileEntityDirtChest.java | 35 ++- .../mods/ironchest/TileEntityGoldChest.java | 5 +- .../mods/ironchest/TileEntityIronChest.java | 285 ++++++++++-------- .../ironchest/TileEntityObsidianChest.java | 3 +- .../mods/ironchest/TileEntitySilverChest.java | 5 +- .../cpw/mods/ironchest/ValidatingSlot.java | 5 +- src/main/java/cpw/mods/ironchest/Version.java | 2 +- .../mods/ironchest/client/ClientProxy.java | 20 +- .../cpw/mods/ironchest/client/GUIChest.java | 59 ++-- .../mods/ironchest/client/ModelHelper.java | 4 +- .../client/TileEntityIronChestRenderer.java | 93 ++++-- .../ironchest/models/item/chest_copper.json | 10 +- .../ironchest/models/item/chest_crystal.json | 10 +- .../ironchest/models/item/chest_diamond.json | 10 +- .../models/item/chest_dirtchest9000.json | 10 +- .../ironchest/models/item/chest_gold.json | 10 +- .../ironchest/models/item/chest_iron.json | 10 +- .../ironchest/models/item/chest_obsidian.json | 10 +- .../ironchest/models/item/chest_silver.json | 10 +- 35 files changed, 506 insertions(+), 434 deletions(-) diff --git a/.gitignore b/.gitignore index 8eef75cd..3a2f51b3 100755 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ build/ .classpath .project +/*.launch .gradle/ eclipse/ bin/ diff --git a/build.gradle b/build.gradle index 86271b00..8bf898be 100755 --- a/build.gradle +++ b/build.gradle @@ -35,8 +35,8 @@ archivesBaseName = "ironchest" // Setup the forge minecraft plugin data. Specify the preferred forge/minecraft version here minecraft { - version = "1.8.9-11.15.0.1689" - mappings = "stable_20" + version = "1.9-12.16.0.1781-1.9" + mappings = "snapshot_20160319" runDir = "run" } diff --git a/src/api/java/invtweaks/api/container/ChestContainer.java b/src/api/java/invtweaks/api/container/ChestContainer.java index dc273777..14a1e5f4 100755 --- a/src/api/java/invtweaks/api/container/ChestContainer.java +++ b/src/api/java/invtweaks/api/container/ChestContainer.java @@ -6,12 +6,12 @@ import java.lang.annotation.Target; /** - * A marker for containers that have a chest-like persistant storage component. Enables the Inventroy Tweaks sorting - * buttons for this container. + * A marker for containers that have a chest-like persistant storage component. Enables the Inventroy Tweaks sorting buttons for this container. */ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) -public @interface ChestContainer { +public @interface ChestContainer +{ // Set to true if the Inventory Tweaks sorting buttons should be shown for this container. boolean showButtons() default true; @@ -26,13 +26,15 @@ // Signature int func() @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) - public @interface RowSizeCallback { + public @interface RowSizeCallback + { } // Annotation for method to get size of a chest row if it is not a fixed size for this container class // Signature int func() @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) - public @interface IsLargeCallback { + public @interface IsLargeCallback + { } } \ No newline at end of file diff --git a/src/main/java/cpw/mods/ironchest/BlockIronChest.java b/src/main/java/cpw/mods/ironchest/BlockIronChest.java index adb8fb5a..f8b2c31a 100755 --- a/src/main/java/cpw/mods/ironchest/BlockIronChest.java +++ b/src/main/java/cpw/mods/ironchest/BlockIronChest.java @@ -14,11 +14,13 @@ import java.util.List; import java.util.Random; +import com.google.common.collect.Lists; + import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; import net.minecraft.block.properties.IProperty; import net.minecraft.block.properties.PropertyEnum; -import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.IBlockState; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; @@ -31,20 +33,21 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; -import net.minecraft.util.MathHelper; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.MathHelper; import net.minecraft.world.Explosion; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -import com.google.common.collect.Lists; - public class BlockIronChest extends BlockContainer { public static final PropertyEnum VARIANT_PROP = PropertyEnum.create("variant", IronChestType.class); + protected static final AxisAlignedBB IRON_CHEST_AABB = new AxisAlignedBB(0.0625D, 0.0D, 0.0625D, 0.9375D, 0.875D, 0.9375D); public BlockIronChest() { @@ -52,26 +55,32 @@ public BlockIronChest() this.setDefaultState(this.blockState.getBaseState().withProperty(VARIANT_PROP, IronChestType.IRON)); - this.setBlockBounds(0.0625F, 0F, 0.0625F, 0.9375F, 0.875F, 0.9375F); this.setHardness(3.0F); this.setUnlocalizedName("IronChest"); this.setCreativeTab(CreativeTabs.tabDecorations); } @Override - public boolean isOpaqueCube() + public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) + { + return IRON_CHEST_AABB; + } + + @Override + public boolean isOpaqueCube(IBlockState state) { return false; } @Override - public boolean isFullCube() + public boolean isFullCube(IBlockState state) { return false; } @Override - public boolean onBlockActivated(World world, BlockPos pos, IBlockState blockState, EntityPlayer player, EnumFacing direction, float p_180639_6_, float p_180639_7_, float p_180639_8_) + public boolean onBlockActivated(World world, BlockPos pos, IBlockState blockState, EntityPlayer player, EnumHand hand, ItemStack heldItem, + EnumFacing direction, float hitX, float hitY, float hitZ) { TileEntity te = world.getTileEntity(pos); @@ -122,21 +131,21 @@ public IBlockState getStateFromMeta(int meta) @Override public int getMetaFromState(IBlockState blockState) { - return ((IronChestType) blockState.getValue(VARIANT_PROP)).ordinal(); + return blockState.getValue(VARIANT_PROP).ordinal(); } @Override - protected BlockState createBlockState() + protected BlockStateContainer createBlockState() { - return new BlockState(this, new IProperty[] { VARIANT_PROP }); + return new BlockStateContainer(this, new IProperty[] { VARIANT_PROP }); } @Override public ArrayList getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) { ArrayList items = Lists.newArrayList(); - ItemStack stack = new ItemStack(this, 1, getMetaFromState(state)); - IronChestType.values()[IronChestType.validateMeta(getMetaFromState(state))].adornItemDrop(stack); + ItemStack stack = new ItemStack(this, 1, this.getMetaFromState(state)); + IronChestType.values()[IronChestType.validateMeta(this.getMetaFromState(state))].adornItemDrop(stack); items.add(stack); return items; } @@ -145,7 +154,7 @@ public ArrayList getDrops(IBlockAccess world, BlockPos pos, IBlockSta public void onBlockAdded(World world, BlockPos pos, IBlockState blockState) { super.onBlockAdded(world, pos, blockState); - world.markBlockForUpdate(pos); + world.notifyBlockUpdate(pos, blockState, blockState, 3); } @Override @@ -175,14 +184,14 @@ public void onBlockPlacedBy(World world, BlockPos pos, IBlockState blockState, E TileEntityIronChest teic = (TileEntityIronChest) te; teic.wasPlaced(entityliving, itemStack); teic.setFacing(chestFacing); - world.markBlockForUpdate(pos); + world.notifyBlockUpdate(pos, blockState, blockState, 3); } } @Override public int damageDropped(IBlockState state) { - return IronChestType.validateMeta(((IronChestType) state.getValue(VARIANT_PROP)).ordinal()); + return IronChestType.validateMeta(state.getValue(VARIANT_PROP).ordinal()); } @Override @@ -192,7 +201,7 @@ public void breakBlock(World world, BlockPos pos, IBlockState blockState) if (tileentitychest != null) { tileentitychest.removeAdornments(); - dropContent(0, tileentitychest, world, tileentitychest.getPos()); + this.dropContent(0, tileentitychest, world, tileentitychest.getPos()); } super.breakBlock(world, pos, blockState); } @@ -219,7 +228,8 @@ public void dropContent(int newSize, IInventory chest, World world, BlockPos pos i1 = itemstack.stackSize; } itemstack.stackSize -= i1; - EntityItem entityitem = new EntityItem(world, pos.getX() + f, (float) pos.getY() + (newSize > 0 ? 1 : 0) + f1, pos.getZ() + f2, new ItemStack(itemstack.getItem(), i1, itemstack.getMetadata())); + EntityItem entityitem = new EntityItem(world, pos.getX() + f, (float) pos.getY() + (newSize > 0 ? 1 : 0) + f1, pos.getZ() + f2, + new ItemStack(itemstack.getItem(), i1, itemstack.getMetadata())); float f3 = 0.05F; entityitem.motionX = (float) random.nextGaussian() * f3; entityitem.motionY = (float) random.nextGaussian() * f3 + 0.2F; @@ -249,13 +259,13 @@ public float getExplosionResistance(World world, BlockPos pos, Entity exploder, } @Override - public boolean hasComparatorInputOverride() + public boolean hasComparatorInputOverride(IBlockState state) { return true; } @Override - public int getComparatorInputOverride(World world, BlockPos pos) + public int getComparatorInputOverride(IBlockState blockState, World world, BlockPos pos) { TileEntity te = world.getTileEntity(pos); if (te instanceof IInventory) diff --git a/src/main/java/cpw/mods/ironchest/ChestChangerType.java b/src/main/java/cpw/mods/ironchest/ChestChangerType.java index c4a1f0c5..9c9eab6f 100755 --- a/src/main/java/cpw/mods/ironchest/ChestChangerType.java +++ b/src/main/java/cpw/mods/ironchest/ChestChangerType.java @@ -14,14 +14,16 @@ import static cpw.mods.ironchest.IronChestType.OBSIDIAN; import static cpw.mods.ironchest.IronChestType.SILVER; import static cpw.mods.ironchest.IronChestType.WOOD; + +import cpw.mods.ironchest.client.ModelHelper; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraftforge.fml.common.FMLCommonHandler; import net.minecraftforge.fml.common.registry.GameRegistry; -import cpw.mods.ironchest.client.ModelHelper; import net.minecraftforge.fml.relauncher.Side; -public enum ChestChangerType { +public enum ChestChangerType +{ IRONGOLD(IRON, GOLD, "ironGoldUpgrade", "Iron to Gold Chest Upgrade", "mmm", "msm", "mmm"), GOLDDIAMOND(GOLD, DIAMOND, "goldDiamondUpgrade", "Gold to Diamond Chest Upgrade", "GGG", "msm", "GGG"), COPPERSILVER(COPPER, SILVER, "copperSilverUpgrade", "Copper to Silver Chest Upgrade", "mmm", "msm", "mmm"), @@ -47,9 +49,10 @@ private ChestChangerType(IronChestType source, IronChestType target, String item this.descriptiveName = descriptiveName; this.recipe = recipe; } - - public IronChestType getSource(){ - return source; + + public IronChestType getSource() + { + return this.source; } public boolean canUpgrade(IronChestType from) @@ -64,22 +67,25 @@ public int getTarget() public ItemChestChanger buildItem() { - item = new ItemChestChanger(this); - GameRegistry.registerItem(item, itemName); - if(FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT) - ModelHelper.registerItem(item, "ironchest:" + itemName); - return item; + this.item = new ItemChestChanger(this); + GameRegistry.registerItem(this.item, this.itemName); + if (FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT) + { + ModelHelper.registerItem(this.item, "ironchest:" + this.itemName); + } + return this.item; } public void addRecipes() { - for (String sourceMat : source.getMatList()) + for (String sourceMat : this.source.getMatList()) { - for (String targetMat : target.getMatList()) + for (String targetMat : this.target.getMatList()) { Object targetMaterial = IronChestType.translateOreName(targetMat); Object sourceMaterial = IronChestType.translateOreName(sourceMat); - IronChestType.addRecipe(new ItemStack(item), recipe, 'm', targetMaterial, 's', sourceMaterial, 'G', "blockGlass", 'O', Blocks.obsidian); + IronChestType.addRecipe(new ItemStack(this.item), this.recipe, 'm', targetMaterial, 's', sourceMaterial, 'G', "blockGlass", 'O', + Blocks.obsidian); } } } diff --git a/src/main/java/cpw/mods/ironchest/CommonProxy.java b/src/main/java/cpw/mods/ironchest/CommonProxy.java index 8660f334..cc1ab21c 100755 --- a/src/main/java/cpw/mods/ironchest/CommonProxy.java +++ b/src/main/java/cpw/mods/ironchest/CommonProxy.java @@ -12,17 +12,18 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraftforge.fml.common.network.IGuiHandler; -public class CommonProxy implements IGuiHandler { +public class CommonProxy implements IGuiHandler +{ public void registerRenderInformation() { } - public void registerTileEntitySpecialRenderer(Class typ) + public void registerTileEntitySpecialRenderer(Class typ) { } diff --git a/src/main/java/cpw/mods/ironchest/ContainerIronChest.java b/src/main/java/cpw/mods/ironchest/ContainerIronChest.java index 6c32bebb..5c55cfe6 100755 --- a/src/main/java/cpw/mods/ironchest/ContainerIronChest.java +++ b/src/main/java/cpw/mods/ironchest/ContainerIronChest.java @@ -19,47 +19,48 @@ import net.minecraft.item.ItemStack; @ChestContainer(isLargeChest = true) -public class ContainerIronChest extends Container { +public class ContainerIronChest extends Container +{ private IronChestType type; private EntityPlayer player; private IInventory chest; public ContainerIronChest(IInventory playerInventory, IInventory chestInventory, IronChestType type, int xSize, int ySize) { - chest = chestInventory; - player = ((InventoryPlayer) playerInventory).player; + this.chest = chestInventory; + this.player = ((InventoryPlayer) playerInventory).player; this.type = type; - chestInventory.openInventory(player); - layoutContainer(playerInventory, chestInventory, type, xSize, ySize); + chestInventory.openInventory(this.player); + this.layoutContainer(playerInventory, chestInventory, type, xSize, ySize); } @Override public boolean canInteractWith(EntityPlayer player) { - return chest.isUseableByPlayer(player); + return this.chest.isUseableByPlayer(player); } @Override public ItemStack transferStackInSlot(EntityPlayer p, int i) { ItemStack itemstack = null; - Slot slot = (Slot) inventorySlots.get(i); + Slot slot = (Slot) this.inventorySlots.get(i); if (slot != null && slot.getHasStack()) { ItemStack itemstack1 = slot.getStack(); itemstack = itemstack1.copy(); - if (i < type.size) + if (i < this.type.size) { - if (!mergeItemStack(itemstack1, type.size, inventorySlots.size(), true)) + if (!this.mergeItemStack(itemstack1, this.type.size, this.inventorySlots.size(), true)) { return null; } } - else if (!type.acceptsStack(itemstack1)) + else if (!this.type.acceptsStack(itemstack1)) { return null; } - else if (!mergeItemStack(itemstack1, 0, type.size, false)) + else if (!this.mergeItemStack(itemstack1, 0, this.type.size, false)) { return null; } @@ -79,19 +80,22 @@ else if (!mergeItemStack(itemstack1, 0, type.size, false)) public void onContainerClosed(EntityPlayer entityplayer) { super.onContainerClosed(entityplayer); - chest.closeInventory(entityplayer); + this.chest.closeInventory(entityplayer); } protected void layoutContainer(IInventory playerInventory, IInventory chestInventory, IronChestType type, int xSize, int ySize) { - if (type == IronChestType.DIRTCHEST9000) { - addSlotToContainer(type.makeSlot(chestInventory, 0, 12 + 4 * 18, 8 + 2 * 18)); - } else { + if (type == IronChestType.DIRTCHEST9000) + { + this.addSlotToContainer(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.getRowLength(); chestCol++) { - addSlotToContainer(type.makeSlot(chestInventory, chestCol + chestRow * type.getRowLength(), 12 + chestCol * 18, 8 + chestRow * 18)); + this.addSlotToContainer(type.makeSlot(chestInventory, chestCol + chestRow * type.getRowLength(), 12 + chestCol * 18, 8 + chestRow * 18)); } } } @@ -101,25 +105,26 @@ protected void layoutContainer(IInventory playerInventory, IInventory chestInven { for (int playerInvCol = 0; playerInvCol < 9; playerInvCol++) { - addSlotToContainer(new Slot(playerInventory, playerInvCol + playerInvRow * 9 + 9, leftCol + playerInvCol * 18, ySize - (4 - playerInvRow) * 18 - - 10)); + this.addSlotToContainer( + new Slot(playerInventory, playerInvCol + playerInvRow * 9 + 9, leftCol + playerInvCol * 18, ySize - (4 - playerInvRow) * 18 - 10)); } } for (int hotbarSlot = 0; hotbarSlot < 9; hotbarSlot++) { - addSlotToContainer(new Slot(playerInventory, hotbarSlot, leftCol + hotbarSlot * 18, ySize - 24)); + this.addSlotToContainer(new Slot(playerInventory, hotbarSlot, leftCol + hotbarSlot * 18, ySize - 24)); } } public EntityPlayer getPlayer() { - return player; + return this.player; } - + @ChestContainer.RowSizeCallback - public int getNumColumns() { - return type.getRowLength(); + public int getNumColumns() + { + return this.type.getRowLength(); } } diff --git a/src/main/java/cpw/mods/ironchest/IronChest.java b/src/main/java/cpw/mods/ironchest/IronChest.java index 9898ce72..13536988 100755 --- a/src/main/java/cpw/mods/ironchest/IronChest.java +++ b/src/main/java/cpw/mods/ironchest/IronChest.java @@ -10,14 +10,7 @@ ******************************************************************************/ package cpw.mods.ironchest; -import io.netty.buffer.ByteBuf; -import net.minecraft.client.renderer.entity.Render; -import net.minecraft.client.renderer.entity.RenderFireball; -import net.minecraft.client.renderer.entity.RenderManager; -import net.minecraft.entity.projectile.EntitySmallFireball; import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.fml.client.registry.IRenderFactory; -import net.minecraftforge.fml.client.registry.RenderingRegistry; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventHandler; import net.minecraftforge.fml.common.Mod.Instance; @@ -25,14 +18,9 @@ import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.common.network.NetworkRegistry; -import net.minecraftforge.fml.common.network.simpleimpl.IMessage; -import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler; -import net.minecraftforge.fml.common.network.simpleimpl.MessageContext; -import net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper; import net.minecraftforge.fml.common.registry.GameRegistry; -import net.minecraftforge.fml.relauncher.Side; -@Mod(modid = "IronChest", name = "Iron Chests", dependencies = "required-after:Forge@[11.15.0,12.0]", acceptedMinecraftVersions="[1.8,1.8.9]") +@Mod(modid = "IronChest", name = "Iron Chests", dependencies = "required-after:Forge@[12.16,)", acceptedMinecraftVersions = "[1.9]") public class IronChest { public static BlockIronChest ironChestBlock; diff --git a/src/main/java/cpw/mods/ironchest/IronChestAIOcelotSit.java b/src/main/java/cpw/mods/ironchest/IronChestAIOcelotSit.java index a34ca279..cb58c5cc 100755 --- a/src/main/java/cpw/mods/ironchest/IronChestAIOcelotSit.java +++ b/src/main/java/cpw/mods/ironchest/IronChestAIOcelotSit.java @@ -2,7 +2,7 @@ import net.minecraft.entity.ai.EntityAIOcelotSit; import net.minecraft.entity.passive.EntityOcelot; -import net.minecraft.util.BlockPos; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; public class IronChestAIOcelotSit extends EntityAIOcelotSit diff --git a/src/main/java/cpw/mods/ironchest/IronChestType.java b/src/main/java/cpw/mods/ironchest/IronChestType.java index 6dd83b3a..1393422f 100755 --- a/src/main/java/cpw/mods/ironchest/IronChestType.java +++ b/src/main/java/cpw/mods/ironchest/IronChestType.java @@ -33,7 +33,7 @@ public enum IronChestType implements IStringSerializable SILVER(72, 9, false, "Silver Chest", "silverchest.png", 4, Arrays.asList("ingotSilver"), TileEntitySilverChest.class, "mmmm3mmmm", "mGmG0GmGm"), CRYSTAL(108, 12, true, "Crystal Chest", "crystalchest.png", 5, Arrays.asList("blockGlass"), TileEntityCrystalChest.class, "GGGGPGGGG"), OBSIDIAN(108, 12, false, "Obsidian Chest", "obsidianchest.png", 6, Arrays.asList("obsidian"), TileEntityObsidianChest.class, "mmmm2mmmm"), - DIRTCHEST9000(1, 1, false, "Dirt Chest 9000", "dirtchest.png",7,Arrays.asList("dirt"), TileEntityDirtChest.class,Item.getItemFromBlock(Blocks.dirt),"mmmmCmmmm"), + DIRTCHEST9000(1, 1, false, "Dirt Chest 9000", "dirtchest.png", 7, Arrays.asList("dirt"), TileEntityDirtChest.class, Item.getItemFromBlock(Blocks.dirt), "mmmmCmmmm"), WOOD(0, 0, false, "", "", -1, Arrays.asList("plankWood"), null); int size; private int rowLength; @@ -49,8 +49,9 @@ public enum IronChestType implements IStringSerializable IronChestType(int size, int rowLength, boolean tieredChest, String friendlyName, String modelTexture, int textureRow, List mats, Class clazz, String... recipes) { - this(size, rowLength, tieredChest, friendlyName, modelTexture, textureRow, mats, clazz, (Item)null, recipes); + this(size, rowLength, tieredChest, friendlyName, modelTexture, textureRow, mats, clazz, (Item) null, recipes); } + IronChestType(int size, int rowLength, boolean tieredChest, String friendlyName, String modelTexture, int textureRow, List mats, Class clazz, Item itemFilter, String... recipes) { @@ -64,23 +65,23 @@ public enum IronChestType implements IStringSerializable this.itemFilter = itemFilter; this.recipes = recipes; this.matList = new ArrayList(); - matList.addAll(mats); + this.matList.addAll(mats); } - + @Override public String getName() { - return name().toLowerCase(); + return this.name().toLowerCase(); } public String getModelTexture() { - return modelTexture; + return this.modelTexture; } public int getTextureRow() { - return textureRow; + return this.textureRow; } public static TileEntityIronChest makeEntity(int metadata) @@ -115,8 +116,11 @@ public static void registerBlocksAndRecipes(BlockIronChest blockResult) { generateRecipesForType(blockResult, previous, typ); ItemStack chest = new ItemStack(blockResult, 1, typ.ordinal()); - //if (typ.isValidForCreativeMode()) GameRegistry.registerCustomItemStack(typ.friendlyName, chest);//TODO fix this!! - if (typ.tieredChest) previous = chest; + // if (typ.isValidForCreativeMode()) GameRegistry.registerCustomItemStack(typ.friendlyName, chest);//TODO fix this!! + if (typ.tieredChest) + { + previous = chest; + } } } @@ -163,12 +167,12 @@ public static void addRecipe(ItemStack is, Object... parts) public int getRowCount() { - return size / rowLength; + return this.size / this.rowLength; } public int getRowLength() { - return rowLength; + return this.rowLength; } public boolean isTransparent() @@ -178,7 +182,7 @@ public boolean isTransparent() public List getMatList() { - return matList; + return this.matList; } public static int validateMeta(int i) @@ -195,7 +199,7 @@ public static int validateMeta(int i) public boolean isValidForCreativeMode() { - return validateMeta(ordinal()) == ordinal(); + return validateMeta(this.ordinal()) == this.ordinal(); } public boolean isExplosionResistant() @@ -210,9 +214,9 @@ public Slot makeSlot(IInventory chestInventory, int index, int x, int y) public boolean acceptsStack(ItemStack itemstack) { - return itemFilter == null || itemstack == null || itemstack.getItem() == itemFilter; + return this.itemFilter == null || itemstack == null || itemstack.getItem() == this.itemFilter; } - + public void adornItemDrop(ItemStack item) { if (this == DIRTCHEST9000) diff --git a/src/main/java/cpw/mods/ironchest/ItemChestChanger.java b/src/main/java/cpw/mods/ironchest/ItemChestChanger.java index b080f890..a6f2a772 100755 --- a/src/main/java/cpw/mods/ironchest/ItemChestChanger.java +++ b/src/main/java/cpw/mods/ironchest/ItemChestChanger.java @@ -11,14 +11,17 @@ package cpw.mods.ironchest; import net.minecraft.block.BlockChest; +import net.minecraft.block.state.IBlockState; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityChest; -import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumActionResult; import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; public class ItemChestChanger extends Item @@ -35,73 +38,114 @@ public ItemChestChanger(ChestChangerType type) } @Override - public boolean onItemUseFirst (ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ) + public EnumActionResult onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { - if (world.isRemote) - return false; - if(this.type.canUpgrade(IronChestType.WOOD)){ - if(!(world.getBlockState(pos).getBlock() instanceof BlockChest)){ - return false; + if (worldIn.isRemote) + { + return EnumActionResult.PASS; + } + if (this.type.canUpgrade(IronChestType.WOOD)) + { + if (!(worldIn.getBlockState(pos).getBlock() instanceof BlockChest)) + { + return EnumActionResult.PASS; } - }else{ - if(world.getBlockState(pos) != IronChest.ironChestBlock.getStateFromMeta(IronChestType.valueOf(type.getSource().getName().toUpperCase()).ordinal())){ - return false; + } + else + { + if (worldIn.getBlockState(pos) != IronChest.ironChestBlock + .getStateFromMeta(IronChestType.valueOf(this.type.getSource().getName().toUpperCase()).ordinal())) + { + return EnumActionResult.PASS; } } - TileEntity te = world.getTileEntity(pos); + TileEntity te = worldIn.getTileEntity(pos); TileEntityIronChest newchest = new TileEntityIronChest(); ItemStack[] chestContents = new ItemStack[27]; + int chestFacing = 0; if (te != null) { if (te instanceof TileEntityIronChest) { chestContents = ((TileEntityIronChest) te).chestContents; + chestFacing = ((TileEntityIronChest) te).getFacing(); newchest = IronChestType.makeEntity(this.getTargetChestOrdinal(this.type.ordinal())); if (newchest == null) - return false; + { + return EnumActionResult.PASS; + } } else if (te instanceof TileEntityChest) { + IBlockState chestState = worldIn.getBlockState(pos); + EnumFacing orientation = chestState.getValue(BlockChest.FACING); + if (orientation == EnumFacing.NORTH) + { + chestFacing = 2; + } + if (orientation == EnumFacing.EAST) + { + chestFacing = 5; + } + if (orientation == EnumFacing.SOUTH) + { + chestFacing = 3; + } + if (orientation == EnumFacing.WEST) + { + chestFacing = 4; + } if (((TileEntityChest) te).numPlayersUsing > 0) - return false; - if (!getType().canUpgrade(IronChestType.WOOD)) - return false; + { + return EnumActionResult.PASS; + } + if (!this.getType().canUpgrade(IronChestType.WOOD)) + { + return EnumActionResult.PASS; + } chestContents = new ItemStack[((TileEntityChest) te).getSizeInventory()]; for (int i = 0; i < chestContents.length; i++) + { chestContents[i] = ((TileEntityChest) te).getStackInSlot(i); + } newchest = IronChestType.makeEntity(this.getTargetChestOrdinal(this.type.ordinal())); } } te.updateContainingBlockInfo(); if (te instanceof TileEntityChest) + { ((TileEntityChest) te).checkForAdjacentChests(); + } + + worldIn.removeTileEntity(pos); + worldIn.setBlockToAir(pos); - world.removeTileEntity(pos); - world.setBlockToAir(pos); + IBlockState iblockstate = IronChest.ironChestBlock.getStateFromMeta(newchest.getType().ordinal()); - world.setTileEntity(pos, newchest); - world.setBlockState(pos, IronChest.ironChestBlock.getStateFromMeta(newchest.getType().ordinal()), 3); + worldIn.setTileEntity(pos, newchest); + worldIn.setBlockState(pos, iblockstate, 3); - world.markBlockForUpdate(pos); + worldIn.notifyBlockUpdate(pos, iblockstate, iblockstate, 3); - TileEntity te2 = world.getTileEntity(pos); + TileEntity te2 = worldIn.getTileEntity(pos); if (te2 instanceof TileEntityIronChest) { ((TileEntityIronChest) te2).setContents(chestContents); + ((TileEntityIronChest) te2).setFacing((byte) chestFacing); } - stack.stackSize = player.capabilities.isCreativeMode ? stack.stackSize : stack.stackSize - 1; - return true; + stack.stackSize = playerIn.capabilities.isCreativeMode ? stack.stackSize : stack.stackSize - 1; + return EnumActionResult.SUCCESS; } public int getTargetChestOrdinal(int sourceOrdinal) { - return type.getTarget(); + return this.type.getTarget(); } public ChestChangerType getType() { - return type; + return this.type; } } diff --git a/src/main/java/cpw/mods/ironchest/ItemIronChest.java b/src/main/java/cpw/mods/ironchest/ItemIronChest.java index 4b3f8410..294501db 100755 --- a/src/main/java/cpw/mods/ironchest/ItemIronChest.java +++ b/src/main/java/cpw/mods/ironchest/ItemIronChest.java @@ -14,12 +14,12 @@ import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; -public class ItemIronChest extends ItemBlock +public class ItemIronChest extends ItemBlock { public ItemIronChest(Block block) { super(block); - + this.setMaxDamage(0); this.setHasSubtypes(true); } diff --git a/src/main/java/cpw/mods/ironchest/OcelotsSitOnChestsHandler.java b/src/main/java/cpw/mods/ironchest/OcelotsSitOnChestsHandler.java index f5c5b783..76fda59a 100755 --- a/src/main/java/cpw/mods/ironchest/OcelotsSitOnChestsHandler.java +++ b/src/main/java/cpw/mods/ironchest/OcelotsSitOnChestsHandler.java @@ -1,28 +1,27 @@ package cpw.mods.ironchest; -import java.util.List; - -import net.minecraft.entity.ai.EntityAIOcelotSit; -import net.minecraft.entity.ai.EntityAITasks; import net.minecraft.entity.passive.EntityOcelot; import net.minecraftforge.event.entity.living.LivingEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; -public class OcelotsSitOnChestsHandler { +public class OcelotsSitOnChestsHandler +{ @SubscribeEvent public void changeSittingTaskForOcelots(LivingEvent.LivingUpdateEvent evt) { if (evt.entityLiving.ticksExisted < 5 && evt.entityLiving instanceof EntityOcelot) { - EntityOcelot ocelot = (EntityOcelot) evt.entityLiving; - List tasks = ocelot.tasks.taskEntries; + // EntityOcelot ocelot = (EntityOcelot) evt.entityLiving; + // Set tasks = ocelot.tasks.taskEntries; - for (EntityAITasks.EntityAITaskEntry task : tasks) { - if (task.priority == 6 && (task.action instanceof EntityAIOcelotSit) && !(task.action instanceof IronChestAIOcelotSit)) { - task.action = new IronChestAIOcelotSit(ocelot, 0.4F); - } - } + // for (EntityAITasks.EntityAITaskEntry task : tasks) + // { + // if (task.priority == 6 && (task.action instanceof EntityAIOcelotSit) && !(task.action instanceof IronChestAIOcelotSit)) + // { + // task.action = new IronChestAIOcelotSit(ocelot, 0.4F); + // } + // } } } } diff --git a/src/main/java/cpw/mods/ironchest/TileEntityCopperChest.java b/src/main/java/cpw/mods/ironchest/TileEntityCopperChest.java index f8ececfe..d54f6a40 100755 --- a/src/main/java/cpw/mods/ironchest/TileEntityCopperChest.java +++ b/src/main/java/cpw/mods/ironchest/TileEntityCopperChest.java @@ -4,13 +4,14 @@ * 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 cpw.mods.ironchest; -public class TileEntityCopperChest extends TileEntityIronChest { +public class TileEntityCopperChest extends TileEntityIronChest +{ public TileEntityCopperChest() { super(IronChestType.COPPER); diff --git a/src/main/java/cpw/mods/ironchest/TileEntityCrystalChest.java b/src/main/java/cpw/mods/ironchest/TileEntityCrystalChest.java index 24288ec9..5b9625ed 100755 --- a/src/main/java/cpw/mods/ironchest/TileEntityCrystalChest.java +++ b/src/main/java/cpw/mods/ironchest/TileEntityCrystalChest.java @@ -4,13 +4,14 @@ * 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 cpw.mods.ironchest; -public class TileEntityCrystalChest extends TileEntityIronChest { +public class TileEntityCrystalChest extends TileEntityIronChest +{ public TileEntityCrystalChest() { super(IronChestType.CRYSTAL); diff --git a/src/main/java/cpw/mods/ironchest/TileEntityDiamondChest.java b/src/main/java/cpw/mods/ironchest/TileEntityDiamondChest.java index 84b90237..70608253 100755 --- a/src/main/java/cpw/mods/ironchest/TileEntityDiamondChest.java +++ b/src/main/java/cpw/mods/ironchest/TileEntityDiamondChest.java @@ -4,13 +4,13 @@ * 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 cpw.mods.ironchest; -public class TileEntityDiamondChest extends TileEntityIronChest +public class TileEntityDiamondChest extends TileEntityIronChest { public TileEntityDiamondChest() { diff --git a/src/main/java/cpw/mods/ironchest/TileEntityDirtChest.java b/src/main/java/cpw/mods/ironchest/TileEntityDirtChest.java index a7608c07..91998d32 100755 --- a/src/main/java/cpw/mods/ironchest/TileEntityDirtChest.java +++ b/src/main/java/cpw/mods/ironchest/TileEntityDirtChest.java @@ -5,38 +5,45 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagList; import net.minecraft.nbt.NBTTagString; -import net.minecraft.util.StatCollector; +import net.minecraft.util.text.translation.I18n; -public class TileEntityDirtChest extends TileEntityIronChest { +public class TileEntityDirtChest extends TileEntityIronChest +{ private static ItemStack dirtChest9000GuideBook = new ItemStack(Items.written_book); - static { + + static + { dirtChest9000GuideBook.setTagInfo("author", new NBTTagString("cpw")); - dirtChest9000GuideBook.setTagInfo("title", new NBTTagString(StatCollector.translateToLocal("book.ironchest:dirtchest9000.title"))); + dirtChest9000GuideBook.setTagInfo("title", new NBTTagString(I18n.translateToLocal("book.ironchest:dirtchest9000.title"))); NBTTagList pages = new NBTTagList(); - pages.appendTag(new NBTTagString(StatCollector.translateToLocal("book.ironchest:dirtchest9000.page1"))); - pages.appendTag(new NBTTagString(StatCollector.translateToLocal("book.ironchest:dirtchest9000.page2"))); - pages.appendTag(new NBTTagString(StatCollector.translateToLocal("book.ironchest:dirtchest9000.page3"))); - pages.appendTag(new NBTTagString(StatCollector.translateToLocal("book.ironchest:dirtchest9000.page4"))); - pages.appendTag(new NBTTagString(StatCollector.translateToLocal("book.ironchest:dirtchest9000.page5"))); + pages.appendTag(new NBTTagString(I18n.translateToLocal("book.ironchest:dirtchest9000.page1"))); + pages.appendTag(new NBTTagString(I18n.translateToLocal("book.ironchest:dirtchest9000.page2"))); + pages.appendTag(new NBTTagString(I18n.translateToLocal("book.ironchest:dirtchest9000.page3"))); + pages.appendTag(new NBTTagString(I18n.translateToLocal("book.ironchest:dirtchest9000.page4"))); + pages.appendTag(new NBTTagString(I18n.translateToLocal("book.ironchest:dirtchest9000.page5"))); dirtChest9000GuideBook.setTagInfo("pages", pages); } - public TileEntityDirtChest() { + + public TileEntityDirtChest() + { super(IronChestType.DIRTCHEST9000); } @Override public void wasPlaced(EntityLivingBase entityliving, ItemStack itemStack) { - if (!(itemStack.hasTagCompound() && itemStack.getTagCompound().getBoolean("dirtchest"))) { - setInventorySlotContents(0, dirtChest9000GuideBook.copy()); + if (!(itemStack.hasTagCompound() && itemStack.getTagCompound().getBoolean("dirtchest"))) + { + this.setInventorySlotContents(0, dirtChest9000GuideBook.copy()); } } @Override public void removeAdornments() { - if (chestContents[0] != null && chestContents[0].isItemEqual(dirtChest9000GuideBook)) { - chestContents[0] = null; + if (this.chestContents[0] != null && this.chestContents[0].isItemEqual(dirtChest9000GuideBook)) + { + this.chestContents[0] = null; } } } diff --git a/src/main/java/cpw/mods/ironchest/TileEntityGoldChest.java b/src/main/java/cpw/mods/ironchest/TileEntityGoldChest.java index fc531e29..01eda3d2 100755 --- a/src/main/java/cpw/mods/ironchest/TileEntityGoldChest.java +++ b/src/main/java/cpw/mods/ironchest/TileEntityGoldChest.java @@ -4,13 +4,14 @@ * 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 cpw.mods.ironchest; -public class TileEntityGoldChest extends TileEntityIronChest { +public class TileEntityGoldChest extends TileEntityIronChest +{ public TileEntityGoldChest() { diff --git a/src/main/java/cpw/mods/ironchest/TileEntityIronChest.java b/src/main/java/cpw/mods/ironchest/TileEntityIronChest.java index 2504b31b..8dd64ffc 100755 --- a/src/main/java/cpw/mods/ironchest/TileEntityIronChest.java +++ b/src/main/java/cpw/mods/ironchest/TileEntityIronChest.java @@ -14,9 +14,11 @@ import java.util.Comparator; import java.util.List; +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.init.SoundEvents; import net.minecraft.inventory.Container; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; @@ -24,11 +26,12 @@ import net.minecraft.nbt.NBTTagList; import net.minecraft.network.NetworkManager; import net.minecraft.network.Packet; -import net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.minecraft.network.play.server.SPacketUpdateTileEntity; import net.minecraft.tileentity.TileEntityLockable; -import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.EnumFacing; import net.minecraft.util.ITickable; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.math.AxisAlignedBB; import net.minecraftforge.common.util.Constants; public class TileEntityIronChest extends TileEntityLockable implements ITickable, IInventory @@ -54,32 +57,32 @@ protected TileEntityIronChest(IronChestType type) { super(); this.type = type; - this.chestContents = new ItemStack[getSizeInventory()]; + this.chestContents = new ItemStack[this.getSizeInventory()]; this.topStacks = new ItemStack[8]; } public ItemStack[] getContents() { - return chestContents; + return this.chestContents; } public void setContents(ItemStack[] contents) { - chestContents = new ItemStack[getSizeInventory()]; + this.chestContents = new ItemStack[this.getSizeInventory()]; for (int i = 0; i < contents.length; i++) { - if (i < chestContents.length) + if (i < this.chestContents.length) { - chestContents[i] = contents[i]; + this.chestContents[i] = contents[i]; } } - inventoryTouched = true; + this.inventoryTouched = true; } @Override public int getSizeInventory() { - return type.size; + return this.type.size; } public int getFacing() @@ -89,121 +92,125 @@ public int getFacing() public IronChestType getType() { - return type; + return this.type; } @Override public ItemStack getStackInSlot(int i) { - inventoryTouched = true; - return chestContents[i]; + this.inventoryTouched = true; + return this.chestContents[i]; } @Override public void markDirty() { super.markDirty(); - sortTopStacks(); + this.sortTopStacks(); } protected void sortTopStacks() { - if (!type.isTransparent() || (worldObj != null && worldObj.isRemote)) + if (!this.type.isTransparent() || (this.worldObj != null && this.worldObj.isRemote)) { return; } - ItemStack[] tempCopy = new ItemStack[getSizeInventory()]; + ItemStack[] tempCopy = new ItemStack[this.getSizeInventory()]; boolean hasStuff = false; int compressedIdx = 0; - mainLoop: for (int i = 0; i < getSizeInventory(); i++) + mainLoop: for (int i = 0; i < this.getSizeInventory(); i++) { - if (chestContents[i] != null) + if (this.chestContents[i] != null) { for (int j = 0; j < compressedIdx; j++) { - if (tempCopy[j].isItemEqual(chestContents[i])) + if (tempCopy[j].isItemEqual(this.chestContents[i])) { - tempCopy[j].stackSize += chestContents[i].stackSize; + tempCopy[j].stackSize += this.chestContents[i].stackSize; continue mainLoop; } } - tempCopy[compressedIdx++] = chestContents[i].copy(); + tempCopy[compressedIdx++] = this.chestContents[i].copy(); hasStuff = true; } } - if (!hasStuff && hadStuff) + if (!hasStuff && this.hadStuff) { - hadStuff = false; - for (int i = 0; i < topStacks.length; i++) + this.hadStuff = false; + for (int i = 0; i < this.topStacks.length; i++) { - topStacks[i] = null; + this.topStacks[i] = null; } - if (worldObj != null) + if (this.worldObj != null) { - worldObj.markBlockForUpdate(pos); + IBlockState iblockstate = this.worldObj.getBlockState(this.pos); + this.worldObj.notifyBlockUpdate(this.pos, iblockstate, iblockstate, 3); } return; } - hadStuff = true; - Arrays.sort(tempCopy, new Comparator() - { + this.hadStuff = true; + Arrays.sort(tempCopy, new Comparator() { @Override public int compare(ItemStack o1, ItemStack o2) { if (o1 == null) { return 1; - } else if (o2 == null) + } + else if (o2 == null) { return -1; - } else + } + else { return o2.stackSize - o1.stackSize; } } }); int p = 0; - for (int i = 0; i < tempCopy.length; i++) + for (ItemStack element : tempCopy) { - if (tempCopy[i] != null && tempCopy[i].stackSize > 0) + if (element != null && element.stackSize > 0) { - topStacks[p++] = tempCopy[i]; - if (p == topStacks.length) + this.topStacks[p++] = element; + if (p == this.topStacks.length) { break; } } } - for (int i = p; i < topStacks.length; i++) + for (int i = p; i < this.topStacks.length; i++) { - topStacks[i] = null; + this.topStacks[i] = null; } - if (worldObj != null) + if (this.worldObj != null) { - worldObj.markBlockForUpdate(pos); + IBlockState iblockstate = this.worldObj.getBlockState(this.pos); + this.worldObj.notifyBlockUpdate(this.pos, iblockstate, iblockstate, 3); } } @Override public ItemStack decrStackSize(int i, int j) { - if (chestContents[i] != null) + if (this.chestContents[i] != null) { - if (chestContents[i].stackSize <= j) + if (this.chestContents[i].stackSize <= j) { - ItemStack itemstack = chestContents[i]; - chestContents[i] = null; - markDirty(); + ItemStack itemstack = this.chestContents[i]; + this.chestContents[i] = null; + this.markDirty(); return itemstack; } - ItemStack itemstack1 = chestContents[i].splitStack(j); - if (chestContents[i].stackSize == 0) + ItemStack itemstack1 = this.chestContents[i].splitStack(j); + if (this.chestContents[i].stackSize == 0) { - chestContents[i] = null; + this.chestContents[i] = null; } - markDirty(); + this.markDirty(); return itemstack1; - } else + } + else { return null; } @@ -212,18 +219,18 @@ public ItemStack decrStackSize(int i, int j) @Override public void setInventorySlotContents(int i, ItemStack itemstack) { - chestContents[i] = itemstack; - if (itemstack != null && itemstack.stackSize > getInventoryStackLimit()) + this.chestContents[i] = itemstack; + if (itemstack != null && itemstack.stackSize > this.getInventoryStackLimit()) { - itemstack.stackSize = getInventoryStackLimit(); + itemstack.stackSize = this.getInventoryStackLimit(); } - markDirty(); + this.markDirty(); } @Override public String getName() { - return this.hasCustomName() ? this.customName : type.name(); + return this.hasCustomName() ? this.customName : this.type.name(); } @Override @@ -243,7 +250,7 @@ public void readFromNBT(NBTTagCompound nbttagcompound) super.readFromNBT(nbttagcompound); NBTTagList nbttaglist = nbttagcompound.getTagList("Items", Constants.NBT.TAG_COMPOUND); - this.chestContents = new ItemStack[getSizeInventory()]; + this.chestContents = new ItemStack[this.getSizeInventory()]; if (nbttagcompound.hasKey("CustomName", Constants.NBT.TAG_STRING)) { @@ -254,13 +261,13 @@ public void readFromNBT(NBTTagCompound nbttagcompound) { NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i); int j = nbttagcompound1.getByte("Slot") & 0xff; - if (j >= 0 && j < chestContents.length) + if (j >= 0 && j < this.chestContents.length) { - chestContents[j] = ItemStack.loadItemStackFromNBT(nbttagcompound1); + this.chestContents[j] = ItemStack.loadItemStackFromNBT(nbttagcompound1); } } - facing = nbttagcompound.getByte("facing"); - sortTopStacks(); + this.facing = nbttagcompound.getByte("facing"); + this.sortTopStacks(); } @Override @@ -268,19 +275,19 @@ public void writeToNBT(NBTTagCompound nbttagcompound) { super.writeToNBT(nbttagcompound); NBTTagList nbttaglist = new NBTTagList(); - for (int i = 0; i < chestContents.length; i++) + for (int i = 0; i < this.chestContents.length; i++) { - if (chestContents[i] != null) + if (this.chestContents[i] != null) { NBTTagCompound nbttagcompound1 = new NBTTagCompound(); nbttagcompound1.setByte("Slot", (byte) i); - chestContents[i].writeToNBT(nbttagcompound1); + this.chestContents[i].writeToNBT(nbttagcompound1); nbttaglist.appendTag(nbttagcompound1); } } nbttagcompound.setTag("Items", nbttaglist); - nbttagcompound.setByte("facing", facing); + nbttagcompound.setByte("facing", this.facing); if (this.hasCustomName()) { @@ -297,26 +304,28 @@ public int getInventoryStackLimit() @Override public boolean isUseableByPlayer(EntityPlayer entityplayer) { - if (worldObj == null) + if (this.worldObj == null) { return true; } - if (worldObj.getTileEntity(pos) != this) + if (this.worldObj.getTileEntity(this.pos) != this) { return false; } - return entityplayer.getDistanceSq(pos.getX() + 0.5D, pos.getY() + 0.5D, pos.getZ() + 0.5D) <= 64D; + return entityplayer.getDistanceSq(this.pos.getX() + 0.5D, this.pos.getY() + 0.5D, this.pos.getZ() + 0.5D) <= 64D; } @Override public void update() { // Resynchronize clients with the server state - if (worldObj != null && !this.worldObj.isRemote && this.numUsingPlayers != 0 && (this.ticksSinceSync + pos.getX() + pos.getY() + pos.getZ()) % 200 == 0) + if (this.worldObj != null && !this.worldObj.isRemote && this.numUsingPlayers != 0 + && (this.ticksSinceSync + this.pos.getX() + this.pos.getY() + this.pos.getZ()) % 200 == 0) { this.numUsingPlayers = 0; float var1 = 5.0F; - List var2 = this.worldObj.getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(pos.getX() - var1, pos.getY() - var1, pos.getZ() - var1, pos.getX() + 1 + var1, pos.getY() + 1 + var1, pos.getZ() + 1 + var1)); + List var2 = this.worldObj.getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(this.pos.getX() - var1, this.pos.getY() - var1, + this.pos.getZ() - var1, this.pos.getX() + 1 + var1, this.pos.getY() + 1 + var1, this.pos.getZ() + 1 + var1)); for (EntityPlayer var4 : var2) { @@ -327,49 +336,52 @@ public void update() } } - if (worldObj != null && !worldObj.isRemote && ticksSinceSync < 0) + if (this.worldObj != null && !this.worldObj.isRemote && this.ticksSinceSync < 0) { - worldObj.addBlockEvent(pos, IronChest.ironChestBlock, 3, ((numUsingPlayers << 3) & 0xF8) | (facing & 0x7)); + this.worldObj.addBlockEvent(this.pos, IronChest.ironChestBlock, 3, ((this.numUsingPlayers << 3) & 0xF8) | (this.facing & 0x7)); } - if (!worldObj.isRemote && inventoryTouched) + if (!this.worldObj.isRemote && this.inventoryTouched) { - inventoryTouched = false; - sortTopStacks(); + this.inventoryTouched = false; + this.sortTopStacks(); } this.ticksSinceSync++; - prevLidAngle = lidAngle; + this.prevLidAngle = this.lidAngle; float f = 0.1F; - if (numUsingPlayers > 0 && lidAngle == 0.0F) + if (this.numUsingPlayers > 0 && this.lidAngle == 0.0F) { - double d = pos.getX() + 0.5D; - double d1 = pos.getZ() + 0.5D; - worldObj.playSoundEffect(d, pos.getY() + 0.5D, d1, "random.chestopen", 0.5F, worldObj.rand.nextFloat() * 0.1F + 0.9F); + double d = this.pos.getX() + 0.5D; + double d1 = this.pos.getZ() + 0.5D; + this.worldObj.playSound((EntityPlayer) null, d, this.pos.getY() + 0.5D, d1, SoundEvents.block_chest_open, SoundCategory.BLOCKS, 0.5F, + this.worldObj.rand.nextFloat() * 0.1F + 0.9F); } - if (numUsingPlayers == 0 && lidAngle > 0.0F || numUsingPlayers > 0 && lidAngle < 1.0F) + if (this.numUsingPlayers == 0 && this.lidAngle > 0.0F || this.numUsingPlayers > 0 && this.lidAngle < 1.0F) { - float f1 = lidAngle; - if (numUsingPlayers > 0) + float f1 = this.lidAngle; + if (this.numUsingPlayers > 0) { - lidAngle += f; - } else + this.lidAngle += f; + } + else { - lidAngle -= f; + this.lidAngle -= f; } - if (lidAngle > 1.0F) + if (this.lidAngle > 1.0F) { - lidAngle = 1.0F; + this.lidAngle = 1.0F; } float f2 = 0.5F; - if (lidAngle < f2 && f1 >= f2) + if (this.lidAngle < f2 && f1 >= f2) { - double d2 = pos.getX() + 0.5D; - double d3 = pos.getZ() + 0.5D; - worldObj.playSoundEffect(d2, pos.getY() + 0.5D, d3, "random.chestclosed", 0.5F, worldObj.rand.nextFloat() * 0.1F + 0.9F); + double d2 = this.pos.getX() + 0.5D; + double d3 = this.pos.getZ() + 0.5D; + this.worldObj.playSound((EntityPlayer) null, d2, this.pos.getY() + 0.5D, d3, SoundEvents.block_chest_close, SoundCategory.BLOCKS, 0.5F, + this.worldObj.rand.nextFloat() * 0.1F + 0.9F); } - if (lidAngle < 0.0F) + if (this.lidAngle < 0.0F) { - lidAngle = 0.0F; + this.lidAngle = 0.0F; } } } @@ -379,14 +391,16 @@ public boolean receiveClientEvent(int i, int j) { if (i == 1) { - numUsingPlayers = j; - } else if (i == 2) + this.numUsingPlayers = j; + } + else if (i == 2) { - facing = (byte) j; - } else if (i == 3) + this.facing = (byte) j; + } + else if (i == 3) { - facing = (byte) (j & 0x7); - numUsingPlayers = (j & 0xF8) >> 3; + this.facing = (byte) (j & 0x7); + this.numUsingPlayers = (j & 0xF8) >> 3; } return true; } @@ -394,23 +408,23 @@ public boolean receiveClientEvent(int i, int j) @Override public void openInventory(EntityPlayer player) { - if (worldObj == null) + if (this.worldObj == null) { return; } - numUsingPlayers++; - worldObj.addBlockEvent(pos, IronChest.ironChestBlock, 1, numUsingPlayers); + this.numUsingPlayers++; + this.worldObj.addBlockEvent(this.pos, IronChest.ironChestBlock, 1, this.numUsingPlayers); } @Override public void closeInventory(EntityPlayer player) { - if (worldObj == null) + if (this.worldObj == null) { return; } - numUsingPlayers--; - worldObj.addBlockEvent(pos, IronChest.ironChestBlock, 1, numUsingPlayers); + this.numUsingPlayers--; + this.worldObj.addBlockEvent(this.pos, IronChest.ironChestBlock, 1, this.numUsingPlayers); } public void setFacing(byte facing2) @@ -420,17 +434,17 @@ public void setFacing(byte facing2) public ItemStack[] getTopItemStacks() { - return topStacks; + return this.topStacks; } public TileEntityIronChest updateFromMetadata(int l) { - if (worldObj != null && worldObj.isRemote) + if (this.worldObj != null && this.worldObj.isRemote) { - if (l != type.ordinal()) + if (l != this.type.ordinal()) { - worldObj.setTileEntity(pos, IronChestType.makeEntity(l)); - return (TileEntityIronChest) worldObj.getTileEntity(pos); + this.worldObj.setTileEntity(this.pos, IronChestType.makeEntity(l)); + return (TileEntityIronChest) this.worldObj.getTileEntity(this.pos); } } return this; @@ -441,9 +455,9 @@ public Packet getDescriptionPacket() { NBTTagCompound nbt = new NBTTagCompound(); - nbt.setInteger("type", getType().ordinal()); - nbt.setByte("facing", facing); - ItemStack[] stacks = buildItemStackDataList(); + nbt.setInteger("type", this.getType().ordinal()); + nbt.setByte("facing", this.facing); + ItemStack[] stacks = this.buildItemStackDataList(); if (stacks != null) { NBTTagList nbttaglist = new NBTTagList(); @@ -460,20 +474,20 @@ public Packet getDescriptionPacket() nbt.setTag("stacks", nbttaglist); } - return new S35PacketUpdateTileEntity(pos, 0, nbt); + return new SPacketUpdateTileEntity(this.pos, 0, nbt); } @Override - public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) + public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt) { if (pkt.getTileEntityType() == 0) { NBTTagCompound nbt = pkt.getNbtCompound(); - type = IronChestType.values()[nbt.getInteger("type")]; - facing = nbt.getByte("facing"); + this.type = IronChestType.values()[nbt.getInteger("type")]; + this.facing = nbt.getByte("facing"); NBTTagList tagList = nbt.getTagList("stacks", Constants.NBT.TAG_COMPOUND); - ItemStack[] stacks = new ItemStack[topStacks.length]; + ItemStack[] stacks = new ItemStack[this.topStacks.length]; for (int i = 0; i < stacks.length; i++) { @@ -485,17 +499,18 @@ public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) } } - if (type.isTransparent() && stacks != null) + if (this.type.isTransparent() && stacks != null) { int pos = 0; - for (int i = 0; i < topStacks.length; i++) + for (int i = 0; i < this.topStacks.length; i++) { if (stacks[pos] != null) { - topStacks[i] = stacks[pos]; - } else + this.topStacks[i] = stacks[pos]; + } + else { - topStacks[i] = null; + this.topStacks[i] = null; } pos++; } @@ -505,16 +520,17 @@ public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) public ItemStack[] buildItemStackDataList() { - if (type.isTransparent()) + if (this.type.isTransparent()) { - ItemStack[] sortList = new ItemStack[topStacks.length]; + ItemStack[] sortList = new ItemStack[this.topStacks.length]; int pos = 0; - for (ItemStack is : topStacks) + for (ItemStack is : this.topStacks) { if (is != null) { sortList[pos++] = is; - } else + } + else { sortList[pos++] = null; } @@ -532,7 +548,8 @@ public ItemStack removeStackFromSlot(int par1) ItemStack var2 = this.chestContents[par1]; this.chestContents[par1] = null; return var2; - } else + } + else { return null; } @@ -541,18 +558,18 @@ public ItemStack removeStackFromSlot(int par1) @Override public boolean isItemValidForSlot(int i, ItemStack itemstack) { - return type.acceptsStack(itemstack); + return this.type.acceptsStack(itemstack); } public void rotateAround() { - facing++; - if (facing > EnumFacing.EAST.ordinal()) + this.facing++; + if (this.facing > EnumFacing.EAST.ordinal()) { - facing = (byte) EnumFacing.NORTH.ordinal(); + this.facing = (byte) EnumFacing.NORTH.ordinal(); } - setFacing(facing); - worldObj.addBlockEvent(pos, IronChest.ironChestBlock, 2, facing); + this.setFacing(this.facing); + this.worldObj.addBlockEvent(this.pos, IronChest.ironChestBlock, 2, this.facing); } public void wasPlaced(EntityLivingBase entityliving, ItemStack itemStack) @@ -598,7 +615,7 @@ public Container createContainer(InventoryPlayer playerInventory, EntityPlayer p @Override public String getGuiID() { - return "IronChest:" + type.name(); + return "IronChest:" + this.type.name(); } @Override diff --git a/src/main/java/cpw/mods/ironchest/TileEntityObsidianChest.java b/src/main/java/cpw/mods/ironchest/TileEntityObsidianChest.java index 5f03eb94..fbef3a19 100755 --- a/src/main/java/cpw/mods/ironchest/TileEntityObsidianChest.java +++ b/src/main/java/cpw/mods/ironchest/TileEntityObsidianChest.java @@ -1,6 +1,7 @@ package cpw.mods.ironchest; -public class TileEntityObsidianChest extends TileEntityIronChest { +public class TileEntityObsidianChest extends TileEntityIronChest +{ public TileEntityObsidianChest() { diff --git a/src/main/java/cpw/mods/ironchest/TileEntitySilverChest.java b/src/main/java/cpw/mods/ironchest/TileEntitySilverChest.java index 439d2667..c0702a1b 100755 --- a/src/main/java/cpw/mods/ironchest/TileEntitySilverChest.java +++ b/src/main/java/cpw/mods/ironchest/TileEntitySilverChest.java @@ -4,13 +4,14 @@ * 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 cpw.mods.ironchest; -public class TileEntitySilverChest extends TileEntityIronChest { +public class TileEntitySilverChest extends TileEntityIronChest +{ public TileEntitySilverChest() { super(IronChestType.SILVER); diff --git a/src/main/java/cpw/mods/ironchest/ValidatingSlot.java b/src/main/java/cpw/mods/ironchest/ValidatingSlot.java index f0348c97..7bf38b41 100755 --- a/src/main/java/cpw/mods/ironchest/ValidatingSlot.java +++ b/src/main/java/cpw/mods/ironchest/ValidatingSlot.java @@ -4,7 +4,8 @@ import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; -public class ValidatingSlot extends Slot { +public class ValidatingSlot extends Slot +{ private IronChestType type; public ValidatingSlot(IInventory par1iInventory, int par2, int par3, int par4, IronChestType type) @@ -16,6 +17,6 @@ public ValidatingSlot(IInventory par1iInventory, int par2, int par3, int par4, I @Override public boolean isItemValid(ItemStack par1ItemStack) { - return type.acceptsStack(par1ItemStack); + return this.type.acceptsStack(par1ItemStack); } } diff --git a/src/main/java/cpw/mods/ironchest/Version.java b/src/main/java/cpw/mods/ironchest/Version.java index f155473d..fc623a73 100755 --- a/src/main/java/cpw/mods/ironchest/Version.java +++ b/src/main/java/cpw/mods/ironchest/Version.java @@ -8,7 +8,7 @@ import java.util.Properties; -public class Version +public class Version { private static String major; private static String minor; diff --git a/src/main/java/cpw/mods/ironchest/client/ClientProxy.java b/src/main/java/cpw/mods/ironchest/client/ClientProxy.java index 8872b760..67cfe2d5 100755 --- a/src/main/java/cpw/mods/ironchest/client/ClientProxy.java +++ b/src/main/java/cpw/mods/ironchest/client/ClientProxy.java @@ -10,21 +10,22 @@ ******************************************************************************/ package cpw.mods.ironchest.client; +import cpw.mods.ironchest.CommonProxy; +import cpw.mods.ironchest.IronChest; +import cpw.mods.ironchest.IronChestType; +import cpw.mods.ironchest.TileEntityIronChest; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.ItemModelMesher; -import net.minecraft.client.resources.model.ModelBakery; -import net.minecraft.client.resources.model.ModelResourceLocation; +import net.minecraft.client.renderer.block.model.ModelBakery; +import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraftforge.fml.client.FMLClientHandler; import net.minecraftforge.fml.client.registry.ClientRegistry; -import cpw.mods.ironchest.CommonProxy; -import cpw.mods.ironchest.IronChest; -import cpw.mods.ironchest.IronChestType; -import cpw.mods.ironchest.TileEntityIronChest; public class ClientProxy extends CommonProxy { @@ -40,7 +41,7 @@ public void registerRenderInformation() { Item chestItem = Item.getItemFromBlock(IronChest.ironChestBlock); mesher.register(chestItem, chestType.ordinal(), new ModelResourceLocation("ironchest:chest_" + chestType.getName().toLowerCase(), "inventory")); - ModelBakery.addVariantName(chestItem, "ironchest:chest_" + chestType.getName().toLowerCase()); + ModelBakery.registerItemVariants(chestItem, new ResourceLocation("ironchest:chest_" + chestType.getName().toLowerCase())); } } } @@ -64,7 +65,8 @@ public Object getClientGuiElement(int ID, EntityPlayer player, World world, int if (te != null && te instanceof TileEntityIronChest) { return GUIChest.GUI.buildGUI(IronChestType.values()[ID], player.inventory, (TileEntityIronChest) te); - } else + } + else { return null; } diff --git a/src/main/java/cpw/mods/ironchest/client/GUIChest.java b/src/main/java/cpw/mods/ironchest/client/GUIChest.java index 345791b8..1371aa3f 100755 --- a/src/main/java/cpw/mods/ironchest/client/GUIChest.java +++ b/src/main/java/cpw/mods/ironchest/client/GUIChest.java @@ -10,39 +10,40 @@ ******************************************************************************/ package cpw.mods.ironchest.client; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.IInventory; -import net.minecraft.util.ResourceLocation; - import org.lwjgl.opengl.GL11; import cpw.mods.ironchest.ContainerIronChest; import cpw.mods.ironchest.IronChestType; import cpw.mods.ironchest.TileEntityIronChest; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.IInventory; +import net.minecraft.util.ResourceLocation; -public class GUIChest extends GuiContainer { - public enum ResourceList { - IRON(new ResourceLocation("ironchest", "textures/gui/ironcontainer.png")), - COPPER(new ResourceLocation("ironchest", "textures/gui/coppercontainer.png")), - SILVER(new ResourceLocation("ironchest", "textures/gui/silvercontainer.png")), - GOLD(new ResourceLocation("ironchest", "textures/gui/goldcontainer.png")), - DIAMOND(new ResourceLocation("ironchest", "textures/gui/diamondcontainer.png")), - DIRT(new ResourceLocation("ironchest", "textures/gui/dirtcontainer.png")); +public class GUIChest extends GuiContainer +{ + public enum ResourceList + { + IRON(new ResourceLocation("ironchest", "textures/gui/ironcontainer.png")), COPPER( + new ResourceLocation("ironchest", "textures/gui/coppercontainer.png")), SILVER( + new ResourceLocation("ironchest", "textures/gui/silvercontainer.png")), GOLD( + new ResourceLocation("ironchest", "textures/gui/goldcontainer.png")), DIAMOND( + new ResourceLocation("ironchest", "textures/gui/diamondcontainer.png")), DIRT( + new ResourceLocation("ironchest", "textures/gui/dirtcontainer.png")); public final ResourceLocation location; - private ResourceList(ResourceLocation loc) { + + private ResourceList(ResourceLocation loc) + { this.location = loc; } } - public enum GUI { - IRON(184, 202, ResourceList.IRON, IronChestType.IRON), - GOLD(184, 256, ResourceList.GOLD, IronChestType.GOLD), - DIAMOND(238, 256, ResourceList.DIAMOND, IronChestType.DIAMOND), - COPPER(184, 184, ResourceList.COPPER, IronChestType.COPPER), - SILVER(184, 238, ResourceList.SILVER, IronChestType.SILVER), - CRYSTAL(238, 256, ResourceList.DIAMOND, IronChestType.CRYSTAL), - OBSIDIAN(238, 256, ResourceList.DIAMOND, IronChestType.OBSIDIAN), - DIRTCHEST9000(184, 184, ResourceList.DIRT, IronChestType.DIRTCHEST9000); + + public enum GUI + { + IRON(184, 202, ResourceList.IRON, IronChestType.IRON), GOLD(184, 256, ResourceList.GOLD, IronChestType.GOLD), DIAMOND(238, 256, ResourceList.DIAMOND, + IronChestType.DIAMOND), COPPER(184, 184, ResourceList.COPPER, IronChestType.COPPER), SILVER(184, 238, ResourceList.SILVER, + IronChestType.SILVER), CRYSTAL(238, 256, ResourceList.DIAMOND, IronChestType.CRYSTAL), OBSIDIAN(238, 256, ResourceList.DIAMOND, + IronChestType.OBSIDIAN), DIRTCHEST9000(184, 184, ResourceList.DIRT, IronChestType.DIRTCHEST9000); private int xSize; private int ySize; @@ -60,7 +61,7 @@ private GUI(int xSize, int ySize, ResourceList guiResourceList, IronChestType ma protected Container makeContainer(IInventory player, IInventory chest) { - return new ContainerIronChest(player, chest, mainType, xSize, ySize); + return new ContainerIronChest(player, chest, this.mainType, this.xSize, this.ySize); } public static GUIChest buildGUI(IronChestType type, IInventory playerInventory, TileEntityIronChest chestInventory) @@ -71,7 +72,7 @@ public static GUIChest buildGUI(IronChestType type, IInventory playerInventory, public int getRowLength() { - return type.mainType.getRowLength(); + return this.type.mainType.getRowLength(); } private GUI type; @@ -90,9 +91,9 @@ protected void drawGuiContainerBackgroundLayer(float f, int i, int j) { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); // new "bind tex" - this.mc.getTextureManager().bindTexture(type.guiResourceList.location); - int x = (width - xSize) / 2; - int y = (height - ySize) / 2; - drawTexturedModalRect(x, y, 0, 0, xSize, ySize); + 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/cpw/mods/ironchest/client/ModelHelper.java b/src/main/java/cpw/mods/ironchest/client/ModelHelper.java index 9fb7a35c..645208b3 100644 --- a/src/main/java/cpw/mods/ironchest/client/ModelHelper.java +++ b/src/main/java/cpw/mods/ironchest/client/ModelHelper.java @@ -13,13 +13,13 @@ import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.ItemModelMesher; -import net.minecraft.client.resources.model.ModelResourceLocation; +import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.item.Item; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) -public class ModelHelper +public class ModelHelper { public static void registerItem(Item item, int metadata, String itemName) { diff --git a/src/main/java/cpw/mods/ironchest/client/TileEntityIronChestRenderer.java b/src/main/java/cpw/mods/ironchest/client/TileEntityIronChestRenderer.java index b9940fdc..551d8780 100755 --- a/src/main/java/cpw/mods/ironchest/client/TileEntityIronChestRenderer.java +++ b/src/main/java/cpw/mods/ironchest/client/TileEntityIronChestRenderer.java @@ -35,10 +35,12 @@ public class TileEntityIronChestRenderer extends { private static Map locations; - static { - Builder builder = ImmutableMap.builder(); - for (IronChestType typ : IronChestType.values()) { - builder.put(typ, new ResourceLocation("ironchest","textures/model/"+typ.getModelTexture())); + static + { + Builder builder = ImmutableMap. builder(); + for (IronChestType typ : IronChestType.values()) + { + builder.put(typ, new ResourceLocation("ironchest", "textures/model/" + typ.getModelTexture())); } locations = builder.build(); } @@ -52,19 +54,24 @@ public class TileEntityIronChestRenderer extends public TileEntityIronChestRenderer(Class type) { - model = new ModelChest(); - random = new Random(); - itemRenderer = new RenderEntityItem(Minecraft.getMinecraft().getRenderManager(), Minecraft.getMinecraft().getRenderItem()){ + this.model = new ModelChest(); + this.random = new Random(); + this.itemRenderer = new RenderEntityItem(Minecraft.getMinecraft().getRenderManager(), Minecraft.getMinecraft().getRenderItem()) { @Override - public int func_177078_a(ItemStack stack) { + public int getModelCount(ItemStack stack) + { return SignedBytes.saturatedCast(Math.min(stack.stackSize / 32, 15) + 1); } + @Override - public boolean shouldBob() { + public boolean shouldBob() + { return false; } + @Override - public boolean shouldSpreadItems() { + public boolean shouldSpreadItems() + { return false; } }; @@ -72,47 +79,58 @@ public boolean shouldSpreadItems() { public void render(TileEntityIronChest tile, double x, double y, double z, float partialTick, int breakStage) { - if (tile == null) { + if (tile == null) + { return; } int facing = 3; IronChestType type = tile.getType(); - if (tile != null && tile.hasWorldObj() && tile.getWorld().getBlockState(tile.getPos()).getBlock() == IronChest.ironChestBlock) { + if (tile != null && tile.hasWorldObj() && tile.getWorld().getBlockState(tile.getPos()).getBlock() == IronChest.ironChestBlock) + { facing = tile.getFacing(); type = tile.getType(); IBlockState state = tile.getWorld().getBlockState(tile.getPos()); - type = (IronChestType)state.getValue(BlockIronChest.VARIANT_PROP); + type = state.getValue(BlockIronChest.VARIANT_PROP); } if (breakStage >= 0) { - bindTexture(DESTROY_STAGES[breakStage]); + this.bindTexture(DESTROY_STAGES[breakStage]); GlStateManager.matrixMode(5890); GlStateManager.pushMatrix(); GlStateManager.scale(4.0F, 4.0F, 1.0F); GlStateManager.translate(0.0625F, 0.0625F, 0.0625F); GlStateManager.matrixMode(5888); - } else - bindTexture(locations.get(type)); + } + else + { + this.bindTexture(locations.get(type)); + } GlStateManager.pushMatrix(); - if(type == IronChestType.CRYSTAL) + if (type == IronChestType.CRYSTAL) + { GlStateManager.disableCull(); + } GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.translate((float) x, (float) y + 1.0F, (float) z + 1.0F); GlStateManager.scale(1.0F, -1F, -1F); GlStateManager.translate(0.5F, 0.5F, 0.5F); int k = 0; - if (facing == 2) { + if (facing == 2) + { k = 180; } - if (facing == 3) { + if (facing == 3) + { k = 0; } - if (facing == 4) { + if (facing == 4) + { k = 90; } - if (facing == 5) { + if (facing == 5) + { k = -90; } GlStateManager.rotate(k, 0.0F, 1.0F, 0.0F); @@ -120,29 +138,34 @@ public void render(TileEntityIronChest tile, double x, double y, double z, float float lidangle = tile.prevLidAngle + (tile.lidAngle - tile.prevLidAngle) * partialTick; lidangle = 1.0F - lidangle; lidangle = 1.0F - lidangle * lidangle * lidangle; - model.chestLid.rotateAngleX = -((lidangle * 3.141593F) / 2.0F); + this.model.chestLid.rotateAngleX = -((lidangle * 3.141593F) / 2.0F); // Render the chest itself - model.renderAll(); + this.model.renderAll(); if (breakStage >= 0) { GlStateManager.matrixMode(5890); GlStateManager.popMatrix(); GlStateManager.matrixMode(5888); } - if(type == IronChestType.CRYSTAL) + if (type == IronChestType.CRYSTAL) + { GlStateManager.enableCull(); + } GlStateManager.popMatrix(); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - if (type.isTransparent() && tile.getDistanceSq(this.rendererDispatcher.entityX, this.rendererDispatcher.entityY, this.rendererDispatcher.entityZ) < 128d) { - random.setSeed(254L); + if (type.isTransparent() + && tile.getDistanceSq(this.rendererDispatcher.entityX, this.rendererDispatcher.entityY, this.rendererDispatcher.entityZ) < 128d) + { + this.random.setSeed(254L); float shiftX; float shiftY; float shiftZ; int shift = 0; float blockScale = 0.70F; - float timeD = (float) (360.0 * (double) (System.currentTimeMillis() & 0x3FFFL) / (double) 0x3FFFL); - if (tile.getTopItemStacks()[1] == null) { + float timeD = (float) (360.0 * (System.currentTimeMillis() & 0x3FFFL) / 0x3FFFL); + if (tile.getTopItemStacks()[1] == null) + { shift = 8; blockScale = 0.85F; } @@ -150,11 +173,14 @@ public void render(TileEntityIronChest tile, double x, double y, double z, float GlStateManager.translate((float) x, (float) y, (float) z); EntityItem customitem = new EntityItem(this.getWorld()); customitem.hoverStart = 0f; - for (ItemStack item : tile.getTopItemStacks()) { - if (shift > shifts.length) { + for (ItemStack item : tile.getTopItemStacks()) + { + if (shift > shifts.length) + { break; } - if (item == null) { + if (item == null) + { shift++; continue; } @@ -167,15 +193,16 @@ public void render(TileEntityIronChest tile, double x, double y, double z, float GlStateManager.rotate(timeD, 0.0F, 1.0F, 0.0F); GlStateManager.scale(blockScale, blockScale, blockScale); customitem.setEntityItemStack(item); - itemRenderer.doRender(customitem, 0, 0, 0, 0, 0); + this.itemRenderer.doRender(customitem, 0, 0, 0, 0, 0); GlStateManager.popMatrix(); } GlStateManager.popMatrix(); } } + @Override public void renderTileEntityAt(TileEntityIronChest tileentity, double x, double y, double z, float partialTick, int breakStage) { - render(tileentity, x, y, z, partialTick, breakStage); + this.render(tileentity, x, y, z, partialTick, breakStage); } } diff --git a/src/main/resources/assets/ironchest/models/item/chest_copper.json b/src/main/resources/assets/ironchest/models/item/chest_copper.json index b66cd972..8b6638e0 100755 --- a/src/main/resources/assets/ironchest/models/item/chest_copper.json +++ b/src/main/resources/assets/ironchest/models/item/chest_copper.json @@ -1,4 +1,5 @@ { + "parent": "block/block", "textures": { "texture": "ironchest:model/copperchest" }, @@ -36,12 +37,5 @@ "east": { "uv": [ 0, 0.25, 0.25, 1.25 ], "texture": "#texture" } } } - ], - "display": { - "thirdperson": { - "rotation": [ 0, 45, 190 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } + ] } diff --git a/src/main/resources/assets/ironchest/models/item/chest_crystal.json b/src/main/resources/assets/ironchest/models/item/chest_crystal.json index d70bd034..6c4ed79a 100755 --- a/src/main/resources/assets/ironchest/models/item/chest_crystal.json +++ b/src/main/resources/assets/ironchest/models/item/chest_crystal.json @@ -1,4 +1,5 @@ { + "parent": "block/block", "textures": { "texture": "ironchest:model/crystalchest" }, @@ -36,12 +37,5 @@ "east": { "uv": [ 0, 0.25, 0.25, 1.25 ], "texture": "#texture" } } } - ], - "display": { - "thirdperson": { - "rotation": [ 0, 45, 190 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } + ] } diff --git a/src/main/resources/assets/ironchest/models/item/chest_diamond.json b/src/main/resources/assets/ironchest/models/item/chest_diamond.json index 4843b884..98b51910 100755 --- a/src/main/resources/assets/ironchest/models/item/chest_diamond.json +++ b/src/main/resources/assets/ironchest/models/item/chest_diamond.json @@ -1,4 +1,5 @@ { + "parent": "block/block", "textures": { "texture": "ironchest:model/diamondchest" }, @@ -36,12 +37,5 @@ "east": { "uv": [ 0, 0.25, 0.25, 1.25 ], "texture": "#texture" } } } - ], - "display": { - "thirdperson": { - "rotation": [ 0, 45, 190 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } + ] } diff --git a/src/main/resources/assets/ironchest/models/item/chest_dirtchest9000.json b/src/main/resources/assets/ironchest/models/item/chest_dirtchest9000.json index a88a880f..8dd53076 100755 --- a/src/main/resources/assets/ironchest/models/item/chest_dirtchest9000.json +++ b/src/main/resources/assets/ironchest/models/item/chest_dirtchest9000.json @@ -1,4 +1,5 @@ { + "parent": "block/block", "textures": { "texture": "ironchest:model/dirtchest" }, @@ -36,12 +37,5 @@ "east": { "uv": [ 0, 0.25, 0.25, 1.25 ], "texture": "#texture" } } } - ], - "display": { - "thirdperson": { - "rotation": [ 0, 45, 190 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } + ] } diff --git a/src/main/resources/assets/ironchest/models/item/chest_gold.json b/src/main/resources/assets/ironchest/models/item/chest_gold.json index bd8b1fd8..cd7785ed 100755 --- a/src/main/resources/assets/ironchest/models/item/chest_gold.json +++ b/src/main/resources/assets/ironchest/models/item/chest_gold.json @@ -1,4 +1,5 @@ { + "parent": "block/block", "textures": { "texture": "ironchest:model/goldchest" }, @@ -36,12 +37,5 @@ "east": { "uv": [ 0, 0.25, 0.25, 1.25 ], "texture": "#texture" } } } - ], - "display": { - "thirdperson": { - "rotation": [ 0, 45, 190 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } + ] } diff --git a/src/main/resources/assets/ironchest/models/item/chest_iron.json b/src/main/resources/assets/ironchest/models/item/chest_iron.json index e2e69ca0..1fc46888 100755 --- a/src/main/resources/assets/ironchest/models/item/chest_iron.json +++ b/src/main/resources/assets/ironchest/models/item/chest_iron.json @@ -1,4 +1,5 @@ { + "parent": "block/block", "textures": { "texture": "ironchest:model/ironchest" }, @@ -36,12 +37,5 @@ "east": { "uv": [ 0, 0.25, 0.25, 1.25 ], "texture": "#texture" } } } - ], - "display": { - "thirdperson": { - "rotation": [ 0, 45, 190 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } + ] } diff --git a/src/main/resources/assets/ironchest/models/item/chest_obsidian.json b/src/main/resources/assets/ironchest/models/item/chest_obsidian.json index 2a544e59..17ca9915 100755 --- a/src/main/resources/assets/ironchest/models/item/chest_obsidian.json +++ b/src/main/resources/assets/ironchest/models/item/chest_obsidian.json @@ -1,4 +1,5 @@ { + "parent": "block/block", "textures": { "texture": "ironchest:model/obsidianchest" }, @@ -36,12 +37,5 @@ "east": { "uv": [ 0, 0.25, 0.25, 1.25 ], "texture": "#texture" } } } - ], - "display": { - "thirdperson": { - "rotation": [ 0, 45, 190 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } + ] } diff --git a/src/main/resources/assets/ironchest/models/item/chest_silver.json b/src/main/resources/assets/ironchest/models/item/chest_silver.json index 74a7268b..ea0ceab9 100755 --- a/src/main/resources/assets/ironchest/models/item/chest_silver.json +++ b/src/main/resources/assets/ironchest/models/item/chest_silver.json @@ -1,4 +1,5 @@ { + "parent": "block/block", "textures": { "texture": "ironchest:model/silverchest" }, @@ -36,12 +37,5 @@ "east": { "uv": [ 0, 0.25, 0.25, 1.25 ], "texture": "#texture" } } } - ], - "display": { - "thirdperson": { - "rotation": [ 0, 45, 190 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } + ] } From 3b123b2583ca52f84e60915a8ac25af4d10d84b9 Mon Sep 17 00:00:00 2001 From: Drullkus Date: Wed, 23 Mar 2016 16:08:21 -0700 Subject: [PATCH 008/105] Break Particles These textures are for the chest breaking particles, as requested by @alexbegt :) --- .../ironchest/textures/blocks/copperbreak.png | Bin 0 -> 3081 bytes .../ironchest/textures/blocks/crystalbreak.png | Bin 0 -> 2978 bytes .../ironchest/textures/blocks/diamondbreak.png | Bin 0 -> 3118 bytes .../ironchest/textures/blocks/goldbreak.png | Bin 0 -> 3192 bytes .../ironchest/textures/blocks/ironbreak.png | Bin 0 -> 3096 bytes .../ironchest/textures/blocks/silverbreak.png | Bin 0 -> 3055 bytes 6 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 src/main/resources/assets/ironchest/textures/blocks/copperbreak.png create mode 100644 src/main/resources/assets/ironchest/textures/blocks/crystalbreak.png create mode 100644 src/main/resources/assets/ironchest/textures/blocks/diamondbreak.png create mode 100644 src/main/resources/assets/ironchest/textures/blocks/goldbreak.png create mode 100644 src/main/resources/assets/ironchest/textures/blocks/ironbreak.png create mode 100644 src/main/resources/assets/ironchest/textures/blocks/silverbreak.png diff --git a/src/main/resources/assets/ironchest/textures/blocks/copperbreak.png b/src/main/resources/assets/ironchest/textures/blocks/copperbreak.png new file mode 100644 index 0000000000000000000000000000000000000000..7cfb64f615a7309ed7072c4474c5e2dea287ea3c GIT binary patch literal 3081 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 literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/ironchest/textures/blocks/crystalbreak.png b/src/main/resources/assets/ironchest/textures/blocks/crystalbreak.png new file mode 100644 index 0000000000000000000000000000000000000000..44d3939d1a004a8d53f6cc246e7cc089379b807a GIT binary patch literal 2978 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 IM6N<$f_~r2kpKVy literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/ironchest/textures/blocks/goldbreak.png b/src/main/resources/assets/ironchest/textures/blocks/goldbreak.png new file mode 100644 index 0000000000000000000000000000000000000000..24074dd6b5889765d6b5d70eeced5400041f9e34 GIT binary patch literal 3192 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 Date: Wed, 23 Mar 2016 22:51:54 -0400 Subject: [PATCH 009/105] Working Particles --- build.gradle | 2 +- .../cpw/mods/ironchest/BlockIronChest.java | 25 ++++ .../java/cpw/mods/ironchest/IronChest.java | 3 + .../client/IronChestEventHandler.java | 25 ++++ .../client/IronChestTextureHandler.java | 139 ++++++++++++++++++ 5 files changed, 193 insertions(+), 1 deletion(-) create mode 100644 src/main/java/cpw/mods/ironchest/client/IronChestEventHandler.java create mode 100644 src/main/java/cpw/mods/ironchest/client/IronChestTextureHandler.java diff --git a/build.gradle b/build.gradle index 8bf898be..aaca5663 100755 --- a/build.gradle +++ b/build.gradle @@ -35,7 +35,7 @@ archivesBaseName = "ironchest" // Setup the forge minecraft plugin data. Specify the preferred forge/minecraft version here minecraft { - version = "1.9-12.16.0.1781-1.9" + version = "1.9-12.16.0.1802-1.9" mappings = "snapshot_20160319" runDir = "run" } diff --git a/src/main/java/cpw/mods/ironchest/BlockIronChest.java b/src/main/java/cpw/mods/ironchest/BlockIronChest.java index f8b2c31a..b428cd9e 100755 --- a/src/main/java/cpw/mods/ironchest/BlockIronChest.java +++ b/src/main/java/cpw/mods/ironchest/BlockIronChest.java @@ -16,6 +16,7 @@ import com.google.common.collect.Lists; +import cpw.mods.ironchest.client.IronChestTextureHandler; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; import net.minecraft.block.properties.IProperty; @@ -33,11 +34,13 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.EnumBlockRenderType; import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumHand; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.MathHelper; +import net.minecraft.util.math.RayTraceResult; import net.minecraft.world.Explosion; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; @@ -78,6 +81,12 @@ public boolean isFullCube(IBlockState state) return false; } + @Override + public EnumBlockRenderType getRenderType(IBlockState state) + { + return EnumBlockRenderType.ENTITYBLOCK_ANIMATED; + } + @Override public boolean onBlockActivated(World world, BlockPos pos, IBlockState blockState, EntityPlayer player, EnumHand hand, ItemStack heldItem, EnumFacing direction, float hitX, float hitY, float hitZ) @@ -258,6 +267,22 @@ public float getExplosionResistance(World world, BlockPos pos, Entity exploder, return super.getExplosionResistance(world, pos, exploder, explosion); } + @Override + @SideOnly(Side.CLIENT) + public boolean addHitEffects(IBlockState state, World worldObj, RayTraceResult target, net.minecraft.client.particle.EffectRenderer effectRenderer) + { + IronChestTextureHandler.addHitEffects(worldObj, target.getBlockPos(), target.sideHit); + return true; + } + + @Override + @SideOnly(Side.CLIENT) + public boolean addDestroyEffects(World world, BlockPos pos, net.minecraft.client.particle.EffectRenderer effectRenderer) + { + IronChestTextureHandler.addDestroyEffects(world, pos, world.getBlockState(pos)); + return true; + } + @Override public boolean hasComparatorInputOverride(IBlockState state) { diff --git a/src/main/java/cpw/mods/ironchest/IronChest.java b/src/main/java/cpw/mods/ironchest/IronChest.java index 13536988..5b6b877a 100755 --- a/src/main/java/cpw/mods/ironchest/IronChest.java +++ b/src/main/java/cpw/mods/ironchest/IronChest.java @@ -10,6 +10,7 @@ ******************************************************************************/ package cpw.mods.ironchest; +import cpw.mods.ironchest.client.IronChestEventHandler; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventHandler; @@ -55,5 +56,7 @@ public void load(FMLInitializationEvent evt) NetworkRegistry.INSTANCE.registerGuiHandler(instance, proxy); proxy.registerRenderInformation(); MinecraftForge.EVENT_BUS.register(new OcelotsSitOnChestsHandler()); + + MinecraftForge.EVENT_BUS.register(IronChestEventHandler.INSTANCE); } } diff --git a/src/main/java/cpw/mods/ironchest/client/IronChestEventHandler.java b/src/main/java/cpw/mods/ironchest/client/IronChestEventHandler.java new file mode 100644 index 00000000..f8a478b4 --- /dev/null +++ b/src/main/java/cpw/mods/ironchest/client/IronChestEventHandler.java @@ -0,0 +1,25 @@ +package cpw.mods.ironchest.client; + +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.event.TextureStitchEvent; +import net.minecraftforge.fml.client.FMLClientHandler; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + +public class IronChestEventHandler +{ + public static IronChestEventHandler INSTANCE = new IronChestEventHandler(); + + @SubscribeEvent + public void onPreTextureStiching(TextureStitchEvent.Pre event) + { + if (event.map == FMLClientHandler.instance().getClient().getTextureMapBlocks()) + { + event.map.registerSprite(new ResourceLocation("ironchest:blocks/copperbreak")); + event.map.registerSprite(new ResourceLocation("ironchest:blocks/crystalbreak")); + event.map.registerSprite(new ResourceLocation("ironchest:blocks/diamondbreak")); + event.map.registerSprite(new ResourceLocation("ironchest:blocks/goldbreak")); + event.map.registerSprite(new ResourceLocation("ironchest:blocks/ironbreak")); + event.map.registerSprite(new ResourceLocation("ironchest:blocks/silverbreak")); + } + } +} diff --git a/src/main/java/cpw/mods/ironchest/client/IronChestTextureHandler.java b/src/main/java/cpw/mods/ironchest/client/IronChestTextureHandler.java new file mode 100644 index 00000000..bb11053e --- /dev/null +++ b/src/main/java/cpw/mods/ironchest/client/IronChestTextureHandler.java @@ -0,0 +1,139 @@ +package cpw.mods.ironchest.client; + +import java.util.Map; +import java.util.Random; + +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableMap.Builder; + +import cpw.mods.ironchest.IronChestType; +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.Minecraft; +import net.minecraft.client.particle.EntityDiggingFX; +import net.minecraft.client.renderer.block.model.ModelManager; +import net.minecraft.util.EnumBlockRenderType; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; + +public class IronChestTextureHandler +{ + private static Map locations; + + static + { + Builder builder = ImmutableMap. builder(); + for (IronChestType typ : IronChestType.values()) + { + if (typ != IronChestType.DIRTCHEST9000 && typ != IronChestType.OBSIDIAN) + builder.put(typ, new ResourceLocation("ironchest", "blocks/" + typ.getModelTexture().replace("chest", "break").replace(".png", ""))); + else if (typ == IronChestType.DIRTCHEST9000) + builder.put(typ, new ResourceLocation("minecraft", "blocks/dirt")); + else if (typ == IronChestType.OBSIDIAN) + builder.put(typ, new ResourceLocation("minecraft", "blocks/obsidian")); + } + locations = builder.build(); + } + + public static void addHitEffects(World world, BlockPos pos, EnumFacing side) + { + IBlockState state = world.getBlockState(pos); + Block block = state.getBlock(); + state = block.getActualState(state, world, pos); + Random rand = new Random(); + IronChestType type = IronChestType.values()[IronChestType.validateMeta(block.getMetaFromState(state))]; + ModelManager modelmanager = Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelManager(); + + if (block.getRenderType(state) != EnumBlockRenderType.INVISIBLE) + { + int i = pos.getX(); + int j = pos.getY(); + int k = pos.getZ(); + float f = 0.1F; + AxisAlignedBB bb = block.getBoundingBox(state, world, pos); + + double d0 = i + rand.nextDouble() * (bb.maxX - bb.minX - f * 2.0F) + f + bb.minX; + double d1 = j + rand.nextDouble() * (bb.maxY - bb.minY - f * 2.0F) + f + bb.minY; + double d2 = k + rand.nextDouble() * (bb.maxZ - bb.minZ - f * 2.0F) + f + bb.minZ; + + if (side == EnumFacing.DOWN) + { + d1 = j + bb.minY - f; + } + + if (side == EnumFacing.UP) + { + d1 = j + bb.maxY + f; + } + + if (side == EnumFacing.NORTH) + { + d2 = k + bb.minZ - f; + } + + if (side == EnumFacing.SOUTH) + { + d2 = k + bb.maxZ + f; + } + + if (side == EnumFacing.WEST) + { + d0 = i + bb.minX - f; + } + + if (side == EnumFacing.EAST) + { + d0 = i + bb.maxX + f; + } + + EntityDiggingFX fx = ((EntityDiggingFX) Minecraft.getMinecraft().effectRenderer.spawnEffectParticle(EnumParticleTypes.BLOCK_CRACK.getParticleID(), + d0, d1, d2, 0.0D, 0.0D, 0.0D, Block.getIdFromBlock(state.getBlock()))); + + fx.setBlockPos(pos); + fx.multiplyVelocity(0.2F); + fx.multipleParticleScaleBy(0.6F); + + if (type != IronChestType.DIRTCHEST9000 && type != IronChestType.OBSIDIAN) + fx.setParticleTexture(modelmanager.getTextureMap().getAtlasSprite("ironchest:" + locations.get(type).getResourcePath())); + else if (type == IronChestType.DIRTCHEST9000) + fx.setParticleTexture(modelmanager.getTextureMap().getAtlasSprite("minecraft:" + locations.get(type).getResourcePath())); + else if (type == IronChestType.OBSIDIAN) + fx.setParticleTexture(modelmanager.getTextureMap().getAtlasSprite("minecraft:" + locations.get(type).getResourcePath())); + } + } + + public static void addDestroyEffects(World world, BlockPos pos, IBlockState state) + { + state = state.getBlock().getActualState(state, world, pos); + int i = 4; + IronChestType type = IronChestType.values()[IronChestType.validateMeta(state.getBlock().getMetaFromState(state))]; + ModelManager modelmanager = Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelManager(); + + for (int j = 0; j < i; ++j) + { + for (int k = 0; k < i; ++k) + { + for (int l = 0; l < i; ++l) + { + double d0 = pos.getX() + (j + 0.5D) / i; + double d1 = pos.getY() + (k + 0.5D) / i; + double d2 = pos.getZ() + (l + 0.5D) / i; + EntityDiggingFX fx = ((EntityDiggingFX) Minecraft.getMinecraft().effectRenderer.spawnEffectParticle( + EnumParticleTypes.BLOCK_CRACK.getParticleID(), d0, d1, d2, d0 - pos.getX() - 0.5D, d1 - pos.getY() - 0.5D, d2 - pos.getZ() - 0.5D, + Block.getIdFromBlock(state.getBlock()))); + fx.setBlockPos(pos); + if (type != IronChestType.DIRTCHEST9000 && type != IronChestType.OBSIDIAN) + fx.setParticleTexture(modelmanager.getTextureMap().getAtlasSprite("ironchest:" + locations.get(type).getResourcePath())); + else if (type == IronChestType.DIRTCHEST9000) + fx.setParticleTexture(modelmanager.getTextureMap().getAtlasSprite("minecraft:" + locations.get(type).getResourcePath())); + else if (type == IronChestType.OBSIDIAN) + fx.setParticleTexture(modelmanager.getTextureMap().getAtlasSprite("minecraft:" + locations.get(type).getResourcePath())); + } + } + } + } +} From 8be3c5ea97dfa680469855ddaf689d7d7020202c Mon Sep 17 00:00:00 2001 From: Alexander Date: Fri, 25 Mar 2016 22:05:26 -0400 Subject: [PATCH 010/105] Fix crash with forge 1809. --- build.gradle | 2 +- .../mods/ironchest/OcelotsSitOnChestsHandler.java | 2 +- .../ironchest/client/IronChestEventHandler.java | 14 +++++++------- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/build.gradle b/build.gradle index aaca5663..885b653a 100755 --- a/build.gradle +++ b/build.gradle @@ -35,7 +35,7 @@ archivesBaseName = "ironchest" // Setup the forge minecraft plugin data. Specify the preferred forge/minecraft version here minecraft { - version = "1.9-12.16.0.1802-1.9" + version = "1.9-12.16.0.1809-1.9" mappings = "snapshot_20160319" runDir = "run" } diff --git a/src/main/java/cpw/mods/ironchest/OcelotsSitOnChestsHandler.java b/src/main/java/cpw/mods/ironchest/OcelotsSitOnChestsHandler.java index 76fda59a..31ee052f 100755 --- a/src/main/java/cpw/mods/ironchest/OcelotsSitOnChestsHandler.java +++ b/src/main/java/cpw/mods/ironchest/OcelotsSitOnChestsHandler.java @@ -10,7 +10,7 @@ public class OcelotsSitOnChestsHandler @SubscribeEvent public void changeSittingTaskForOcelots(LivingEvent.LivingUpdateEvent evt) { - if (evt.entityLiving.ticksExisted < 5 && evt.entityLiving instanceof EntityOcelot) + if (evt.getEntityLiving().ticksExisted < 5 && evt.getEntityLiving() instanceof EntityOcelot) { // EntityOcelot ocelot = (EntityOcelot) evt.entityLiving; // Set tasks = ocelot.tasks.taskEntries; diff --git a/src/main/java/cpw/mods/ironchest/client/IronChestEventHandler.java b/src/main/java/cpw/mods/ironchest/client/IronChestEventHandler.java index f8a478b4..a831508a 100644 --- a/src/main/java/cpw/mods/ironchest/client/IronChestEventHandler.java +++ b/src/main/java/cpw/mods/ironchest/client/IronChestEventHandler.java @@ -12,14 +12,14 @@ public class IronChestEventHandler @SubscribeEvent public void onPreTextureStiching(TextureStitchEvent.Pre event) { - if (event.map == FMLClientHandler.instance().getClient().getTextureMapBlocks()) + if (event.getMap() == FMLClientHandler.instance().getClient().getTextureMapBlocks()) { - event.map.registerSprite(new ResourceLocation("ironchest:blocks/copperbreak")); - event.map.registerSprite(new ResourceLocation("ironchest:blocks/crystalbreak")); - event.map.registerSprite(new ResourceLocation("ironchest:blocks/diamondbreak")); - event.map.registerSprite(new ResourceLocation("ironchest:blocks/goldbreak")); - event.map.registerSprite(new ResourceLocation("ironchest:blocks/ironbreak")); - event.map.registerSprite(new ResourceLocation("ironchest:blocks/silverbreak")); + event.getMap().registerSprite(new ResourceLocation("ironchest:blocks/copperbreak")); + event.getMap().registerSprite(new ResourceLocation("ironchest:blocks/crystalbreak")); + event.getMap().registerSprite(new ResourceLocation("ironchest:blocks/diamondbreak")); + event.getMap().registerSprite(new ResourceLocation("ironchest:blocks/goldbreak")); + event.getMap().registerSprite(new ResourceLocation("ironchest:blocks/ironbreak")); + event.getMap().registerSprite(new ResourceLocation("ironchest:blocks/silverbreak")); } } } From 0aae1ff3347b3d59870c0459bf8e24faf641c1fb Mon Sep 17 00:00:00 2001 From: Alexander Date: Sat, 26 Mar 2016 14:47:15 -0400 Subject: [PATCH 011/105] Fix #64, only call the event on the client. --- .../java/cpw/mods/ironchest/client/IronChestEventHandler.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/cpw/mods/ironchest/client/IronChestEventHandler.java b/src/main/java/cpw/mods/ironchest/client/IronChestEventHandler.java index a831508a..f6f8d374 100644 --- a/src/main/java/cpw/mods/ironchest/client/IronChestEventHandler.java +++ b/src/main/java/cpw/mods/ironchest/client/IronChestEventHandler.java @@ -4,12 +4,15 @@ import net.minecraftforge.client.event.TextureStitchEvent; import net.minecraftforge.fml.client.FMLClientHandler; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.relauncher.SideOnly; +import net.minecraftforge.fml.relauncher.Side; public class IronChestEventHandler { public static IronChestEventHandler INSTANCE = new IronChestEventHandler(); @SubscribeEvent + @SideOnly(Side.CLIENT) public void onPreTextureStiching(TextureStitchEvent.Pre event) { if (event.getMap() == FMLClientHandler.instance().getClient().getTextureMapBlocks()) From a4184e69612530d088cce2d8415f541588a6b1b4 Mon Sep 17 00:00:00 2001 From: Alexander Date: Sat, 2 Apr 2016 19:18:26 -0400 Subject: [PATCH 012/105] Update IronChests to new Forge with the registry changes. --- build.gradle | 4 ++-- src/main/java/cpw/mods/ironchest/IronChest.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index 885b653a..6b0825b0 100755 --- a/build.gradle +++ b/build.gradle @@ -35,8 +35,8 @@ archivesBaseName = "ironchest" // Setup the forge minecraft plugin data. Specify the preferred forge/minecraft version here minecraft { - version = "1.9-12.16.0.1809-1.9" - mappings = "snapshot_20160319" + version = "1.9-12.16.0.1826-1.9" + mappings = "snapshot_20160324" runDir = "run" } diff --git a/src/main/java/cpw/mods/ironchest/IronChest.java b/src/main/java/cpw/mods/ironchest/IronChest.java index 5b6b877a..b1ef5774 100755 --- a/src/main/java/cpw/mods/ironchest/IronChest.java +++ b/src/main/java/cpw/mods/ironchest/IronChest.java @@ -21,7 +21,7 @@ import net.minecraftforge.fml.common.network.NetworkRegistry; import net.minecraftforge.fml.common.registry.GameRegistry; -@Mod(modid = "IronChest", name = "Iron Chests", dependencies = "required-after:Forge@[12.16,)", acceptedMinecraftVersions = "[1.9]") +@Mod(modid = "IronChest", name = "Iron Chests", dependencies = "required-after:Forge@[12.16.0.1819,)", acceptedMinecraftVersions = "[1.9]") public class IronChest { public static BlockIronChest ironChestBlock; From d0b721e33208b59253fa41b9a1069ed923aee217 Mon Sep 17 00:00:00 2001 From: Alexander Date: Thu, 21 Apr 2016 14:29:22 -0400 Subject: [PATCH 013/105] Fix some formatter issues and update forge and mappings. --- build.gradle | 4 ++-- .../java/cpw/mods/ironchest/BlockIronChest.java | 9 +++++---- .../java/cpw/mods/ironchest/ChestChangerType.java | 13 ++++++++++--- src/main/java/cpw/mods/ironchest/IronChest.java | 9 ++++++++- .../java/cpw/mods/ironchest/IronChestType.java | 12 ++++++++---- .../java/cpw/mods/ironchest/ItemChestChanger.java | 4 +++- .../cpw/mods/ironchest/TileEntityDirtChest.java | 2 +- .../cpw/mods/ironchest/TileEntityIronChest.java | 15 +++++++++------ 8 files changed, 46 insertions(+), 22 deletions(-) diff --git a/build.gradle b/build.gradle index 6b0825b0..3decca06 100755 --- a/build.gradle +++ b/build.gradle @@ -35,8 +35,8 @@ archivesBaseName = "ironchest" // Setup the forge minecraft plugin data. Specify the preferred forge/minecraft version here minecraft { - version = "1.9-12.16.0.1826-1.9" - mappings = "snapshot_20160324" + version = "1.9-12.16.0.1865-1.9" + mappings = "snapshot_20160419" runDir = "run" } diff --git a/src/main/java/cpw/mods/ironchest/BlockIronChest.java b/src/main/java/cpw/mods/ironchest/BlockIronChest.java index b428cd9e..247ac0d5 100755 --- a/src/main/java/cpw/mods/ironchest/BlockIronChest.java +++ b/src/main/java/cpw/mods/ironchest/BlockIronChest.java @@ -54,13 +54,13 @@ public class BlockIronChest extends BlockContainer public BlockIronChest() { - super(Material.iron); + super(Material.IRON); this.setDefaultState(this.blockState.getBaseState().withProperty(VARIANT_PROP, IronChestType.IRON)); this.setHardness(3.0F); this.setUnlocalizedName("IronChest"); - this.setCreativeTab(CreativeTabs.tabDecorations); + this.setCreativeTab(CreativeTabs.DECORATIONS); } @Override @@ -88,8 +88,9 @@ public EnumBlockRenderType getRenderType(IBlockState state) } @Override - public boolean onBlockActivated(World world, BlockPos pos, IBlockState blockState, EntityPlayer player, EnumHand hand, ItemStack heldItem, - EnumFacing direction, float hitX, float hitY, float hitZ) + //@formatter:off + public boolean onBlockActivated(World world, BlockPos pos, IBlockState blockState, EntityPlayer player, EnumHand hand, ItemStack heldItem, EnumFacing direction, float hitX, float hitY, float hitZ) + //@formatter:on { TileEntity te = world.getTileEntity(pos); diff --git a/src/main/java/cpw/mods/ironchest/ChestChangerType.java b/src/main/java/cpw/mods/ironchest/ChestChangerType.java index 9c9eab6f..593715aa 100755 --- a/src/main/java/cpw/mods/ironchest/ChestChangerType.java +++ b/src/main/java/cpw/mods/ironchest/ChestChangerType.java @@ -24,6 +24,7 @@ public enum ChestChangerType { + //@formatter:off IRONGOLD(IRON, GOLD, "ironGoldUpgrade", "Iron to Gold Chest Upgrade", "mmm", "msm", "mmm"), GOLDDIAMOND(GOLD, DIAMOND, "goldDiamondUpgrade", "Gold to Diamond Chest Upgrade", "GGG", "msm", "GGG"), COPPERSILVER(COPPER, SILVER, "copperSilverUpgrade", "Copper to Silver Chest Upgrade", "mmm", "msm", "mmm"), @@ -33,6 +34,7 @@ public enum ChestChangerType WOODIRON(WOOD, IRON, "woodIronUpgrade", "Normal chest to Iron Chest Upgrade", "mmm", "msm", "mmm"), WOODCOPPER(WOOD, COPPER, "woodCopperUpgrade", "Normal chest to Copper Chest Upgrade", "mmm", "msm", "mmm"), DIAMONDOBSIDIAN(DIAMOND, OBSIDIAN, "diamondObsidianUpgrade", "Diamond to Obsidian Chest Upgrade", "mmm", "mGm", "mmm"); + //@formatter:on private IronChestType source; private IronChestType target; @@ -68,11 +70,15 @@ public int getTarget() public ItemChestChanger buildItem() { this.item = new ItemChestChanger(this); - GameRegistry.registerItem(this.item, this.itemName); + this.item.setRegistryName(this.itemName); + + GameRegistry.register(this.item); + if (FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT) { ModelHelper.registerItem(this.item, "ironchest:" + this.itemName); } + return this.item; } @@ -84,8 +90,9 @@ public void addRecipes() { Object targetMaterial = IronChestType.translateOreName(targetMat); Object sourceMaterial = IronChestType.translateOreName(sourceMat); - IronChestType.addRecipe(new ItemStack(this.item), this.recipe, 'm', targetMaterial, 's', sourceMaterial, 'G', "blockGlass", 'O', - Blocks.obsidian); + //@formatter:off + IronChestType.addRecipe(new ItemStack(this.item), this.recipe, 'm', targetMaterial, 's', sourceMaterial, 'G', "blockGlass", 'O', Blocks.OBSIDIAN); + //@formatter:on } } } diff --git a/src/main/java/cpw/mods/ironchest/IronChest.java b/src/main/java/cpw/mods/ironchest/IronChest.java index b1ef5774..0abc9663 100755 --- a/src/main/java/cpw/mods/ironchest/IronChest.java +++ b/src/main/java/cpw/mods/ironchest/IronChest.java @@ -25,6 +25,7 @@ public class IronChest { public static BlockIronChest ironChestBlock; + public static ItemIronChest ironChestItemBlock; @SidedProxy(clientSide = "cpw.mods.ironchest.client.ClientProxy", serverSide = "cpw.mods.ironchest.CommonProxy") public static CommonProxy proxy; @Instance("IronChest") @@ -44,7 +45,13 @@ public void load(FMLInitializationEvent evt) // Minecraft.getRenderItem() returns null before this stage ChestChangerType.buildItems(); ironChestBlock = new BlockIronChest(); - GameRegistry.registerBlock(ironChestBlock, ItemIronChest.class, "BlockIronChest"); + ironChestItemBlock = new ItemIronChest(ironChestBlock); + + ironChestBlock.setRegistryName("BlockIronChest"); + ironChestItemBlock.setRegistryName("BlockIronChest"); + + GameRegistry.register(ironChestBlock); + GameRegistry.register(ironChestItemBlock); for (IronChestType typ : IronChestType.values()) { diff --git a/src/main/java/cpw/mods/ironchest/IronChestType.java b/src/main/java/cpw/mods/ironchest/IronChestType.java index 1393422f..cd844b0a 100755 --- a/src/main/java/cpw/mods/ironchest/IronChestType.java +++ b/src/main/java/cpw/mods/ironchest/IronChestType.java @@ -26,6 +26,7 @@ public enum IronChestType implements IStringSerializable { + //@formatter:off IRON(54, 9, true, "Iron Chest", "ironchest.png", 0, Arrays.asList("ingotIron", "ingotRefinedIron"), TileEntityIronChest.class, "mmmmPmmmm", "mGmG3GmGm"), GOLD(81, 9, true, "Gold Chest", "goldchest.png", 1, Arrays.asList("ingotGold"), TileEntityGoldChest.class, "mmmmPmmmm", "mGmG4GmGm"), DIAMOND(108, 12, true, "Diamond Chest", "diamondchest.png", 2, Arrays.asList("gemDiamond"), TileEntityDiamondChest.class, "GGGmPmGGG", "GGGG4Gmmm"), @@ -33,8 +34,9 @@ public enum IronChestType implements IStringSerializable SILVER(72, 9, false, "Silver Chest", "silverchest.png", 4, Arrays.asList("ingotSilver"), TileEntitySilverChest.class, "mmmm3mmmm", "mGmG0GmGm"), CRYSTAL(108, 12, true, "Crystal Chest", "crystalchest.png", 5, Arrays.asList("blockGlass"), TileEntityCrystalChest.class, "GGGGPGGGG"), OBSIDIAN(108, 12, false, "Obsidian Chest", "obsidianchest.png", 6, Arrays.asList("obsidian"), TileEntityObsidianChest.class, "mmmm2mmmm"), - DIRTCHEST9000(1, 1, false, "Dirt Chest 9000", "dirtchest.png", 7, Arrays.asList("dirt"), TileEntityDirtChest.class, Item.getItemFromBlock(Blocks.dirt), "mmmmCmmmm"), + DIRTCHEST9000(1, 1, false, "Dirt Chest 9000", "dirtchest.png", 7, Arrays.asList("dirt"), TileEntityDirtChest.class, Item.getItemFromBlock(Blocks.DIRT), "mmmmCmmmm"), WOOD(0, 0, false, "", "", -1, Arrays.asList("plankWood"), null); + //@formatter:on int size; private int rowLength; public String friendlyName; @@ -133,6 +135,7 @@ public static void generateRecipesForType(BlockIronChest blockResult, Object pre for (String mat : type.matList) { mainMaterial = translateOreName(mat); + //@formatter:off addRecipe(new ItemStack(blockResult, 1, type.ordinal()), recipeSplit, 'm', mainMaterial, 'P', previousTier, /* previous tier of chest */ 'G', "blockGlass", 'C', "chestWood", @@ -140,8 +143,9 @@ public static void generateRecipesForType(BlockIronChest blockResult, Object pre '1', new ItemStack(blockResult, 1, 1), /* Gold Chest */ '2', new ItemStack(blockResult, 1, 2), /* Diamond Chest */ '3', new ItemStack(blockResult, 1, 3), /* Copper Chest */ - '4', new ItemStack(blockResult, 1, 4) /* Silver Chest */ + '4', new ItemStack(blockResult, 1, 4) /* Silver Chest */ ); + //@formatter:on } } } @@ -150,11 +154,11 @@ public static Object translateOreName(String mat) { if (mat.equals("obsidian")) { - return Blocks.obsidian; + return Blocks.OBSIDIAN; } else if (mat.equals("dirt")) { - return Blocks.dirt; + return Blocks.DIRT; } return mat; } diff --git a/src/main/java/cpw/mods/ironchest/ItemChestChanger.java b/src/main/java/cpw/mods/ironchest/ItemChestChanger.java index a6f2a772..62cd8bdb 100755 --- a/src/main/java/cpw/mods/ironchest/ItemChestChanger.java +++ b/src/main/java/cpw/mods/ironchest/ItemChestChanger.java @@ -34,11 +34,13 @@ public ItemChestChanger(ChestChangerType type) this.setMaxStackSize(1); this.setUnlocalizedName("ironchest:" + type.name()); - this.setCreativeTab(CreativeTabs.tabMisc); + this.setCreativeTab(CreativeTabs.MISC); } @Override + //@formatter:off public EnumActionResult onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) + //@formatter:on { if (worldIn.isRemote) { diff --git a/src/main/java/cpw/mods/ironchest/TileEntityDirtChest.java b/src/main/java/cpw/mods/ironchest/TileEntityDirtChest.java index 91998d32..15489c9f 100755 --- a/src/main/java/cpw/mods/ironchest/TileEntityDirtChest.java +++ b/src/main/java/cpw/mods/ironchest/TileEntityDirtChest.java @@ -9,7 +9,7 @@ public class TileEntityDirtChest extends TileEntityIronChest { - private static ItemStack dirtChest9000GuideBook = new ItemStack(Items.written_book); + private static ItemStack dirtChest9000GuideBook = new ItemStack(Items.WRITTEN_BOOK); static { diff --git a/src/main/java/cpw/mods/ironchest/TileEntityIronChest.java b/src/main/java/cpw/mods/ironchest/TileEntityIronChest.java index 8dd64ffc..e5903bc0 100755 --- a/src/main/java/cpw/mods/ironchest/TileEntityIronChest.java +++ b/src/main/java/cpw/mods/ironchest/TileEntityIronChest.java @@ -324,8 +324,9 @@ public void update() { this.numUsingPlayers = 0; float var1 = 5.0F; - List var2 = this.worldObj.getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(this.pos.getX() - var1, this.pos.getY() - var1, - this.pos.getZ() - var1, this.pos.getX() + 1 + var1, this.pos.getY() + 1 + var1, this.pos.getZ() + 1 + var1)); + //@formatter:off + List var2 = this.worldObj.getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(this.pos.getX() - var1, this.pos.getY() - var1, this.pos.getZ() - var1, this.pos.getX() + 1 + var1, this.pos.getY() + 1 + var1, this.pos.getZ() + 1 + var1)); + //@formatter:on for (EntityPlayer var4 : var2) { @@ -353,8 +354,9 @@ public void update() { double d = this.pos.getX() + 0.5D; double d1 = this.pos.getZ() + 0.5D; - this.worldObj.playSound((EntityPlayer) null, d, this.pos.getY() + 0.5D, d1, SoundEvents.block_chest_open, SoundCategory.BLOCKS, 0.5F, - this.worldObj.rand.nextFloat() * 0.1F + 0.9F); + //@formatter:off + this.worldObj.playSound((EntityPlayer) null, d, this.pos.getY() + 0.5D, d1, SoundEvents.BLOCK_CHEST_OPEN, SoundCategory.BLOCKS, 0.5F, this.worldObj.rand.nextFloat() * 0.1F + 0.9F); + //@formatter:on } if (this.numUsingPlayers == 0 && this.lidAngle > 0.0F || this.numUsingPlayers > 0 && this.lidAngle < 1.0F) { @@ -376,8 +378,9 @@ public void update() { double d2 = this.pos.getX() + 0.5D; double d3 = this.pos.getZ() + 0.5D; - this.worldObj.playSound((EntityPlayer) null, d2, this.pos.getY() + 0.5D, d3, SoundEvents.block_chest_close, SoundCategory.BLOCKS, 0.5F, - this.worldObj.rand.nextFloat() * 0.1F + 0.9F); + //@formatter:off + this.worldObj.playSound((EntityPlayer) null, d2, this.pos.getY() + 0.5D, d3, SoundEvents.BLOCK_CHEST_CLOSE, SoundCategory.BLOCKS, 0.5F, this.worldObj.rand.nextFloat() * 0.1F + 0.9F); + //@formatter:on } if (this.lidAngle < 0.0F) { From 8fcccc40eeaba0b9772ff8329f9cabe96e42e080 Mon Sep 17 00:00:00 2001 From: LatvianModder Date: Thu, 19 May 2016 02:47:25 +0300 Subject: [PATCH 014/105] Absolutely barbaric rewrite --- .../cpw/mods/ironchest/BlockIronChest.java | 83 ++++---- .../cpw/mods/ironchest/ChestChangerType.java | 48 ++--- .../java/cpw/mods/ironchest/CommonProxy.java | 18 +- .../mods/ironchest/ContainerIronChest.java | 12 +- .../java/cpw/mods/ironchest/IronChest.java | 58 +++--- .../cpw/mods/ironchest/IronChestType.java | 186 +++++++++--------- .../cpw/mods/ironchest/ItemChestChanger.java | 53 ++--- .../cpw/mods/ironchest/ItemIronChest.java | 10 +- .../ironchest/OcelotsSitOnChestsHandler.java | 1 - .../mods/ironchest/TileEntityCopperChest.java | 7 +- .../ironchest/TileEntityCrystalChest.java | 6 +- .../ironchest/TileEntityDiamondChest.java | 6 +- .../mods/ironchest/TileEntityDirtChest.java | 2 +- .../mods/ironchest/TileEntityGoldChest.java | 4 +- .../mods/ironchest/TileEntityIronChest.java | 80 +++----- .../mods/ironchest/TileEntitySilverChest.java | 4 +- src/main/java/cpw/mods/ironchest/Version.java | 36 ---- .../mods/ironchest/client/ClientProxy.java | 47 +++-- .../cpw/mods/ironchest/client/GUIChest.java | 47 ++--- .../client/IronChestEventHandler.java | 13 +- .../client/IronChestTextureHandler.java | 42 +--- .../mods/ironchest/client/ModelHelper.java | 44 ----- .../client/TileEntityIronChestRenderer.java | 147 +++++++------- 23 files changed, 376 insertions(+), 578 deletions(-) delete mode 100755 src/main/java/cpw/mods/ironchest/Version.java delete mode 100644 src/main/java/cpw/mods/ironchest/client/ModelHelper.java diff --git a/src/main/java/cpw/mods/ironchest/BlockIronChest.java b/src/main/java/cpw/mods/ironchest/BlockIronChest.java index 247ac0d5..14ddc7a7 100755 --- a/src/main/java/cpw/mods/ironchest/BlockIronChest.java +++ b/src/main/java/cpw/mods/ironchest/BlockIronChest.java @@ -4,25 +4,22 @@ * 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 + * cpw - initial API and implementation ******************************************************************************/ package cpw.mods.ironchest; -import java.util.ArrayList; import java.util.List; import java.util.Random; -import com.google.common.collect.Lists; - import cpw.mods.ironchest.client.IronChestTextureHandler; -import net.minecraft.block.BlockContainer; +import net.minecraft.block.Block; import net.minecraft.block.material.Material; -import net.minecraft.block.properties.IProperty; import net.minecraft.block.properties.PropertyEnum; import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.IBlockState; +import net.minecraft.client.particle.EffectRenderer; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; @@ -37,9 +34,9 @@ import net.minecraft.util.EnumBlockRenderType; import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumHand; +import net.minecraft.util.ResourceLocation; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.RayTraceResult; import net.minecraft.world.Explosion; import net.minecraft.world.IBlockAccess; @@ -47,7 +44,7 @@ import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -public class BlockIronChest extends BlockContainer +public class BlockIronChest extends Block { public static final PropertyEnum VARIANT_PROP = PropertyEnum.create("variant", IronChestType.class); protected static final AxisAlignedBB IRON_CHEST_AABB = new AxisAlignedBB(0.0625D, 0.0D, 0.0625D, 0.9375D, 0.875D, 0.9375D); @@ -55,6 +52,7 @@ public class BlockIronChest extends BlockContainer public BlockIronChest() { super(Material.IRON); + this.setRegistryName(new ResourceLocation(IronChest.MOD_ID, "BlockIronChest")); this.setDefaultState(this.blockState.getBaseState().withProperty(VARIANT_PROP, IronChestType.IRON)); @@ -114,16 +112,22 @@ public boolean onBlockActivated(World world, BlockPos pos, IBlockState blockStat } @Override - public TileEntity createNewTileEntity(World world, int metadata) + public boolean hasTileEntity(IBlockState state) + { + return true; + } + + @Override + public TileEntity createTileEntity(World world, IBlockState state) { - return IronChestType.makeEntity(metadata); + return state.getValue(VARIANT_PROP).makeEntity(); } @Override @SideOnly(Side.CLIENT) public void getSubBlocks(Item itemIn, CreativeTabs tab, List list) { - for (IronChestType type : IronChestType.values()) + for (IronChestType type : IronChestType.VALUES) { if (type.isValidForCreativeMode()) { @@ -135,7 +139,7 @@ public void getSubBlocks(Item itemIn, CreativeTabs tab, List list) @Override public IBlockState getStateFromMeta(int meta) { - return this.getDefaultState().withProperty(VARIANT_PROP, IronChestType.values()[meta]); + return this.getDefaultState().withProperty(VARIANT_PROP, IronChestType.VALUES[meta]); } @Override @@ -147,17 +151,7 @@ public int getMetaFromState(IBlockState blockState) @Override protected BlockStateContainer createBlockState() { - return new BlockStateContainer(this, new IProperty[] { VARIANT_PROP }); - } - - @Override - public ArrayList getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) - { - ArrayList items = Lists.newArrayList(); - ItemStack stack = new ItemStack(this, 1, this.getMetaFromState(state)); - IronChestType.values()[IronChestType.validateMeta(this.getMetaFromState(state))].adornItemDrop(stack); - items.add(stack); - return items; + return new BlockStateContainer(this, VARIANT_PROP); } @Override @@ -170,30 +164,12 @@ public void onBlockAdded(World world, BlockPos pos, IBlockState blockState) @Override public void onBlockPlacedBy(World world, BlockPos pos, IBlockState blockState, EntityLivingBase entityliving, ItemStack itemStack) { - byte chestFacing = 0; - int facing = MathHelper.floor_double((entityliving.rotationYaw * 4F) / 360F + 0.5D) & 3; - if (facing == 0) - { - chestFacing = 2; - } - if (facing == 1) - { - chestFacing = 5; - } - if (facing == 2) - { - chestFacing = 3; - } - if (facing == 3) - { - chestFacing = 4; - } TileEntity te = world.getTileEntity(pos); if (te != null && te instanceof TileEntityIronChest) { TileEntityIronChest teic = (TileEntityIronChest) te; teic.wasPlaced(entityliving, itemStack); - teic.setFacing(chestFacing); + teic.setFacing(entityliving.getHorizontalFacing().getOpposite()); world.notifyBlockUpdate(pos, blockState, blockState, 3); } } @@ -201,7 +177,7 @@ public void onBlockPlacedBy(World world, BlockPos pos, IBlockState blockState, E @Override public int damageDropped(IBlockState state) { - return IronChestType.validateMeta(state.getValue(VARIANT_PROP).ordinal()); + return state.getValue(VARIANT_PROP).ordinal(); } @Override @@ -268,9 +244,14 @@ public float getExplosionResistance(World world, BlockPos pos, Entity exploder, return super.getExplosionResistance(world, pos, exploder, explosion); } + /* + * @Override public boolean addLandingEffects(IBlockState state, WorldServer world, BlockPos pos, IBlockState iblockstate, EntityLivingBase entity, int numberOfParticles) { + * IronChestTextureHandler.addDestroyEffects(world, pos, state); return true; } + */ + @Override @SideOnly(Side.CLIENT) - public boolean addHitEffects(IBlockState state, World worldObj, RayTraceResult target, net.minecraft.client.particle.EffectRenderer effectRenderer) + public boolean addHitEffects(IBlockState state, World worldObj, RayTraceResult target, EffectRenderer effectRenderer) { IronChestTextureHandler.addHitEffects(worldObj, target.getBlockPos(), target.sideHit); return true; @@ -278,7 +259,7 @@ public boolean addHitEffects(IBlockState state, World worldObj, RayTraceResult t @Override @SideOnly(Side.CLIENT) - public boolean addDestroyEffects(World world, BlockPos pos, net.minecraft.client.particle.EffectRenderer effectRenderer) + public boolean addDestroyEffects(World world, BlockPos pos, EffectRenderer effectRenderer) { IronChestTextureHandler.addDestroyEffects(world, pos, world.getBlockState(pos)); return true; @@ -328,4 +309,12 @@ public boolean rotateBlock(World worldObj, BlockPos pos, EnumFacing axis) } return false; } -} \ No newline at end of file + + @Override + public boolean onBlockEventReceived(World worldIn, BlockPos pos, IBlockState state, int eventID, int eventParam) + { + super.onBlockEventReceived(worldIn, pos, state, eventID, eventParam); + TileEntity tileentity = worldIn.getTileEntity(pos); + return tileentity != null && tileentity.receiveClientEvent(eventID, eventParam); + } +} diff --git a/src/main/java/cpw/mods/ironchest/ChestChangerType.java b/src/main/java/cpw/mods/ironchest/ChestChangerType.java index 593715aa..d24ed711 100755 --- a/src/main/java/cpw/mods/ironchest/ChestChangerType.java +++ b/src/main/java/cpw/mods/ironchest/ChestChangerType.java @@ -1,7 +1,7 @@ /******************************************************************************* * 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 cpw.mods.ironchest; @@ -15,40 +15,37 @@ import static cpw.mods.ironchest.IronChestType.SILVER; import static cpw.mods.ironchest.IronChestType.WOOD; -import cpw.mods.ironchest.client.ModelHelper; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; -import net.minecraftforge.fml.common.FMLCommonHandler; import net.minecraftforge.fml.common.registry.GameRegistry; -import net.minecraftforge.fml.relauncher.Side; public enum ChestChangerType { //@formatter:off - IRONGOLD(IRON, GOLD, "ironGoldUpgrade", "Iron to Gold Chest Upgrade", "mmm", "msm", "mmm"), - GOLDDIAMOND(GOLD, DIAMOND, "goldDiamondUpgrade", "Gold to Diamond Chest Upgrade", "GGG", "msm", "GGG"), - COPPERSILVER(COPPER, SILVER, "copperSilverUpgrade", "Copper to Silver Chest Upgrade", "mmm", "msm", "mmm"), - SILVERGOLD(SILVER, GOLD, "silverGoldUpgrade", "Silver to Gold Chest Upgrade", "mGm", "GsG", "mGm"), - COPPERIRON(COPPER, IRON, "copperIronUpgrade", "Copper to Iron Chest Upgrade", "mGm", "GsG", "mGm"), - DIAMONDCRYSTAL(DIAMOND, CRYSTAL, "diamondCrystalUpgrade", "Diamond to Crystal Chest Upgrade", "GGG", "GOG", "GGG"), - WOODIRON(WOOD, IRON, "woodIronUpgrade", "Normal chest to Iron Chest Upgrade", "mmm", "msm", "mmm"), - WOODCOPPER(WOOD, COPPER, "woodCopperUpgrade", "Normal chest to Copper Chest Upgrade", "mmm", "msm", "mmm"), - DIAMONDOBSIDIAN(DIAMOND, OBSIDIAN, "diamondObsidianUpgrade", "Diamond to Obsidian Chest Upgrade", "mmm", "mGm", "mmm"); + IRONGOLD(IRON, GOLD, "ironGoldUpgrade", "mmm", "msm", "mmm"), + GOLDDIAMOND(GOLD, DIAMOND, "goldDiamondUpgrade", "GGG", "msm", "GGG"), + COPPERSILVER(COPPER, SILVER, "copperSilverUpgrade", "mmm", "msm", "mmm"), + SILVERGOLD(SILVER, GOLD, "silverGoldUpgrade", "mGm", "GsG", "mGm"), + COPPERIRON(COPPER, IRON, "copperIronUpgrade", "mGm", "GsG", "mGm"), + DIAMONDCRYSTAL(DIAMOND, CRYSTAL, "diamondCrystalUpgrade", "GGG", "GOG", "GGG"), + WOODIRON(WOOD, IRON, "woodIronUpgrade", "mmm", "msm", "mmm"), + WOODCOPPER(WOOD, COPPER, "woodCopperUpgrade", "mmm", "msm", "mmm"), + DIAMONDOBSIDIAN(DIAMOND, OBSIDIAN, "diamondObsidianUpgrade", "mmm", "mGm", "mmm"); //@formatter:on + public static final ChestChangerType[] VALUES = values(); + private IronChestType source; private IronChestType target; public String itemName; - public String descriptiveName; public ItemChestChanger item; private String[] recipe; - private ChestChangerType(IronChestType source, IronChestType target, String itemName, String descriptiveName, String... recipe) + ChestChangerType(IronChestType source, IronChestType target, String itemName, String... recipe) { this.source = source; this.target = target; this.itemName = itemName; - this.descriptiveName = descriptiveName; this.recipe = recipe; } @@ -62,31 +59,24 @@ public boolean canUpgrade(IronChestType from) return from == this.source; } - public int getTarget() + public IronChestType getTarget() { - return this.target.ordinal(); + return this.target; } public ItemChestChanger buildItem() { this.item = new ItemChestChanger(this); this.item.setRegistryName(this.itemName); - GameRegistry.register(this.item); - - if (FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT) - { - ModelHelper.registerItem(this.item, "ironchest:" + this.itemName); - } - return this.item; } public void addRecipes() { - for (String sourceMat : this.source.getMatList()) + for (String sourceMat : this.source.matList) { - for (String targetMat : this.target.getMatList()) + for (String targetMat : this.target.matList) { Object targetMaterial = IronChestType.translateOreName(targetMat); Object sourceMaterial = IronChestType.translateOreName(sourceMat); @@ -99,7 +89,7 @@ public void addRecipes() public static void buildItems() { - for (ChestChangerType type : values()) + for (ChestChangerType type : VALUES) { type.buildItem(); } @@ -107,7 +97,7 @@ public static void buildItems() public static void generateRecipes() { - for (ChestChangerType item : values()) + for (ChestChangerType item : VALUES) { item.addRecipes(); } diff --git a/src/main/java/cpw/mods/ironchest/CommonProxy.java b/src/main/java/cpw/mods/ironchest/CommonProxy.java index cc1ab21c..505be12e 100755 --- a/src/main/java/cpw/mods/ironchest/CommonProxy.java +++ b/src/main/java/cpw/mods/ironchest/CommonProxy.java @@ -4,9 +4,9 @@ * 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 + * cpw - initial API and implementation ******************************************************************************/ package cpw.mods.ironchest; @@ -20,12 +20,6 @@ public class CommonProxy implements IGuiHandler { public void registerRenderInformation() { - - } - - public void registerTileEntitySpecialRenderer(Class typ) - { - } @Override @@ -48,10 +42,4 @@ public Object getServerGuiElement(int ID, EntityPlayer player, World world, int return null; } } - - public World getClientWorld() - { - return null; - } - -} +} \ No newline at end of file diff --git a/src/main/java/cpw/mods/ironchest/ContainerIronChest.java b/src/main/java/cpw/mods/ironchest/ContainerIronChest.java index 5c55cfe6..b69fea38 100755 --- a/src/main/java/cpw/mods/ironchest/ContainerIronChest.java +++ b/src/main/java/cpw/mods/ironchest/ContainerIronChest.java @@ -4,9 +4,9 @@ * 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 + * cpw - initial API and implementation ******************************************************************************/ package cpw.mods.ironchest; @@ -44,7 +44,7 @@ public boolean canInteractWith(EntityPlayer player) public ItemStack transferStackInSlot(EntityPlayer p, int i) { ItemStack itemstack = null; - Slot slot = (Slot) this.inventorySlots.get(i); + Slot slot = this.inventorySlots.get(i); if (slot != null && slot.getHasStack()) { ItemStack itemstack1 = slot.getStack(); @@ -93,9 +93,9 @@ protected void layoutContainer(IInventory playerInventory, IInventory chestInven { for (int chestRow = 0; chestRow < type.getRowCount(); chestRow++) { - for (int chestCol = 0; chestCol < type.getRowLength(); chestCol++) + for (int chestCol = 0; chestCol < type.rowLength; chestCol++) { - this.addSlotToContainer(type.makeSlot(chestInventory, chestCol + chestRow * type.getRowLength(), 12 + chestCol * 18, 8 + chestRow * 18)); + this.addSlotToContainer(type.makeSlot(chestInventory, chestCol + chestRow * type.rowLength, 12 + chestCol * 18, 8 + chestRow * 18)); } } } @@ -125,6 +125,6 @@ public EntityPlayer getPlayer() @ChestContainer.RowSizeCallback public int getNumColumns() { - return this.type.getRowLength(); + return this.type.rowLength; } } diff --git a/src/main/java/cpw/mods/ironchest/IronChest.java b/src/main/java/cpw/mods/ironchest/IronChest.java index 0abc9663..e6722656 100755 --- a/src/main/java/cpw/mods/ironchest/IronChest.java +++ b/src/main/java/cpw/mods/ironchest/IronChest.java @@ -4,66 +4,68 @@ * 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 + * cpw - initial API and implementation ******************************************************************************/ package cpw.mods.ironchest; +import java.util.Properties; + import cpw.mods.ironchest.client.IronChestEventHandler; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventHandler; import net.minecraftforge.fml.common.Mod.Instance; import net.minecraftforge.fml.common.SidedProxy; -import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.common.network.NetworkRegistry; import net.minecraftforge.fml.common.registry.GameRegistry; -@Mod(modid = "IronChest", name = "Iron Chests", dependencies = "required-after:Forge@[12.16.0.1819,)", acceptedMinecraftVersions = "[1.9]") +@Mod(modid = IronChest.MOD_ID, name = "Iron Chests", dependencies = "required-after:Forge@[12.16.0.1819,)", acceptedMinecraftVersions = "[1.9]") public class IronChest { - public static BlockIronChest ironChestBlock; - public static ItemIronChest ironChestItemBlock; + public static final String MOD_ID = "IronChest"; + + @Instance(IronChest.MOD_ID) + public static IronChest instance; + @SidedProxy(clientSide = "cpw.mods.ironchest.client.ClientProxy", serverSide = "cpw.mods.ironchest.CommonProxy") public static CommonProxy proxy; - @Instance("IronChest") - public static IronChest instance; - @EventHandler - public void preInit(FMLPreInitializationEvent event) - { - Version.init(event.getVersionProperties()); - event.getModMetadata().version = Version.fullVersionString(); - } + public static BlockIronChest ironChestBlock; + public static ItemIronChest ironChestItemBlock; @EventHandler - public void load(FMLInitializationEvent evt) + public void preInit(FMLPreInitializationEvent event) { - // Registration has been moved to init to account for the registration of inventory models - // Minecraft.getRenderItem() returns null before this stage - ChestChangerType.buildItems(); - ironChestBlock = new BlockIronChest(); - ironChestItemBlock = new ItemIronChest(ironChestBlock); + Properties properties = event.getVersionProperties(); - ironChestBlock.setRegistryName("BlockIronChest"); - ironChestItemBlock.setRegistryName("BlockIronChest"); + if (properties != null) + { + String major = properties.getProperty("IronChest.build.major.number"); + String minor = properties.getProperty("IronChest.build.minor.number"); + String rev = properties.getProperty("IronChest.build.revision.number"); + String build = properties.getProperty("IronChest.build.number"); + // String mcversion = properties.getProperty("IronChest.build.mcversion"); + event.getModMetadata().version = String.format("%s.%s.%s build %s", major, minor, rev, build); + } - GameRegistry.register(ironChestBlock); + ChestChangerType.buildItems(); + ironChestBlock = GameRegistry.register(new BlockIronChest()); + ironChestItemBlock = GameRegistry.register(new ItemIronChest(ironChestBlock)); GameRegistry.register(ironChestItemBlock); - for (IronChestType typ : IronChestType.values()) + for (IronChestType typ : IronChestType.VALUES) { - GameRegistry.registerTileEntityWithAlternatives(typ.clazz, "IronChest." + typ.name(), typ.name()); - proxy.registerTileEntitySpecialRenderer(typ.clazz); + GameRegistry.registerTileEntity(typ.clazz, "IronChest." + typ.name()); } + IronChestType.registerBlocksAndRecipes(ironChestBlock); ChestChangerType.generateRecipes(); NetworkRegistry.INSTANCE.registerGuiHandler(instance, proxy); proxy.registerRenderInformation(); - MinecraftForge.EVENT_BUS.register(new OcelotsSitOnChestsHandler()); - + // FIXME: MinecraftForge.EVENT_BUS.register(new OcelotsSitOnChestsHandler()); MinecraftForge.EVENT_BUS.register(IronChestEventHandler.INSTANCE); } } diff --git a/src/main/java/cpw/mods/ironchest/IronChestType.java b/src/main/java/cpw/mods/ironchest/IronChestType.java index cd844b0a..5aacd11a 100755 --- a/src/main/java/cpw/mods/ironchest/IronChestType.java +++ b/src/main/java/cpw/mods/ironchest/IronChestType.java @@ -4,15 +4,15 @@ * 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 + * cpw - initial API and implementation ******************************************************************************/ package cpw.mods.ironchest; -import java.util.ArrayList; import java.util.Arrays; -import java.util.List; +import java.util.Collection; +import java.util.Collections; import net.minecraft.init.Blocks; import net.minecraft.inventory.IInventory; @@ -21,94 +21,77 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagByte; import net.minecraft.util.IStringSerializable; +import net.minecraft.util.ResourceLocation; import net.minecraftforge.fml.common.registry.GameRegistry; import net.minecraftforge.oredict.ShapedOreRecipe; public enum IronChestType implements IStringSerializable { //@formatter:off - IRON(54, 9, true, "Iron Chest", "ironchest.png", 0, Arrays.asList("ingotIron", "ingotRefinedIron"), TileEntityIronChest.class, "mmmmPmmmm", "mGmG3GmGm"), - GOLD(81, 9, true, "Gold Chest", "goldchest.png", 1, Arrays.asList("ingotGold"), TileEntityGoldChest.class, "mmmmPmmmm", "mGmG4GmGm"), - DIAMOND(108, 12, true, "Diamond Chest", "diamondchest.png", 2, Arrays.asList("gemDiamond"), TileEntityDiamondChest.class, "GGGmPmGGG", "GGGG4Gmmm"), - COPPER(45, 9, false, "Copper Chest", "copperchest.png", 3, Arrays.asList("ingotCopper"), TileEntityCopperChest.class, "mmmmCmmmm"), - SILVER(72, 9, false, "Silver Chest", "silverchest.png", 4, Arrays.asList("ingotSilver"), TileEntitySilverChest.class, "mmmm3mmmm", "mGmG0GmGm"), - CRYSTAL(108, 12, true, "Crystal Chest", "crystalchest.png", 5, Arrays.asList("blockGlass"), TileEntityCrystalChest.class, "GGGGPGGGG"), - OBSIDIAN(108, 12, false, "Obsidian Chest", "obsidianchest.png", 6, Arrays.asList("obsidian"), TileEntityObsidianChest.class, "mmmm2mmmm"), - DIRTCHEST9000(1, 1, false, "Dirt Chest 9000", "dirtchest.png", 7, Arrays.asList("dirt"), TileEntityDirtChest.class, Item.getItemFromBlock(Blocks.DIRT), "mmmmCmmmm"), - WOOD(0, 0, false, "", "", -1, Arrays.asList("plankWood"), null); + IRON(54, 9, true, "ironchest.png", Arrays.asList("ingotIron", "ingotRefinedIron"), TileEntityIronChest.class, "mmmmPmmmm", "mGmG3GmGm"), + GOLD(81, 9, true, "goldchest.png", Collections.singleton("ingotGold"), TileEntityGoldChest.class, "mmmmPmmmm", "mGmG4GmGm"), + DIAMOND(108, 12, true, "diamondchest.png", Collections.singleton("gemDiamond"), TileEntityDiamondChest.class, "GGGmPmGGG", "GGGG4Gmmm"), + COPPER(45, 9, false, "copperchest.png", Collections.singleton("ingotCopper"), TileEntityCopperChest.class, "mmmmCmmmm"), + SILVER(72, 9, false, "silverchest.png", Collections.singleton("ingotSilver"), TileEntitySilverChest.class, "mmmm3mmmm", "mGmG0GmGm"), + CRYSTAL(108, 12, true, "crystalchest.png", Collections.singleton("blockGlass"), TileEntityCrystalChest.class, "GGGGPGGGG"), + OBSIDIAN(108, 12, false, "obsidianchest.png", Collections.singleton("obsidian"), TileEntityObsidianChest.class, "mmmm2mmmm"), + DIRTCHEST9000(1, 1, false, "dirtchest.png", Collections.singleton("dirt"), TileEntityDirtChest.class, "mmmmCmmmm"), + WOOD(0, 0, false, "", Collections.singleton("plankWood"), null); //@formatter:on - int size; - private int rowLength; - public String friendlyName; - private boolean tieredChest; - private String modelTexture; - private int textureRow; - public Class clazz; - private String[] recipes; - private ArrayList matList; - private Item itemFilter; - - IronChestType(int size, int rowLength, boolean tieredChest, String friendlyName, String modelTexture, int textureRow, List mats, - Class clazz, String... recipes) - { - this(size, rowLength, tieredChest, friendlyName, modelTexture, textureRow, mats, clazz, (Item) null, recipes); - } - IronChestType(int size, int rowLength, boolean tieredChest, String friendlyName, String modelTexture, int textureRow, List mats, - Class clazz, Item itemFilter, String... recipes) + public static final IronChestType VALUES[] = values(); + + public final String name; + public final int size; + public final int rowLength; + public final boolean tieredChest; + public final ResourceLocation modelTexture; + private String breakTexture; + public final Class clazz; + public final Collection recipes; + public final Collection matList; + + IronChestType(int size, int rowLength, boolean tieredChest, String modelTexture, Collection mats, Class clazz, + String... recipes) { + this.name = this.name().toLowerCase(); this.size = size; this.rowLength = rowLength; this.tieredChest = tieredChest; - this.friendlyName = friendlyName; - this.modelTexture = modelTexture; - this.textureRow = textureRow; + this.modelTexture = new ResourceLocation("ironchest", "textures/model/" + modelTexture); + this.matList = Collections.unmodifiableCollection(mats); this.clazz = clazz; - this.itemFilter = itemFilter; - this.recipes = recipes; - this.matList = new ArrayList(); - this.matList.addAll(mats); - } - - @Override - public String getName() - { - return this.name().toLowerCase(); - } - - public String getModelTexture() - { - return this.modelTexture; + this.recipes = Collections.unmodifiableCollection(Arrays.asList(recipes)); } - public int getTextureRow() + public String getBreakTexture() { - return this.textureRow; - } - - public static TileEntityIronChest makeEntity(int metadata) - { - // Compatibility - int chesttype = validateMeta(metadata); - if (chesttype == metadata) + if (this.breakTexture == null) { - try + switch (this) { - TileEntityIronChest te = values()[chesttype].clazz.newInstance(); - return te; + case DIRTCHEST9000: + { + this.breakTexture = "minecraft:blocks/dirt"; } - catch (InstantiationException e) + case OBSIDIAN: { - // unpossible - e.printStackTrace(); + this.breakTexture = "minecraft:blocks/obsidian"; } - catch (IllegalAccessException e) + default: { - // unpossible - e.printStackTrace(); + this.breakTexture = "ironchest:blocks/" + this.getName() + "break"; + } } } - return null; + + return this.breakTexture; + } + + @Override + public String getName() + { + return this.name; } public static void registerBlocksAndRecipes(BlockIronChest blockResult) @@ -136,15 +119,12 @@ public static void generateRecipesForType(BlockIronChest blockResult, Object pre { mainMaterial = translateOreName(mat); //@formatter:off - addRecipe(new ItemStack(blockResult, 1, type.ordinal()), recipeSplit, - 'm', mainMaterial, 'P', previousTier, /* previous tier of chest */ - 'G', "blockGlass", 'C', "chestWood", - '0', new ItemStack(blockResult, 1, 0), /* Iron Chest */ + addRecipe(new ItemStack(blockResult, 1, type.ordinal()), recipeSplit, 'm', mainMaterial, 'P', previousTier, /* previous tier of chest */ + 'G', "blockGlass", 'C', "chestWood", '0', new ItemStack(blockResult, 1, 0), /* Iron Chest */ '1', new ItemStack(blockResult, 1, 1), /* Gold Chest */ '2', new ItemStack(blockResult, 1, 2), /* Diamond Chest */ '3', new ItemStack(blockResult, 1, 3), /* Copper Chest */ - '4', new ItemStack(blockResult, 1, 4) /* Silver Chest */ - ); + '4', new ItemStack(blockResult, 1, 4) /* Silver Chest */); //@formatter:on } } @@ -174,36 +154,14 @@ public int getRowCount() return this.size / this.rowLength; } - public int getRowLength() - { - return this.rowLength; - } - public boolean isTransparent() { return this == CRYSTAL; } - public List getMatList() - { - return this.matList; - } - - public static int validateMeta(int i) - { - if (i < values().length && values()[i].size > 0) - { - return i; - } - else - { - return 0; - } - } - public boolean isValidForCreativeMode() { - return validateMeta(this.ordinal()) == this.ordinal(); + return true; } public boolean isExplosionResistant() @@ -216,9 +174,16 @@ public Slot makeSlot(IInventory chestInventory, int index, int x, int y) return new ValidatingSlot(chestInventory, index, x, y, this); } + private static final Item DIRT_ITEM = Item.getItemFromBlock(Blocks.DIRT); + public boolean acceptsStack(ItemStack itemstack) { - return this.itemFilter == null || itemstack == null || itemstack.getItem() == this.itemFilter; + if (this == DIRTCHEST9000) + { + return itemstack == null || itemstack.getItem() == DIRT_ITEM; + } + + return true; } public void adornItemDrop(ItemStack item) @@ -228,4 +193,29 @@ public void adornItemDrop(ItemStack item) item.setTagInfo("dirtchest", new NBTTagByte((byte) 1)); } } + + public TileEntityIronChest makeEntity() + { + switch (this) + { + case IRON: + return new TileEntityIronChest(); + case GOLD: + return new TileEntityGoldChest(); + case DIAMOND: + return new TileEntityDiamondChest(); + case COPPER: + return new TileEntityCopperChest(); + case SILVER: + return new TileEntitySilverChest(); + case CRYSTAL: + return new TileEntityCrystalChest(); + case OBSIDIAN: + return new TileEntityObsidianChest(); + case DIRTCHEST9000: + return new TileEntityDirtChest(); + default: + return null; + } + } } \ No newline at end of file diff --git a/src/main/java/cpw/mods/ironchest/ItemChestChanger.java b/src/main/java/cpw/mods/ironchest/ItemChestChanger.java index 62cd8bdb..1e14f5a8 100755 --- a/src/main/java/cpw/mods/ironchest/ItemChestChanger.java +++ b/src/main/java/cpw/mods/ironchest/ItemChestChanger.java @@ -4,9 +4,9 @@ * 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 + * cpw - initial API and implementation ******************************************************************************/ package cpw.mods.ironchest; @@ -26,12 +26,11 @@ public class ItemChestChanger extends Item { - private ChestChangerType type; + public final ChestChangerType type; public ItemChestChanger(ChestChangerType type) { this.type = type; - this.setMaxStackSize(1); this.setUnlocalizedName("ironchest:" + type.name()); this.setCreativeTab(CreativeTabs.MISC); @@ -64,14 +63,14 @@ public EnumActionResult onItemUse(ItemStack stack, EntityPlayer playerIn, World TileEntity te = worldIn.getTileEntity(pos); TileEntityIronChest newchest = new TileEntityIronChest(); ItemStack[] chestContents = new ItemStack[27]; - int chestFacing = 0; + EnumFacing chestFacing = EnumFacing.DOWN; if (te != null) { if (te instanceof TileEntityIronChest) { chestContents = ((TileEntityIronChest) te).chestContents; chestFacing = ((TileEntityIronChest) te).getFacing(); - newchest = IronChestType.makeEntity(this.getTargetChestOrdinal(this.type.ordinal())); + newchest = this.type.getTarget().makeEntity(); if (newchest == null) { return EnumActionResult.PASS; @@ -80,37 +79,23 @@ public EnumActionResult onItemUse(ItemStack stack, EntityPlayer playerIn, World else if (te instanceof TileEntityChest) { IBlockState chestState = worldIn.getBlockState(pos); - EnumFacing orientation = chestState.getValue(BlockChest.FACING); - if (orientation == EnumFacing.NORTH) - { - chestFacing = 2; - } - if (orientation == EnumFacing.EAST) - { - chestFacing = 5; - } - if (orientation == EnumFacing.SOUTH) - { - chestFacing = 3; - } - if (orientation == EnumFacing.WEST) - { - chestFacing = 4; - } - if (((TileEntityChest) te).numPlayersUsing > 0) + chestFacing = chestState.getValue(BlockChest.FACING); + TileEntityChest chest = (TileEntityChest) te; + + if (chest.numPlayersUsing > 0) { return EnumActionResult.PASS; } - if (!this.getType().canUpgrade(IronChestType.WOOD)) + if (!this.type.canUpgrade(IronChestType.WOOD)) { return EnumActionResult.PASS; } - chestContents = new ItemStack[((TileEntityChest) te).getSizeInventory()]; + chestContents = new ItemStack[chest.getSizeInventory()]; for (int i = 0; i < chestContents.length; i++) { - chestContents[i] = ((TileEntityChest) te).getStackInSlot(i); + chestContents[i] = chest.getStackInSlot(i); } - newchest = IronChestType.makeEntity(this.getTargetChestOrdinal(this.type.ordinal())); + newchest = this.type.getTarget().makeEntity(); } } @@ -134,20 +119,10 @@ else if (te instanceof TileEntityChest) if (te2 instanceof TileEntityIronChest) { ((TileEntityIronChest) te2).setContents(chestContents); - ((TileEntityIronChest) te2).setFacing((byte) chestFacing); + ((TileEntityIronChest) te2).setFacing(chestFacing); } stack.stackSize = playerIn.capabilities.isCreativeMode ? stack.stackSize : stack.stackSize - 1; return EnumActionResult.SUCCESS; } - - public int getTargetChestOrdinal(int sourceOrdinal) - { - return this.type.getTarget(); - } - - public ChestChangerType getType() - { - return this.type; - } } diff --git a/src/main/java/cpw/mods/ironchest/ItemIronChest.java b/src/main/java/cpw/mods/ironchest/ItemIronChest.java index 294501db..f86e9b84 100755 --- a/src/main/java/cpw/mods/ironchest/ItemIronChest.java +++ b/src/main/java/cpw/mods/ironchest/ItemIronChest.java @@ -4,21 +4,23 @@ * 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 + * cpw - initial API and implementation ******************************************************************************/ package cpw.mods.ironchest; import net.minecraft.block.Block; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; public class ItemIronChest extends ItemBlock { public ItemIronChest(Block block) { super(block); + this.setRegistryName(new ResourceLocation(IronChest.MOD_ID, "BlockIronChest")); this.setMaxDamage(0); this.setHasSubtypes(true); @@ -27,12 +29,12 @@ public ItemIronChest(Block block) @Override public int getMetadata(int meta) { - return IronChestType.validateMeta(meta); + return meta; } @Override public String getUnlocalizedName(ItemStack itemstack) { - return "tile.ironchest:" + IronChestType.values()[itemstack.getMetadata()].name(); + return "tile.ironchest:" + IronChestType.VALUES[itemstack.getMetadata()].getName(); } } diff --git a/src/main/java/cpw/mods/ironchest/OcelotsSitOnChestsHandler.java b/src/main/java/cpw/mods/ironchest/OcelotsSitOnChestsHandler.java index 31ee052f..d57331a8 100755 --- a/src/main/java/cpw/mods/ironchest/OcelotsSitOnChestsHandler.java +++ b/src/main/java/cpw/mods/ironchest/OcelotsSitOnChestsHandler.java @@ -6,7 +6,6 @@ public class OcelotsSitOnChestsHandler { - @SubscribeEvent public void changeSittingTaskForOcelots(LivingEvent.LivingUpdateEvent evt) { diff --git a/src/main/java/cpw/mods/ironchest/TileEntityCopperChest.java b/src/main/java/cpw/mods/ironchest/TileEntityCopperChest.java index d54f6a40..f3929efc 100755 --- a/src/main/java/cpw/mods/ironchest/TileEntityCopperChest.java +++ b/src/main/java/cpw/mods/ironchest/TileEntityCopperChest.java @@ -4,9 +4,9 @@ * 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 + * cpw - initial API and implementation ******************************************************************************/ package cpw.mods.ironchest; @@ -16,5 +16,4 @@ public TileEntityCopperChest() { super(IronChestType.COPPER); } - -} +} \ No newline at end of file diff --git a/src/main/java/cpw/mods/ironchest/TileEntityCrystalChest.java b/src/main/java/cpw/mods/ironchest/TileEntityCrystalChest.java index 5b9625ed..6a652622 100755 --- a/src/main/java/cpw/mods/ironchest/TileEntityCrystalChest.java +++ b/src/main/java/cpw/mods/ironchest/TileEntityCrystalChest.java @@ -4,9 +4,9 @@ * 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 + * cpw - initial API and implementation ******************************************************************************/ package cpw.mods.ironchest; @@ -16,4 +16,4 @@ public TileEntityCrystalChest() { super(IronChestType.CRYSTAL); } -} +} \ No newline at end of file diff --git a/src/main/java/cpw/mods/ironchest/TileEntityDiamondChest.java b/src/main/java/cpw/mods/ironchest/TileEntityDiamondChest.java index 70608253..f81ab571 100755 --- a/src/main/java/cpw/mods/ironchest/TileEntityDiamondChest.java +++ b/src/main/java/cpw/mods/ironchest/TileEntityDiamondChest.java @@ -4,9 +4,9 @@ * 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 + * cpw - initial API and implementation ******************************************************************************/ package cpw.mods.ironchest; @@ -16,4 +16,4 @@ public TileEntityDiamondChest() { super(IronChestType.DIAMOND); } -} +} \ No newline at end of file diff --git a/src/main/java/cpw/mods/ironchest/TileEntityDirtChest.java b/src/main/java/cpw/mods/ironchest/TileEntityDirtChest.java index 15489c9f..d70d4f65 100755 --- a/src/main/java/cpw/mods/ironchest/TileEntityDirtChest.java +++ b/src/main/java/cpw/mods/ironchest/TileEntityDirtChest.java @@ -46,4 +46,4 @@ public void removeAdornments() this.chestContents[0] = null; } } -} +} \ No newline at end of file diff --git a/src/main/java/cpw/mods/ironchest/TileEntityGoldChest.java b/src/main/java/cpw/mods/ironchest/TileEntityGoldChest.java index 01eda3d2..2c36323c 100755 --- a/src/main/java/cpw/mods/ironchest/TileEntityGoldChest.java +++ b/src/main/java/cpw/mods/ironchest/TileEntityGoldChest.java @@ -4,9 +4,9 @@ * 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 + * cpw - initial API and implementation ******************************************************************************/ package cpw.mods.ironchest; diff --git a/src/main/java/cpw/mods/ironchest/TileEntityIronChest.java b/src/main/java/cpw/mods/ironchest/TileEntityIronChest.java index e5903bc0..73636f7f 100755 --- a/src/main/java/cpw/mods/ironchest/TileEntityIronChest.java +++ b/src/main/java/cpw/mods/ironchest/TileEntityIronChest.java @@ -4,9 +4,9 @@ * 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 + * cpw - initial API and implementation ******************************************************************************/ package cpw.mods.ironchest; @@ -40,10 +40,9 @@ public class TileEntityIronChest extends TileEntityLockable implements ITickable public float prevLidAngle; public float lidAngle; private int numUsingPlayers; - private IronChestType type; public ItemStack[] chestContents; private ItemStack[] topStacks; - private byte facing; + private EnumFacing facing; private boolean inventoryTouched; private boolean hadStuff; private String customName; @@ -56,19 +55,14 @@ public TileEntityIronChest() protected TileEntityIronChest(IronChestType type) { super(); - this.type = type; - this.chestContents = new ItemStack[this.getSizeInventory()]; + this.chestContents = new ItemStack[type.size]; this.topStacks = new ItemStack[8]; - } - - public ItemStack[] getContents() - { - return this.chestContents; + this.facing = EnumFacing.NORTH; } public void setContents(ItemStack[] contents) { - this.chestContents = new ItemStack[this.getSizeInventory()]; + this.chestContents = new ItemStack[this.getType().size]; for (int i = 0; i < contents.length; i++) { if (i < this.chestContents.length) @@ -82,17 +76,17 @@ public void setContents(ItemStack[] contents) @Override public int getSizeInventory() { - return this.type.size; + return this.chestContents.length; } - public int getFacing() + public EnumFacing getFacing() { return this.facing; } public IronChestType getType() { - return this.type; + return this.hasWorldObj() ? this.worldObj.getBlockState(this.pos).getValue(BlockIronChest.VARIANT_PROP) : IronChestType.WOOD; } @Override @@ -111,7 +105,7 @@ public void markDirty() protected void sortTopStacks() { - if (!this.type.isTransparent() || (this.worldObj != null && this.worldObj.isRemote)) + if (!this.getType().isTransparent() || (this.worldObj != null && this.worldObj.isRemote)) { return; } @@ -230,7 +224,7 @@ public void setInventorySlotContents(int i, ItemStack itemstack) @Override public String getName() { - return this.hasCustomName() ? this.customName : this.type.name(); + return this.hasCustomName() ? this.customName : this.getType().name(); } @Override @@ -266,7 +260,7 @@ public void readFromNBT(NBTTagCompound nbttagcompound) this.chestContents[j] = ItemStack.loadItemStackFromNBT(nbttagcompound1); } } - this.facing = nbttagcompound.getByte("facing"); + this.facing = EnumFacing.VALUES[nbttagcompound.getByte("facing")]; this.sortTopStacks(); } @@ -287,7 +281,7 @@ public void writeToNBT(NBTTagCompound nbttagcompound) } nbttagcompound.setTag("Items", nbttaglist); - nbttagcompound.setByte("facing", this.facing); + nbttagcompound.setByte("facing", (byte) this.facing.ordinal()); if (this.hasCustomName()) { @@ -339,7 +333,7 @@ public void update() if (this.worldObj != null && !this.worldObj.isRemote && this.ticksSinceSync < 0) { - this.worldObj.addBlockEvent(this.pos, IronChest.ironChestBlock, 3, ((this.numUsingPlayers << 3) & 0xF8) | (this.facing & 0x7)); + this.worldObj.addBlockEvent(this.pos, IronChest.ironChestBlock, 3, ((this.numUsingPlayers << 3) & 0xF8) | (this.facing.ordinal() & 0x7)); } if (!this.worldObj.isRemote && this.inventoryTouched) { @@ -355,7 +349,7 @@ public void update() double d = this.pos.getX() + 0.5D; double d1 = this.pos.getZ() + 0.5D; //@formatter:off - this.worldObj.playSound((EntityPlayer) null, d, this.pos.getY() + 0.5D, d1, SoundEvents.BLOCK_CHEST_OPEN, SoundCategory.BLOCKS, 0.5F, this.worldObj.rand.nextFloat() * 0.1F + 0.9F); + this.worldObj.playSound(null, d, this.pos.getY() + 0.5D, d1, SoundEvents.BLOCK_CHEST_OPEN, SoundCategory.BLOCKS, 0.5F, this.worldObj.rand.nextFloat() * 0.1F + 0.9F); //@formatter:on } if (this.numUsingPlayers == 0 && this.lidAngle > 0.0F || this.numUsingPlayers > 0 && this.lidAngle < 1.0F) @@ -379,7 +373,7 @@ public void update() double d2 = this.pos.getX() + 0.5D; double d3 = this.pos.getZ() + 0.5D; //@formatter:off - this.worldObj.playSound((EntityPlayer) null, d2, this.pos.getY() + 0.5D, d3, SoundEvents.BLOCK_CHEST_CLOSE, SoundCategory.BLOCKS, 0.5F, this.worldObj.rand.nextFloat() * 0.1F + 0.9F); + this.worldObj.playSound(null, d2, this.pos.getY() + 0.5D, d3, SoundEvents.BLOCK_CHEST_CLOSE, SoundCategory.BLOCKS, 0.5F, this.worldObj.rand.nextFloat() * 0.1F + 0.9F); //@formatter:on } if (this.lidAngle < 0.0F) @@ -398,11 +392,11 @@ public boolean receiveClientEvent(int i, int j) } else if (i == 2) { - this.facing = (byte) j; + this.facing = EnumFacing.VALUES[j]; } else if (i == 3) { - this.facing = (byte) (j & 0x7); + this.facing = EnumFacing.VALUES[j & 0x7]; this.numUsingPlayers = (j & 0xF8) >> 3; } return true; @@ -430,7 +424,7 @@ public void closeInventory(EntityPlayer player) this.worldObj.addBlockEvent(this.pos, IronChest.ironChestBlock, 1, this.numUsingPlayers); } - public void setFacing(byte facing2) + public void setFacing(EnumFacing facing2) { this.facing = facing2; } @@ -440,26 +434,12 @@ public ItemStack[] getTopItemStacks() return this.topStacks; } - public TileEntityIronChest updateFromMetadata(int l) - { - if (this.worldObj != null && this.worldObj.isRemote) - { - if (l != this.type.ordinal()) - { - this.worldObj.setTileEntity(this.pos, IronChestType.makeEntity(l)); - return (TileEntityIronChest) this.worldObj.getTileEntity(this.pos); - } - } - return this; - } - @Override public Packet getDescriptionPacket() { NBTTagCompound nbt = new NBTTagCompound(); - nbt.setInteger("type", this.getType().ordinal()); - nbt.setByte("facing", this.facing); + nbt.setByte("facing", (byte) this.facing.ordinal()); ItemStack[] stacks = this.buildItemStackDataList(); if (stacks != null) { @@ -486,8 +466,7 @@ public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt) if (pkt.getTileEntityType() == 0) { NBTTagCompound nbt = pkt.getNbtCompound(); - this.type = IronChestType.values()[nbt.getInteger("type")]; - this.facing = nbt.getByte("facing"); + this.facing = EnumFacing.VALUES[nbt.getByte("facing")]; NBTTagList tagList = nbt.getTagList("stacks", Constants.NBT.TAG_COMPOUND); ItemStack[] stacks = new ItemStack[this.topStacks.length]; @@ -502,7 +481,7 @@ public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt) } } - if (this.type.isTransparent() && stacks != null) + if (this.getType().isTransparent() && stacks != null) { int pos = 0; for (int i = 0; i < this.topStacks.length; i++) @@ -523,7 +502,7 @@ public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt) public ItemStack[] buildItemStackDataList() { - if (this.type.isTransparent()) + if (this.getType().isTransparent()) { ItemStack[] sortList = new ItemStack[this.topStacks.length]; int pos = 0; @@ -561,18 +540,13 @@ public ItemStack removeStackFromSlot(int par1) @Override public boolean isItemValidForSlot(int i, ItemStack itemstack) { - return this.type.acceptsStack(itemstack); + return this.getType().acceptsStack(itemstack); } public void rotateAround() { - this.facing++; - if (this.facing > EnumFacing.EAST.ordinal()) - { - this.facing = (byte) EnumFacing.NORTH.ordinal(); - } - this.setFacing(this.facing); - this.worldObj.addBlockEvent(this.pos, IronChest.ironChestBlock, 2, this.facing); + this.setFacing(this.facing.rotateY()); + this.worldObj.addBlockEvent(this.pos, IronChest.ironChestBlock, 2, this.facing.ordinal()); } public void wasPlaced(EntityLivingBase entityliving, ItemStack itemStack) @@ -618,7 +592,7 @@ public Container createContainer(InventoryPlayer playerInventory, EntityPlayer p @Override public String getGuiID() { - return "IronChest:" + this.type.name(); + return "IronChest:" + this.getType().name(); } @Override diff --git a/src/main/java/cpw/mods/ironchest/TileEntitySilverChest.java b/src/main/java/cpw/mods/ironchest/TileEntitySilverChest.java index c0702a1b..17691862 100755 --- a/src/main/java/cpw/mods/ironchest/TileEntitySilverChest.java +++ b/src/main/java/cpw/mods/ironchest/TileEntitySilverChest.java @@ -4,9 +4,9 @@ * 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 + * cpw - initial API and implementation ******************************************************************************/ package cpw.mods.ironchest; diff --git a/src/main/java/cpw/mods/ironchest/Version.java b/src/main/java/cpw/mods/ironchest/Version.java deleted file mode 100755 index fc623a73..00000000 --- a/src/main/java/cpw/mods/ironchest/Version.java +++ /dev/null @@ -1,36 +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 cpw.mods.ironchest; - -import java.util.Properties; - -public class Version -{ - private static String major; - private static String minor; - private static String rev; - private static String build; - @SuppressWarnings("unused") - private static String mcversion; - - static void init(Properties properties) - { - if (properties != null) - { - major = properties.getProperty("IronChest.build.major.number"); - minor = properties.getProperty("IronChest.build.minor.number"); - rev = properties.getProperty("IronChest.build.revision.number"); - build = properties.getProperty("IronChest.build.number"); - mcversion = properties.getProperty("IronChest.build.mcversion"); - } - } - - public static String fullVersionString() - { - return String.format("%s.%s.%s build %s", major, minor, rev, build); - } -} diff --git a/src/main/java/cpw/mods/ironchest/client/ClientProxy.java b/src/main/java/cpw/mods/ironchest/client/ClientProxy.java index 67cfe2d5..46cdc79c 100755 --- a/src/main/java/cpw/mods/ironchest/client/ClientProxy.java +++ b/src/main/java/cpw/mods/ironchest/client/ClientProxy.java @@ -4,19 +4,17 @@ * 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 + * cpw - initial API and implementation ******************************************************************************/ package cpw.mods.ironchest.client; +import cpw.mods.ironchest.ChestChangerType; import cpw.mods.ironchest.CommonProxy; import cpw.mods.ironchest.IronChest; import cpw.mods.ironchest.IronChestType; import cpw.mods.ironchest.TileEntityIronChest; -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.ItemModelMesher; -import net.minecraft.client.renderer.block.model.ModelBakery; import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; @@ -24,38 +22,39 @@ import net.minecraft.util.ResourceLocation; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import net.minecraftforge.fml.client.FMLClientHandler; +import net.minecraftforge.client.model.ModelLoader; import net.minecraftforge.fml.client.registry.ClientRegistry; +import net.minecraftforge.fml.common.FMLCommonHandler; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +@SideOnly(Side.CLIENT) public class ClientProxy extends CommonProxy { @Override public void registerRenderInformation() { - Minecraft.getMinecraft().getRenderItem().getItemModelMesher().getModelManager().getBlockModelShapes().registerBuiltInBlocks(IronChest.ironChestBlock); + Item chestItem = Item.getItemFromBlock(IronChest.ironChestBlock); - ItemModelMesher mesher = Minecraft.getMinecraft().getRenderItem().getItemModelMesher(); - for (IronChestType chestType : IronChestType.values()) + for (IronChestType type : IronChestType.values()) { - if (chestType != IronChestType.WOOD) + if (type != IronChestType.WOOD) { - Item chestItem = Item.getItemFromBlock(IronChest.ironChestBlock); - mesher.register(chestItem, chestType.ordinal(), new ModelResourceLocation("ironchest:chest_" + chestType.getName().toLowerCase(), "inventory")); - ModelBakery.registerItemVariants(chestItem, new ResourceLocation("ironchest:chest_" + chestType.getName().toLowerCase())); + ModelLoader.setCustomModelResourceLocation(chestItem, type.ordinal(), + new ModelResourceLocation(new ResourceLocation(IronChest.MOD_ID, "chest_" + type.getName()), "inventory")); } - } - } - @Override - public void registerTileEntitySpecialRenderer(Class type) - { - ClientRegistry.bindTileEntitySpecialRenderer(type, new TileEntityIronChestRenderer(type)); - } + ClientRegistry.bindTileEntitySpecialRenderer(type.clazz, new TileEntityIronChestRenderer()); + } - @Override - public World getClientWorld() - { - return FMLClientHandler.instance().getClient().theWorld; + for (ChestChangerType type : ChestChangerType.VALUES) + { + if (FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT) + { + ModelLoader.setCustomModelResourceLocation(type.item, 0, + new ModelResourceLocation(new ResourceLocation(IronChest.MOD_ID, type.itemName), "inventory")); + } + } } @Override diff --git a/src/main/java/cpw/mods/ironchest/client/GUIChest.java b/src/main/java/cpw/mods/ironchest/client/GUIChest.java index 1371aa3f..ae8f205a 100755 --- a/src/main/java/cpw/mods/ironchest/client/GUIChest.java +++ b/src/main/java/cpw/mods/ironchest/client/GUIChest.java @@ -4,18 +4,17 @@ * 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 + * cpw - initial API and implementation ******************************************************************************/ package cpw.mods.ironchest.client; -import org.lwjgl.opengl.GL11; - import cpw.mods.ironchest.ContainerIronChest; import cpw.mods.ironchest.IronChestType; import cpw.mods.ironchest.TileEntityIronChest; import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.GlStateManager; import net.minecraft.inventory.Container; import net.minecraft.inventory.IInventory; import net.minecraft.util.ResourceLocation; @@ -24,15 +23,17 @@ public class GUIChest extends GuiContainer { public enum ResourceList { - IRON(new ResourceLocation("ironchest", "textures/gui/ironcontainer.png")), COPPER( - new ResourceLocation("ironchest", "textures/gui/coppercontainer.png")), SILVER( - new ResourceLocation("ironchest", "textures/gui/silvercontainer.png")), GOLD( - new ResourceLocation("ironchest", "textures/gui/goldcontainer.png")), DIAMOND( - new ResourceLocation("ironchest", "textures/gui/diamondcontainer.png")), DIRT( - new ResourceLocation("ironchest", "textures/gui/dirtcontainer.png")); + //@formatter:off + IRON(new ResourceLocation("ironchest", "textures/gui/ironcontainer.png")), + COPPER(new ResourceLocation("ironchest", "textures/gui/coppercontainer.png")), + SILVER(new ResourceLocation("ironchest", "textures/gui/silvercontainer.png")), + GOLD(new ResourceLocation("ironchest", "textures/gui/goldcontainer.png")), + DIAMOND(new ResourceLocation("ironchest", "textures/gui/diamondcontainer.png")), + DIRT(new ResourceLocation("ironchest", "textures/gui/dirtcontainer.png")); + //@formatter:on public final ResourceLocation location; - private ResourceList(ResourceLocation loc) + ResourceList(ResourceLocation loc) { this.location = loc; } @@ -40,23 +41,28 @@ private ResourceList(ResourceLocation loc) public enum GUI { - IRON(184, 202, ResourceList.IRON, IronChestType.IRON), GOLD(184, 256, ResourceList.GOLD, IronChestType.GOLD), DIAMOND(238, 256, ResourceList.DIAMOND, - IronChestType.DIAMOND), COPPER(184, 184, ResourceList.COPPER, IronChestType.COPPER), SILVER(184, 238, ResourceList.SILVER, - IronChestType.SILVER), CRYSTAL(238, 256, ResourceList.DIAMOND, IronChestType.CRYSTAL), OBSIDIAN(238, 256, ResourceList.DIAMOND, - IronChestType.OBSIDIAN), DIRTCHEST9000(184, 184, ResourceList.DIRT, IronChestType.DIRTCHEST9000); + //@formatter:off + IRON(184, 202, ResourceList.IRON, IronChestType.IRON), + GOLD(184, 256, ResourceList.GOLD, IronChestType.GOLD), + DIAMOND(238, 256, ResourceList.DIAMOND, IronChestType.DIAMOND), + COPPER(184, 184, ResourceList.COPPER, IronChestType.COPPER), + SILVER(184, 238, ResourceList.SILVER, IronChestType.SILVER), + CRYSTAL(238, 256, ResourceList.DIAMOND, IronChestType.CRYSTAL), + OBSIDIAN(238, 256, ResourceList.DIAMOND,IronChestType.OBSIDIAN), + DIRTCHEST9000(184, 184, ResourceList.DIRT, IronChestType.DIRTCHEST9000); + //@formatter:on private int xSize; private int ySize; private ResourceList guiResourceList; private IronChestType mainType; - private GUI(int xSize, int ySize, ResourceList guiResourceList, IronChestType mainType) + GUI(int xSize, int ySize, ResourceList guiResourceList, IronChestType mainType) { this.xSize = xSize; this.ySize = ySize; this.guiResourceList = guiResourceList; this.mainType = mainType; - } protected Container makeContainer(IInventory player, IInventory chest) @@ -70,11 +76,6 @@ public static GUIChest buildGUI(IronChestType type, IInventory playerInventory, } } - public int getRowLength() - { - return this.type.mainType.getRowLength(); - } - private GUI type; private GUIChest(GUI type, IInventory player, IInventory chest) @@ -89,7 +90,7 @@ private GUIChest(GUI type, IInventory player, IInventory chest) @Override protected void drawGuiContainerBackgroundLayer(float f, int i, int j) { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); // new "bind tex" this.mc.getTextureManager().bindTexture(this.type.guiResourceList.location); int x = (this.width - this.xSize) / 2; diff --git a/src/main/java/cpw/mods/ironchest/client/IronChestEventHandler.java b/src/main/java/cpw/mods/ironchest/client/IronChestEventHandler.java index f6f8d374..d94910c4 100644 --- a/src/main/java/cpw/mods/ironchest/client/IronChestEventHandler.java +++ b/src/main/java/cpw/mods/ironchest/client/IronChestEventHandler.java @@ -1,11 +1,12 @@ package cpw.mods.ironchest.client; +import cpw.mods.ironchest.IronChestType; import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.event.TextureStitchEvent; import net.minecraftforge.fml.client.FMLClientHandler; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; -import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; public class IronChestEventHandler { @@ -17,12 +18,10 @@ public void onPreTextureStiching(TextureStitchEvent.Pre event) { if (event.getMap() == FMLClientHandler.instance().getClient().getTextureMapBlocks()) { - event.getMap().registerSprite(new ResourceLocation("ironchest:blocks/copperbreak")); - event.getMap().registerSprite(new ResourceLocation("ironchest:blocks/crystalbreak")); - event.getMap().registerSprite(new ResourceLocation("ironchest:blocks/diamondbreak")); - event.getMap().registerSprite(new ResourceLocation("ironchest:blocks/goldbreak")); - event.getMap().registerSprite(new ResourceLocation("ironchest:blocks/ironbreak")); - event.getMap().registerSprite(new ResourceLocation("ironchest:blocks/silverbreak")); + for (IronChestType t : IronChestType.VALUES) + { + event.getMap().registerSprite(new ResourceLocation(t.getBreakTexture())); + } } } } diff --git a/src/main/java/cpw/mods/ironchest/client/IronChestTextureHandler.java b/src/main/java/cpw/mods/ironchest/client/IronChestTextureHandler.java index bb11053e..f6d7016b 100644 --- a/src/main/java/cpw/mods/ironchest/client/IronChestTextureHandler.java +++ b/src/main/java/cpw/mods/ironchest/client/IronChestTextureHandler.java @@ -1,11 +1,8 @@ package cpw.mods.ironchest.client; -import java.util.Map; import java.util.Random; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableMap.Builder; - +import cpw.mods.ironchest.BlockIronChest; import cpw.mods.ironchest.IronChestType; import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; @@ -15,37 +12,19 @@ import net.minecraft.util.EnumBlockRenderType; import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumParticleTypes; -import net.minecraft.util.ResourceLocation; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; public class IronChestTextureHandler { - private static Map locations; - - static - { - Builder builder = ImmutableMap. builder(); - for (IronChestType typ : IronChestType.values()) - { - if (typ != IronChestType.DIRTCHEST9000 && typ != IronChestType.OBSIDIAN) - builder.put(typ, new ResourceLocation("ironchest", "blocks/" + typ.getModelTexture().replace("chest", "break").replace(".png", ""))); - else if (typ == IronChestType.DIRTCHEST9000) - builder.put(typ, new ResourceLocation("minecraft", "blocks/dirt")); - else if (typ == IronChestType.OBSIDIAN) - builder.put(typ, new ResourceLocation("minecraft", "blocks/obsidian")); - } - locations = builder.build(); - } - public static void addHitEffects(World world, BlockPos pos, EnumFacing side) { IBlockState state = world.getBlockState(pos); Block block = state.getBlock(); state = block.getActualState(state, world, pos); Random rand = new Random(); - IronChestType type = IronChestType.values()[IronChestType.validateMeta(block.getMetaFromState(state))]; + IronChestType type = state.getValue(BlockIronChest.VARIANT_PROP); ModelManager modelmanager = Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelManager(); if (block.getRenderType(state) != EnumBlockRenderType.INVISIBLE) @@ -96,13 +75,7 @@ public static void addHitEffects(World world, BlockPos pos, EnumFacing side) fx.setBlockPos(pos); fx.multiplyVelocity(0.2F); fx.multipleParticleScaleBy(0.6F); - - if (type != IronChestType.DIRTCHEST9000 && type != IronChestType.OBSIDIAN) - fx.setParticleTexture(modelmanager.getTextureMap().getAtlasSprite("ironchest:" + locations.get(type).getResourcePath())); - else if (type == IronChestType.DIRTCHEST9000) - fx.setParticleTexture(modelmanager.getTextureMap().getAtlasSprite("minecraft:" + locations.get(type).getResourcePath())); - else if (type == IronChestType.OBSIDIAN) - fx.setParticleTexture(modelmanager.getTextureMap().getAtlasSprite("minecraft:" + locations.get(type).getResourcePath())); + fx.setParticleTexture(modelmanager.getTextureMap().getAtlasSprite(type.getBreakTexture())); } } @@ -110,7 +83,7 @@ public static void addDestroyEffects(World world, BlockPos pos, IBlockState stat { state = state.getBlock().getActualState(state, world, pos); int i = 4; - IronChestType type = IronChestType.values()[IronChestType.validateMeta(state.getBlock().getMetaFromState(state))]; + IronChestType type = state.getValue(BlockIronChest.VARIANT_PROP); ModelManager modelmanager = Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelManager(); for (int j = 0; j < i; ++j) @@ -126,12 +99,7 @@ public static void addDestroyEffects(World world, BlockPos pos, IBlockState stat EnumParticleTypes.BLOCK_CRACK.getParticleID(), d0, d1, d2, d0 - pos.getX() - 0.5D, d1 - pos.getY() - 0.5D, d2 - pos.getZ() - 0.5D, Block.getIdFromBlock(state.getBlock()))); fx.setBlockPos(pos); - if (type != IronChestType.DIRTCHEST9000 && type != IronChestType.OBSIDIAN) - fx.setParticleTexture(modelmanager.getTextureMap().getAtlasSprite("ironchest:" + locations.get(type).getResourcePath())); - else if (type == IronChestType.DIRTCHEST9000) - fx.setParticleTexture(modelmanager.getTextureMap().getAtlasSprite("minecraft:" + locations.get(type).getResourcePath())); - else if (type == IronChestType.OBSIDIAN) - fx.setParticleTexture(modelmanager.getTextureMap().getAtlasSprite("minecraft:" + locations.get(type).getResourcePath())); + fx.setParticleTexture(modelmanager.getTextureMap().getAtlasSprite(type.getBreakTexture())); } } } diff --git a/src/main/java/cpw/mods/ironchest/client/ModelHelper.java b/src/main/java/cpw/mods/ironchest/client/ModelHelper.java deleted file mode 100644 index 645208b3..00000000 --- a/src/main/java/cpw/mods/ironchest/client/ModelHelper.java +++ /dev/null @@ -1,44 +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 cpw.mods.ironchest.client; - -import net.minecraft.block.Block; -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.ItemModelMesher; -import net.minecraft.client.renderer.block.model.ModelResourceLocation; -import net.minecraft.item.Item; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class ModelHelper -{ - public static void registerItem(Item item, int metadata, String itemName) - { - ItemModelMesher mesher = Minecraft.getMinecraft().getRenderItem().getItemModelMesher(); - mesher.register(item, metadata, new ModelResourceLocation(itemName, "inventory")); - } - - public static void registerBlock(Block block, int metadata, String blockName) - { - registerItem(Item.getItemFromBlock(block), metadata, blockName); - } - - public static void registerBlock(Block block, String blockName) - { - registerBlock(block, 0, blockName); - } - - public static void registerItem(Item item, String itemName) - { - registerItem(item, 0, itemName); - } -} diff --git a/src/main/java/cpw/mods/ironchest/client/TileEntityIronChestRenderer.java b/src/main/java/cpw/mods/ironchest/client/TileEntityIronChestRenderer.java index 551d8780..53e0378d 100755 --- a/src/main/java/cpw/mods/ironchest/client/TileEntityIronChestRenderer.java +++ b/src/main/java/cpw/mods/ironchest/client/TileEntityIronChestRenderer.java @@ -4,17 +4,14 @@ * 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 cpw.mods.ironchest.client; -import java.util.Map; import java.util.Random; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableMap.Builder; import com.google.common.primitives.SignedBytes; import cpw.mods.ironchest.BlockIronChest; @@ -29,67 +26,39 @@ import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.entity.item.EntityItem; import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; +import net.minecraft.util.EnumFacing; -public class TileEntityIronChestRenderer extends TileEntitySpecialRenderer +public class TileEntityIronChestRenderer extends TileEntitySpecialRenderer { - private static Map locations; - - static - { - Builder builder = ImmutableMap. builder(); - for (IronChestType typ : IronChestType.values()) - { - builder.put(typ, new ResourceLocation("ironchest", "textures/model/" + typ.getModelTexture())); - } - locations = builder.build(); - } - private Random random; private RenderEntityItem itemRenderer; private ModelChest model; private static float[][] shifts = { { 0.3F, 0.45F, 0.3F }, { 0.7F, 0.45F, 0.3F }, { 0.3F, 0.45F, 0.7F }, { 0.7F, 0.45F, 0.7F }, { 0.3F, 0.1F, 0.3F }, { 0.7F, 0.1F, 0.3F }, { 0.3F, 0.1F, 0.7F }, { 0.7F, 0.1F, 0.7F }, { 0.5F, 0.32F, 0.5F }, }; + private static EntityItem customitem = new EntityItem(null); + private static float halfPI = (float) (Math.PI / 2D); - public TileEntityIronChestRenderer(Class type) + public TileEntityIronChestRenderer() { this.model = new ModelChest(); this.random = new Random(); - this.itemRenderer = new RenderEntityItem(Minecraft.getMinecraft().getRenderManager(), Minecraft.getMinecraft().getRenderItem()) { - @Override - public int getModelCount(ItemStack stack) - { - return SignedBytes.saturatedCast(Math.min(stack.stackSize / 32, 15) + 1); - } - - @Override - public boolean shouldBob() - { - return false; - } - - @Override - public boolean shouldSpreadItems() - { - return false; - } - }; } - public void render(TileEntityIronChest tile, double x, double y, double z, float partialTick, int breakStage) + @Override + public void renderTileEntityAt(TileEntityIronChest tile, double x, double y, double z, float partialTick, int breakStage) { - if (tile == null) + if (tile == null || tile.isInvalid()) { return; } - int facing = 3; + + EnumFacing facing = EnumFacing.SOUTH; IronChestType type = tile.getType(); - if (tile != null && tile.hasWorldObj() && tile.getWorld().getBlockState(tile.getPos()).getBlock() == IronChest.ironChestBlock) + if (tile.hasWorldObj() && tile.getWorld().getBlockState(tile.getPos()).getBlock() == IronChest.ironChestBlock) { facing = tile.getFacing(); - type = tile.getType(); IBlockState state = tile.getWorld().getBlockState(tile.getPos()); type = state.getValue(BlockIronChest.VARIANT_PROP); } @@ -99,46 +68,59 @@ public void render(TileEntityIronChest tile, double x, double y, double z, float this.bindTexture(DESTROY_STAGES[breakStage]); GlStateManager.matrixMode(5890); GlStateManager.pushMatrix(); - GlStateManager.scale(4.0F, 4.0F, 1.0F); + GlStateManager.scale(4F, 4F, 1F); GlStateManager.translate(0.0625F, 0.0625F, 0.0625F); GlStateManager.matrixMode(5888); } else { - this.bindTexture(locations.get(type)); + this.bindTexture(type.modelTexture); } GlStateManager.pushMatrix(); if (type == IronChestType.CRYSTAL) { GlStateManager.disableCull(); } - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - GlStateManager.translate((float) x, (float) y + 1.0F, (float) z + 1.0F); - GlStateManager.scale(1.0F, -1F, -1F); + GlStateManager.color(1F, 1F, 1F, 1F); + GlStateManager.translate((float) x, (float) y + 1F, (float) z + 1F); + GlStateManager.scale(1F, -1F, -1F); GlStateManager.translate(0.5F, 0.5F, 0.5F); - int k = 0; - if (facing == 2) + + switch (facing) + { + case NORTH: { - k = 180; + GlStateManager.rotate(180F, 0F, 1F, 0F); + break; } - if (facing == 3) + case SOUTH: { - k = 0; + GlStateManager.rotate(0F, 0F, 1F, 0F); + break; } - if (facing == 4) + case WEST: { - k = 90; + GlStateManager.rotate(90F, 0F, 1F, 0F); + break; } - if (facing == 5) + case EAST: { - k = -90; + GlStateManager.rotate(270F, 0F, 1F, 0F); + break; } - GlStateManager.rotate(k, 0.0F, 1.0F, 0.0F); + } + GlStateManager.translate(-0.5F, -0.5F, -0.5F); float lidangle = tile.prevLidAngle + (tile.lidAngle - tile.prevLidAngle) * partialTick; - lidangle = 1.0F - lidangle; - lidangle = 1.0F - lidangle * lidangle * lidangle; - this.model.chestLid.rotateAngleX = -((lidangle * 3.141593F) / 2.0F); + lidangle = 1F - lidangle; + lidangle = 1F - lidangle * lidangle * lidangle; + + if (type.isTransparent()) + { + GlStateManager.scale(1F, 0.99F, 1F); + } + + this.model.chestLid.rotateAngleX = -lidangle * halfPI; // Render the chest itself this.model.renderAll(); if (breakStage >= 0) @@ -152,7 +134,7 @@ public void render(TileEntityIronChest tile, double x, double y, double z, float GlStateManager.enableCull(); } GlStateManager.popMatrix(); - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + GlStateManager.color(1F, 1F, 1F, 1F); if (type.isTransparent() && tile.getDistanceSq(this.rendererDispatcher.entityX, this.rendererDispatcher.entityY, this.rendererDispatcher.entityZ) < 128d) @@ -163,7 +145,7 @@ public void render(TileEntityIronChest tile, double x, double y, double z, float float shiftZ; int shift = 0; float blockScale = 0.70F; - float timeD = (float) (360.0 * (System.currentTimeMillis() & 0x3FFFL) / 0x3FFFL); + float timeD = (float) (360D * (System.currentTimeMillis() & 0x3FFFL) / 0x3FFFL); if (tile.getTopItemStacks()[1] == null) { shift = 8; @@ -171,8 +153,9 @@ public void render(TileEntityIronChest tile, double x, double y, double z, float } GlStateManager.pushMatrix(); GlStateManager.translate((float) x, (float) y, (float) z); - EntityItem customitem = new EntityItem(this.getWorld()); - customitem.hoverStart = 0f; + + customitem.setWorld(this.getWorld()); + customitem.hoverStart = 0F; for (ItemStack item : tile.getTopItemStacks()) { if (shift > shifts.length) @@ -190,19 +173,39 @@ public void render(TileEntityIronChest tile, double x, double y, double z, float shift++; GlStateManager.pushMatrix(); GlStateManager.translate(shiftX, shiftY, shiftZ); - GlStateManager.rotate(timeD, 0.0F, 1.0F, 0.0F); + GlStateManager.rotate(timeD, 0F, 1F, 0F); GlStateManager.scale(blockScale, blockScale, blockScale); customitem.setEntityItemStack(item); - this.itemRenderer.doRender(customitem, 0, 0, 0, 0, 0); + + if (this.itemRenderer == null) + { + this.itemRenderer = new RenderEntityItem(Minecraft.getMinecraft().getRenderManager(), Minecraft.getMinecraft().getRenderItem()) { + @Override + public int getModelCount(ItemStack stack) + { + return SignedBytes.saturatedCast(Math.min(stack.stackSize / 32, 15) + 1); + } + + @Override + public boolean shouldBob() + { + return false; + } + + @Override + public boolean shouldSpreadItems() + { + return true; + } + }; + } + + this.itemRenderer.doRender(customitem, 0D, 0D, 0D, 0F, partialTick); GlStateManager.popMatrix(); } + GlStateManager.popMatrix(); } - } - @Override - public void renderTileEntityAt(TileEntityIronChest tileentity, double x, double y, double z, float partialTick, int breakStage) - { - this.render(tileentity, x, y, z, partialTick, breakStage); } } From 96ecbabcb4f067313cbb6741970150e7a0dbaa71 Mon Sep 17 00:00:00 2001 From: LatvianModder Date: Thu, 19 May 2016 13:42:14 +0300 Subject: [PATCH 015/105] Added blockstates, fixed block particles, item localizations and item rotation --- .../cpw/mods/ironchest/BlockIronChest.java | 24 ---- .../cpw/mods/ironchest/ChestChangerType.java | 18 +-- .../cpw/mods/ironchest/ItemChestChanger.java | 6 +- .../cpw/mods/ironchest/ItemIronChest.java | 2 +- .../mods/ironchest/client/ClientProxy.java | 9 +- .../client/IronChestTextureHandler.java | 107 ------------------ .../client/TileEntityIronChestRenderer.java | 2 +- .../ironchest/blockstates/BlockIronChest.json | 59 ++++++++++ .../blockstates/ItemChestUpgrade.json | 56 +++++++++ .../chest_copper.json => block/chest.json} | 82 +++++++------- .../ironchest/models/item/chest_crystal.json | 41 ------- .../ironchest/models/item/chest_diamond.json | 41 ------- .../models/item/chest_dirtchest9000.json | 41 ------- .../ironchest/models/item/chest_gold.json | 41 ------- .../ironchest/models/item/chest_iron.json | 41 ------- .../ironchest/models/item/chest_obsidian.json | 41 ------- .../ironchest/models/item/chest_silver.json | 41 ------- .../models/item/copperIronUpgrade.json | 18 --- .../models/item/copperSilverUpgrade.json | 18 --- .../models/item/diamondCrystalUpgrade.json | 18 --- .../models/item/diamondObsidianUpgrade.json | 18 --- .../models/item/goldDiamondUpgrade.json | 18 --- .../models/item/ironGoldUpgrade.json | 18 --- .../models/item/silverGoldUpgrade.json | 18 --- .../models/item/woodCopperUpgrade.json | 18 --- .../models/item/woodIronUpgrade.json | 18 --- 26 files changed, 167 insertions(+), 647 deletions(-) delete mode 100644 src/main/java/cpw/mods/ironchest/client/IronChestTextureHandler.java create mode 100644 src/main/resources/assets/ironchest/blockstates/BlockIronChest.json create mode 100644 src/main/resources/assets/ironchest/blockstates/ItemChestUpgrade.json rename src/main/resources/assets/ironchest/models/{item/chest_copper.json => block/chest.json} (98%) mode change 100755 => 100644 delete mode 100755 src/main/resources/assets/ironchest/models/item/chest_crystal.json delete mode 100755 src/main/resources/assets/ironchest/models/item/chest_diamond.json delete mode 100755 src/main/resources/assets/ironchest/models/item/chest_dirtchest9000.json delete mode 100755 src/main/resources/assets/ironchest/models/item/chest_gold.json delete mode 100755 src/main/resources/assets/ironchest/models/item/chest_iron.json delete mode 100755 src/main/resources/assets/ironchest/models/item/chest_obsidian.json delete mode 100755 src/main/resources/assets/ironchest/models/item/chest_silver.json delete mode 100644 src/main/resources/assets/ironchest/models/item/copperIronUpgrade.json delete mode 100755 src/main/resources/assets/ironchest/models/item/copperSilverUpgrade.json delete mode 100644 src/main/resources/assets/ironchest/models/item/diamondCrystalUpgrade.json delete mode 100644 src/main/resources/assets/ironchest/models/item/diamondObsidianUpgrade.json delete mode 100755 src/main/resources/assets/ironchest/models/item/goldDiamondUpgrade.json delete mode 100755 src/main/resources/assets/ironchest/models/item/ironGoldUpgrade.json delete mode 100755 src/main/resources/assets/ironchest/models/item/silverGoldUpgrade.json delete mode 100644 src/main/resources/assets/ironchest/models/item/woodCopperUpgrade.json delete mode 100644 src/main/resources/assets/ironchest/models/item/woodIronUpgrade.json diff --git a/src/main/java/cpw/mods/ironchest/BlockIronChest.java b/src/main/java/cpw/mods/ironchest/BlockIronChest.java index 14ddc7a7..1ff40b00 100755 --- a/src/main/java/cpw/mods/ironchest/BlockIronChest.java +++ b/src/main/java/cpw/mods/ironchest/BlockIronChest.java @@ -13,13 +13,11 @@ import java.util.List; import java.util.Random; -import cpw.mods.ironchest.client.IronChestTextureHandler; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.block.properties.PropertyEnum; import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.IBlockState; -import net.minecraft.client.particle.EffectRenderer; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; @@ -37,7 +35,6 @@ import net.minecraft.util.ResourceLocation; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.RayTraceResult; import net.minecraft.world.Explosion; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; @@ -244,27 +241,6 @@ public float getExplosionResistance(World world, BlockPos pos, Entity exploder, return super.getExplosionResistance(world, pos, exploder, explosion); } - /* - * @Override public boolean addLandingEffects(IBlockState state, WorldServer world, BlockPos pos, IBlockState iblockstate, EntityLivingBase entity, int numberOfParticles) { - * IronChestTextureHandler.addDestroyEffects(world, pos, state); return true; } - */ - - @Override - @SideOnly(Side.CLIENT) - public boolean addHitEffects(IBlockState state, World worldObj, RayTraceResult target, EffectRenderer effectRenderer) - { - IronChestTextureHandler.addHitEffects(worldObj, target.getBlockPos(), target.sideHit); - return true; - } - - @Override - @SideOnly(Side.CLIENT) - public boolean addDestroyEffects(World world, BlockPos pos, EffectRenderer effectRenderer) - { - IronChestTextureHandler.addDestroyEffects(world, pos, world.getBlockState(pos)); - return true; - } - @Override public boolean hasComparatorInputOverride(IBlockState state) { diff --git a/src/main/java/cpw/mods/ironchest/ChestChangerType.java b/src/main/java/cpw/mods/ironchest/ChestChangerType.java index d24ed711..7990020d 100755 --- a/src/main/java/cpw/mods/ironchest/ChestChangerType.java +++ b/src/main/java/cpw/mods/ironchest/ChestChangerType.java @@ -35,9 +35,9 @@ public enum ChestChangerType public static final ChestChangerType[] VALUES = values(); - private IronChestType source; - private IronChestType target; - public String itemName; + public final IronChestType source; + public final IronChestType target; + public final String itemName; public ItemChestChanger item; private String[] recipe; @@ -49,21 +49,11 @@ public enum ChestChangerType this.recipe = recipe; } - public IronChestType getSource() - { - return this.source; - } - public boolean canUpgrade(IronChestType from) { return from == this.source; } - - public IronChestType getTarget() - { - return this.target; - } - + public ItemChestChanger buildItem() { this.item = new ItemChestChanger(this); diff --git a/src/main/java/cpw/mods/ironchest/ItemChestChanger.java b/src/main/java/cpw/mods/ironchest/ItemChestChanger.java index 1e14f5a8..bac35ebf 100755 --- a/src/main/java/cpw/mods/ironchest/ItemChestChanger.java +++ b/src/main/java/cpw/mods/ironchest/ItemChestChanger.java @@ -55,7 +55,7 @@ public EnumActionResult onItemUse(ItemStack stack, EntityPlayer playerIn, World else { if (worldIn.getBlockState(pos) != IronChest.ironChestBlock - .getStateFromMeta(IronChestType.valueOf(this.type.getSource().getName().toUpperCase()).ordinal())) + .getStateFromMeta(IronChestType.valueOf(this.type.source.getName().toUpperCase()).ordinal())) { return EnumActionResult.PASS; } @@ -70,7 +70,7 @@ public EnumActionResult onItemUse(ItemStack stack, EntityPlayer playerIn, World { chestContents = ((TileEntityIronChest) te).chestContents; chestFacing = ((TileEntityIronChest) te).getFacing(); - newchest = this.type.getTarget().makeEntity(); + newchest = this.type.target.makeEntity(); if (newchest == null) { return EnumActionResult.PASS; @@ -95,7 +95,7 @@ else if (te instanceof TileEntityChest) { chestContents[i] = chest.getStackInSlot(i); } - newchest = this.type.getTarget().makeEntity(); + newchest = this.type.target.makeEntity(); } } diff --git a/src/main/java/cpw/mods/ironchest/ItemIronChest.java b/src/main/java/cpw/mods/ironchest/ItemIronChest.java index f86e9b84..25a7eb3b 100755 --- a/src/main/java/cpw/mods/ironchest/ItemIronChest.java +++ b/src/main/java/cpw/mods/ironchest/ItemIronChest.java @@ -35,6 +35,6 @@ public int getMetadata(int meta) @Override public String getUnlocalizedName(ItemStack itemstack) { - return "tile.ironchest:" + IronChestType.VALUES[itemstack.getMetadata()].getName(); + return "tile.ironchest:" + IronChestType.VALUES[itemstack.getMetadata()].name(); } } diff --git a/src/main/java/cpw/mods/ironchest/client/ClientProxy.java b/src/main/java/cpw/mods/ironchest/client/ClientProxy.java index 46cdc79c..9d56e9ba 100755 --- a/src/main/java/cpw/mods/ironchest/client/ClientProxy.java +++ b/src/main/java/cpw/mods/ironchest/client/ClientProxy.java @@ -40,8 +40,7 @@ public void registerRenderInformation() { if (type != IronChestType.WOOD) { - ModelLoader.setCustomModelResourceLocation(chestItem, type.ordinal(), - new ModelResourceLocation(new ResourceLocation(IronChest.MOD_ID, "chest_" + type.getName()), "inventory")); + ModelLoader.setCustomModelResourceLocation(chestItem, type.ordinal(), new ModelResourceLocation(chestItem.getRegistryName(), "variant=" + type.getName())); } ClientRegistry.bindTileEntitySpecialRenderer(type.clazz, new TileEntityIronChestRenderer()); @@ -49,11 +48,7 @@ public void registerRenderInformation() for (ChestChangerType type : ChestChangerType.VALUES) { - if (FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT) - { - ModelLoader.setCustomModelResourceLocation(type.item, 0, - new ModelResourceLocation(new ResourceLocation(IronChest.MOD_ID, type.itemName), "inventory")); - } + ModelLoader.setCustomModelResourceLocation(type.item, 0, new ModelResourceLocation(new ResourceLocation(IronChest.MOD_ID, "ItemChestUpgrade"), "variant=" + type.itemName.toLowerCase())); } } diff --git a/src/main/java/cpw/mods/ironchest/client/IronChestTextureHandler.java b/src/main/java/cpw/mods/ironchest/client/IronChestTextureHandler.java deleted file mode 100644 index f6d7016b..00000000 --- a/src/main/java/cpw/mods/ironchest/client/IronChestTextureHandler.java +++ /dev/null @@ -1,107 +0,0 @@ -package cpw.mods.ironchest.client; - -import java.util.Random; - -import cpw.mods.ironchest.BlockIronChest; -import cpw.mods.ironchest.IronChestType; -import net.minecraft.block.Block; -import net.minecraft.block.state.IBlockState; -import net.minecraft.client.Minecraft; -import net.minecraft.client.particle.EntityDiggingFX; -import net.minecraft.client.renderer.block.model.ModelManager; -import net.minecraft.util.EnumBlockRenderType; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.EnumParticleTypes; -import net.minecraft.util.math.AxisAlignedBB; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.World; - -public class IronChestTextureHandler -{ - public static void addHitEffects(World world, BlockPos pos, EnumFacing side) - { - IBlockState state = world.getBlockState(pos); - Block block = state.getBlock(); - state = block.getActualState(state, world, pos); - Random rand = new Random(); - IronChestType type = state.getValue(BlockIronChest.VARIANT_PROP); - ModelManager modelmanager = Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelManager(); - - if (block.getRenderType(state) != EnumBlockRenderType.INVISIBLE) - { - int i = pos.getX(); - int j = pos.getY(); - int k = pos.getZ(); - float f = 0.1F; - AxisAlignedBB bb = block.getBoundingBox(state, world, pos); - - double d0 = i + rand.nextDouble() * (bb.maxX - bb.minX - f * 2.0F) + f + bb.minX; - double d1 = j + rand.nextDouble() * (bb.maxY - bb.minY - f * 2.0F) + f + bb.minY; - double d2 = k + rand.nextDouble() * (bb.maxZ - bb.minZ - f * 2.0F) + f + bb.minZ; - - if (side == EnumFacing.DOWN) - { - d1 = j + bb.minY - f; - } - - if (side == EnumFacing.UP) - { - d1 = j + bb.maxY + f; - } - - if (side == EnumFacing.NORTH) - { - d2 = k + bb.minZ - f; - } - - if (side == EnumFacing.SOUTH) - { - d2 = k + bb.maxZ + f; - } - - if (side == EnumFacing.WEST) - { - d0 = i + bb.minX - f; - } - - if (side == EnumFacing.EAST) - { - d0 = i + bb.maxX + f; - } - - EntityDiggingFX fx = ((EntityDiggingFX) Minecraft.getMinecraft().effectRenderer.spawnEffectParticle(EnumParticleTypes.BLOCK_CRACK.getParticleID(), - d0, d1, d2, 0.0D, 0.0D, 0.0D, Block.getIdFromBlock(state.getBlock()))); - - fx.setBlockPos(pos); - fx.multiplyVelocity(0.2F); - fx.multipleParticleScaleBy(0.6F); - fx.setParticleTexture(modelmanager.getTextureMap().getAtlasSprite(type.getBreakTexture())); - } - } - - public static void addDestroyEffects(World world, BlockPos pos, IBlockState state) - { - state = state.getBlock().getActualState(state, world, pos); - int i = 4; - IronChestType type = state.getValue(BlockIronChest.VARIANT_PROP); - ModelManager modelmanager = Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelManager(); - - for (int j = 0; j < i; ++j) - { - for (int k = 0; k < i; ++k) - { - for (int l = 0; l < i; ++l) - { - double d0 = pos.getX() + (j + 0.5D) / i; - double d1 = pos.getY() + (k + 0.5D) / i; - double d2 = pos.getZ() + (l + 0.5D) / i; - EntityDiggingFX fx = ((EntityDiggingFX) Minecraft.getMinecraft().effectRenderer.spawnEffectParticle( - EnumParticleTypes.BLOCK_CRACK.getParticleID(), d0, d1, d2, d0 - pos.getX() - 0.5D, d1 - pos.getY() - 0.5D, d2 - pos.getZ() - 0.5D, - Block.getIdFromBlock(state.getBlock()))); - fx.setBlockPos(pos); - fx.setParticleTexture(modelmanager.getTextureMap().getAtlasSprite(type.getBreakTexture())); - } - } - } - } -} diff --git a/src/main/java/cpw/mods/ironchest/client/TileEntityIronChestRenderer.java b/src/main/java/cpw/mods/ironchest/client/TileEntityIronChestRenderer.java index 53e0378d..3ec792a1 100755 --- a/src/main/java/cpw/mods/ironchest/client/TileEntityIronChestRenderer.java +++ b/src/main/java/cpw/mods/ironchest/client/TileEntityIronChestRenderer.java @@ -145,7 +145,7 @@ public void renderTileEntityAt(TileEntityIronChest tile, double x, double y, dou float shiftZ; int shift = 0; float blockScale = 0.70F; - float timeD = (float) (360D * (System.currentTimeMillis() & 0x3FFFL) / 0x3FFFL); + float timeD = (float) (360D * (System.currentTimeMillis() & 0x3FFFL) / 0x3FFFL) - partialTick; if (tile.getTopItemStacks()[1] == null) { shift = 8; diff --git a/src/main/resources/assets/ironchest/blockstates/BlockIronChest.json b/src/main/resources/assets/ironchest/blockstates/BlockIronChest.json new file mode 100644 index 00000000..f006699e --- /dev/null +++ b/src/main/resources/assets/ironchest/blockstates/BlockIronChest.json @@ -0,0 +1,59 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "ironchest:chest", + "transform": "forge:default-block" + }, + "variants": { + "variant": { + "iron": { + "textures": { + "particle": "ironchest:blocks/ironbreak", + "texture": "ironchest:model/ironchest" + } + }, + "gold": { + "textures": { + "particle": "ironchest:blocks/goldbreak", + "texture": "ironchest:model/goldchest" + } + }, + "diamond": { + "textures": { + "particle": "ironchest:blocks/diamondbreak", + "texture": "ironchest:model/diamondchest" + } + }, + "copper": { + "textures": { + "particle": "ironchest:blocks/copperbreak", + "texture": "ironchest:model/copperchest" + } + }, + "silver": { + "textures": { + "particle": "ironchest:blocks/silverbreak", + "texture": "ironchest:model/silverchest" + } + }, + "crystal": { + "textures": { + "particle": "ironchest:blocks/crystalbreak", + "texture": "ironchest:model/crystalchest" + } + }, + "obsidian": { + "textures": { + "particle": "minecraft:blocks/obsidian", + "texture": "ironchest:model/obsidianchest" + } + }, + "dirtchest9000": { + "textures": { + "particle": "minecraft:blocks/dirt", + "texture": "ironchest:model/dirtchest" + } + } + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/ironchest/blockstates/ItemChestUpgrade.json b/src/main/resources/assets/ironchest/blockstates/ItemChestUpgrade.json new file mode 100644 index 00000000..ad78c63c --- /dev/null +++ b/src/main/resources/assets/ironchest/blockstates/ItemChestUpgrade.json @@ -0,0 +1,56 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "builtin/generated", + "transform": "forge:default-item" + }, + "variants": { + "variant": { + "irongoldupgrade": { + "textures": { + "layer0": "ironchest:items/ironGoldUpgrade" + } + }, + "coppersilverupgrade": { + "textures": { + "layer0": "ironchest:items/copperSilverUpgrade" + } + }, + "diamondcrystalupgrade": { + "textures": { + "layer0": "ironchest:items/diamondCrystalUpgrade" + } + }, + "diamondobsidianupgrade": { + "textures": { + "layer0": "ironchest:items/diamondObsidianUpgrade" + } + }, + "golddiamondupgrade": { + "textures": { + "layer0": "ironchest:items/goldDiamondUpgrade" + } + }, + "irongoldupgrade": { + "textures": { + "layer0": "ironchest:items/ironGoldUpgrade" + } + }, + "silvergoldupgrade": { + "textures": { + "layer0": "ironchest:items/silverGoldUpgrade" + } + }, + "woodcopperupgrade": { + "textures": { + "layer0": "ironchest:items/woodCopperUpgrade" + } + }, + "woodironupgrade": { + "textures": { + "layer0": "ironchest:items/woodIronUpgrade" + } + } + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/ironchest/models/item/chest_copper.json b/src/main/resources/assets/ironchest/models/block/chest.json old mode 100755 new mode 100644 similarity index 98% rename from src/main/resources/assets/ironchest/models/item/chest_copper.json rename to src/main/resources/assets/ironchest/models/block/chest.json index 8b6638e0..eba0514b --- a/src/main/resources/assets/ironchest/models/item/chest_copper.json +++ b/src/main/resources/assets/ironchest/models/block/chest.json @@ -1,41 +1,41 @@ -{ - "parent": "block/block", - "textures": { - "texture": "ironchest:model/copperchest" - }, - "elements": [ - { "from": [ 1, 0, 1 ], - "to": [ 15, 10, 15 ], - "faces": { - "down": { "uv": [ 7, 4.75, 10.5, 8.25 ], "texture": "#texture" }, - "up": { "uv": [ 3.5, 4.75, 7, 8.25 ], "texture": "#texture" }, - "north": { "uv": [ 3.5, 8.25, 7, 10.75 ], "texture": "#texture" }, - "south": { "uv": [ 10.5, 8.25, 14, 10.75 ], "texture": "#texture" }, - "west": { "uv": [ 7, 8.25, 10.5, 10.75 ], "texture": "#texture" }, - "east": { "uv": [ 0, 8.25, 3.5, 10.75 ], "texture": "#texture" } - } - }, - { "from": [ 1, 9, 1 ], - "to": [ 15, 14, 15 ], - "faces": { - "down": { "uv": [ 7, 0, 10.5, 3.5 ], "texture": "#texture" }, - "up": { "uv": [ 3.5, 0, 7, 3.5 ], "texture": "#texture" }, - "north": { "uv": [ 3.5, 3.5, 7, 4.75 ], "texture": "#texture" }, - "south": { "uv": [ 10.5, 3.5, 14, 4.75 ], "texture": "#texture" }, - "west": { "uv": [ 7, 3.5, 10.5, 4.75 ], "texture": "#texture" }, - "east": { "uv": [ 0, 3.5, 3.5, 4.75 ], "texture": "#texture" } - } - }, - { "from": [ 7, 7, 0 ], - "to": [ 9, 11, 1 ], - "faces": { - "down": { "uv": [ 0, 0.75, 1.25, 0.5 ], "texture": "#texture" }, - "up": { "uv": [ 0, 0.25, 0.75, 0.5 ], "texture": "#texture" }, - "north": { "uv": [ 0.25, 0.25, 0.75, 1.25 ], "texture": "#texture" }, - "south": { "uv": [ 1, 0.25, 1.5, 1.25 ], "texture": "#texture" }, - "west": { "uv": [ 0.75, 0.25, 1, 1.25 ], "texture": "#texture" }, - "east": { "uv": [ 0, 0.25, 0.25, 1.25 ], "texture": "#texture" } - } - } - ] -} +{ + "parent": "block/block", + "textures": { + "texture": "ironchest:model/copperchest" + }, + "elements": [ + { "from": [ 1, 0, 1 ], + "to": [ 15, 10, 15 ], + "faces": { + "down": { "uv": [ 7, 4.75, 10.5, 8.25 ], "texture": "#texture" }, + "up": { "uv": [ 3.5, 4.75, 7, 8.25 ], "texture": "#texture" }, + "north": { "uv": [ 3.5, 8.25, 7, 10.75 ], "texture": "#texture" }, + "south": { "uv": [ 10.5, 8.25, 14, 10.75 ], "texture": "#texture" }, + "west": { "uv": [ 7, 8.25, 10.5, 10.75 ], "texture": "#texture" }, + "east": { "uv": [ 0, 8.25, 3.5, 10.75 ], "texture": "#texture" } + } + }, + { "from": [ 1, 9, 1 ], + "to": [ 15, 14, 15 ], + "faces": { + "down": { "uv": [ 7, 0, 10.5, 3.5 ], "texture": "#texture" }, + "up": { "uv": [ 3.5, 0, 7, 3.5 ], "texture": "#texture" }, + "north": { "uv": [ 3.5, 3.5, 7, 4.75 ], "texture": "#texture" }, + "south": { "uv": [ 10.5, 3.5, 14, 4.75 ], "texture": "#texture" }, + "west": { "uv": [ 7, 3.5, 10.5, 4.75 ], "texture": "#texture" }, + "east": { "uv": [ 0, 3.5, 3.5, 4.75 ], "texture": "#texture" } + } + }, + { "from": [ 7, 7, 0 ], + "to": [ 9, 11, 1 ], + "faces": { + "down": { "uv": [ 0, 0.75, 1.25, 0.5 ], "texture": "#texture" }, + "up": { "uv": [ 0, 0.25, 0.75, 0.5 ], "texture": "#texture" }, + "north": { "uv": [ 0.25, 0.25, 0.75, 1.25 ], "texture": "#texture" }, + "south": { "uv": [ 1, 0.25, 1.5, 1.25 ], "texture": "#texture" }, + "west": { "uv": [ 0.75, 0.25, 1, 1.25 ], "texture": "#texture" }, + "east": { "uv": [ 0, 0.25, 0.25, 1.25 ], "texture": "#texture" } + } + } + ] +} diff --git a/src/main/resources/assets/ironchest/models/item/chest_crystal.json b/src/main/resources/assets/ironchest/models/item/chest_crystal.json deleted file mode 100755 index 6c4ed79a..00000000 --- a/src/main/resources/assets/ironchest/models/item/chest_crystal.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "parent": "block/block", - "textures": { - "texture": "ironchest:model/crystalchest" - }, - "elements": [ - { "from": [ 1, 0, 1 ], - "to": [ 15, 10, 15 ], - "faces": { - "down": { "uv": [ 7, 4.75, 10.5, 8.25 ], "texture": "#texture" }, - "up": { "uv": [ 3.5, 4.75, 7, 8.25 ], "texture": "#texture" }, - "north": { "uv": [ 3.5, 8.25, 7, 10.75 ], "texture": "#texture" }, - "south": { "uv": [ 10.5, 8.25, 14, 10.75 ], "texture": "#texture" }, - "west": { "uv": [ 7, 8.25, 10.5, 10.75 ], "texture": "#texture" }, - "east": { "uv": [ 0, 8.25, 3.5, 10.75 ], "texture": "#texture" } - } - }, - { "from": [ 1, 9, 1 ], - "to": [ 15, 14, 15 ], - "faces": { - "down": { "uv": [ 7, 0, 10.5, 3.5 ], "texture": "#texture" }, - "up": { "uv": [ 3.5, 0, 7, 3.5 ], "texture": "#texture" }, - "north": { "uv": [ 3.5, 3.5, 7, 4.75 ], "texture": "#texture" }, - "south": { "uv": [ 10.5, 3.5, 14, 4.75 ], "texture": "#texture" }, - "west": { "uv": [ 7, 3.5, 10.5, 4.75 ], "texture": "#texture" }, - "east": { "uv": [ 0, 3.5, 3.5, 4.75 ], "texture": "#texture" } - } - }, - { "from": [ 7, 7, 0 ], - "to": [ 9, 11, 1 ], - "faces": { - "down": { "uv": [ 0, 0.75, 1.25, 0.5 ], "texture": "#texture" }, - "up": { "uv": [ 0, 0.25, 0.75, 0.5 ], "texture": "#texture" }, - "north": { "uv": [ 0.25, 0.25, 0.75, 1.25 ], "texture": "#texture" }, - "south": { "uv": [ 1, 0.25, 1.5, 1.25 ], "texture": "#texture" }, - "west": { "uv": [ 0.75, 0.25, 1, 1.25 ], "texture": "#texture" }, - "east": { "uv": [ 0, 0.25, 0.25, 1.25 ], "texture": "#texture" } - } - } - ] -} diff --git a/src/main/resources/assets/ironchest/models/item/chest_diamond.json b/src/main/resources/assets/ironchest/models/item/chest_diamond.json deleted file mode 100755 index 98b51910..00000000 --- a/src/main/resources/assets/ironchest/models/item/chest_diamond.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "parent": "block/block", - "textures": { - "texture": "ironchest:model/diamondchest" - }, - "elements": [ - { "from": [ 1, 0, 1 ], - "to": [ 15, 10, 15 ], - "faces": { - "down": { "uv": [ 7, 4.75, 10.5, 8.25 ], "texture": "#texture" }, - "up": { "uv": [ 3.5, 4.75, 7, 8.25 ], "texture": "#texture" }, - "north": { "uv": [ 3.5, 8.25, 7, 10.75 ], "texture": "#texture" }, - "south": { "uv": [ 10.5, 8.25, 14, 10.75 ], "texture": "#texture" }, - "west": { "uv": [ 7, 8.25, 10.5, 10.75 ], "texture": "#texture" }, - "east": { "uv": [ 0, 8.25, 3.5, 10.75 ], "texture": "#texture" } - } - }, - { "from": [ 1, 9, 1 ], - "to": [ 15, 14, 15 ], - "faces": { - "down": { "uv": [ 7, 0, 10.5, 3.5 ], "texture": "#texture" }, - "up": { "uv": [ 3.5, 0, 7, 3.5 ], "texture": "#texture" }, - "north": { "uv": [ 3.5, 3.5, 7, 4.75 ], "texture": "#texture" }, - "south": { "uv": [ 10.5, 3.5, 14, 4.75 ], "texture": "#texture" }, - "west": { "uv": [ 7, 3.5, 10.5, 4.75 ], "texture": "#texture" }, - "east": { "uv": [ 0, 3.5, 3.5, 4.75 ], "texture": "#texture" } - } - }, - { "from": [ 7, 7, 0 ], - "to": [ 9, 11, 1 ], - "faces": { - "down": { "uv": [ 0, 0.75, 1.25, 0.5 ], "texture": "#texture" }, - "up": { "uv": [ 0, 0.25, 0.75, 0.5 ], "texture": "#texture" }, - "north": { "uv": [ 0.25, 0.25, 0.75, 1.25 ], "texture": "#texture" }, - "south": { "uv": [ 1, 0.25, 1.5, 1.25 ], "texture": "#texture" }, - "west": { "uv": [ 0.75, 0.25, 1, 1.25 ], "texture": "#texture" }, - "east": { "uv": [ 0, 0.25, 0.25, 1.25 ], "texture": "#texture" } - } - } - ] -} diff --git a/src/main/resources/assets/ironchest/models/item/chest_dirtchest9000.json b/src/main/resources/assets/ironchest/models/item/chest_dirtchest9000.json deleted file mode 100755 index 8dd53076..00000000 --- a/src/main/resources/assets/ironchest/models/item/chest_dirtchest9000.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "parent": "block/block", - "textures": { - "texture": "ironchest:model/dirtchest" - }, - "elements": [ - { "from": [ 1, 0, 1 ], - "to": [ 15, 10, 15 ], - "faces": { - "down": { "uv": [ 7, 4.75, 10.5, 8.25 ], "texture": "#texture" }, - "up": { "uv": [ 3.5, 4.75, 7, 8.25 ], "texture": "#texture" }, - "north": { "uv": [ 3.5, 8.25, 7, 10.75 ], "texture": "#texture" }, - "south": { "uv": [ 10.5, 8.25, 14, 10.75 ], "texture": "#texture" }, - "west": { "uv": [ 7, 8.25, 10.5, 10.75 ], "texture": "#texture" }, - "east": { "uv": [ 0, 8.25, 3.5, 10.75 ], "texture": "#texture" } - } - }, - { "from": [ 1, 9, 1 ], - "to": [ 15, 14, 15 ], - "faces": { - "down": { "uv": [ 7, 0, 10.5, 3.5 ], "texture": "#texture" }, - "up": { "uv": [ 3.5, 0, 7, 3.5 ], "texture": "#texture" }, - "north": { "uv": [ 3.5, 3.5, 7, 4.75 ], "texture": "#texture" }, - "south": { "uv": [ 10.5, 3.5, 14, 4.75 ], "texture": "#texture" }, - "west": { "uv": [ 7, 3.5, 10.5, 4.75 ], "texture": "#texture" }, - "east": { "uv": [ 0, 3.5, 3.5, 4.75 ], "texture": "#texture" } - } - }, - { "from": [ 7, 7, 0 ], - "to": [ 9, 11, 1 ], - "faces": { - "down": { "uv": [ 0, 0.75, 1.25, 0.5 ], "texture": "#texture" }, - "up": { "uv": [ 0, 0.25, 0.75, 0.5 ], "texture": "#texture" }, - "north": { "uv": [ 0.25, 0.25, 0.75, 1.25 ], "texture": "#texture" }, - "south": { "uv": [ 1, 0.25, 1.5, 1.25 ], "texture": "#texture" }, - "west": { "uv": [ 0.75, 0.25, 1, 1.25 ], "texture": "#texture" }, - "east": { "uv": [ 0, 0.25, 0.25, 1.25 ], "texture": "#texture" } - } - } - ] -} diff --git a/src/main/resources/assets/ironchest/models/item/chest_gold.json b/src/main/resources/assets/ironchest/models/item/chest_gold.json deleted file mode 100755 index cd7785ed..00000000 --- a/src/main/resources/assets/ironchest/models/item/chest_gold.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "parent": "block/block", - "textures": { - "texture": "ironchest:model/goldchest" - }, - "elements": [ - { "from": [ 1, 0, 1 ], - "to": [ 15, 10, 15 ], - "faces": { - "down": { "uv": [ 7, 4.75, 10.5, 8.25 ], "texture": "#texture" }, - "up": { "uv": [ 3.5, 4.75, 7, 8.25 ], "texture": "#texture" }, - "north": { "uv": [ 3.5, 8.25, 7, 10.75 ], "texture": "#texture" }, - "south": { "uv": [ 10.5, 8.25, 14, 10.75 ], "texture": "#texture" }, - "west": { "uv": [ 7, 8.25, 10.5, 10.75 ], "texture": "#texture" }, - "east": { "uv": [ 0, 8.25, 3.5, 10.75 ], "texture": "#texture" } - } - }, - { "from": [ 1, 9, 1 ], - "to": [ 15, 14, 15 ], - "faces": { - "down": { "uv": [ 7, 0, 10.5, 3.5 ], "texture": "#texture" }, - "up": { "uv": [ 3.5, 0, 7, 3.5 ], "texture": "#texture" }, - "north": { "uv": [ 3.5, 3.5, 7, 4.75 ], "texture": "#texture" }, - "south": { "uv": [ 10.5, 3.5, 14, 4.75 ], "texture": "#texture" }, - "west": { "uv": [ 7, 3.5, 10.5, 4.75 ], "texture": "#texture" }, - "east": { "uv": [ 0, 3.5, 3.5, 4.75 ], "texture": "#texture" } - } - }, - { "from": [ 7, 7, 0 ], - "to": [ 9, 11, 1 ], - "faces": { - "down": { "uv": [ 0, 0.75, 1.25, 0.5 ], "texture": "#texture" }, - "up": { "uv": [ 0, 0.25, 0.75, 0.5 ], "texture": "#texture" }, - "north": { "uv": [ 0.25, 0.25, 0.75, 1.25 ], "texture": "#texture" }, - "south": { "uv": [ 1, 0.25, 1.5, 1.25 ], "texture": "#texture" }, - "west": { "uv": [ 0.75, 0.25, 1, 1.25 ], "texture": "#texture" }, - "east": { "uv": [ 0, 0.25, 0.25, 1.25 ], "texture": "#texture" } - } - } - ] -} diff --git a/src/main/resources/assets/ironchest/models/item/chest_iron.json b/src/main/resources/assets/ironchest/models/item/chest_iron.json deleted file mode 100755 index 1fc46888..00000000 --- a/src/main/resources/assets/ironchest/models/item/chest_iron.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "parent": "block/block", - "textures": { - "texture": "ironchest:model/ironchest" - }, - "elements": [ - { "from": [ 1, 0, 1 ], - "to": [ 15, 10, 15 ], - "faces": { - "down": { "uv": [ 7, 4.75, 10.5, 8.25 ], "texture": "#texture" }, - "up": { "uv": [ 3.5, 4.75, 7, 8.25 ], "texture": "#texture" }, - "north": { "uv": [ 3.5, 8.25, 7, 10.75 ], "texture": "#texture" }, - "south": { "uv": [ 10.5, 8.25, 14, 10.75 ], "texture": "#texture" }, - "west": { "uv": [ 7, 8.25, 10.5, 10.75 ], "texture": "#texture" }, - "east": { "uv": [ 0, 8.25, 3.5, 10.75 ], "texture": "#texture" } - } - }, - { "from": [ 1, 9, 1 ], - "to": [ 15, 14, 15 ], - "faces": { - "down": { "uv": [ 7, 0, 10.5, 3.5 ], "texture": "#texture" }, - "up": { "uv": [ 3.5, 0, 7, 3.5 ], "texture": "#texture" }, - "north": { "uv": [ 3.5, 3.5, 7, 4.75 ], "texture": "#texture" }, - "south": { "uv": [ 10.5, 3.5, 14, 4.75 ], "texture": "#texture" }, - "west": { "uv": [ 7, 3.5, 10.5, 4.75 ], "texture": "#texture" }, - "east": { "uv": [ 0, 3.5, 3.5, 4.75 ], "texture": "#texture" } - } - }, - { "from": [ 7, 7, 0 ], - "to": [ 9, 11, 1 ], - "faces": { - "down": { "uv": [ 0, 0.75, 1.25, 0.5 ], "texture": "#texture" }, - "up": { "uv": [ 0, 0.25, 0.75, 0.5 ], "texture": "#texture" }, - "north": { "uv": [ 0.25, 0.25, 0.75, 1.25 ], "texture": "#texture" }, - "south": { "uv": [ 1, 0.25, 1.5, 1.25 ], "texture": "#texture" }, - "west": { "uv": [ 0.75, 0.25, 1, 1.25 ], "texture": "#texture" }, - "east": { "uv": [ 0, 0.25, 0.25, 1.25 ], "texture": "#texture" } - } - } - ] -} diff --git a/src/main/resources/assets/ironchest/models/item/chest_obsidian.json b/src/main/resources/assets/ironchest/models/item/chest_obsidian.json deleted file mode 100755 index 17ca9915..00000000 --- a/src/main/resources/assets/ironchest/models/item/chest_obsidian.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "parent": "block/block", - "textures": { - "texture": "ironchest:model/obsidianchest" - }, - "elements": [ - { "from": [ 1, 0, 1 ], - "to": [ 15, 10, 15 ], - "faces": { - "down": { "uv": [ 7, 4.75, 10.5, 8.25 ], "texture": "#texture" }, - "up": { "uv": [ 3.5, 4.75, 7, 8.25 ], "texture": "#texture" }, - "north": { "uv": [ 3.5, 8.25, 7, 10.75 ], "texture": "#texture" }, - "south": { "uv": [ 10.5, 8.25, 14, 10.75 ], "texture": "#texture" }, - "west": { "uv": [ 7, 8.25, 10.5, 10.75 ], "texture": "#texture" }, - "east": { "uv": [ 0, 8.25, 3.5, 10.75 ], "texture": "#texture" } - } - }, - { "from": [ 1, 9, 1 ], - "to": [ 15, 14, 15 ], - "faces": { - "down": { "uv": [ 7, 0, 10.5, 3.5 ], "texture": "#texture" }, - "up": { "uv": [ 3.5, 0, 7, 3.5 ], "texture": "#texture" }, - "north": { "uv": [ 3.5, 3.5, 7, 4.75 ], "texture": "#texture" }, - "south": { "uv": [ 10.5, 3.5, 14, 4.75 ], "texture": "#texture" }, - "west": { "uv": [ 7, 3.5, 10.5, 4.75 ], "texture": "#texture" }, - "east": { "uv": [ 0, 3.5, 3.5, 4.75 ], "texture": "#texture" } - } - }, - { "from": [ 7, 7, 0 ], - "to": [ 9, 11, 1 ], - "faces": { - "down": { "uv": [ 0, 0.75, 1.25, 0.5 ], "texture": "#texture" }, - "up": { "uv": [ 0, 0.25, 0.75, 0.5 ], "texture": "#texture" }, - "north": { "uv": [ 0.25, 0.25, 0.75, 1.25 ], "texture": "#texture" }, - "south": { "uv": [ 1, 0.25, 1.5, 1.25 ], "texture": "#texture" }, - "west": { "uv": [ 0.75, 0.25, 1, 1.25 ], "texture": "#texture" }, - "east": { "uv": [ 0, 0.25, 0.25, 1.25 ], "texture": "#texture" } - } - } - ] -} diff --git a/src/main/resources/assets/ironchest/models/item/chest_silver.json b/src/main/resources/assets/ironchest/models/item/chest_silver.json deleted file mode 100755 index ea0ceab9..00000000 --- a/src/main/resources/assets/ironchest/models/item/chest_silver.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "parent": "block/block", - "textures": { - "texture": "ironchest:model/silverchest" - }, - "elements": [ - { "from": [ 1, 0, 1 ], - "to": [ 15, 10, 15 ], - "faces": { - "down": { "uv": [ 7, 4.75, 10.5, 8.25 ], "texture": "#texture" }, - "up": { "uv": [ 3.5, 4.75, 7, 8.25 ], "texture": "#texture" }, - "north": { "uv": [ 3.5, 8.25, 7, 10.75 ], "texture": "#texture" }, - "south": { "uv": [ 10.5, 8.25, 14, 10.75 ], "texture": "#texture" }, - "west": { "uv": [ 7, 8.25, 10.5, 10.75 ], "texture": "#texture" }, - "east": { "uv": [ 0, 8.25, 3.5, 10.75 ], "texture": "#texture" } - } - }, - { "from": [ 1, 9, 1 ], - "to": [ 15, 14, 15 ], - "faces": { - "down": { "uv": [ 7, 0, 10.5, 3.5 ], "texture": "#texture" }, - "up": { "uv": [ 3.5, 0, 7, 3.5 ], "texture": "#texture" }, - "north": { "uv": [ 3.5, 3.5, 7, 4.75 ], "texture": "#texture" }, - "south": { "uv": [ 10.5, 3.5, 14, 4.75 ], "texture": "#texture" }, - "west": { "uv": [ 7, 3.5, 10.5, 4.75 ], "texture": "#texture" }, - "east": { "uv": [ 0, 3.5, 3.5, 4.75 ], "texture": "#texture" } - } - }, - { "from": [ 7, 7, 0 ], - "to": [ 9, 11, 1 ], - "faces": { - "down": { "uv": [ 0, 0.75, 1.25, 0.5 ], "texture": "#texture" }, - "up": { "uv": [ 0, 0.25, 0.75, 0.5 ], "texture": "#texture" }, - "north": { "uv": [ 0.25, 0.25, 0.75, 1.25 ], "texture": "#texture" }, - "south": { "uv": [ 1, 0.25, 1.5, 1.25 ], "texture": "#texture" }, - "west": { "uv": [ 0.75, 0.25, 1, 1.25 ], "texture": "#texture" }, - "east": { "uv": [ 0, 0.25, 0.25, 1.25 ], "texture": "#texture" } - } - } - ] -} diff --git a/src/main/resources/assets/ironchest/models/item/copperIronUpgrade.json b/src/main/resources/assets/ironchest/models/item/copperIronUpgrade.json deleted file mode 100644 index 3ef545ee..00000000 --- a/src/main/resources/assets/ironchest/models/item/copperIronUpgrade.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "parent": "builtin/generated", - "textures": { - "layer0": "ironchest:items/copperIronUpgrade" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } - } -} diff --git a/src/main/resources/assets/ironchest/models/item/copperSilverUpgrade.json b/src/main/resources/assets/ironchest/models/item/copperSilverUpgrade.json deleted file mode 100755 index 01941656..00000000 --- a/src/main/resources/assets/ironchest/models/item/copperSilverUpgrade.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "parent": "builtin/generated", - "textures": { - "layer0": "ironchest:items/copperSilverUpgrade" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } - } -} diff --git a/src/main/resources/assets/ironchest/models/item/diamondCrystalUpgrade.json b/src/main/resources/assets/ironchest/models/item/diamondCrystalUpgrade.json deleted file mode 100644 index 846f6e92..00000000 --- a/src/main/resources/assets/ironchest/models/item/diamondCrystalUpgrade.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "parent": "builtin/generated", - "textures": { - "layer0": "ironchest:items/diamondCrystalUpgrade" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } - } -} diff --git a/src/main/resources/assets/ironchest/models/item/diamondObsidianUpgrade.json b/src/main/resources/assets/ironchest/models/item/diamondObsidianUpgrade.json deleted file mode 100644 index 04e94ba3..00000000 --- a/src/main/resources/assets/ironchest/models/item/diamondObsidianUpgrade.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "parent": "builtin/generated", - "textures": { - "layer0": "ironchest:items/diamondObsidianUpgrade" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } - } -} diff --git a/src/main/resources/assets/ironchest/models/item/goldDiamondUpgrade.json b/src/main/resources/assets/ironchest/models/item/goldDiamondUpgrade.json deleted file mode 100755 index 0a0e6269..00000000 --- a/src/main/resources/assets/ironchest/models/item/goldDiamondUpgrade.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "parent": "builtin/generated", - "textures": { - "layer0": "ironchest:items/goldDiamondUpgrade" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } - } -} diff --git a/src/main/resources/assets/ironchest/models/item/ironGoldUpgrade.json b/src/main/resources/assets/ironchest/models/item/ironGoldUpgrade.json deleted file mode 100755 index 4579f8a4..00000000 --- a/src/main/resources/assets/ironchest/models/item/ironGoldUpgrade.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "parent": "builtin/generated", - "textures": { - "layer0": "ironchest:items/ironGoldUpgrade" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } - } -} diff --git a/src/main/resources/assets/ironchest/models/item/silverGoldUpgrade.json b/src/main/resources/assets/ironchest/models/item/silverGoldUpgrade.json deleted file mode 100755 index 62351b24..00000000 --- a/src/main/resources/assets/ironchest/models/item/silverGoldUpgrade.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "parent": "builtin/generated", - "textures": { - "layer0": "ironchest:items/silverGoldUpgrade" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } - } -} diff --git a/src/main/resources/assets/ironchest/models/item/woodCopperUpgrade.json b/src/main/resources/assets/ironchest/models/item/woodCopperUpgrade.json deleted file mode 100644 index 51918f77..00000000 --- a/src/main/resources/assets/ironchest/models/item/woodCopperUpgrade.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "parent": "builtin/generated", - "textures": { - "layer0": "ironchest:items/woodCopperUpgrade" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } - } -} diff --git a/src/main/resources/assets/ironchest/models/item/woodIronUpgrade.json b/src/main/resources/assets/ironchest/models/item/woodIronUpgrade.json deleted file mode 100644 index 84e149dc..00000000 --- a/src/main/resources/assets/ironchest/models/item/woodIronUpgrade.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "parent": "builtin/generated", - "textures": { - "layer0": "ironchest:items/woodIronUpgrade" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } - } -} From 158ad6d3346d52288ea43a109a754ac1d2a5bb01 Mon Sep 17 00:00:00 2001 From: LatvianModder Date: Thu, 19 May 2016 13:49:36 +0300 Subject: [PATCH 016/105] Fixed missing copperIronUpgrade texture and ItemChestChanger breaking tile --- src/main/java/cpw/mods/ironchest/IronChestType.java | 2 +- src/main/java/cpw/mods/ironchest/ItemChestChanger.java | 2 +- .../assets/ironchest/blockstates/ItemChestUpgrade.json | 5 +++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/cpw/mods/ironchest/IronChestType.java b/src/main/java/cpw/mods/ironchest/IronChestType.java index 5aacd11a..1b507eca 100755 --- a/src/main/java/cpw/mods/ironchest/IronChestType.java +++ b/src/main/java/cpw/mods/ironchest/IronChestType.java @@ -161,7 +161,7 @@ public boolean isTransparent() public boolean isValidForCreativeMode() { - return true; + return this != WOOD; } public boolean isExplosionResistant() diff --git a/src/main/java/cpw/mods/ironchest/ItemChestChanger.java b/src/main/java/cpw/mods/ironchest/ItemChestChanger.java index bac35ebf..8f79c8f8 100755 --- a/src/main/java/cpw/mods/ironchest/ItemChestChanger.java +++ b/src/main/java/cpw/mods/ironchest/ItemChestChanger.java @@ -108,7 +108,7 @@ else if (te instanceof TileEntityChest) worldIn.removeTileEntity(pos); worldIn.setBlockToAir(pos); - IBlockState iblockstate = IronChest.ironChestBlock.getStateFromMeta(newchest.getType().ordinal()); + IBlockState iblockstate = IronChest.ironChestBlock.getDefaultState().withProperty(BlockIronChest.VARIANT_PROP, type.target); worldIn.setTileEntity(pos, newchest); worldIn.setBlockState(pos, iblockstate, 3); diff --git a/src/main/resources/assets/ironchest/blockstates/ItemChestUpgrade.json b/src/main/resources/assets/ironchest/blockstates/ItemChestUpgrade.json index ad78c63c..108e2ba1 100644 --- a/src/main/resources/assets/ironchest/blockstates/ItemChestUpgrade.json +++ b/src/main/resources/assets/ironchest/blockstates/ItemChestUpgrade.json @@ -50,6 +50,11 @@ "textures": { "layer0": "ironchest:items/woodIronUpgrade" } + }, + "copperironupgrade": { + "textures": { + "layer0": "ironchest:items/copperIronUpgrade" + } } } } From 94aa1671d559050d8ce38e23f31b4a7cbf52afd2 Mon Sep 17 00:00:00 2001 From: alexbegt Date: Thu, 19 May 2016 18:01:50 -0400 Subject: [PATCH 017/105] Fix some bugs from the PR. --- build.gradle | 12 ++++++++++-- .../java/cpw/mods/ironchest/ChestChangerType.java | 2 +- src/main/java/cpw/mods/ironchest/IronChest.java | 1 - src/main/java/cpw/mods/ironchest/IronChestType.java | 7 +++++++ .../java/cpw/mods/ironchest/ItemChestChanger.java | 2 +- .../java/cpw/mods/ironchest/client/ClientProxy.java | 5 ++++- .../assets/ironchest/blockstates/BlockIronChest.json | 6 ++++++ 7 files changed, 29 insertions(+), 6 deletions(-) diff --git a/build.gradle b/build.gradle index 3decca06..93b00c73 100755 --- a/build.gradle +++ b/build.gradle @@ -26,6 +26,14 @@ repositories { name "fileRepo" dirs "repo" } + maven { + name 'DVS1 Maven FS' + url 'http://dvs1.progwml6.com/files/maven' + } +} + +dependencies { + deobfCompile "mezz.jei:jei_1.9:3.3.3.200" } // This is our group. I'm cpw.mods @@ -35,8 +43,8 @@ archivesBaseName = "ironchest" // Setup the forge minecraft plugin data. Specify the preferred forge/minecraft version here minecraft { - version = "1.9-12.16.0.1865-1.9" - mappings = "snapshot_20160419" + version = "1.9-12.16.1.1907" + mappings = "snapshot_20160516" runDir = "run" } diff --git a/src/main/java/cpw/mods/ironchest/ChestChangerType.java b/src/main/java/cpw/mods/ironchest/ChestChangerType.java index 7990020d..07b91c5e 100755 --- a/src/main/java/cpw/mods/ironchest/ChestChangerType.java +++ b/src/main/java/cpw/mods/ironchest/ChestChangerType.java @@ -53,7 +53,7 @@ public boolean canUpgrade(IronChestType from) { return from == this.source; } - + public ItemChestChanger buildItem() { this.item = new ItemChestChanger(this); diff --git a/src/main/java/cpw/mods/ironchest/IronChest.java b/src/main/java/cpw/mods/ironchest/IronChest.java index e6722656..aba8a053 100755 --- a/src/main/java/cpw/mods/ironchest/IronChest.java +++ b/src/main/java/cpw/mods/ironchest/IronChest.java @@ -54,7 +54,6 @@ public void preInit(FMLPreInitializationEvent event) ChestChangerType.buildItems(); ironChestBlock = GameRegistry.register(new BlockIronChest()); ironChestItemBlock = GameRegistry.register(new ItemIronChest(ironChestBlock)); - GameRegistry.register(ironChestItemBlock); for (IronChestType typ : IronChestType.VALUES) { diff --git a/src/main/java/cpw/mods/ironchest/IronChestType.java b/src/main/java/cpw/mods/ironchest/IronChestType.java index 1b507eca..131af194 100755 --- a/src/main/java/cpw/mods/ironchest/IronChestType.java +++ b/src/main/java/cpw/mods/ironchest/IronChestType.java @@ -73,10 +73,17 @@ public String getBreakTexture() case DIRTCHEST9000: { this.breakTexture = "minecraft:blocks/dirt"; + break; } case OBSIDIAN: { this.breakTexture = "minecraft:blocks/obsidian"; + break; + } + case WOOD: + { + this.breakTexture = "minecraft:blocks/planks_oak"; + break; } default: { diff --git a/src/main/java/cpw/mods/ironchest/ItemChestChanger.java b/src/main/java/cpw/mods/ironchest/ItemChestChanger.java index 8f79c8f8..dce71556 100755 --- a/src/main/java/cpw/mods/ironchest/ItemChestChanger.java +++ b/src/main/java/cpw/mods/ironchest/ItemChestChanger.java @@ -108,7 +108,7 @@ else if (te instanceof TileEntityChest) worldIn.removeTileEntity(pos); worldIn.setBlockToAir(pos); - IBlockState iblockstate = IronChest.ironChestBlock.getDefaultState().withProperty(BlockIronChest.VARIANT_PROP, type.target); + IBlockState iblockstate = IronChest.ironChestBlock.getDefaultState().withProperty(BlockIronChest.VARIANT_PROP, this.type.target); worldIn.setTileEntity(pos, newchest); worldIn.setBlockState(pos, iblockstate, 3); diff --git a/src/main/java/cpw/mods/ironchest/client/ClientProxy.java b/src/main/java/cpw/mods/ironchest/client/ClientProxy.java index 9d56e9ba..9637c345 100755 --- a/src/main/java/cpw/mods/ironchest/client/ClientProxy.java +++ b/src/main/java/cpw/mods/ironchest/client/ClientProxy.java @@ -24,7 +24,6 @@ import net.minecraft.world.World; import net.minecraftforge.client.model.ModelLoader; import net.minecraftforge.fml.client.registry.ClientRegistry; -import net.minecraftforge.fml.common.FMLCommonHandler; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @@ -40,7 +39,9 @@ public void registerRenderInformation() { if (type != IronChestType.WOOD) { + //@formatter:off ModelLoader.setCustomModelResourceLocation(chestItem, type.ordinal(), new ModelResourceLocation(chestItem.getRegistryName(), "variant=" + type.getName())); + //@formatter:on } ClientRegistry.bindTileEntitySpecialRenderer(type.clazz, new TileEntityIronChestRenderer()); @@ -48,7 +49,9 @@ public void registerRenderInformation() for (ChestChangerType type : ChestChangerType.VALUES) { + //@formatter:off ModelLoader.setCustomModelResourceLocation(type.item, 0, new ModelResourceLocation(new ResourceLocation(IronChest.MOD_ID, "ItemChestUpgrade"), "variant=" + type.itemName.toLowerCase())); + //@formatter:on } } diff --git a/src/main/resources/assets/ironchest/blockstates/BlockIronChest.json b/src/main/resources/assets/ironchest/blockstates/BlockIronChest.json index f006699e..96ad5142 100644 --- a/src/main/resources/assets/ironchest/blockstates/BlockIronChest.json +++ b/src/main/resources/assets/ironchest/blockstates/BlockIronChest.json @@ -53,6 +53,12 @@ "particle": "minecraft:blocks/dirt", "texture": "ironchest:model/dirtchest" } + }, + "wood": { + "textures": { + "particle": "minecraft:blocks/planks_oak", + "texture": "minecraft:blocks/planks_oak" + } } } } From 644b16903bf5bf504bce98d862b2aa441e22dbfa Mon Sep 17 00:00:00 2001 From: alexbegt Date: Thu, 19 May 2016 18:17:38 -0400 Subject: [PATCH 018/105] Update to 1.9.4 --- build.gradle | 8 ++++---- src/main/java/cpw/mods/ironchest/BlockIronChest.java | 7 ++++--- src/main/java/cpw/mods/ironchest/TileEntityDirtChest.java | 1 + src/main/java/cpw/mods/ironchest/TileEntityIronChest.java | 7 ++++--- .../ironchest/client/TileEntityIronChestRenderer.java | 5 +++++ 5 files changed, 18 insertions(+), 10 deletions(-) diff --git a/build.gradle b/build.gradle index 93b00c73..a8cf1df4 100755 --- a/build.gradle +++ b/build.gradle @@ -8,7 +8,7 @@ buildscript { } } dependencies { - classpath 'net.minecraftforge.gradle:ForgeGradle:2.1-SNAPSHOT' + classpath 'net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT' } } plugins { @@ -33,7 +33,7 @@ repositories { } dependencies { - deobfCompile "mezz.jei:jei_1.9:3.3.3.200" + deobfCompile "mezz.jei:jei_1.9.4:3.4.0.202" } // This is our group. I'm cpw.mods @@ -43,8 +43,8 @@ archivesBaseName = "ironchest" // Setup the forge minecraft plugin data. Specify the preferred forge/minecraft version here minecraft { - version = "1.9-12.16.1.1907" - mappings = "snapshot_20160516" + version = "1.9.4-12.17.0.1909-1.9.4" + mappings = "snapshot_20160519" runDir = "run" } diff --git a/src/main/java/cpw/mods/ironchest/BlockIronChest.java b/src/main/java/cpw/mods/ironchest/BlockIronChest.java index 1ff40b00..1574866b 100755 --- a/src/main/java/cpw/mods/ironchest/BlockIronChest.java +++ b/src/main/java/cpw/mods/ironchest/BlockIronChest.java @@ -287,10 +287,11 @@ public boolean rotateBlock(World worldObj, BlockPos pos, EnumFacing axis) } @Override - public boolean onBlockEventReceived(World worldIn, BlockPos pos, IBlockState state, int eventID, int eventParam) + @Deprecated + public boolean eventReceived(IBlockState state, World worldIn, BlockPos pos, int id, int param) { - super.onBlockEventReceived(worldIn, pos, state, eventID, eventParam); + super.eventReceived(state, worldIn, pos, id, param); TileEntity tileentity = worldIn.getTileEntity(pos); - return tileentity != null && tileentity.receiveClientEvent(eventID, eventParam); + return tileentity != null && tileentity.receiveClientEvent(id, param); } } diff --git a/src/main/java/cpw/mods/ironchest/TileEntityDirtChest.java b/src/main/java/cpw/mods/ironchest/TileEntityDirtChest.java index d70d4f65..b7b0f6e3 100755 --- a/src/main/java/cpw/mods/ironchest/TileEntityDirtChest.java +++ b/src/main/java/cpw/mods/ironchest/TileEntityDirtChest.java @@ -7,6 +7,7 @@ import net.minecraft.nbt.NBTTagString; import net.minecraft.util.text.translation.I18n; +@SuppressWarnings("deprecation") public class TileEntityDirtChest extends TileEntityIronChest { private static ItemStack dirtChest9000GuideBook = new ItemStack(Items.WRITTEN_BOOK); diff --git a/src/main/java/cpw/mods/ironchest/TileEntityIronChest.java b/src/main/java/cpw/mods/ironchest/TileEntityIronChest.java index 73636f7f..e766cc6c 100755 --- a/src/main/java/cpw/mods/ironchest/TileEntityIronChest.java +++ b/src/main/java/cpw/mods/ironchest/TileEntityIronChest.java @@ -25,7 +25,6 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.network.NetworkManager; -import net.minecraft.network.Packet; import net.minecraft.network.play.server.SPacketUpdateTileEntity; import net.minecraft.tileentity.TileEntityLockable; import net.minecraft.util.EnumFacing; @@ -265,7 +264,7 @@ public void readFromNBT(NBTTagCompound nbttagcompound) } @Override - public void writeToNBT(NBTTagCompound nbttagcompound) + public NBTTagCompound writeToNBT(NBTTagCompound nbttagcompound) { super.writeToNBT(nbttagcompound); NBTTagList nbttaglist = new NBTTagList(); @@ -287,6 +286,8 @@ public void writeToNBT(NBTTagCompound nbttagcompound) { nbttagcompound.setString("CustomName", this.customName); } + + return nbttagcompound; } @Override @@ -435,7 +436,7 @@ public ItemStack[] getTopItemStacks() } @Override - public Packet getDescriptionPacket() + public SPacketUpdateTileEntity getUpdatePacket() { NBTTagCompound nbt = new NBTTagCompound(); diff --git a/src/main/java/cpw/mods/ironchest/client/TileEntityIronChestRenderer.java b/src/main/java/cpw/mods/ironchest/client/TileEntityIronChestRenderer.java index 3ec792a1..ff96ee62 100755 --- a/src/main/java/cpw/mods/ironchest/client/TileEntityIronChestRenderer.java +++ b/src/main/java/cpw/mods/ironchest/client/TileEntityIronChestRenderer.java @@ -108,6 +108,11 @@ public void renderTileEntityAt(TileEntityIronChest tile, double x, double y, dou GlStateManager.rotate(270F, 0F, 1F, 0F); break; } + default: + { + GlStateManager.rotate(0F, 0F, 1F, 0F); + break; + } } GlStateManager.translate(-0.5F, -0.5F, -0.5F); From 566efca357e0f27893f76e334eee850419983757 Mon Sep 17 00:00:00 2001 From: alexbegt Date: Thu, 19 May 2016 18:21:01 -0400 Subject: [PATCH 019/105] Update Forge required and minecraft version. --- src/main/java/cpw/mods/ironchest/IronChest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/cpw/mods/ironchest/IronChest.java b/src/main/java/cpw/mods/ironchest/IronChest.java index aba8a053..0cd6b364 100755 --- a/src/main/java/cpw/mods/ironchest/IronChest.java +++ b/src/main/java/cpw/mods/ironchest/IronChest.java @@ -22,7 +22,7 @@ import net.minecraftforge.fml.common.network.NetworkRegistry; import net.minecraftforge.fml.common.registry.GameRegistry; -@Mod(modid = IronChest.MOD_ID, name = "Iron Chests", dependencies = "required-after:Forge@[12.16.0.1819,)", acceptedMinecraftVersions = "[1.9]") +@Mod(modid = IronChest.MOD_ID, name = "Iron Chests", dependencies = "required-after:Forge@[12.17.0.1909,)", acceptedMinecraftVersions = "[1.9.4]") public class IronChest { public static final String MOD_ID = "IronChest"; From 6e4188fe62a8e3ace416fde588e5e97e19cdc69d Mon Sep 17 00:00:00 2001 From: alexbegt Date: Mon, 30 May 2016 13:43:45 -0400 Subject: [PATCH 020/105] This should fix #69, I couldn't recreate the crash so it needs to be tested. --- .../java/cpw/mods/ironchest/TileEntityIronChest.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main/java/cpw/mods/ironchest/TileEntityIronChest.java b/src/main/java/cpw/mods/ironchest/TileEntityIronChest.java index e766cc6c..7cd77333 100755 --- a/src/main/java/cpw/mods/ironchest/TileEntityIronChest.java +++ b/src/main/java/cpw/mods/ironchest/TileEntityIronChest.java @@ -85,7 +85,16 @@ public EnumFacing getFacing() public IronChestType getType() { - return this.hasWorldObj() ? this.worldObj.getBlockState(this.pos).getValue(BlockIronChest.VARIANT_PROP) : IronChestType.WOOD; + IronChestType type = IronChestType.WOOD; + if (this.hasWorldObj()) + { + IBlockState state = this.worldObj.getBlockState(this.pos); + if (state.getBlock() == IronChest.ironChestBlock) + { + type = state.getValue(BlockIronChest.VARIANT_PROP); + } + } + return type; } @Override From 5d607a0d1526141a2be3096620473cde17f0535d Mon Sep 17 00:00:00 2001 From: alexbegt Date: Wed, 8 Jun 2016 15:59:44 -0400 Subject: [PATCH 021/105] Fix #71, Chest orientation will now stay the same after a Chunk Unload. --- .../cpw/mods/ironchest/IronChestType.java | 5 +- .../cpw/mods/ironchest/ItemChestChanger.java | 5 +- .../mods/ironchest/TileEntityGoldChest.java | 1 - .../mods/ironchest/TileEntityIronChest.java | 314 +++++++++++------- .../ironchest/TileEntityObsidianChest.java | 1 - .../cpw/mods/ironchest/ValidatingSlot.java | 4 +- 6 files changed, 207 insertions(+), 123 deletions(-) diff --git a/src/main/java/cpw/mods/ironchest/IronChestType.java b/src/main/java/cpw/mods/ironchest/IronChestType.java index 131af194..63a878f5 100755 --- a/src/main/java/cpw/mods/ironchest/IronChestType.java +++ b/src/main/java/cpw/mods/ironchest/IronChestType.java @@ -51,8 +51,9 @@ public enum IronChestType implements IStringSerializable public final Collection recipes; public final Collection matList; - IronChestType(int size, int rowLength, boolean tieredChest, String modelTexture, Collection mats, Class clazz, - String... recipes) + //@formatter:off + IronChestType(int size, int rowLength, boolean tieredChest, String modelTexture, Collection mats, Class clazz, String... recipes) + //@formatter:on { this.name = this.name().toLowerCase(); this.size = size; diff --git a/src/main/java/cpw/mods/ironchest/ItemChestChanger.java b/src/main/java/cpw/mods/ironchest/ItemChestChanger.java index dce71556..d8cdbbad 100755 --- a/src/main/java/cpw/mods/ironchest/ItemChestChanger.java +++ b/src/main/java/cpw/mods/ironchest/ItemChestChanger.java @@ -54,8 +54,9 @@ public EnumActionResult onItemUse(ItemStack stack, EntityPlayer playerIn, World } else { - if (worldIn.getBlockState(pos) != IronChest.ironChestBlock - .getStateFromMeta(IronChestType.valueOf(this.type.source.getName().toUpperCase()).ordinal())) + //@formatter:off + if (worldIn.getBlockState(pos) != IronChest.ironChestBlock.getStateFromMeta(IronChestType.valueOf(this.type.source.getName().toUpperCase()).ordinal())) + //@formatter:on { return EnumActionResult.PASS; } diff --git a/src/main/java/cpw/mods/ironchest/TileEntityGoldChest.java b/src/main/java/cpw/mods/ironchest/TileEntityGoldChest.java index 2c36323c..16776ed5 100755 --- a/src/main/java/cpw/mods/ironchest/TileEntityGoldChest.java +++ b/src/main/java/cpw/mods/ironchest/TileEntityGoldChest.java @@ -12,7 +12,6 @@ public class TileEntityGoldChest extends TileEntityIronChest { - public TileEntityGoldChest() { super(IronChestType.GOLD); diff --git a/src/main/java/cpw/mods/ironchest/TileEntityIronChest.java b/src/main/java/cpw/mods/ironchest/TileEntityIronChest.java index 7cd77333..b4cd3f1b 100755 --- a/src/main/java/cpw/mods/ironchest/TileEntityIronChest.java +++ b/src/main/java/cpw/mods/ironchest/TileEntityIronChest.java @@ -12,7 +12,8 @@ import java.util.Arrays; import java.util.Comparator; -import java.util.List; + +import javax.annotation.Nullable; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.EntityLivingBase; @@ -38,7 +39,7 @@ public class TileEntityIronChest extends TileEntityLockable implements ITickable private int ticksSinceSync = -1; public float prevLidAngle; public float lidAngle; - private int numUsingPlayers; + private int numPlayersUsing; public ItemStack[] chestContents; private ItemStack[] topStacks; private EnumFacing facing; @@ -62,6 +63,7 @@ protected TileEntityIronChest(IronChestType type) public void setContents(ItemStack[] contents) { this.chestContents = new ItemStack[this.getType().size]; + for (int i = 0; i < contents.length; i++) { if (i < this.chestContents.length) @@ -69,6 +71,7 @@ public void setContents(ItemStack[] contents) this.chestContents[i] = contents[i]; } } + this.inventoryTouched = true; } @@ -86,6 +89,7 @@ public EnumFacing getFacing() public IronChestType getType() { IronChestType type = IronChestType.WOOD; + if (this.hasWorldObj()) { IBlockState state = this.worldObj.getBlockState(this.pos); @@ -94,20 +98,23 @@ public IronChestType getType() type = state.getValue(BlockIronChest.VARIANT_PROP); } } + return type; } @Override - public ItemStack getStackInSlot(int i) + public ItemStack getStackInSlot(int index) { this.inventoryTouched = true; - return this.chestContents[i]; + + return this.chestContents[index]; } @Override public void markDirty() { super.markDirty(); + this.sortTopStacks(); } @@ -117,9 +124,13 @@ protected void sortTopStacks() { return; } + ItemStack[] tempCopy = new ItemStack[this.getSizeInventory()]; + boolean hasStuff = false; + int compressedIdx = 0; + mainLoop: for (int i = 0; i < this.getSizeInventory(); i++) { if (this.chestContents[i] != null) @@ -136,21 +147,27 @@ protected void sortTopStacks() hasStuff = true; } } + if (!hasStuff && this.hadStuff) { this.hadStuff = false; + for (int i = 0; i < this.topStacks.length; i++) { this.topStacks[i] = null; } + if (this.worldObj != null) { IBlockState iblockstate = this.worldObj.getBlockState(this.pos); this.worldObj.notifyBlockUpdate(this.pos, iblockstate, iblockstate, 3); } + return; } + this.hadStuff = true; + Arrays.sort(tempCopy, new Comparator() { @Override public int compare(ItemStack o1, ItemStack o2) @@ -169,48 +186,61 @@ else if (o2 == null) } } }); + int p = 0; + for (ItemStack element : tempCopy) { if (element != null && element.stackSize > 0) { this.topStacks[p++] = element; + if (p == this.topStacks.length) { break; } } } + for (int i = p; i < this.topStacks.length; i++) { this.topStacks[i] = null; } + if (this.worldObj != null) { IBlockState iblockstate = this.worldObj.getBlockState(this.pos); + this.worldObj.notifyBlockUpdate(this.pos, iblockstate, iblockstate, 3); } } @Override - public ItemStack decrStackSize(int i, int j) + public ItemStack decrStackSize(int index, int count) { - if (this.chestContents[i] != null) + if (this.chestContents[index] != null) { - if (this.chestContents[i].stackSize <= j) + if (this.chestContents[index].stackSize <= count) { - ItemStack itemstack = this.chestContents[i]; - this.chestContents[i] = null; + ItemStack stack = this.chestContents[index]; + + this.chestContents[index] = null; + this.markDirty(); - return itemstack; + + return stack; } - ItemStack itemstack1 = this.chestContents[i].splitStack(j); - if (this.chestContents[i].stackSize == 0) + + ItemStack stack = this.chestContents[index].splitStack(count); + + if (this.chestContents[index].stackSize == 0) { - this.chestContents[i] = null; + this.chestContents[index] = null; } + this.markDirty(); - return itemstack1; + + return stack; } else { @@ -219,13 +249,15 @@ public ItemStack decrStackSize(int i, int j) } @Override - public void setInventorySlotContents(int i, ItemStack itemstack) + public void setInventorySlotContents(int index, @Nullable ItemStack stack) { - this.chestContents[i] = itemstack; - if (itemstack != null && itemstack.stackSize > this.getInventoryStackLimit()) + this.chestContents[index] = stack; + + if (stack != null && stack.stackSize > this.getInventoryStackLimit()) { - itemstack.stackSize = this.getInventoryStackLimit(); + stack.stackSize = this.getInventoryStackLimit(); } + this.markDirty(); } @@ -247,56 +279,67 @@ public void setCustomName(String name) } @Override - public void readFromNBT(NBTTagCompound nbttagcompound) + public void readFromNBT(NBTTagCompound compound) { - super.readFromNBT(nbttagcompound); + super.readFromNBT(compound); + + NBTTagList tagList = compound.getTagList("Items", Constants.NBT.TAG_COMPOUND); - NBTTagList nbttaglist = nbttagcompound.getTagList("Items", Constants.NBT.TAG_COMPOUND); this.chestContents = new ItemStack[this.getSizeInventory()]; - if (nbttagcompound.hasKey("CustomName", Constants.NBT.TAG_STRING)) + if (compound.hasKey("CustomName", Constants.NBT.TAG_STRING)) { - this.customName = nbttagcompound.getString("CustomName"); + this.customName = compound.getString("CustomName"); } - for (int i = 0; i < nbttaglist.tagCount(); i++) + for (int i = 0; i < tagList.tagCount(); i++) { - NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i); - int j = nbttagcompound1.getByte("Slot") & 0xff; - if (j >= 0 && j < this.chestContents.length) + NBTTagCompound tag = tagList.getCompoundTagAt(i); + + int slot = tag.getByte("Slot") & 0xff; + + if (slot >= 0 && slot < this.chestContents.length) { - this.chestContents[j] = ItemStack.loadItemStackFromNBT(nbttagcompound1); + this.chestContents[slot] = ItemStack.loadItemStackFromNBT(tag); } } - this.facing = EnumFacing.VALUES[nbttagcompound.getByte("facing")]; + + this.facing = EnumFacing.VALUES[compound.getByte("facing")]; + this.sortTopStacks(); } @Override - public NBTTagCompound writeToNBT(NBTTagCompound nbttagcompound) + public NBTTagCompound writeToNBT(NBTTagCompound compound) { - super.writeToNBT(nbttagcompound); - NBTTagList nbttaglist = new NBTTagList(); - for (int i = 0; i < this.chestContents.length; i++) + super.writeToNBT(compound); + + NBTTagList tagList = new NBTTagList(); + + for (int slot = 0; slot < this.chestContents.length; slot++) { - if (this.chestContents[i] != null) + if (this.chestContents[slot] != null) { - NBTTagCompound nbttagcompound1 = new NBTTagCompound(); - nbttagcompound1.setByte("Slot", (byte) i); - this.chestContents[i].writeToNBT(nbttagcompound1); - nbttaglist.appendTag(nbttagcompound1); + NBTTagCompound tag = new NBTTagCompound(); + + tag.setByte("Slot", (byte) slot); + + this.chestContents[slot].writeToNBT(tag); + + tagList.appendTag(tag); } } - nbttagcompound.setTag("Items", nbttaglist); - nbttagcompound.setByte("facing", (byte) this.facing.ordinal()); + compound.setTag("Items", tagList); + + compound.setByte("facing", (byte) this.facing.ordinal()); if (this.hasCustomName()) { - nbttagcompound.setString("CustomName", this.customName); + compound.setString("CustomName", this.customName); } - return nbttagcompound; + return compound; } @Override @@ -306,86 +349,105 @@ public int getInventoryStackLimit() } @Override - public boolean isUseableByPlayer(EntityPlayer entityplayer) + public boolean isUseableByPlayer(EntityPlayer player) { if (this.worldObj == null) { return true; } + if (this.worldObj.getTileEntity(this.pos) != this) { return false; } - return entityplayer.getDistanceSq(this.pos.getX() + 0.5D, this.pos.getY() + 0.5D, this.pos.getZ() + 0.5D) <= 64D; + + return player.getDistanceSq(this.pos.getX() + 0.5D, this.pos.getY() + 0.5D, this.pos.getZ() + 0.5D) <= 64D; } @Override public void update() { - // Resynchronize clients with the server state - if (this.worldObj != null && !this.worldObj.isRemote && this.numUsingPlayers != 0 - && (this.ticksSinceSync + this.pos.getX() + this.pos.getY() + this.pos.getZ()) % 200 == 0) + // Resynchronizes clients with the server state + + //@formatter:off + if (this.worldObj != null && !this.worldObj.isRemote && this.numPlayersUsing != 0 && (this.ticksSinceSync + this.pos.getX() + this.pos.getY() + this.pos.getZ()) % 200 == 0) + //@formatter:on { - this.numUsingPlayers = 0; - float var1 = 5.0F; + this.numPlayersUsing = 0; + + float f = 5.0F; + //@formatter:off - List var2 = this.worldObj.getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(this.pos.getX() - var1, this.pos.getY() - var1, this.pos.getZ() - var1, this.pos.getX() + 1 + var1, this.pos.getY() + 1 + var1, this.pos.getZ() + 1 + var1)); + for (EntityPlayer player : this.worldObj.getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(this.pos.getX() - f, this.pos.getY() - f, this.pos.getZ() - f, this.pos.getX() + 1 + f, this.pos.getY() + 1 + f, this.pos.getZ() + 1 + f))) //@formatter:on - - for (EntityPlayer var4 : var2) { - if (var4.openContainer instanceof ContainerIronChest) + if (player.openContainer instanceof ContainerIronChest) { - ++this.numUsingPlayers; + ++this.numPlayersUsing; } } } if (this.worldObj != null && !this.worldObj.isRemote && this.ticksSinceSync < 0) { - this.worldObj.addBlockEvent(this.pos, IronChest.ironChestBlock, 3, ((this.numUsingPlayers << 3) & 0xF8) | (this.facing.ordinal() & 0x7)); + this.worldObj.addBlockEvent(this.pos, IronChest.ironChestBlock, 3, ((this.numPlayersUsing << 3) & 0xF8) | (this.facing.ordinal() & 0x7)); } + if (!this.worldObj.isRemote && this.inventoryTouched) { this.inventoryTouched = false; + this.sortTopStacks(); } this.ticksSinceSync++; + this.prevLidAngle = this.lidAngle; - float f = 0.1F; - if (this.numUsingPlayers > 0 && this.lidAngle == 0.0F) + + float angle = 0.1F; + + if (this.numPlayersUsing > 0 && this.lidAngle == 0.0F) { - double d = this.pos.getX() + 0.5D; - double d1 = this.pos.getZ() + 0.5D; + double x = this.pos.getX() + 0.5D; + double y = this.pos.getY() + 0.5D; + double z = this.pos.getZ() + 0.5D; + //@formatter:off - this.worldObj.playSound(null, d, this.pos.getY() + 0.5D, d1, SoundEvents.BLOCK_CHEST_OPEN, SoundCategory.BLOCKS, 0.5F, this.worldObj.rand.nextFloat() * 0.1F + 0.9F); + this.worldObj.playSound(null, x, y, z, SoundEvents.BLOCK_CHEST_OPEN, SoundCategory.BLOCKS, 0.5F, this.worldObj.rand.nextFloat() * 0.1F + 0.9F); //@formatter:on } - if (this.numUsingPlayers == 0 && this.lidAngle > 0.0F || this.numUsingPlayers > 0 && this.lidAngle < 1.0F) + + if (this.numPlayersUsing == 0 && this.lidAngle > 0.0F || this.numPlayersUsing > 0 && this.lidAngle < 1.0F) { - float f1 = this.lidAngle; - if (this.numUsingPlayers > 0) + float currentAngle = this.lidAngle; + + if (this.numPlayersUsing > 0) { - this.lidAngle += f; + this.lidAngle += angle; } else { - this.lidAngle -= f; + this.lidAngle -= angle; } + if (this.lidAngle > 1.0F) { this.lidAngle = 1.0F; } - float f2 = 0.5F; - if (this.lidAngle < f2 && f1 >= f2) + + float maxAngle = 0.5F; + + if (this.lidAngle < maxAngle && currentAngle >= maxAngle) { - double d2 = this.pos.getX() + 0.5D; - double d3 = this.pos.getZ() + 0.5D; + double x = this.pos.getX() + 0.5D; + double y = this.pos.getY() + 0.5D; + double z = this.pos.getZ() + 0.5D; + //@formatter:off - this.worldObj.playSound(null, d2, this.pos.getY() + 0.5D, d3, SoundEvents.BLOCK_CHEST_CLOSE, SoundCategory.BLOCKS, 0.5F, this.worldObj.rand.nextFloat() * 0.1F + 0.9F); + this.worldObj.playSound(null, x, y, z, SoundEvents.BLOCK_CHEST_CLOSE, SoundCategory.BLOCKS, 0.5F, this.worldObj.rand.nextFloat() * 0.1F + 0.9F); //@formatter:on } + if (this.lidAngle < 0.0F) { this.lidAngle = 0.0F; @@ -394,21 +456,22 @@ public void update() } @Override - public boolean receiveClientEvent(int i, int j) + public boolean receiveClientEvent(int id, int type) { - if (i == 1) + if (id == 1) { - this.numUsingPlayers = j; + this.numPlayersUsing = type; } - else if (i == 2) + else if (id == 2) { - this.facing = EnumFacing.VALUES[j]; + this.facing = EnumFacing.VALUES[type]; } - else if (i == 3) + else if (id == 3) { - this.facing = EnumFacing.VALUES[j & 0x7]; - this.numUsingPlayers = (j & 0xF8) >> 3; + this.facing = EnumFacing.VALUES[type & 0x7]; + this.numPlayersUsing = (type & 0xF8) >> 3; } + return true; } @@ -419,8 +482,10 @@ public void openInventory(EntityPlayer player) { return; } - this.numUsingPlayers++; - this.worldObj.addBlockEvent(this.pos, IronChest.ironChestBlock, 1, this.numUsingPlayers); + + this.numPlayersUsing++; + + this.worldObj.addBlockEvent(this.pos, IronChest.ironChestBlock, 1, this.numPlayersUsing); } @Override @@ -430,13 +495,15 @@ public void closeInventory(EntityPlayer player) { return; } - this.numUsingPlayers--; - this.worldObj.addBlockEvent(this.pos, IronChest.ironChestBlock, 1, this.numUsingPlayers); + + this.numPlayersUsing--; + + this.worldObj.addBlockEvent(this.pos, IronChest.ironChestBlock, 1, this.numPlayersUsing); } - public void setFacing(EnumFacing facing2) + public void setFacing(EnumFacing facing) { - this.facing = facing2; + this.facing = facing; } public ItemStack[] getTopItemStacks() @@ -447,27 +514,26 @@ public ItemStack[] getTopItemStacks() @Override public SPacketUpdateTileEntity getUpdatePacket() { - - NBTTagCompound nbt = new NBTTagCompound(); - nbt.setByte("facing", (byte) this.facing.ordinal()); + NBTTagCompound compound = new NBTTagCompound(); + compound.setByte("facing", (byte) this.facing.ordinal()); ItemStack[] stacks = this.buildItemStackDataList(); if (stacks != null) { - NBTTagList nbttaglist = new NBTTagList(); - for (int i = 0; i < stacks.length; i++) + NBTTagList tagList = new NBTTagList(); + for (int slot = 0; slot < stacks.length; slot++) { - if (stacks[i] != null) + if (stacks[slot] != null) { - NBTTagCompound nbttagcompound1 = new NBTTagCompound(); - nbttagcompound1.setByte("Slot", (byte) i); - stacks[i].writeToNBT(nbttagcompound1); - nbttaglist.appendTag(nbttagcompound1); + NBTTagCompound tag = new NBTTagCompound(); + tag.setByte("Slot", (byte) slot); + stacks[slot].writeToNBT(tag); + tagList.appendTag(tag); } } - nbt.setTag("stacks", nbttaglist); + compound.setTag("stacks", tagList); } - return new SPacketUpdateTileEntity(this.pos, 0, nbt); + return new SPacketUpdateTileEntity(this.pos, 0, compound); } @Override @@ -475,25 +541,30 @@ public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt) { if (pkt.getTileEntityType() == 0) { - NBTTagCompound nbt = pkt.getNbtCompound(); - this.facing = EnumFacing.VALUES[nbt.getByte("facing")]; + NBTTagCompound compound = pkt.getNbtCompound(); + + this.facing = EnumFacing.VALUES[compound.getByte("facing")]; + + NBTTagList tagList = compound.getTagList("stacks", Constants.NBT.TAG_COMPOUND); - NBTTagList tagList = nbt.getTagList("stacks", Constants.NBT.TAG_COMPOUND); ItemStack[] stacks = new ItemStack[this.topStacks.length]; - for (int i = 0; i < stacks.length; i++) + for (int item = 0; item < stacks.length; item++) { - NBTTagCompound nbt1 = tagList.getCompoundTagAt(i); - int j = nbt1.getByte("Slot") & 0xff; - if (j >= 0 && j < stacks.length) + NBTTagCompound itemStack = tagList.getCompoundTagAt(item); + + int slot = itemStack.getByte("Slot") & 0xff; + + if (slot >= 0 && slot < stacks.length) { - stacks[j] = ItemStack.loadItemStackFromNBT(nbt1); + stacks[slot] = ItemStack.loadItemStackFromNBT(itemStack); } } if (this.getType().isTransparent() && stacks != null) { int pos = 0; + for (int i = 0; i < this.topStacks.length; i++) { if (stacks[pos] != null) @@ -504,6 +575,7 @@ public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt) { this.topStacks[i] = null; } + pos++; } } @@ -515,7 +587,9 @@ public ItemStack[] buildItemStackDataList() if (this.getType().isTransparent()) { ItemStack[] sortList = new ItemStack[this.topStacks.length]; + int pos = 0; + for (ItemStack is : this.topStacks) { if (is != null) @@ -527,19 +601,23 @@ public ItemStack[] buildItemStackDataList() sortList[pos++] = null; } } + return sortList; } + return null; } @Override - public ItemStack removeStackFromSlot(int par1) + public ItemStack removeStackFromSlot(int index) { - if (this.chestContents[par1] != null) + if (this.chestContents[index] != null) { - ItemStack var2 = this.chestContents[par1]; - this.chestContents[par1] = null; - return var2; + ItemStack stack = this.chestContents[index]; + + this.chestContents[index] = null; + + return stack; } else { @@ -548,9 +626,9 @@ public ItemStack removeStackFromSlot(int par1) } @Override - public boolean isItemValidForSlot(int i, ItemStack itemstack) + public boolean isItemValidForSlot(int index, ItemStack stack) { - return this.getType().acceptsStack(itemstack); + return this.getType().acceptsStack(stack); } public void rotateAround() @@ -559,7 +637,7 @@ public void rotateAround() this.worldObj.addBlockEvent(this.pos, IronChest.ironChestBlock, 2, this.facing.ordinal()); } - public void wasPlaced(EntityLivingBase entityliving, ItemStack itemStack) + public void wasPlaced(EntityLivingBase entityliving, ItemStack stack) { } @@ -587,14 +665,14 @@ public int getFieldCount() @Override public void clear() { - for (int i = 0; i < this.chestContents.length; ++i) + for (int slot = 0; slot < this.chestContents.length; ++slot) { - this.chestContents[i] = null; + this.chestContents[slot] = null; } } @Override - public Container createContainer(InventoryPlayer playerInventory, EntityPlayer player) + public Container createContainer(InventoryPlayer playerInventory, EntityPlayer playerIn) { return null; } @@ -610,4 +688,10 @@ public boolean canRenderBreaking() { return true; } + + @Override + public NBTTagCompound getUpdateTag() + { + return writeToNBT(new NBTTagCompound()); + } } diff --git a/src/main/java/cpw/mods/ironchest/TileEntityObsidianChest.java b/src/main/java/cpw/mods/ironchest/TileEntityObsidianChest.java index fbef3a19..db21645c 100755 --- a/src/main/java/cpw/mods/ironchest/TileEntityObsidianChest.java +++ b/src/main/java/cpw/mods/ironchest/TileEntityObsidianChest.java @@ -2,7 +2,6 @@ public class TileEntityObsidianChest extends TileEntityIronChest { - public TileEntityObsidianChest() { super(IronChestType.OBSIDIAN); diff --git a/src/main/java/cpw/mods/ironchest/ValidatingSlot.java b/src/main/java/cpw/mods/ironchest/ValidatingSlot.java index 7bf38b41..24e661a6 100755 --- a/src/main/java/cpw/mods/ironchest/ValidatingSlot.java +++ b/src/main/java/cpw/mods/ironchest/ValidatingSlot.java @@ -8,9 +8,9 @@ public class ValidatingSlot extends Slot { private IronChestType type; - public ValidatingSlot(IInventory par1iInventory, int par2, int par3, int par4, IronChestType type) + public ValidatingSlot(IInventory inventoryIn, int slotIndex, int xPosition, int yPosition, IronChestType type) { - super(par1iInventory, par2, par3, par4); + super(inventoryIn, slotIndex, xPosition, yPosition); this.type = type; } From bb8cb4ff98a2237df9abc3597da6a8c8f2edb9ba Mon Sep 17 00:00:00 2001 From: alexbegt Date: Sat, 11 Jun 2016 20:51:23 -0400 Subject: [PATCH 022/105] Fix #72, Chests now work while as a spectator. --- build.gradle | 6 +-- .../api/container/ChestContainer.java | 6 +-- .../cpw/mods/ironchest/IronChestType.java | 24 +++++++----- .../mods/ironchest/TileEntityIronChest.java | 37 +++++++++++++------ 4 files changed, 45 insertions(+), 28 deletions(-) diff --git a/build.gradle b/build.gradle index a8cf1df4..9b3a4673 100755 --- a/build.gradle +++ b/build.gradle @@ -33,7 +33,7 @@ repositories { } dependencies { - deobfCompile "mezz.jei:jei_1.9.4:3.4.0.202" + deobfCompile "mezz.jei:jei_1.9.4:3.5.0.209" } // This is our group. I'm cpw.mods @@ -43,8 +43,8 @@ archivesBaseName = "ironchest" // Setup the forge minecraft plugin data. Specify the preferred forge/minecraft version here minecraft { - version = "1.9.4-12.17.0.1909-1.9.4" - mappings = "snapshot_20160519" + version = "1.9.4-12.17.0.1954" + mappings = "snapshot_20160607" runDir = "run" } diff --git a/src/api/java/invtweaks/api/container/ChestContainer.java b/src/api/java/invtweaks/api/container/ChestContainer.java index 14a1e5f4..52a07a35 100755 --- a/src/api/java/invtweaks/api/container/ChestContainer.java +++ b/src/api/java/invtweaks/api/container/ChestContainer.java @@ -6,7 +6,7 @@ import java.lang.annotation.Target; /** - * A marker for containers that have a chest-like persistant storage component. Enables the Inventroy Tweaks sorting buttons for this container. + * A marker for containers that have a chest-like persistent storage component. Enables the Inventory Tweaks sorting buttons for this container. */ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) @@ -26,7 +26,7 @@ // Signature int func() @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) - public @interface RowSizeCallback + @interface RowSizeCallback { } @@ -34,7 +34,7 @@ // Signature int func() @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) - public @interface IsLargeCallback + @interface IsLargeCallback { } } \ No newline at end of file diff --git a/src/main/java/cpw/mods/ironchest/IronChestType.java b/src/main/java/cpw/mods/ironchest/IronChestType.java index 63a878f5..d2b3cda7 100755 --- a/src/main/java/cpw/mods/ironchest/IronChestType.java +++ b/src/main/java/cpw/mods/ironchest/IronChestType.java @@ -28,15 +28,15 @@ public enum IronChestType implements IStringSerializable { //@formatter:off - IRON(54, 9, true, "ironchest.png", Arrays.asList("ingotIron", "ingotRefinedIron"), TileEntityIronChest.class, "mmmmPmmmm", "mGmG3GmGm"), - GOLD(81, 9, true, "goldchest.png", Collections.singleton("ingotGold"), TileEntityGoldChest.class, "mmmmPmmmm", "mGmG4GmGm"), - DIAMOND(108, 12, true, "diamondchest.png", Collections.singleton("gemDiamond"), TileEntityDiamondChest.class, "GGGmPmGGG", "GGGG4Gmmm"), - COPPER(45, 9, false, "copperchest.png", Collections.singleton("ingotCopper"), TileEntityCopperChest.class, "mmmmCmmmm"), - SILVER(72, 9, false, "silverchest.png", Collections.singleton("ingotSilver"), TileEntitySilverChest.class, "mmmm3mmmm", "mGmG0GmGm"), - CRYSTAL(108, 12, true, "crystalchest.png", Collections.singleton("blockGlass"), TileEntityCrystalChest.class, "GGGGPGGGG"), - OBSIDIAN(108, 12, false, "obsidianchest.png", Collections.singleton("obsidian"), TileEntityObsidianChest.class, "mmmm2mmmm"), - DIRTCHEST9000(1, 1, false, "dirtchest.png", Collections.singleton("dirt"), TileEntityDirtChest.class, "mmmmCmmmm"), - WOOD(0, 0, false, "", Collections.singleton("plankWood"), null); + IRON(54, 9, true, "ironchest.png", Arrays.asList("ingotIron", "ingotRefinedIron"), TileEntityIronChest.class, 184, 202, "mmmmPmmmm", "mGmG3GmGm"), + GOLD(81, 9, true, "goldchest.png", Collections.singleton("ingotGold"), TileEntityGoldChest.class, 184, 256, "mmmmPmmmm", "mGmG4GmGm"), + DIAMOND(108, 12, true, "diamondchest.png", Collections.singleton("gemDiamond"), TileEntityDiamondChest.class, 184, 256, "GGGmPmGGG", "GGGG4Gmmm"), + COPPER(45, 9, false, "copperchest.png", Collections.singleton("ingotCopper"), TileEntityCopperChest.class, 184, 184, "mmmmCmmmm"), + SILVER(72, 9, false, "silverchest.png", Collections.singleton("ingotSilver"), TileEntitySilverChest.class, 184, 238, "mmmm3mmmm", "mGmG0GmGm"), + CRYSTAL(108, 12, true, "crystalchest.png", Collections.singleton("blockGlass"), TileEntityCrystalChest.class, 238, 256, "GGGGPGGGG"), + OBSIDIAN(108, 12, false, "obsidianchest.png", Collections.singleton("obsidian"), TileEntityObsidianChest.class, 238, 256, "mmmm2mmmm"), + DIRTCHEST9000(1, 1, false, "dirtchest.png", Collections.singleton("dirt"), TileEntityDirtChest.class, 184, 184, "mmmmCmmmm"), + WOOD(0, 0, false, "", Collections.singleton("plankWood"), null, 0, 0); //@formatter:on public static final IronChestType VALUES[] = values(); @@ -50,9 +50,11 @@ public enum IronChestType implements IStringSerializable public final Class clazz; public final Collection recipes; public final Collection matList; + public final int xSize; + public final int ySize; //@formatter:off - IronChestType(int size, int rowLength, boolean tieredChest, String modelTexture, Collection mats, Class clazz, String... recipes) + IronChestType(int size, int rowLength, boolean tieredChest, String modelTexture, Collection mats, Class clazz, int xSize, int ySize, String... recipes) //@formatter:on { this.name = this.name().toLowerCase(); @@ -63,6 +65,8 @@ public enum IronChestType implements IStringSerializable this.matList = Collections.unmodifiableCollection(mats); this.clazz = clazz; this.recipes = Collections.unmodifiableCollection(Arrays.asList(recipes)); + this.xSize = xSize; + this.ySize = ySize; } public String getBreakTexture() diff --git a/src/main/java/cpw/mods/ironchest/TileEntityIronChest.java b/src/main/java/cpw/mods/ironchest/TileEntityIronChest.java index b4cd3f1b..f6260ac3 100755 --- a/src/main/java/cpw/mods/ironchest/TileEntityIronChest.java +++ b/src/main/java/cpw/mods/ironchest/TileEntityIronChest.java @@ -46,6 +46,7 @@ public class TileEntityIronChest extends TileEntityLockable implements ITickable private boolean inventoryTouched; private boolean hadStuff; private String customName; + private IronChestType chestType; public TileEntityIronChest() { @@ -55,6 +56,7 @@ public TileEntityIronChest() protected TileEntityIronChest(IronChestType type) { super(); + this.chestType = type; this.chestContents = new ItemStack[type.size]; this.topStacks = new ItemStack[8]; this.facing = EnumFacing.NORTH; @@ -478,27 +480,38 @@ else if (id == 3) @Override public void openInventory(EntityPlayer player) { - if (this.worldObj == null) + if (!player.isSpectator()) { - return; - } + if (this.worldObj == null) + { + return; + } + + if (this.numPlayersUsing < 0) + { + this.numPlayersUsing = 0; + } - this.numPlayersUsing++; + this.numPlayersUsing++; - this.worldObj.addBlockEvent(this.pos, IronChest.ironChestBlock, 1, this.numPlayersUsing); + this.worldObj.addBlockEvent(this.pos, IronChest.ironChestBlock, 1, this.numPlayersUsing); + } } @Override public void closeInventory(EntityPlayer player) { - if (this.worldObj == null) + if (!player.isSpectator()) { - return; - } + if (this.worldObj == null) + { + return; + } - this.numPlayersUsing--; + this.numPlayersUsing--; - this.worldObj.addBlockEvent(this.pos, IronChest.ironChestBlock, 1, this.numPlayersUsing); + this.worldObj.addBlockEvent(this.pos, IronChest.ironChestBlock, 1, this.numPlayersUsing); + } } public void setFacing(EnumFacing facing) @@ -674,7 +687,7 @@ public void clear() @Override public Container createContainer(InventoryPlayer playerInventory, EntityPlayer playerIn) { - return null; + return new ContainerIronChest(playerInventory, this, this.chestType, this.chestType.xSize, this.chestType.ySize); } @Override @@ -692,6 +705,6 @@ public boolean canRenderBreaking() @Override public NBTTagCompound getUpdateTag() { - return writeToNBT(new NBTTagCompound()); + return this.writeToNBT(new NBTTagCompound()); } } From 4d145cd90b938d8e57a7f9e5eb05b756bbb91aa5 Mon Sep 17 00:00:00 2001 From: alexbegt Date: Sat, 11 Jun 2016 22:36:20 -0400 Subject: [PATCH 023/105] Ocelots now sit on top of IronChests again! --- .../java/cpw/mods/ironchest/IronChest.java | 2 +- .../ironchest/OcelotsSitOnChestsHandler.java | 33 ++++++++++++------- 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/src/main/java/cpw/mods/ironchest/IronChest.java b/src/main/java/cpw/mods/ironchest/IronChest.java index 0cd6b364..767373b2 100755 --- a/src/main/java/cpw/mods/ironchest/IronChest.java +++ b/src/main/java/cpw/mods/ironchest/IronChest.java @@ -64,7 +64,7 @@ public void preInit(FMLPreInitializationEvent event) ChestChangerType.generateRecipes(); NetworkRegistry.INSTANCE.registerGuiHandler(instance, proxy); proxy.registerRenderInformation(); - // FIXME: MinecraftForge.EVENT_BUS.register(new OcelotsSitOnChestsHandler()); + MinecraftForge.EVENT_BUS.register(new OcelotsSitOnChestsHandler()); MinecraftForge.EVENT_BUS.register(IronChestEventHandler.INSTANCE); } } diff --git a/src/main/java/cpw/mods/ironchest/OcelotsSitOnChestsHandler.java b/src/main/java/cpw/mods/ironchest/OcelotsSitOnChestsHandler.java index d57331a8..04145afe 100755 --- a/src/main/java/cpw/mods/ironchest/OcelotsSitOnChestsHandler.java +++ b/src/main/java/cpw/mods/ironchest/OcelotsSitOnChestsHandler.java @@ -1,26 +1,37 @@ package cpw.mods.ironchest; +import java.util.HashSet; + +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; +import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; public class OcelotsSitOnChestsHandler { @SubscribeEvent - public void changeSittingTaskForOcelots(LivingEvent.LivingUpdateEvent evt) + public void changeSittingTaskForOcelots(LivingUpdateEvent evt) { if (evt.getEntityLiving().ticksExisted < 5 && evt.getEntityLiving() instanceof EntityOcelot) { - // EntityOcelot ocelot = (EntityOcelot) evt.entityLiving; - // Set tasks = ocelot.tasks.taskEntries; + HashSet hashset = new HashSet(); + + EntityOcelot ocelot = (EntityOcelot) evt.getEntityLiving(); + + for (EntityAITaskEntry task : ocelot.tasks.taskEntries) + { + if (task.action.getClass() == EntityAIOcelotSit.class) + { + hashset.add(task); + } + } - // for (EntityAITasks.EntityAITaskEntry task : tasks) - // { - // if (task.priority == 6 && (task.action instanceof EntityAIOcelotSit) && !(task.action instanceof IronChestAIOcelotSit)) - // { - // task.action = new IronChestAIOcelotSit(ocelot, 0.4F); - // } - // } + for (EntityAITaskEntry task : hashset) + { + ocelot.tasks.removeTask(task.action); + ocelot.tasks.addTask(task.priority, new IronChestAIOcelotSit(ocelot, 0.4F)); + } } } } From efd5046037558c728e2dbe7dcbdea0af20676996 Mon Sep 17 00:00:00 2001 From: alexbegt Date: Mon, 13 Jun 2016 19:06:32 -0400 Subject: [PATCH 024/105] This might fix the crashes that happen on death. --- .../java/cpw/mods/ironchest/IronChestAIOcelotSit.java | 11 ++++++----- .../java/cpw/mods/ironchest/TileEntityIronChest.java | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/main/java/cpw/mods/ironchest/IronChestAIOcelotSit.java b/src/main/java/cpw/mods/ironchest/IronChestAIOcelotSit.java index cb58c5cc..4e74ffb1 100755 --- a/src/main/java/cpw/mods/ironchest/IronChestAIOcelotSit.java +++ b/src/main/java/cpw/mods/ironchest/IronChestAIOcelotSit.java @@ -7,18 +7,19 @@ public class IronChestAIOcelotSit extends EntityAIOcelotSit { - public IronChestAIOcelotSit(EntityOcelot par1EntityOcelot, float par2) + public IronChestAIOcelotSit(EntityOcelot ocelotIn, float speedIn) { - super(par1EntityOcelot, par2); + super(ocelotIn, speedIn); } @Override - protected boolean shouldMoveTo(World world, BlockPos pos) + protected boolean shouldMoveTo(World worldIn, BlockPos pos) { - if (world.getBlockState(pos).getBlock() == IronChest.ironChestBlock) + if (worldIn.getBlockState(pos).getBlock() == IronChest.ironChestBlock) { return true; } - return super.shouldMoveTo(world, pos); + + return super.shouldMoveTo(worldIn, pos); } } diff --git a/src/main/java/cpw/mods/ironchest/TileEntityIronChest.java b/src/main/java/cpw/mods/ironchest/TileEntityIronChest.java index f6260ac3..dea6f755 100755 --- a/src/main/java/cpw/mods/ironchest/TileEntityIronChest.java +++ b/src/main/java/cpw/mods/ironchest/TileEntityIronChest.java @@ -90,7 +90,7 @@ public EnumFacing getFacing() public IronChestType getType() { - IronChestType type = IronChestType.WOOD; + IronChestType type = IronChestType.IRON; if (this.hasWorldObj()) { From 53d563f4408aea8a2cd33bd0ea5500491ae03fe2 Mon Sep 17 00:00:00 2001 From: alexbegt Date: Thu, 23 Jun 2016 03:24:05 -0400 Subject: [PATCH 025/105] Fix Authors List in the mcmod.info --- src/main/resources/mcmod.info | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info index c2a7c0a6..ecb32ac6 100755 --- a/src/main/resources/mcmod.info +++ b/src/main/resources/mcmod.info @@ -7,9 +7,7 @@ "mcversion": "${mcversion}", "url": "http://www.minecraftforum.net/topic/981855-", "updateUrl": "", - "authors": [ - "cpw" - ], + "authorList": ["cpw"], "credits": "By cpw, based on an original idea by Lishid", "logoFile": "", "screenshots": [ From 3321ba2c1ba49d118120265b6b6d8564fe719d52 Mon Sep 17 00:00:00 2001 From: alexbegt Date: Thu, 23 Jun 2016 16:13:31 -0400 Subject: [PATCH 026/105] Add support for 1.10! --- build.gradle | 6 +++--- src/main/java/cpw/mods/ironchest/IronChest.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index 9b3a4673..52b420f3 100755 --- a/build.gradle +++ b/build.gradle @@ -33,7 +33,7 @@ repositories { } dependencies { - deobfCompile "mezz.jei:jei_1.9.4:3.5.0.209" + deobfCompile "mezz.jei:jei_1.10:3.7.0.218" } // This is our group. I'm cpw.mods @@ -43,8 +43,8 @@ archivesBaseName = "ironchest" // Setup the forge minecraft plugin data. Specify the preferred forge/minecraft version here minecraft { - version = "1.9.4-12.17.0.1954" - mappings = "snapshot_20160607" + version = "1.10-12.18.0.1984-1.10.0" + mappings = "snapshot_20160623" runDir = "run" } diff --git a/src/main/java/cpw/mods/ironchest/IronChest.java b/src/main/java/cpw/mods/ironchest/IronChest.java index 767373b2..ba3a116d 100755 --- a/src/main/java/cpw/mods/ironchest/IronChest.java +++ b/src/main/java/cpw/mods/ironchest/IronChest.java @@ -22,7 +22,7 @@ import net.minecraftforge.fml.common.network.NetworkRegistry; import net.minecraftforge.fml.common.registry.GameRegistry; -@Mod(modid = IronChest.MOD_ID, name = "Iron Chests", dependencies = "required-after:Forge@[12.17.0.1909,)", acceptedMinecraftVersions = "[1.9.4]") +@Mod(modid = IronChest.MOD_ID, name = "Iron Chests", dependencies = "required-after:Forge@[12.17.0.1909,)", acceptedMinecraftVersions = "[1.9.4, 1.11)") public class IronChest { public static final String MOD_ID = "IronChest"; From e718cae381adeac32a1f857d31a358427db1701a Mon Sep 17 00:00:00 2001 From: alexbegt Date: Thu, 23 Jun 2016 18:42:26 -0400 Subject: [PATCH 027/105] Bump forge version to fix dupe bug with items while running deobf testing. --- build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 52b420f3..f54a6e6f 100755 --- a/build.gradle +++ b/build.gradle @@ -37,13 +37,13 @@ dependencies { } // This is our group. I'm cpw.mods -group= "cpw.mods" // http://maven.apache.org/guides/mini/guide-naming-conventions.html +group = "cpw.mods" // http://maven.apache.org/guides/mini/guide-naming-conventions.html // This is our actual project within the group. Note: FML has "fml" here. But this is ironchest. archivesBaseName = "ironchest" // Setup the forge minecraft plugin data. Specify the preferred forge/minecraft version here minecraft { - version = "1.10-12.18.0.1984-1.10.0" + version = "1.10-12.18.0.1986-1.10.0" mappings = "snapshot_20160623" runDir = "run" } From cc78de2c6d78fd1708303a57e05f05d34648ec3d Mon Sep 17 00:00:00 2001 From: alexbegt Date: Thu, 30 Jun 2016 23:01:17 -0400 Subject: [PATCH 028/105] Remove unneeded Event Handler. --- .../java/cpw/mods/ironchest/IronChest.java | 2 -- .../client/IronChestEventHandler.java | 27 ------------------- 2 files changed, 29 deletions(-) delete mode 100644 src/main/java/cpw/mods/ironchest/client/IronChestEventHandler.java diff --git a/src/main/java/cpw/mods/ironchest/IronChest.java b/src/main/java/cpw/mods/ironchest/IronChest.java index ba3a116d..f6e3d430 100755 --- a/src/main/java/cpw/mods/ironchest/IronChest.java +++ b/src/main/java/cpw/mods/ironchest/IronChest.java @@ -12,7 +12,6 @@ import java.util.Properties; -import cpw.mods.ironchest.client.IronChestEventHandler; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventHandler; @@ -65,6 +64,5 @@ public void preInit(FMLPreInitializationEvent event) NetworkRegistry.INSTANCE.registerGuiHandler(instance, proxy); proxy.registerRenderInformation(); MinecraftForge.EVENT_BUS.register(new OcelotsSitOnChestsHandler()); - MinecraftForge.EVENT_BUS.register(IronChestEventHandler.INSTANCE); } } diff --git a/src/main/java/cpw/mods/ironchest/client/IronChestEventHandler.java b/src/main/java/cpw/mods/ironchest/client/IronChestEventHandler.java deleted file mode 100644 index d94910c4..00000000 --- a/src/main/java/cpw/mods/ironchest/client/IronChestEventHandler.java +++ /dev/null @@ -1,27 +0,0 @@ -package cpw.mods.ironchest.client; - -import cpw.mods.ironchest.IronChestType; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.event.TextureStitchEvent; -import net.minecraftforge.fml.client.FMLClientHandler; -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - -public class IronChestEventHandler -{ - public static IronChestEventHandler INSTANCE = new IronChestEventHandler(); - - @SubscribeEvent - @SideOnly(Side.CLIENT) - public void onPreTextureStiching(TextureStitchEvent.Pre event) - { - if (event.getMap() == FMLClientHandler.instance().getClient().getTextureMapBlocks()) - { - for (IronChestType t : IronChestType.VALUES) - { - event.getMap().registerSprite(new ResourceLocation(t.getBreakTexture())); - } - } - } -} From 7c8d3986e7d2c60cf82ba99c9e50388080e00781 Mon Sep 17 00:00:00 2001 From: alexbegt Date: Sun, 3 Jul 2016 14:39:21 -0400 Subject: [PATCH 029/105] Switch back to the way 1.7.10 did chest upgrades, you do not have to hold shift to upgrade them now, but holding shift will still open the chest after upgrading it. Should fix #75 somewhat. --- src/main/java/cpw/mods/ironchest/ItemChestChanger.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/cpw/mods/ironchest/ItemChestChanger.java b/src/main/java/cpw/mods/ironchest/ItemChestChanger.java index d8cdbbad..80e15b30 100755 --- a/src/main/java/cpw/mods/ironchest/ItemChestChanger.java +++ b/src/main/java/cpw/mods/ironchest/ItemChestChanger.java @@ -38,13 +38,14 @@ public ItemChestChanger(ChestChangerType type) @Override //@formatter:off - public EnumActionResult onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) + public EnumActionResult onItemUseFirst(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, EnumHand hand) //@formatter:on { if (worldIn.isRemote) { return EnumActionResult.PASS; } + if (this.type.canUpgrade(IronChestType.WOOD)) { if (!(worldIn.getBlockState(pos).getBlock() instanceof BlockChest)) @@ -61,10 +62,12 @@ public EnumActionResult onItemUse(ItemStack stack, EntityPlayer playerIn, World return EnumActionResult.PASS; } } + TileEntity te = worldIn.getTileEntity(pos); TileEntityIronChest newchest = new TileEntityIronChest(); ItemStack[] chestContents = new ItemStack[27]; EnumFacing chestFacing = EnumFacing.DOWN; + if (te != null) { if (te instanceof TileEntityIronChest) @@ -101,6 +104,7 @@ else if (te instanceof TileEntityChest) } te.updateContainingBlockInfo(); + if (te instanceof TileEntityChest) { ((TileEntityChest) te).checkForAdjacentChests(); @@ -117,6 +121,7 @@ else if (te instanceof TileEntityChest) worldIn.notifyBlockUpdate(pos, iblockstate, iblockstate, 3); TileEntity te2 = worldIn.getTileEntity(pos); + if (te2 instanceof TileEntityIronChest) { ((TileEntityIronChest) te2).setContents(chestContents); @@ -124,6 +129,7 @@ else if (te instanceof TileEntityChest) } stack.stackSize = playerIn.capabilities.isCreativeMode ? stack.stackSize : stack.stackSize - 1; + return EnumActionResult.SUCCESS; } } From cac7322894d0b45e2df8551b0fbafc7297dac53a Mon Sep 17 00:00:00 2001 From: alexbegt Date: Sun, 3 Jul 2016 19:56:39 -0400 Subject: [PATCH 030/105] Add support for loot tables, fix #76. --- .../cpw/mods/ironchest/BlockIronChest.java | 53 +------ .../mods/ironchest/TileEntityIronChest.java | 137 +++++++++--------- 2 files changed, 78 insertions(+), 112 deletions(-) diff --git a/src/main/java/cpw/mods/ironchest/BlockIronChest.java b/src/main/java/cpw/mods/ironchest/BlockIronChest.java index 1574866b..e5a63288 100755 --- a/src/main/java/cpw/mods/ironchest/BlockIronChest.java +++ b/src/main/java/cpw/mods/ironchest/BlockIronChest.java @@ -11,7 +11,6 @@ package cpw.mods.ironchest; import java.util.List; -import java.util.Random; import net.minecraft.block.Block; import net.minecraft.block.material.Material; @@ -21,13 +20,12 @@ import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.Container; import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.InventoryHelper; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumBlockRenderType; import net.minecraft.util.EnumFacing; @@ -178,52 +176,17 @@ public int damageDropped(IBlockState state) } @Override - public void breakBlock(World world, BlockPos pos, IBlockState blockState) + public void breakBlock(World worldIn, BlockPos pos, IBlockState state) { - TileEntityIronChest tileentitychest = (TileEntityIronChest) world.getTileEntity(pos); - if (tileentitychest != null) - { - tileentitychest.removeAdornments(); - this.dropContent(0, tileentitychest, world, tileentitychest.getPos()); - } - super.breakBlock(world, pos, blockState); - } - - public void dropContent(int newSize, IInventory chest, World world, BlockPos pos) - { - Random random = world.rand; + TileEntityIronChest tileentity = (TileEntityIronChest) worldIn.getTileEntity(pos); - for (int l = newSize; l < chest.getSizeInventory(); l++) + if (tileentity != null) { - ItemStack itemstack = chest.getStackInSlot(l); - if (itemstack == null) - { - continue; - } - float f = random.nextFloat() * 0.8F + 0.1F; - float f1 = random.nextFloat() * 0.8F + 0.1F; - float f2 = random.nextFloat() * 0.8F + 0.1F; - while (itemstack.stackSize > 0) - { - int i1 = random.nextInt(21) + 10; - if (i1 > itemstack.stackSize) - { - i1 = itemstack.stackSize; - } - itemstack.stackSize -= i1; - EntityItem entityitem = new EntityItem(world, pos.getX() + f, (float) pos.getY() + (newSize > 0 ? 1 : 0) + f1, pos.getZ() + f2, - new ItemStack(itemstack.getItem(), i1, itemstack.getMetadata())); - float f3 = 0.05F; - entityitem.motionX = (float) random.nextGaussian() * f3; - entityitem.motionY = (float) random.nextGaussian() * f3 + 0.2F; - entityitem.motionZ = (float) random.nextGaussian() * f3; - if (itemstack.hasTagCompound()) - { - entityitem.getEntityItem().setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy()); - } - world.spawnEntityInWorld(entityitem); - } + tileentity.removeAdornments(); + + InventoryHelper.dropInventoryItems(worldIn, pos, tileentity); } + super.breakBlock(worldIn, pos, state); } @Override diff --git a/src/main/java/cpw/mods/ironchest/TileEntityIronChest.java b/src/main/java/cpw/mods/ironchest/TileEntityIronChest.java index dea6f755..ee952f2b 100755 --- a/src/main/java/cpw/mods/ironchest/TileEntityIronChest.java +++ b/src/main/java/cpw/mods/ironchest/TileEntityIronChest.java @@ -22,19 +22,20 @@ import net.minecraft.init.SoundEvents; import net.minecraft.inventory.Container; import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.ItemStackHelper; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.network.NetworkManager; import net.minecraft.network.play.server.SPacketUpdateTileEntity; -import net.minecraft.tileentity.TileEntityLockable; +import net.minecraft.tileentity.TileEntityLockableLoot; import net.minecraft.util.EnumFacing; import net.minecraft.util.ITickable; import net.minecraft.util.SoundCategory; import net.minecraft.util.math.AxisAlignedBB; import net.minecraftforge.common.util.Constants; -public class TileEntityIronChest extends TileEntityLockable implements ITickable, IInventory +public class TileEntityIronChest extends TileEntityLockableLoot implements ITickable, IInventory { private int ticksSinceSync = -1; public float prevLidAngle; @@ -95,6 +96,7 @@ public IronChestType getType() if (this.hasWorldObj()) { IBlockState state = this.worldObj.getBlockState(this.pos); + if (state.getBlock() == IronChest.ironChestBlock) { type = state.getValue(BlockIronChest.VARIANT_PROP); @@ -107,6 +109,8 @@ public IronChestType getType() @Override public ItemStack getStackInSlot(int index) { + this.fillWithLoot((EntityPlayer) null); + this.inventoryTouched = true; return this.chestContents[index]; @@ -218,41 +222,26 @@ else if (o2 == null) } @Override + @Nullable public ItemStack decrStackSize(int index, int count) { - if (this.chestContents[index] != null) - { - if (this.chestContents[index].stackSize <= count) - { - ItemStack stack = this.chestContents[index]; + this.fillWithLoot((EntityPlayer) null); - this.chestContents[index] = null; - - this.markDirty(); - - return stack; - } - - ItemStack stack = this.chestContents[index].splitStack(count); - - if (this.chestContents[index].stackSize == 0) - { - this.chestContents[index] = null; - } - - this.markDirty(); + ItemStack itemstack = ItemStackHelper.getAndSplit(this.chestContents, index, count); - return stack; - } - else + if (itemstack != null) { - return null; + this.markDirty(); } + + return itemstack; } @Override public void setInventorySlotContents(int index, @Nullable ItemStack stack) { + this.fillWithLoot((EntityPlayer) null); + this.chestContents[index] = stack; if (stack != null && stack.stackSize > this.getInventoryStackLimit()) @@ -285,8 +274,6 @@ public void readFromNBT(NBTTagCompound compound) { super.readFromNBT(compound); - NBTTagList tagList = compound.getTagList("Items", Constants.NBT.TAG_COMPOUND); - this.chestContents = new ItemStack[this.getSizeInventory()]; if (compound.hasKey("CustomName", Constants.NBT.TAG_STRING)) @@ -294,15 +281,20 @@ public void readFromNBT(NBTTagCompound compound) this.customName = compound.getString("CustomName"); } - for (int i = 0; i < tagList.tagCount(); i++) + if (!this.checkLootAndRead(compound)) { - NBTTagCompound tag = tagList.getCompoundTagAt(i); - - int slot = tag.getByte("Slot") & 0xff; + NBTTagList itemList = compound.getTagList("Items", Constants.NBT.TAG_COMPOUND); - if (slot >= 0 && slot < this.chestContents.length) + for (int itemNumber = 0; itemNumber < itemList.tagCount(); ++itemNumber) { - this.chestContents[slot] = ItemStack.loadItemStackFromNBT(tag); + NBTTagCompound item = itemList.getCompoundTagAt(itemNumber); + + int slot = item.getByte("Slot") & 255; + + if (slot >= 0 && slot < this.chestContents.length) + { + this.chestContents[slot] = ItemStack.loadItemStackFromNBT(item); + } } } @@ -316,23 +308,26 @@ public NBTTagCompound writeToNBT(NBTTagCompound compound) { super.writeToNBT(compound); - NBTTagList tagList = new NBTTagList(); - - for (int slot = 0; slot < this.chestContents.length; slot++) + if (!this.checkLootAndWrite(compound)) { - if (this.chestContents[slot] != null) + NBTTagList itemList = new NBTTagList(); + + for (int slot = 0; slot < this.chestContents.length; ++slot) { - NBTTagCompound tag = new NBTTagCompound(); + if (this.chestContents[slot] != null) + { + NBTTagCompound tag = new NBTTagCompound(); - tag.setByte("Slot", (byte) slot); + tag.setByte("Slot", (byte) slot); - this.chestContents[slot].writeToNBT(tag); + this.chestContents[slot].writeToNBT(tag); - tagList.appendTag(tag); + itemList.appendTag(tag); + } } - } - compound.setTag("Items", tagList); + compound.setTag("Items", itemList); + } compound.setByte("facing", (byte) this.facing.ordinal()); @@ -370,7 +365,6 @@ public boolean isUseableByPlayer(EntityPlayer player) public void update() { // Resynchronizes clients with the server state - //@formatter:off if (this.worldObj != null && !this.worldObj.isRemote && this.numPlayersUsing != 0 && (this.ticksSinceSync + this.pos.getX() + this.pos.getY() + this.pos.getZ()) % 200 == 0) //@formatter:on @@ -492,9 +486,11 @@ public void openInventory(EntityPlayer player) this.numPlayersUsing = 0; } - this.numPlayersUsing++; + ++this.numPlayersUsing; this.worldObj.addBlockEvent(this.pos, IronChest.ironChestBlock, 1, this.numPlayersUsing); + this.worldObj.notifyNeighborsOfStateChange(this.pos, IronChest.ironChestBlock); + this.worldObj.notifyNeighborsOfStateChange(this.pos.down(), IronChest.ironChestBlock); } } @@ -508,9 +504,11 @@ public void closeInventory(EntityPlayer player) return; } - this.numPlayersUsing--; + --this.numPlayersUsing; this.worldObj.addBlockEvent(this.pos, IronChest.ironChestBlock, 1, this.numPlayersUsing); + this.worldObj.notifyNeighborsOfStateChange(this.pos, IronChest.ironChestBlock); + this.worldObj.notifyNeighborsOfStateChange(this.pos.down(), IronChest.ironChestBlock); } } @@ -528,22 +526,30 @@ public ItemStack[] getTopItemStacks() public SPacketUpdateTileEntity getUpdatePacket() { NBTTagCompound compound = new NBTTagCompound(); + compound.setByte("facing", (byte) this.facing.ordinal()); + ItemStack[] stacks = this.buildItemStackDataList(); + if (stacks != null) { - NBTTagList tagList = new NBTTagList(); + NBTTagList itemList = new NBTTagList(); + for (int slot = 0; slot < stacks.length; slot++) { if (stacks[slot] != null) { - NBTTagCompound tag = new NBTTagCompound(); - tag.setByte("Slot", (byte) slot); - stacks[slot].writeToNBT(tag); - tagList.appendTag(tag); + NBTTagCompound item = new NBTTagCompound(); + + item.setByte("Slot", (byte) slot); + + stacks[slot].writeToNBT(item); + + itemList.appendTag(item); } } - compound.setTag("stacks", tagList); + + compound.setTag("stacks", itemList); } return new SPacketUpdateTileEntity(this.pos, 0, compound); @@ -558,15 +564,15 @@ public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt) this.facing = EnumFacing.VALUES[compound.getByte("facing")]; - NBTTagList tagList = compound.getTagList("stacks", Constants.NBT.TAG_COMPOUND); + NBTTagList itemList = compound.getTagList("stacks", Constants.NBT.TAG_COMPOUND); ItemStack[] stacks = new ItemStack[this.topStacks.length]; for (int item = 0; item < stacks.length; item++) { - NBTTagCompound itemStack = tagList.getCompoundTagAt(item); + NBTTagCompound itemStack = itemList.getCompoundTagAt(item); - int slot = itemStack.getByte("Slot") & 0xff; + int slot = itemStack.getByte("Slot") & 255; if (slot >= 0 && slot < stacks.length) { @@ -622,20 +628,12 @@ public ItemStack[] buildItemStackDataList() } @Override + @Nullable public ItemStack removeStackFromSlot(int index) { - if (this.chestContents[index] != null) - { - ItemStack stack = this.chestContents[index]; - - this.chestContents[index] = null; + this.fillWithLoot((EntityPlayer) null); - return stack; - } - else - { - return null; - } + return ItemStackHelper.getAndRemove(this.chestContents, index); } @Override @@ -647,6 +645,7 @@ public boolean isItemValidForSlot(int index, ItemStack stack) public void rotateAround() { this.setFacing(this.facing.rotateY()); + this.worldObj.addBlockEvent(this.pos, IronChest.ironChestBlock, 2, this.facing.ordinal()); } @@ -678,6 +677,8 @@ public int getFieldCount() @Override public void clear() { + this.fillWithLoot((EntityPlayer) null); + for (int slot = 0; slot < this.chestContents.length; ++slot) { this.chestContents[slot] = null; @@ -687,6 +688,8 @@ public void clear() @Override public Container createContainer(InventoryPlayer playerInventory, EntityPlayer playerIn) { + this.fillWithLoot((EntityPlayer) null); + return new ContainerIronChest(playerInventory, this, this.chestType, this.chestType.xSize, this.chestType.ySize); } From 29ef3a5c54d0dd38282cdb5de93884dff3fa6da5 Mon Sep 17 00:00:00 2001 From: alexbegt Date: Wed, 6 Jul 2016 21:10:03 -0400 Subject: [PATCH 031/105] Update to 1.10.2! --- build.gradle | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index f54a6e6f..89855a94 100755 --- a/build.gradle +++ b/build.gradle @@ -33,7 +33,7 @@ repositories { } dependencies { - deobfCompile "mezz.jei:jei_1.10:3.7.0.218" + deobfCompile "mezz.jei:jei_1.10.2:3.7.4.226" } // This is our group. I'm cpw.mods @@ -43,8 +43,8 @@ archivesBaseName = "ironchest" // Setup the forge minecraft plugin data. Specify the preferred forge/minecraft version here minecraft { - version = "1.10-12.18.0.1986-1.10.0" - mappings = "snapshot_20160623" + version = "1.10.2-12.18.0.2007-1.10.0" + mappings = "snapshot_20160706" runDir = "run" } From 0606cedabeeb94241c80043c67554a3ee6cd4762 Mon Sep 17 00:00:00 2001 From: alexbegt Date: Sat, 16 Jul 2016 00:34:45 -0400 Subject: [PATCH 032/105] Change to newer forge! --- build.gradle | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index 89855a94..dc6a0f97 100755 --- a/build.gradle +++ b/build.gradle @@ -33,7 +33,7 @@ repositories { } dependencies { - deobfCompile "mezz.jei:jei_1.10.2:3.7.4.226" + deobfCompile "mezz.jei:jei_1.10.2:3.7.6.232" } // This is our group. I'm cpw.mods @@ -43,8 +43,8 @@ archivesBaseName = "ironchest" // Setup the forge minecraft plugin data. Specify the preferred forge/minecraft version here minecraft { - version = "1.10.2-12.18.0.2007-1.10.0" - mappings = "snapshot_20160706" + version = "1.10.2-12.18.1.2014" + mappings = "snapshot_20160715" runDir = "run" } From 6ce296701c2d4431d7afb5258ccbf801d85f8b4a Mon Sep 17 00:00:00 2001 From: AfterRebelion Date: Sat, 6 Aug 2016 18:22:04 +0200 Subject: [PATCH 033/105] Make modid lowercase To comply with https://github.com/MinecraftForge/MinecraftForge/commit/45b299ce06a453debe31c7056441d2aff26106e1 --- src/main/java/cpw/mods/ironchest/IronChest.java | 2 +- src/main/resources/mcmod.info | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/cpw/mods/ironchest/IronChest.java b/src/main/java/cpw/mods/ironchest/IronChest.java index f6e3d430..d726e37f 100755 --- a/src/main/java/cpw/mods/ironchest/IronChest.java +++ b/src/main/java/cpw/mods/ironchest/IronChest.java @@ -24,7 +24,7 @@ @Mod(modid = IronChest.MOD_ID, name = "Iron Chests", dependencies = "required-after:Forge@[12.17.0.1909,)", acceptedMinecraftVersions = "[1.9.4, 1.11)") public class IronChest { - public static final String MOD_ID = "IronChest"; + public static final String MOD_ID = "ironchest"; @Instance(IronChest.MOD_ID) public static IronChest instance; diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info index ecb32ac6..79afb745 100755 --- a/src/main/resources/mcmod.info +++ b/src/main/resources/mcmod.info @@ -1,6 +1,6 @@ [ { - "modid": "IronChest", + "modid": "ironchest", "name": "Iron Chest", "description": "New chests with larger sizes, with in-place upgrade items.\nThe feature chest is the crystal chest, which is transparent - some inventory contents are visible without opening the chest", "version": "${version}", From a43c7259c30894edab9bfbfa23527ff1a989942f Mon Sep 17 00:00:00 2001 From: Progwml6 Date: Wed, 16 Nov 2016 10:58:31 -0500 Subject: [PATCH 034/105] start of 1.11 update --- build.gradle | 6 +- .../mods/ironchest/ContainerIronChest.java | 2 +- .../java/cpw/mods/ironchest/IronChest.java | 2 +- .../cpw/mods/ironchest/ItemChestChanger.java | 2 +- .../mods/ironchest/TileEntityIronChest.java | 358 ++++++------------ .../client/TileEntityIronChestRenderer.java | 2 +- 6 files changed, 130 insertions(+), 242 deletions(-) diff --git a/build.gradle b/build.gradle index dc6a0f97..aeb6feb6 100755 --- a/build.gradle +++ b/build.gradle @@ -33,7 +33,7 @@ repositories { } dependencies { - deobfCompile "mezz.jei:jei_1.10.2:3.7.6.232" + //deobfCompile "mezz.jei:jei_1.10.2:3.7.6.232" } // This is our group. I'm cpw.mods @@ -43,8 +43,8 @@ archivesBaseName = "ironchest" // Setup the forge minecraft plugin data. Specify the preferred forge/minecraft version here minecraft { - version = "1.10.2-12.18.1.2014" - mappings = "snapshot_20160715" + version = "1.11-13.19.0.2130" + mappings = "snapshot_20161111" runDir = "run" } diff --git a/src/main/java/cpw/mods/ironchest/ContainerIronChest.java b/src/main/java/cpw/mods/ironchest/ContainerIronChest.java index b69fea38..90f66688 100755 --- a/src/main/java/cpw/mods/ironchest/ContainerIronChest.java +++ b/src/main/java/cpw/mods/ironchest/ContainerIronChest.java @@ -64,7 +64,7 @@ else if (!this.mergeItemStack(itemstack1, 0, this.type.size, false)) { return null; } - if (itemstack1.stackSize == 0) + if (itemstack1.func_190916_E() == 0) { slot.putStack(null); } diff --git a/src/main/java/cpw/mods/ironchest/IronChest.java b/src/main/java/cpw/mods/ironchest/IronChest.java index d726e37f..ed1db123 100755 --- a/src/main/java/cpw/mods/ironchest/IronChest.java +++ b/src/main/java/cpw/mods/ironchest/IronChest.java @@ -21,7 +21,7 @@ import net.minecraftforge.fml.common.network.NetworkRegistry; import net.minecraftforge.fml.common.registry.GameRegistry; -@Mod(modid = IronChest.MOD_ID, name = "Iron Chests", dependencies = "required-after:Forge@[12.17.0.1909,)", acceptedMinecraftVersions = "[1.9.4, 1.11)") +@Mod(modid = IronChest.MOD_ID, name = "Iron Chests", dependencies = "required-after:Forge@[12.17.0.1909,)", acceptedMinecraftVersions = "[1.11, 1.12)") public class IronChest { public static final String MOD_ID = "ironchest"; diff --git a/src/main/java/cpw/mods/ironchest/ItemChestChanger.java b/src/main/java/cpw/mods/ironchest/ItemChestChanger.java index 80e15b30..12e4dcc3 100755 --- a/src/main/java/cpw/mods/ironchest/ItemChestChanger.java +++ b/src/main/java/cpw/mods/ironchest/ItemChestChanger.java @@ -128,7 +128,7 @@ else if (te instanceof TileEntityChest) ((TileEntityIronChest) te2).setFacing(chestFacing); } - stack.stackSize = playerIn.capabilities.isCreativeMode ? stack.stackSize : stack.stackSize - 1; + stack.func_190920_e(playerIn.capabilities.isCreativeMode ? stack.func_190916_E() : stack.func_190916_E() - 1); return EnumActionResult.SUCCESS; } diff --git a/src/main/java/cpw/mods/ironchest/TileEntityIronChest.java b/src/main/java/cpw/mods/ironchest/TileEntityIronChest.java index ee952f2b..2cc499e0 100755 --- a/src/main/java/cpw/mods/ironchest/TileEntityIronChest.java +++ b/src/main/java/cpw/mods/ironchest/TileEntityIronChest.java @@ -10,11 +10,6 @@ ******************************************************************************/ package cpw.mods.ironchest; -import java.util.Arrays; -import java.util.Comparator; - -import javax.annotation.Nullable; - import net.minecraft.block.state.IBlockState; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; @@ -35,13 +30,17 @@ import net.minecraft.util.math.AxisAlignedBB; import net.minecraftforge.common.util.Constants; -public class TileEntityIronChest extends TileEntityLockableLoot implements ITickable, IInventory -{ - private int ticksSinceSync = -1; +import java.util.Arrays; +import java.util.Comparator; + +import javax.annotation.Nullable; + +public class TileEntityIronChest extends TileEntityLockableLoot implements ITickable, IInventory { public float prevLidAngle; public float lidAngle; - private int numPlayersUsing; public ItemStack[] chestContents; + private int ticksSinceSync = -1; + private int numPlayersUsing; private ItemStack[] topStacks; private EnumFacing facing; private boolean inventoryTouched; @@ -49,13 +48,11 @@ public class TileEntityIronChest extends TileEntityLockableLoot implements ITick private String customName; private IronChestType chestType; - public TileEntityIronChest() - { + public TileEntityIronChest () { this(IronChestType.IRON); } - protected TileEntityIronChest(IronChestType type) - { + protected TileEntityIronChest (IronChestType type) { super(); this.chestType = type; this.chestContents = new ItemStack[type.size]; @@ -63,14 +60,11 @@ protected TileEntityIronChest(IronChestType type) this.facing = EnumFacing.NORTH; } - public void setContents(ItemStack[] contents) - { + public void setContents (ItemStack[] contents) { this.chestContents = new ItemStack[this.getType().size]; - for (int i = 0; i < contents.length; i++) - { - if (i < this.chestContents.length) - { + for (int i = 0; i < contents.length; i++) { + if (i < this.chestContents.length) { this.chestContents[i] = contents[i]; } } @@ -79,26 +73,25 @@ public void setContents(ItemStack[] contents) } @Override - public int getSizeInventory() - { + public int getSizeInventory () { return this.chestContents.length; } - public EnumFacing getFacing() - { + public EnumFacing getFacing () { return this.facing; } - public IronChestType getType() - { + public void setFacing (EnumFacing facing) { + this.facing = facing; + } + + public IronChestType getType () { IronChestType type = IronChestType.IRON; - if (this.hasWorldObj()) - { + if (this.hasWorldObj()) { IBlockState state = this.worldObj.getBlockState(this.pos); - if (state.getBlock() == IronChest.ironChestBlock) - { + if (state.getBlock() == IronChest.ironChestBlock) { type = state.getValue(BlockIronChest.VARIANT_PROP); } } @@ -107,8 +100,7 @@ public IronChestType getType() } @Override - public ItemStack getStackInSlot(int index) - { + public ItemStack getStackInSlot (int index) { this.fillWithLoot((EntityPlayer) null); this.inventoryTouched = true; @@ -117,17 +109,14 @@ public ItemStack getStackInSlot(int index) } @Override - public void markDirty() - { + public void markDirty () { super.markDirty(); this.sortTopStacks(); } - protected void sortTopStacks() - { - if (!this.getType().isTransparent() || (this.worldObj != null && this.worldObj.isRemote)) - { + protected void sortTopStacks () { + if (!this.getType().isTransparent() || (this.worldObj != null && this.worldObj.isRemote)) { return; } @@ -137,15 +126,12 @@ protected void sortTopStacks() int compressedIdx = 0; - mainLoop: for (int i = 0; i < this.getSizeInventory(); i++) - { - if (this.chestContents[i] != null) - { - for (int j = 0; j < compressedIdx; j++) - { - if (tempCopy[j].isItemEqual(this.chestContents[i])) - { - tempCopy[j].stackSize += this.chestContents[i].stackSize; + mainLoop: + for (int i = 0; i < this.getSizeInventory(); i++) { + if (this.chestContents[i] != null) { + for (int j = 0; j < compressedIdx; j++) { + if (tempCopy[j].isItemEqual(this.chestContents[i])) { + tempCopy[j].func_190920_e(tempCopy[j].func_190916_E() + this.chestContents[i].func_190916_E()); continue mainLoop; } } @@ -154,17 +140,14 @@ protected void sortTopStacks() } } - if (!hasStuff && this.hadStuff) - { + if (!hasStuff && this.hadStuff) { this.hadStuff = false; - for (int i = 0; i < this.topStacks.length; i++) - { + for (int i = 0; i < this.topStacks.length; i++) { this.topStacks[i] = null; } - if (this.worldObj != null) - { + if (this.worldObj != null) { IBlockState iblockstate = this.worldObj.getBlockState(this.pos); this.worldObj.notifyBlockUpdate(this.pos, iblockstate, iblockstate, 3); } @@ -176,45 +159,34 @@ protected void sortTopStacks() Arrays.sort(tempCopy, new Comparator() { @Override - public int compare(ItemStack o1, ItemStack o2) - { - if (o1 == null) - { + public int compare (ItemStack o1, ItemStack o2) { + if (o1 == null) { return 1; - } - else if (o2 == null) - { + } else if (o2 == null) { return -1; - } - else - { - return o2.stackSize - o1.stackSize; + } else { + return o2.func_190916_E() - o1.func_190916_E(); } } }); int p = 0; - for (ItemStack element : tempCopy) - { - if (element != null && element.stackSize > 0) - { + for (ItemStack element : tempCopy) { + if (element != ItemStack.field_190927_a && element.func_190916_E() > 0) { this.topStacks[p++] = element; - if (p == this.topStacks.length) - { + if (p == this.topStacks.length) { break; } } } - for (int i = p; i < this.topStacks.length; i++) - { + for (int i = p; i < this.topStacks.length; i++) { this.topStacks[i] = null; } - if (this.worldObj != null) - { + if (this.worldObj != null) { IBlockState iblockstate = this.worldObj.getBlockState(this.pos); this.worldObj.notifyBlockUpdate(this.pos, iblockstate, iblockstate, 3); @@ -223,14 +195,12 @@ else if (o2 == null) @Override @Nullable - public ItemStack decrStackSize(int index, int count) - { + public ItemStack decrStackSize (int index, int count) { this.fillWithLoot((EntityPlayer) null); ItemStack itemstack = ItemStackHelper.getAndSplit(this.chestContents, index, count); - if (itemstack != null) - { + if (itemstack != null) { this.markDirty(); } @@ -238,61 +208,51 @@ public ItemStack decrStackSize(int index, int count) } @Override - public void setInventorySlotContents(int index, @Nullable ItemStack stack) - { + public void setInventorySlotContents (int index, @Nullable ItemStack stack) { this.fillWithLoot((EntityPlayer) null); this.chestContents[index] = stack; - if (stack != null && stack.stackSize > this.getInventoryStackLimit()) - { - stack.stackSize = this.getInventoryStackLimit(); + if (stack != null && stack.func_190916_E() > this.getInventoryStackLimit()) { + stack.func_190920_e(this.getInventoryStackLimit()); } this.markDirty(); } @Override - public String getName() - { + public String getName () { return this.hasCustomName() ? this.customName : this.getType().name(); } @Override - public boolean hasCustomName() - { + public boolean hasCustomName () { return this.customName != null && this.customName.length() > 0; } - public void setCustomName(String name) - { + public void setCustomName (String name) { this.customName = name; } @Override - public void readFromNBT(NBTTagCompound compound) - { + public void readFromNBT (NBTTagCompound compound) { super.readFromNBT(compound); this.chestContents = new ItemStack[this.getSizeInventory()]; - if (compound.hasKey("CustomName", Constants.NBT.TAG_STRING)) - { + if (compound.hasKey("CustomName", Constants.NBT.TAG_STRING)) { this.customName = compound.getString("CustomName"); } - if (!this.checkLootAndRead(compound)) - { + if (!this.checkLootAndRead(compound)) { NBTTagList itemList = compound.getTagList("Items", Constants.NBT.TAG_COMPOUND); - for (int itemNumber = 0; itemNumber < itemList.tagCount(); ++itemNumber) - { + for (int itemNumber = 0; itemNumber < itemList.tagCount(); ++itemNumber) { NBTTagCompound item = itemList.getCompoundTagAt(itemNumber); int slot = item.getByte("Slot") & 255; - if (slot >= 0 && slot < this.chestContents.length) - { + if (slot >= 0 && slot < this.chestContents.length) { this.chestContents[slot] = ItemStack.loadItemStackFromNBT(item); } } @@ -304,18 +264,14 @@ public void readFromNBT(NBTTagCompound compound) } @Override - public NBTTagCompound writeToNBT(NBTTagCompound compound) - { + public NBTTagCompound writeToNBT (NBTTagCompound compound) { super.writeToNBT(compound); - if (!this.checkLootAndWrite(compound)) - { + if (!this.checkLootAndWrite(compound)) { NBTTagList itemList = new NBTTagList(); - for (int slot = 0; slot < this.chestContents.length; ++slot) - { - if (this.chestContents[slot] != null) - { + for (int slot = 0; slot < this.chestContents.length; ++slot) { + if (this.chestContents[slot] != null) { NBTTagCompound tag = new NBTTagCompound(); tag.setByte("Slot", (byte) slot); @@ -331,8 +287,7 @@ public NBTTagCompound writeToNBT(NBTTagCompound compound) compound.setByte("facing", (byte) this.facing.ordinal()); - if (this.hasCustomName()) - { + if (this.hasCustomName()) { compound.setString("CustomName", this.customName); } @@ -340,21 +295,17 @@ public NBTTagCompound writeToNBT(NBTTagCompound compound) } @Override - public int getInventoryStackLimit() - { + public int getInventoryStackLimit () { return 64; } @Override - public boolean isUseableByPlayer(EntityPlayer player) - { - if (this.worldObj == null) - { + public boolean isUseableByPlayer (EntityPlayer player) { + if (this.worldObj == null) { return true; } - if (this.worldObj.getTileEntity(this.pos) != this) - { + if (this.worldObj.getTileEntity(this.pos) != this) { return false; } @@ -362,8 +313,7 @@ public boolean isUseableByPlayer(EntityPlayer player) } @Override - public void update() - { + public void update () { // Resynchronizes clients with the server state //@formatter:off if (this.worldObj != null && !this.worldObj.isRemote && this.numPlayersUsing != 0 && (this.ticksSinceSync + this.pos.getX() + this.pos.getY() + this.pos.getZ()) % 200 == 0) @@ -374,23 +324,21 @@ public void update() float f = 5.0F; //@formatter:off - for (EntityPlayer player : this.worldObj.getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(this.pos.getX() - f, this.pos.getY() - f, this.pos.getZ() - f, this.pos.getX() + 1 + f, this.pos.getY() + 1 + f, this.pos.getZ() + 1 + f))) + for (EntityPlayer player : this.worldObj.getEntitiesWithinAABB(EntityPlayer.class, + new AxisAlignedBB(this.pos.getX() - f, this.pos.getY() - f, this.pos.getZ() - f, this.pos.getX() + 1 + f, this.pos.getY() + 1 + f, this.pos.getZ() + 1 + f))) //@formatter:on { - if (player.openContainer instanceof ContainerIronChest) - { + if (player.openContainer instanceof ContainerIronChest) { ++this.numPlayersUsing; } } } - if (this.worldObj != null && !this.worldObj.isRemote && this.ticksSinceSync < 0) - { + if (this.worldObj != null && !this.worldObj.isRemote && this.ticksSinceSync < 0) { this.worldObj.addBlockEvent(this.pos, IronChest.ironChestBlock, 3, ((this.numPlayersUsing << 3) & 0xF8) | (this.facing.ordinal() & 0x7)); } - if (!this.worldObj.isRemote && this.inventoryTouched) - { + if (!this.worldObj.isRemote && this.inventoryTouched) { this.inventoryTouched = false; this.sortTopStacks(); @@ -402,8 +350,7 @@ public void update() float angle = 0.1F; - if (this.numPlayersUsing > 0 && this.lidAngle == 0.0F) - { + if (this.numPlayersUsing > 0 && this.lidAngle == 0.0F) { double x = this.pos.getX() + 0.5D; double y = this.pos.getY() + 0.5D; double z = this.pos.getZ() + 0.5D; @@ -413,28 +360,22 @@ public void update() //@formatter:on } - if (this.numPlayersUsing == 0 && this.lidAngle > 0.0F || this.numPlayersUsing > 0 && this.lidAngle < 1.0F) - { + if (this.numPlayersUsing == 0 && this.lidAngle > 0.0F || this.numPlayersUsing > 0 && this.lidAngle < 1.0F) { float currentAngle = this.lidAngle; - if (this.numPlayersUsing > 0) - { + if (this.numPlayersUsing > 0) { this.lidAngle += angle; - } - else - { + } else { this.lidAngle -= angle; } - if (this.lidAngle > 1.0F) - { + if (this.lidAngle > 1.0F) { this.lidAngle = 1.0F; } float maxAngle = 0.5F; - if (this.lidAngle < maxAngle && currentAngle >= maxAngle) - { + if (this.lidAngle < maxAngle && currentAngle >= maxAngle) { double x = this.pos.getX() + 0.5D; double y = this.pos.getY() + 0.5D; double z = this.pos.getZ() + 0.5D; @@ -444,26 +385,19 @@ public void update() //@formatter:on } - if (this.lidAngle < 0.0F) - { + if (this.lidAngle < 0.0F) { this.lidAngle = 0.0F; } } } @Override - public boolean receiveClientEvent(int id, int type) - { - if (id == 1) - { + public boolean receiveClientEvent (int id, int type) { + if (id == 1) { this.numPlayersUsing = type; - } - else if (id == 2) - { + } else if (id == 2) { this.facing = EnumFacing.VALUES[type]; - } - else if (id == 3) - { + } else if (id == 3) { this.facing = EnumFacing.VALUES[type & 0x7]; this.numPlayersUsing = (type & 0xF8) >> 3; } @@ -472,17 +406,13 @@ else if (id == 3) } @Override - public void openInventory(EntityPlayer player) - { - if (!player.isSpectator()) - { - if (this.worldObj == null) - { + public void openInventory (EntityPlayer player) { + if (!player.isSpectator()) { + if (this.worldObj == null) { return; } - if (this.numPlayersUsing < 0) - { + if (this.numPlayersUsing < 0) { this.numPlayersUsing = 0; } @@ -495,12 +425,9 @@ public void openInventory(EntityPlayer player) } @Override - public void closeInventory(EntityPlayer player) - { - if (!player.isSpectator()) - { - if (this.worldObj == null) - { + public void closeInventory (EntityPlayer player) { + if (!player.isSpectator()) { + if (this.worldObj == null) { return; } @@ -512,33 +439,23 @@ public void closeInventory(EntityPlayer player) } } - public void setFacing(EnumFacing facing) - { - this.facing = facing; - } - - public ItemStack[] getTopItemStacks() - { + public ItemStack[] getTopItemStacks () { return this.topStacks; } @Override - public SPacketUpdateTileEntity getUpdatePacket() - { + public SPacketUpdateTileEntity getUpdatePacket () { NBTTagCompound compound = new NBTTagCompound(); compound.setByte("facing", (byte) this.facing.ordinal()); ItemStack[] stacks = this.buildItemStackDataList(); - if (stacks != null) - { + if (stacks != null) { NBTTagList itemList = new NBTTagList(); - for (int slot = 0; slot < stacks.length; slot++) - { - if (stacks[slot] != null) - { + for (int slot = 0; slot < stacks.length; slot++) { + if (stacks[slot] != null) { NBTTagCompound item = new NBTTagCompound(); item.setByte("Slot", (byte) slot); @@ -556,10 +473,8 @@ public SPacketUpdateTileEntity getUpdatePacket() } @Override - public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt) - { - if (pkt.getTileEntityType() == 0) - { + public void onDataPacket (NetworkManager net, SPacketUpdateTileEntity pkt) { + if (pkt.getTileEntityType() == 0) { NBTTagCompound compound = pkt.getNbtCompound(); this.facing = EnumFacing.VALUES[compound.getByte("facing")]; @@ -568,30 +483,23 @@ public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt) ItemStack[] stacks = new ItemStack[this.topStacks.length]; - for (int item = 0; item < stacks.length; item++) - { + for (int item = 0; item < stacks.length; item++) { NBTTagCompound itemStack = itemList.getCompoundTagAt(item); int slot = itemStack.getByte("Slot") & 255; - if (slot >= 0 && slot < stacks.length) - { + if (slot >= 0 && slot < stacks.length) { stacks[slot] = ItemStack.loadItemStackFromNBT(itemStack); } } - if (this.getType().isTransparent() && stacks != null) - { + if (this.getType().isTransparent() && stacks != null) { int pos = 0; - for (int i = 0; i < this.topStacks.length; i++) - { - if (stacks[pos] != null) - { + for (int i = 0; i < this.topStacks.length; i++) { + if (stacks[pos] != null) { this.topStacks[i] = stacks[pos]; - } - else - { + } else { this.topStacks[i] = null; } @@ -601,22 +509,16 @@ public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt) } } - public ItemStack[] buildItemStackDataList() - { - if (this.getType().isTransparent()) - { + public ItemStack[] buildItemStackDataList () { + if (this.getType().isTransparent()) { ItemStack[] sortList = new ItemStack[this.topStacks.length]; int pos = 0; - for (ItemStack is : this.topStacks) - { - if (is != null) - { + for (ItemStack is : this.topStacks) { + if (is != null) { sortList[pos++] = is; - } - else - { + } else { sortList[pos++] = null; } } @@ -629,85 +531,71 @@ public ItemStack[] buildItemStackDataList() @Override @Nullable - public ItemStack removeStackFromSlot(int index) - { + public ItemStack removeStackFromSlot (int index) { this.fillWithLoot((EntityPlayer) null); return ItemStackHelper.getAndRemove(this.chestContents, index); } @Override - public boolean isItemValidForSlot(int index, ItemStack stack) - { + public boolean isItemValidForSlot (int index, ItemStack stack) { return this.getType().acceptsStack(stack); } - public void rotateAround() - { + public void rotateAround () { this.setFacing(this.facing.rotateY()); this.worldObj.addBlockEvent(this.pos, IronChest.ironChestBlock, 2, this.facing.ordinal()); } - public void wasPlaced(EntityLivingBase entityliving, ItemStack stack) - { + public void wasPlaced (EntityLivingBase entityliving, ItemStack stack) { } - public void removeAdornments() - { + public void removeAdornments () { } @Override - public int getField(int id) - { + public int getField (int id) { return 0; } @Override - public void setField(int id, int value) - { + public void setField (int id, int value) { } @Override - public int getFieldCount() - { + public int getFieldCount () { return 0; } @Override - public void clear() - { + public void clear () { this.fillWithLoot((EntityPlayer) null); - for (int slot = 0; slot < this.chestContents.length; ++slot) - { + for (int slot = 0; slot < this.chestContents.length; ++slot) { this.chestContents[slot] = null; } } @Override - public Container createContainer(InventoryPlayer playerInventory, EntityPlayer playerIn) - { + public Container createContainer (InventoryPlayer playerInventory, EntityPlayer playerIn) { this.fillWithLoot((EntityPlayer) null); return new ContainerIronChest(playerInventory, this, this.chestType, this.chestType.xSize, this.chestType.ySize); } @Override - public String getGuiID() - { + public String getGuiID () { return "IronChest:" + this.getType().name(); } @Override - public boolean canRenderBreaking() - { + public boolean canRenderBreaking () { return true; } @Override - public NBTTagCompound getUpdateTag() - { + public NBTTagCompound getUpdateTag () { return this.writeToNBT(new NBTTagCompound()); } } diff --git a/src/main/java/cpw/mods/ironchest/client/TileEntityIronChestRenderer.java b/src/main/java/cpw/mods/ironchest/client/TileEntityIronChestRenderer.java index ff96ee62..83051c15 100755 --- a/src/main/java/cpw/mods/ironchest/client/TileEntityIronChestRenderer.java +++ b/src/main/java/cpw/mods/ironchest/client/TileEntityIronChestRenderer.java @@ -188,7 +188,7 @@ public void renderTileEntityAt(TileEntityIronChest tile, double x, double y, dou @Override public int getModelCount(ItemStack stack) { - return SignedBytes.saturatedCast(Math.min(stack.stackSize / 32, 15) + 1); + return SignedBytes.saturatedCast(Math.min(stack.func_190916_E() / 32, 15) + 1); } @Override From 9fe6c6912a84c550f752864d61d25f8dce422652 Mon Sep 17 00:00:00 2001 From: alexbegt Date: Thu, 17 Nov 2016 16:39:07 -0500 Subject: [PATCH 035/105] Work on the 1.11 update more, some is still buggy but nearly complete. --- build.gradle | 2 +- .../api/container/ChestContainer.java | 0 .../cpw/mods/ironchest/BlockIronChest.java | 18 +- .../mods/ironchest/ContainerIronChest.java | 25 +- .../java/cpw/mods/ironchest/IronChest.java | 6 +- .../cpw/mods/ironchest/IronChestType.java | 14 +- .../cpw/mods/ironchest/ItemChestChanger.java | 40 +- .../mods/ironchest/TileEntityDirtChest.java | 6 +- .../mods/ironchest/TileEntityIronChest.java | 525 ++++++++++-------- .../client/TileEntityIronChestRenderer.java | 24 +- src/main/resources/mcmod.info | 6 +- 11 files changed, 364 insertions(+), 302 deletions(-) rename src/{ => main}/api/java/invtweaks/api/container/ChestContainer.java (100%) mode change 100755 => 100644 diff --git a/build.gradle b/build.gradle index aeb6feb6..855238c7 100755 --- a/build.gradle +++ b/build.gradle @@ -43,7 +43,7 @@ archivesBaseName = "ironchest" // Setup the forge minecraft plugin data. Specify the preferred forge/minecraft version here minecraft { - version = "1.11-13.19.0.2130" + version = "1.11-13.19.0.2148" mappings = "snapshot_20161111" runDir = "run" } diff --git a/src/api/java/invtweaks/api/container/ChestContainer.java b/src/main/api/java/invtweaks/api/container/ChestContainer.java old mode 100755 new mode 100644 similarity index 100% rename from src/api/java/invtweaks/api/container/ChestContainer.java rename to src/main/api/java/invtweaks/api/container/ChestContainer.java diff --git a/src/main/java/cpw/mods/ironchest/BlockIronChest.java b/src/main/java/cpw/mods/ironchest/BlockIronChest.java index e5a63288..e041d81a 100755 --- a/src/main/java/cpw/mods/ironchest/BlockIronChest.java +++ b/src/main/java/cpw/mods/ironchest/BlockIronChest.java @@ -10,8 +10,6 @@ ******************************************************************************/ package cpw.mods.ironchest; -import java.util.List; - import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.block.properties.PropertyEnum; @@ -30,6 +28,7 @@ import net.minecraft.util.EnumBlockRenderType; import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumHand; +import net.minecraft.util.NonNullList; import net.minecraft.util.ResourceLocation; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; @@ -42,6 +41,7 @@ public class BlockIronChest extends Block { public static final PropertyEnum VARIANT_PROP = PropertyEnum.create("variant", IronChestType.class); + protected static final AxisAlignedBB IRON_CHEST_AABB = new AxisAlignedBB(0.0625D, 0.0D, 0.0625D, 0.9375D, 0.875D, 0.9375D); public BlockIronChest() @@ -82,27 +82,28 @@ public EnumBlockRenderType getRenderType(IBlockState state) @Override //@formatter:off - public boolean onBlockActivated(World world, BlockPos pos, IBlockState blockState, EntityPlayer player, EnumHand hand, ItemStack heldItem, EnumFacing direction, float hitX, float hitY, float hitZ) + public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing heldItem, float side, float hitX, float hitY) + //public boolean onBlockActivated(World world, BlockPos pos, IBlockState blockState, EntityPlayer player, EnumHand hand, ItemStack heldItem, EnumFacing direction, float hitX, float hitY, float hitZ) //@formatter:on { - TileEntity te = world.getTileEntity(pos); + TileEntity te = worldIn.getTileEntity(pos); if (te == null || !(te instanceof TileEntityIronChest)) { return true; } - if (world.isSideSolid(pos.add(0, 1, 0), EnumFacing.DOWN)) + if (worldIn.isSideSolid(pos.add(0, 1, 0), EnumFacing.DOWN)) { return true; } - if (world.isRemote) + if (worldIn.isRemote) { return true; } - player.openGui(IronChest.instance, ((TileEntityIronChest) te).getType().ordinal(), world, pos.getX(), pos.getY(), pos.getZ()); + playerIn.openGui(IronChest.instance, ((TileEntityIronChest) te).getType().ordinal(), worldIn, pos.getX(), pos.getY(), pos.getZ()); return true; } @@ -120,7 +121,8 @@ public TileEntity createTileEntity(World world, IBlockState state) @Override @SideOnly(Side.CLIENT) - public void getSubBlocks(Item itemIn, CreativeTabs tab, List list) + //public void getSubBlocks(Item itemIn, CreativeTabs tab, List list) + public void getSubBlocks(Item itemIn, CreativeTabs tab, NonNullList list) { for (IronChestType type : IronChestType.VALUES) { diff --git a/src/main/java/cpw/mods/ironchest/ContainerIronChest.java b/src/main/java/cpw/mods/ironchest/ContainerIronChest.java index 90f66688..83819c36 100755 --- a/src/main/java/cpw/mods/ironchest/ContainerIronChest.java +++ b/src/main/java/cpw/mods/ironchest/ContainerIronChest.java @@ -10,7 +10,6 @@ ******************************************************************************/ package cpw.mods.ironchest; -import invtweaks.api.container.ChestContainer; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; @@ -18,11 +17,13 @@ import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; -@ChestContainer(isLargeChest = true) +//@ChestContainer(isLargeChest = true) public class ContainerIronChest extends Container { private IronChestType type; + private EntityPlayer player; + private IInventory chest; public ContainerIronChest(IInventory playerInventory, IInventory chestInventory, IronChestType type, int xSize, int ySize) @@ -43,7 +44,7 @@ public boolean canInteractWith(EntityPlayer player) @Override public ItemStack transferStackInSlot(EntityPlayer p, int i) { - ItemStack itemstack = null; + ItemStack itemstack = ItemStack.field_190927_a; Slot slot = this.inventorySlots.get(i); if (slot != null && slot.getHasStack()) { @@ -53,20 +54,20 @@ public ItemStack transferStackInSlot(EntityPlayer p, int i) { if (!this.mergeItemStack(itemstack1, this.type.size, this.inventorySlots.size(), true)) { - return null; + return ItemStack.field_190927_a; } } else if (!this.type.acceptsStack(itemstack1)) { - return null; + return ItemStack.field_190927_a; } else if (!this.mergeItemStack(itemstack1, 0, this.type.size, false)) { - return null; + return ItemStack.field_190927_a; } if (itemstack1.func_190916_E() == 0) { - slot.putStack(null); + slot.putStack(ItemStack.field_190927_a); } else { @@ -122,9 +123,9 @@ public EntityPlayer getPlayer() return this.player; } - @ChestContainer.RowSizeCallback - public int getNumColumns() - { - return this.type.rowLength; - } + //@ChestContainer.RowSizeCallback + //public int getNumColumns() + //{ + // return this.type.rowLength; + //} } diff --git a/src/main/java/cpw/mods/ironchest/IronChest.java b/src/main/java/cpw/mods/ironchest/IronChest.java index ed1db123..ea641bad 100755 --- a/src/main/java/cpw/mods/ironchest/IronChest.java +++ b/src/main/java/cpw/mods/ironchest/IronChest.java @@ -21,7 +21,7 @@ import net.minecraftforge.fml.common.network.NetworkRegistry; import net.minecraftforge.fml.common.registry.GameRegistry; -@Mod(modid = IronChest.MOD_ID, name = "Iron Chests", dependencies = "required-after:Forge@[12.17.0.1909,)", acceptedMinecraftVersions = "[1.11, 1.12)") +@Mod(modid = IronChest.MOD_ID, name = "Iron Chests", /*dependencies = "required-after:Forge@[12.17.0.1909,)",*/ acceptedMinecraftVersions = "[1.11, 1.12)") public class IronChest { public static final String MOD_ID = "ironchest"; @@ -33,6 +33,7 @@ public class IronChest public static CommonProxy proxy; public static BlockIronChest ironChestBlock; + public static ItemIronChest ironChestItemBlock; @EventHandler @@ -56,7 +57,8 @@ public void preInit(FMLPreInitializationEvent event) for (IronChestType typ : IronChestType.VALUES) { - GameRegistry.registerTileEntity(typ.clazz, "IronChest." + typ.name()); + if (typ.clazz != null) + GameRegistry.registerTileEntity(typ.clazz, "IronChest." + typ.name()); } IronChestType.registerBlocksAndRecipes(ironChestBlock); diff --git a/src/main/java/cpw/mods/ironchest/IronChestType.java b/src/main/java/cpw/mods/ironchest/IronChestType.java index d2b3cda7..a9fdf36f 100755 --- a/src/main/java/cpw/mods/ironchest/IronChestType.java +++ b/src/main/java/cpw/mods/ironchest/IronChestType.java @@ -42,15 +42,25 @@ public enum IronChestType implements IStringSerializable public static final IronChestType VALUES[] = values(); public final String name; + public final int size; + public final int rowLength; + public final boolean tieredChest; + public final ResourceLocation modelTexture; + private String breakTexture; + public final Class clazz; + public final Collection recipes; + public final Collection matList; + public final int xSize; + public final int ySize; //@formatter:off @@ -192,7 +202,7 @@ public boolean acceptsStack(ItemStack itemstack) { if (this == DIRTCHEST9000) { - return itemstack == null || itemstack.getItem() == DIRT_ITEM; + return itemstack == ItemStack.field_190927_a || itemstack.getItem() == DIRT_ITEM; } return true; @@ -230,4 +240,4 @@ public TileEntityIronChest makeEntity() return null; } } -} \ No newline at end of file +} diff --git a/src/main/java/cpw/mods/ironchest/ItemChestChanger.java b/src/main/java/cpw/mods/ironchest/ItemChestChanger.java index 12e4dcc3..9da9e629 100755 --- a/src/main/java/cpw/mods/ironchest/ItemChestChanger.java +++ b/src/main/java/cpw/mods/ironchest/ItemChestChanger.java @@ -21,6 +21,7 @@ import net.minecraft.util.EnumActionResult; import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumHand; +import net.minecraft.util.NonNullList; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; @@ -38,17 +39,18 @@ public ItemChestChanger(ChestChangerType type) @Override //@formatter:off - public EnumActionResult onItemUseFirst(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, EnumHand hand) + public EnumActionResult onItemUseFirst(EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ, EnumHand hand) + //public EnumActionResult onItemUseFirst(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, EnumHand hand) //@formatter:on { - if (worldIn.isRemote) + if (world.isRemote) { return EnumActionResult.PASS; } if (this.type.canUpgrade(IronChestType.WOOD)) { - if (!(worldIn.getBlockState(pos).getBlock() instanceof BlockChest)) + if (!(world.getBlockState(pos).getBlock() instanceof BlockChest)) { return EnumActionResult.PASS; } @@ -56,23 +58,23 @@ public EnumActionResult onItemUseFirst(ItemStack stack, EntityPlayer playerIn, W else { //@formatter:off - if (worldIn.getBlockState(pos) != IronChest.ironChestBlock.getStateFromMeta(IronChestType.valueOf(this.type.source.getName().toUpperCase()).ordinal())) + if (world.getBlockState(pos) != IronChest.ironChestBlock.getStateFromMeta(IronChestType.valueOf(this.type.source.getName().toUpperCase()).ordinal())) //@formatter:on { return EnumActionResult.PASS; } } - TileEntity te = worldIn.getTileEntity(pos); + TileEntity te = world.getTileEntity(pos); TileEntityIronChest newchest = new TileEntityIronChest(); - ItemStack[] chestContents = new ItemStack[27]; + NonNullList chestContents = NonNullList. func_191197_a(27, ItemStack.field_190927_a); EnumFacing chestFacing = EnumFacing.DOWN; if (te != null) { if (te instanceof TileEntityIronChest) { - chestContents = ((TileEntityIronChest) te).chestContents; + chestContents = ((TileEntityIronChest) te).func_190576_q(); chestFacing = ((TileEntityIronChest) te).getFacing(); newchest = this.type.target.makeEntity(); if (newchest == null) @@ -82,7 +84,7 @@ public EnumActionResult onItemUseFirst(ItemStack stack, EntityPlayer playerIn, W } else if (te instanceof TileEntityChest) { - IBlockState chestState = worldIn.getBlockState(pos); + IBlockState chestState = world.getBlockState(pos); chestFacing = chestState.getValue(BlockChest.FACING); TileEntityChest chest = (TileEntityChest) te; @@ -94,10 +96,10 @@ else if (te instanceof TileEntityChest) { return EnumActionResult.PASS; } - chestContents = new ItemStack[chest.getSizeInventory()]; - for (int i = 0; i < chestContents.length; i++) + chestContents = NonNullList. func_191197_a(chest.getSizeInventory(), ItemStack.field_190927_a);//new ItemStack[chest.getSizeInventory()]; + for (int i = 0; i < chestContents.size(); i++) { - chestContents[i] = chest.getStackInSlot(i); + chestContents.set(i, chest.getStackInSlot(i)); } newchest = this.type.target.makeEntity(); } @@ -110,17 +112,17 @@ else if (te instanceof TileEntityChest) ((TileEntityChest) te).checkForAdjacentChests(); } - worldIn.removeTileEntity(pos); - worldIn.setBlockToAir(pos); + world.removeTileEntity(pos); + world.setBlockToAir(pos); IBlockState iblockstate = IronChest.ironChestBlock.getDefaultState().withProperty(BlockIronChest.VARIANT_PROP, this.type.target); - worldIn.setTileEntity(pos, newchest); - worldIn.setBlockState(pos, iblockstate, 3); + world.setTileEntity(pos, newchest); + world.setBlockState(pos, iblockstate, 3); - worldIn.notifyBlockUpdate(pos, iblockstate, iblockstate, 3); + world.notifyBlockUpdate(pos, iblockstate, iblockstate, 3); - TileEntity te2 = worldIn.getTileEntity(pos); + TileEntity te2 = world.getTileEntity(pos); if (te2 instanceof TileEntityIronChest) { @@ -128,7 +130,9 @@ else if (te instanceof TileEntityChest) ((TileEntityIronChest) te2).setFacing(chestFacing); } - stack.func_190920_e(playerIn.capabilities.isCreativeMode ? stack.func_190916_E() : stack.func_190916_E() - 1); + ItemStack stack = player.getHeldItem(hand); + + stack.func_190920_e(player.capabilities.isCreativeMode ? stack.func_190916_E() : stack.func_190916_E() - 1); return EnumActionResult.SUCCESS; } diff --git a/src/main/java/cpw/mods/ironchest/TileEntityDirtChest.java b/src/main/java/cpw/mods/ironchest/TileEntityDirtChest.java index b7b0f6e3..0b04bb23 100755 --- a/src/main/java/cpw/mods/ironchest/TileEntityDirtChest.java +++ b/src/main/java/cpw/mods/ironchest/TileEntityDirtChest.java @@ -42,9 +42,9 @@ public void wasPlaced(EntityLivingBase entityliving, ItemStack itemStack) @Override public void removeAdornments() { - if (this.chestContents[0] != null && this.chestContents[0].isItemEqual(dirtChest9000GuideBook)) + if (this.func_190576_q().get(0) != ItemStack.field_190927_a && this.func_190576_q().get(0).isItemEqual(dirtChest9000GuideBook)) { - this.chestContents[0] = null; + this.func_190576_q().set(0, ItemStack.field_190927_a); } } -} \ No newline at end of file +} diff --git a/src/main/java/cpw/mods/ironchest/TileEntityIronChest.java b/src/main/java/cpw/mods/ironchest/TileEntityIronChest.java index 2cc499e0..c8dcad68 100755 --- a/src/main/java/cpw/mods/ironchest/TileEntityIronChest.java +++ b/src/main/java/cpw/mods/ironchest/TileEntityIronChest.java @@ -16,56 +16,68 @@ import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.init.SoundEvents; import net.minecraft.inventory.Container; -import net.minecraft.inventory.IInventory; import net.minecraft.inventory.ItemStackHelper; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; import net.minecraft.network.NetworkManager; import net.minecraft.network.play.server.SPacketUpdateTileEntity; import net.minecraft.tileentity.TileEntityLockableLoot; import net.minecraft.util.EnumFacing; import net.minecraft.util.ITickable; +import net.minecraft.util.NonNullList; import net.minecraft.util.SoundCategory; import net.minecraft.util.math.AxisAlignedBB; import net.minecraftforge.common.util.Constants; -import java.util.Arrays; -import java.util.Comparator; - -import javax.annotation.Nullable; +public class TileEntityIronChest extends TileEntityLockableLoot implements ITickable//, IInventory +{ + /** The current angle of the lid (between 0 and 1) */ + public float lidAngle; -public class TileEntityIronChest extends TileEntityLockableLoot implements ITickable, IInventory { + /** The angle of the lid last tick */ public float prevLidAngle; - public float lidAngle; - public ItemStack[] chestContents; + + private NonNullList chestContents; + private int ticksSinceSync = -1; + private int numPlayersUsing; - private ItemStack[] topStacks; + + //private ItemStack[] topStacks; + private EnumFacing facing; + private boolean inventoryTouched; + private boolean hadStuff; + private String customName; + private IronChestType chestType; - public TileEntityIronChest () { + public TileEntityIronChest() + { this(IronChestType.IRON); } - protected TileEntityIronChest (IronChestType type) { + protected TileEntityIronChest(IronChestType type) + { super(); this.chestType = type; - this.chestContents = new ItemStack[type.size]; - this.topStacks = new ItemStack[8]; + this.chestContents = NonNullList. func_191197_a(type.size, ItemStack.field_190927_a); + //this.topStacks = new ItemStack[8]; this.facing = EnumFacing.NORTH; } - public void setContents (ItemStack[] contents) { - this.chestContents = new ItemStack[this.getType().size]; + public void setContents(NonNullList contents) + { + this.chestContents = NonNullList. func_191197_a(this.getType().size, ItemStack.field_190927_a); - for (int i = 0; i < contents.length; i++) { - if (i < this.chestContents.length) { - this.chestContents[i] = contents[i]; + for (int i = 0; i < contents.size(); i++) + { + if (i < this.chestContents.size()) + { + this.chestContents.set(i, contents.get(i)); } } @@ -73,25 +85,31 @@ public void setContents (ItemStack[] contents) { } @Override - public int getSizeInventory () { - return this.chestContents.length; + public int getSizeInventory() + { + return this.chestContents.size(); } - public EnumFacing getFacing () { + public EnumFacing getFacing() + { return this.facing; } - public void setFacing (EnumFacing facing) { + public void setFacing(EnumFacing facing) + { this.facing = facing; } - public IronChestType getType () { + public IronChestType getType() + { IronChestType type = IronChestType.IRON; - if (this.hasWorldObj()) { + if (this.hasWorldObj()) + { IBlockState state = this.worldObj.getBlockState(this.pos); - if (state.getBlock() == IronChest.ironChestBlock) { + if (state.getBlock() == IronChest.ironChestBlock) + { type = state.getValue(BlockIronChest.VARIANT_PROP); } } @@ -100,37 +118,45 @@ public IronChestType getType () { } @Override - public ItemStack getStackInSlot (int index) { + public ItemStack getStackInSlot(int index) + { this.fillWithLoot((EntityPlayer) null); this.inventoryTouched = true; - return this.chestContents[index]; + return this.func_190576_q().get(index); } @Override - public void markDirty () { + public void markDirty() + { super.markDirty(); - this.sortTopStacks(); + //this.sortTopStacks(); } - protected void sortTopStacks () { - if (!this.getType().isTransparent() || (this.worldObj != null && this.worldObj.isRemote)) { + /*protected void sortTopStacks() + { + if (!this.getType().isTransparent() || (this.worldObj != null && this.worldObj.isRemote)) + { return; } - + ItemStack[] tempCopy = new ItemStack[this.getSizeInventory()]; - + boolean hasStuff = false; - + int compressedIdx = 0; - + mainLoop: - for (int i = 0; i < this.getSizeInventory(); i++) { - if (this.chestContents[i] != null) { - for (int j = 0; j < compressedIdx; j++) { - if (tempCopy[j].isItemEqual(this.chestContents[i])) { + for (int i = 0; i < this.getSizeInventory(); i++) + { + if (this.chestContents[i] != null) + { + for (int j = 0; j < compressedIdx; j++) + { + if (tempCopy[j].isItemEqual(this.chestContents[i])) + { tempCopy[j].func_190920_e(tempCopy[j].func_190916_E() + this.chestContents[i].func_190916_E()); continue mainLoop; } @@ -139,155 +165,128 @@ protected void sortTopStacks () { hasStuff = true; } } - - if (!hasStuff && this.hadStuff) { + + if (!hasStuff && this.hadStuff) + { this.hadStuff = false; - - for (int i = 0; i < this.topStacks.length; i++) { + + for (int i = 0; i < this.topStacks.length; i++) + { this.topStacks[i] = null; } - - if (this.worldObj != null) { + + if (this.worldObj != null) + { IBlockState iblockstate = this.worldObj.getBlockState(this.pos); this.worldObj.notifyBlockUpdate(this.pos, iblockstate, iblockstate, 3); } - + return; } - + this.hadStuff = true; - - Arrays.sort(tempCopy, new Comparator() { + + Arrays.sort(tempCopy, new Comparator() + { @Override - public int compare (ItemStack o1, ItemStack o2) { - if (o1 == null) { + public int compare(ItemStack o1, ItemStack o2) + { + if (o1 == null) + { return 1; - } else if (o2 == null) { + } + else if (o2 == null) + { return -1; - } else { + } + else + { return o2.func_190916_E() - o1.func_190916_E(); } } }); - + int p = 0; - - for (ItemStack element : tempCopy) { - if (element != ItemStack.field_190927_a && element.func_190916_E() > 0) { + + for (ItemStack element : tempCopy) + { + if (element != ItemStack.field_190927_a && element.func_190916_E() > 0) + { this.topStacks[p++] = element; - - if (p == this.topStacks.length) { + + if (p == this.topStacks.length) + { break; } } } - - for (int i = p; i < this.topStacks.length; i++) { + + for (int i = p; i < this.topStacks.length; i++) + { this.topStacks[i] = null; } - - if (this.worldObj != null) { + + if (this.worldObj != null) + { IBlockState iblockstate = this.worldObj.getBlockState(this.pos); - + this.worldObj.notifyBlockUpdate(this.pos, iblockstate, iblockstate, 3); } - } - - @Override - @Nullable - public ItemStack decrStackSize (int index, int count) { - this.fillWithLoot((EntityPlayer) null); - - ItemStack itemstack = ItemStackHelper.getAndSplit(this.chestContents, index, count); - - if (itemstack != null) { - this.markDirty(); - } - - return itemstack; - } - - @Override - public void setInventorySlotContents (int index, @Nullable ItemStack stack) { - this.fillWithLoot((EntityPlayer) null); - - this.chestContents[index] = stack; - - if (stack != null && stack.func_190916_E() > this.getInventoryStackLimit()) { - stack.func_190920_e(this.getInventoryStackLimit()); - } - - this.markDirty(); - } + }*/ @Override - public String getName () { + public String getName() + { return this.hasCustomName() ? this.customName : this.getType().name(); } @Override - public boolean hasCustomName () { + public boolean hasCustomName() + { return this.customName != null && this.customName.length() > 0; } - public void setCustomName (String name) { + public void setCustomName(String name) + { this.customName = name; } @Override - public void readFromNBT (NBTTagCompound compound) { + public void readFromNBT(NBTTagCompound compound) + { super.readFromNBT(compound); - this.chestContents = new ItemStack[this.getSizeInventory()]; + this.chestContents = NonNullList. func_191197_a(this.getSizeInventory(), ItemStack.field_190927_a); - if (compound.hasKey("CustomName", Constants.NBT.TAG_STRING)) { + if (compound.hasKey("CustomName", Constants.NBT.TAG_STRING)) + { this.customName = compound.getString("CustomName"); } - if (!this.checkLootAndRead(compound)) { - NBTTagList itemList = compound.getTagList("Items", Constants.NBT.TAG_COMPOUND); - - for (int itemNumber = 0; itemNumber < itemList.tagCount(); ++itemNumber) { - NBTTagCompound item = itemList.getCompoundTagAt(itemNumber); - - int slot = item.getByte("Slot") & 255; - - if (slot >= 0 && slot < this.chestContents.length) { - this.chestContents[slot] = ItemStack.loadItemStackFromNBT(item); - } - } + if (!this.checkLootAndRead(compound)) + { + ItemStackHelper.func_191283_b(compound, this.chestContents); } this.facing = EnumFacing.VALUES[compound.getByte("facing")]; - this.sortTopStacks(); + //this.sortTopStacks(); } @Override - public NBTTagCompound writeToNBT (NBTTagCompound compound) { + public NBTTagCompound writeToNBT(NBTTagCompound compound) + { super.writeToNBT(compound); - if (!this.checkLootAndWrite(compound)) { - NBTTagList itemList = new NBTTagList(); - - for (int slot = 0; slot < this.chestContents.length; ++slot) { - if (this.chestContents[slot] != null) { - NBTTagCompound tag = new NBTTagCompound(); - - tag.setByte("Slot", (byte) slot); - - this.chestContents[slot].writeToNBT(tag); - - itemList.appendTag(tag); - } - } - - compound.setTag("Items", itemList); + if (!this.checkLootAndWrite(compound)) + { + ItemStackHelper.func_191282_a(compound, this.chestContents); } compound.setByte("facing", (byte) this.facing.ordinal()); - if (this.hasCustomName()) { + if (this.hasCustomName()) + { compound.setString("CustomName", this.customName); } @@ -295,17 +294,21 @@ public NBTTagCompound writeToNBT (NBTTagCompound compound) { } @Override - public int getInventoryStackLimit () { + public int getInventoryStackLimit() + { return 64; } @Override - public boolean isUseableByPlayer (EntityPlayer player) { - if (this.worldObj == null) { + public boolean isUseableByPlayer(EntityPlayer player) + { + if (this.worldObj == null) + { return true; } - if (this.worldObj.getTileEntity(this.pos) != this) { + if (this.worldObj.getTileEntity(this.pos) != this) + { return false; } @@ -313,7 +316,8 @@ public boolean isUseableByPlayer (EntityPlayer player) { } @Override - public void update () { + public void update() + { // Resynchronizes clients with the server state //@formatter:off if (this.worldObj != null && !this.worldObj.isRemote && this.numPlayersUsing != 0 && (this.ticksSinceSync + this.pos.getX() + this.pos.getY() + this.pos.getZ()) % 200 == 0) @@ -328,20 +332,23 @@ public void update () { new AxisAlignedBB(this.pos.getX() - f, this.pos.getY() - f, this.pos.getZ() - f, this.pos.getX() + 1 + f, this.pos.getY() + 1 + f, this.pos.getZ() + 1 + f))) //@formatter:on { - if (player.openContainer instanceof ContainerIronChest) { + if (player.openContainer instanceof ContainerIronChest) + { ++this.numPlayersUsing; } } } - if (this.worldObj != null && !this.worldObj.isRemote && this.ticksSinceSync < 0) { + if (this.worldObj != null && !this.worldObj.isRemote && this.ticksSinceSync < 0) + { this.worldObj.addBlockEvent(this.pos, IronChest.ironChestBlock, 3, ((this.numPlayersUsing << 3) & 0xF8) | (this.facing.ordinal() & 0x7)); } - if (!this.worldObj.isRemote && this.inventoryTouched) { + if (!this.worldObj.isRemote && this.inventoryTouched) + { this.inventoryTouched = false; - this.sortTopStacks(); + //this.sortTopStacks(); } this.ticksSinceSync++; @@ -350,7 +357,8 @@ public void update () { float angle = 0.1F; - if (this.numPlayersUsing > 0 && this.lidAngle == 0.0F) { + if (this.numPlayersUsing > 0 && this.lidAngle == 0.0F) + { double x = this.pos.getX() + 0.5D; double y = this.pos.getY() + 0.5D; double z = this.pos.getZ() + 0.5D; @@ -360,22 +368,28 @@ public void update () { //@formatter:on } - if (this.numPlayersUsing == 0 && this.lidAngle > 0.0F || this.numPlayersUsing > 0 && this.lidAngle < 1.0F) { + if (this.numPlayersUsing == 0 && this.lidAngle > 0.0F || this.numPlayersUsing > 0 && this.lidAngle < 1.0F) + { float currentAngle = this.lidAngle; - if (this.numPlayersUsing > 0) { + if (this.numPlayersUsing > 0) + { this.lidAngle += angle; - } else { + } + else + { this.lidAngle -= angle; } - if (this.lidAngle > 1.0F) { + if (this.lidAngle > 1.0F) + { this.lidAngle = 1.0F; } float maxAngle = 0.5F; - if (this.lidAngle < maxAngle && currentAngle >= maxAngle) { + if (this.lidAngle < maxAngle && currentAngle >= maxAngle) + { double x = this.pos.getX() + 0.5D; double y = this.pos.getY() + 0.5D; double z = this.pos.getZ() + 0.5D; @@ -385,19 +399,26 @@ public void update () { //@formatter:on } - if (this.lidAngle < 0.0F) { + if (this.lidAngle < 0.0F) + { this.lidAngle = 0.0F; } } } @Override - public boolean receiveClientEvent (int id, int type) { - if (id == 1) { + public boolean receiveClientEvent(int id, int type) + { + if (id == 1) + { this.numPlayersUsing = type; - } else if (id == 2) { + } + else if (id == 2) + { this.facing = EnumFacing.VALUES[type]; - } else if (id == 3) { + } + else if (id == 3) + { this.facing = EnumFacing.VALUES[type & 0x7]; this.numPlayersUsing = (type & 0xF8) >> 3; } @@ -406,196 +427,220 @@ public boolean receiveClientEvent (int id, int type) { } @Override - public void openInventory (EntityPlayer player) { - if (!player.isSpectator()) { - if (this.worldObj == null) { + public void openInventory(EntityPlayer player) + { + if (!player.isSpectator()) + { + if (this.worldObj == null) + { return; } - if (this.numPlayersUsing < 0) { + if (this.numPlayersUsing < 0) + { this.numPlayersUsing = 0; } ++this.numPlayersUsing; this.worldObj.addBlockEvent(this.pos, IronChest.ironChestBlock, 1, this.numPlayersUsing); - this.worldObj.notifyNeighborsOfStateChange(this.pos, IronChest.ironChestBlock); - this.worldObj.notifyNeighborsOfStateChange(this.pos.down(), IronChest.ironChestBlock); + this.worldObj.notifyNeighborsOfStateChange(this.pos, IronChest.ironChestBlock, false); + this.worldObj.notifyNeighborsOfStateChange(this.pos.down(), IronChest.ironChestBlock, false); } } @Override - public void closeInventory (EntityPlayer player) { - if (!player.isSpectator()) { - if (this.worldObj == null) { + public void closeInventory(EntityPlayer player) + { + if (!player.isSpectator()) + { + if (this.worldObj == null) + { return; } --this.numPlayersUsing; this.worldObj.addBlockEvent(this.pos, IronChest.ironChestBlock, 1, this.numPlayersUsing); - this.worldObj.notifyNeighborsOfStateChange(this.pos, IronChest.ironChestBlock); - this.worldObj.notifyNeighborsOfStateChange(this.pos.down(), IronChest.ironChestBlock); + this.worldObj.notifyNeighborsOfStateChange(this.pos, IronChest.ironChestBlock, false); + this.worldObj.notifyNeighborsOfStateChange(this.pos.down(), IronChest.ironChestBlock, false); } } - public ItemStack[] getTopItemStacks () { - return this.topStacks; - } + //public ItemStack[] getTopItemStacks() + //{ + // return this.topStacks; + //} @Override - public SPacketUpdateTileEntity getUpdatePacket () { + public SPacketUpdateTileEntity getUpdatePacket() + { NBTTagCompound compound = new NBTTagCompound(); compound.setByte("facing", (byte) this.facing.ordinal()); - ItemStack[] stacks = this.buildItemStackDataList(); - - if (stacks != null) { + /*ItemStack[] stacks = this.buildItemStackDataList(); + + if (stacks != null) + { NBTTagList itemList = new NBTTagList(); - - for (int slot = 0; slot < stacks.length; slot++) { - if (stacks[slot] != null) { + + for (int slot = 0; slot < stacks.length; slot++) + { + if (stacks[slot] != null) + { NBTTagCompound item = new NBTTagCompound(); - + item.setByte("Slot", (byte) slot); - + stacks[slot].writeToNBT(item); - + itemList.appendTag(item); } } - + compound.setTag("stacks", itemList); - } + }*/ return new SPacketUpdateTileEntity(this.pos, 0, compound); } @Override - public void onDataPacket (NetworkManager net, SPacketUpdateTileEntity pkt) { - if (pkt.getTileEntityType() == 0) { + public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt) + { + if (pkt.getTileEntityType() == 0) + { NBTTagCompound compound = pkt.getNbtCompound(); this.facing = EnumFacing.VALUES[compound.getByte("facing")]; - NBTTagList itemList = compound.getTagList("stacks", Constants.NBT.TAG_COMPOUND); - + /*NBTTagList itemList = compound.getTagList("stacks", Constants.NBT.TAG_COMPOUND); + ItemStack[] stacks = new ItemStack[this.topStacks.length]; - - for (int item = 0; item < stacks.length; item++) { + + for (int item = 0; item < stacks.length; item++) + { NBTTagCompound itemStack = itemList.getCompoundTagAt(item); - + int slot = itemStack.getByte("Slot") & 255; - - if (slot >= 0 && slot < stacks.length) { + + if (slot >= 0 && slot < stacks.length) + { stacks[slot] = ItemStack.loadItemStackFromNBT(itemStack); } } - - if (this.getType().isTransparent() && stacks != null) { + + if (this.getType().isTransparent() && stacks != null) + { int pos = 0; - - for (int i = 0; i < this.topStacks.length; i++) { - if (stacks[pos] != null) { + + for (int i = 0; i < this.topStacks.length; i++) + { + if (stacks[pos] != null) + { this.topStacks[i] = stacks[pos]; - } else { + } + else + { this.topStacks[i] = null; } - + pos++; } - } + }*/ } } - public ItemStack[] buildItemStackDataList () { - if (this.getType().isTransparent()) { + /*public ItemStack[] buildItemStackDataList() + { + if (this.getType().isTransparent()) + { ItemStack[] sortList = new ItemStack[this.topStacks.length]; - + int pos = 0; - - for (ItemStack is : this.topStacks) { - if (is != null) { + + for (ItemStack is : this.topStacks) + { + if (is != null) + { sortList[pos++] = is; - } else { + } + else + { sortList[pos++] = null; } } - + return sortList; } - + return null; - } - - @Override - @Nullable - public ItemStack removeStackFromSlot (int index) { - this.fillWithLoot((EntityPlayer) null); - - return ItemStackHelper.getAndRemove(this.chestContents, index); - } + }*/ @Override - public boolean isItemValidForSlot (int index, ItemStack stack) { + public boolean isItemValidForSlot(int index, ItemStack stack) + { return this.getType().acceptsStack(stack); } - public void rotateAround () { + public void rotateAround() + { this.setFacing(this.facing.rotateY()); this.worldObj.addBlockEvent(this.pos, IronChest.ironChestBlock, 2, this.facing.ordinal()); } - public void wasPlaced (EntityLivingBase entityliving, ItemStack stack) { + public void wasPlaced(EntityLivingBase entityliving, ItemStack stack) + { } - public void removeAdornments () { + public void removeAdornments() + { } @Override - public int getField (int id) { - return 0; - } + public Container createContainer(InventoryPlayer playerInventory, EntityPlayer playerIn) + { + this.fillWithLoot((EntityPlayer) null); - @Override - public void setField (int id, int value) { + return new ContainerIronChest(playerInventory, this, this.chestType, this.chestType.xSize, this.chestType.ySize); } @Override - public int getFieldCount () { - return 0; + public String getGuiID() + { + return "IronChest:" + this.getType().name(); } @Override - public void clear () { - this.fillWithLoot((EntityPlayer) null); - - for (int slot = 0; slot < this.chestContents.length; ++slot) { - this.chestContents[slot] = null; - } + public boolean canRenderBreaking() + { + return true; } @Override - public Container createContainer (InventoryPlayer playerInventory, EntityPlayer playerIn) { - this.fillWithLoot((EntityPlayer) null); - - return new ContainerIronChest(playerInventory, this, this.chestType, this.chestType.xSize, this.chestType.ySize); + public NBTTagCompound getUpdateTag() + { + return this.writeToNBT(new NBTTagCompound()); } @Override - public String getGuiID () { - return "IronChest:" + this.getType().name(); + protected NonNullList func_190576_q() + { + return this.chestContents; } @Override - public boolean canRenderBreaking () { - return true; - } + public boolean func_191420_l() + { + for (ItemStack itemstack : this.chestContents) + { + if (!itemstack.func_190926_b()) + { + return false; + } + } - @Override - public NBTTagCompound getUpdateTag () { - return this.writeToNBT(new NBTTagCompound()); + return true; } } diff --git a/src/main/java/cpw/mods/ironchest/client/TileEntityIronChestRenderer.java b/src/main/java/cpw/mods/ironchest/client/TileEntityIronChestRenderer.java index 83051c15..c8335d3d 100755 --- a/src/main/java/cpw/mods/ironchest/client/TileEntityIronChestRenderer.java +++ b/src/main/java/cpw/mods/ironchest/client/TileEntityIronChestRenderer.java @@ -12,31 +12,31 @@ import java.util.Random; -import com.google.common.primitives.SignedBytes; - import cpw.mods.ironchest.BlockIronChest; import cpw.mods.ironchest.IronChest; import cpw.mods.ironchest.IronChestType; import cpw.mods.ironchest.TileEntityIronChest; import net.minecraft.block.state.IBlockState; -import net.minecraft.client.Minecraft; import net.minecraft.client.model.ModelChest; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.entity.RenderEntityItem; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.entity.item.EntityItem; -import net.minecraft.item.ItemStack; import net.minecraft.util.EnumFacing; public class TileEntityIronChestRenderer extends TileEntitySpecialRenderer { private Random random; + private RenderEntityItem itemRenderer; + private ModelChest model; private static float[][] shifts = { { 0.3F, 0.45F, 0.3F }, { 0.7F, 0.45F, 0.3F }, { 0.3F, 0.45F, 0.7F }, { 0.7F, 0.45F, 0.7F }, { 0.3F, 0.1F, 0.3F }, { 0.7F, 0.1F, 0.3F }, { 0.3F, 0.1F, 0.7F }, { 0.7F, 0.1F, 0.7F }, { 0.5F, 0.32F, 0.5F }, }; + private static EntityItem customitem = new EntityItem(null); + private static float halfPI = (float) (Math.PI / 2D); public TileEntityIronChestRenderer() @@ -141,7 +141,7 @@ public void renderTileEntityAt(TileEntityIronChest tile, double x, double y, dou GlStateManager.popMatrix(); GlStateManager.color(1F, 1F, 1F, 1F); - if (type.isTransparent() + /*if (type.isTransparent() && tile.getDistanceSq(this.rendererDispatcher.entityX, this.rendererDispatcher.entityY, this.rendererDispatcher.entityZ) < 128d) { this.random.setSeed(254L); @@ -158,7 +158,7 @@ public void renderTileEntityAt(TileEntityIronChest tile, double x, double y, dou } GlStateManager.pushMatrix(); GlStateManager.translate((float) x, (float) y, (float) z); - + customitem.setWorld(this.getWorld()); customitem.hoverStart = 0F; for (ItemStack item : tile.getTopItemStacks()) @@ -181,7 +181,7 @@ public void renderTileEntityAt(TileEntityIronChest tile, double x, double y, dou GlStateManager.rotate(timeD, 0F, 1F, 0F); GlStateManager.scale(blockScale, blockScale, blockScale); customitem.setEntityItemStack(item); - + if (this.itemRenderer == null) { this.itemRenderer = new RenderEntityItem(Minecraft.getMinecraft().getRenderManager(), Minecraft.getMinecraft().getRenderItem()) { @@ -190,13 +190,13 @@ public int getModelCount(ItemStack stack) { return SignedBytes.saturatedCast(Math.min(stack.func_190916_E() / 32, 15) + 1); } - + @Override public boolean shouldBob() { return false; } - + @Override public boolean shouldSpreadItems() { @@ -204,13 +204,13 @@ public boolean shouldSpreadItems() } }; } - + this.itemRenderer.doRender(customitem, 0D, 0D, 0D, 0F, partialTick); GlStateManager.popMatrix(); } - + GlStateManager.popMatrix(); - } + }*/ } } diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info index 79afb745..3ecbefcd 100755 --- a/src/main/resources/mcmod.info +++ b/src/main/resources/mcmod.info @@ -10,10 +10,8 @@ "authorList": ["cpw"], "credits": "By cpw, based on an original idea by Lishid", "logoFile": "", - "screenshots": [ - ], + "screenshots": [], "parent":"", - "dependencies": [ - ] + "dependencies": [] } ] From e6fb331bd9e19f56796dcfca6cb393da2625a208 Mon Sep 17 00:00:00 2001 From: alexbegt Date: Fri, 18 Nov 2016 10:26:10 -0500 Subject: [PATCH 036/105] Add JEI to the dev environment, rename the items + blocks to match vanilla formats of no capital letters and to include underscores, and fix the crystal chest not rendering items in it. --- build.gradle | 2 +- .../api/container/ChestContainer.java | 0 .../cpw/mods/ironchest/BlockIronChest.java | 4 +- .../cpw/mods/ironchest/ChestChangerType.java | 18 +- .../mods/ironchest/ContainerIronChest.java | 13 +- .../java/cpw/mods/ironchest/IronChest.java | 107 ++++++++++- .../mods/ironchest/IronChestAIOcelotSit.java | 27 ++- .../cpw/mods/ironchest/IronChestType.java | 16 +- .../cpw/mods/ironchest/ItemIronChest.java | 2 +- .../mods/ironchest/TileEntityIronChest.java | 178 +++++++++--------- .../mods/ironchest/client/ClientProxy.java | 2 +- .../cpw/mods/ironchest/client/GUIChest.java | 12 +- .../client/TileEntityIronChestRenderer.java | 35 ++-- .../blockstates/ItemChestUpgrade.json | 61 ------ .../{BlockIronChest.json => iron_chest.json} | 30 +-- .../blockstates/iron_chest_upgrades.json | 56 ++++++ .../assets/ironchest/lang/hu_HU.lang | 25 +++ .../block/{chest.json => iron_chest.json} | 2 +- .../{copperbreak.png => copper_break.png} | Bin .../{crystalbreak.png => crystal_break.png} | Bin .../{diamondbreak.png => diamond_break.png} | Bin .../blocks/{goldbreak.png => gold_break.png} | Bin .../blocks/{ironbreak.png => iron_break.png} | Bin .../{silverbreak.png => silver_break.png} | Bin ...ppercontainer.png => copper_container.png} | Bin ...ondcontainer.png => diamond_container.png} | Bin .../{dirtcontainer.png => dirt_container.png} | Bin .../{goldcontainer.png => gold_container.png} | Bin .../{ironcontainer.png => iron_container.png} | Bin ...lvercontainer.png => silver_container.png} | Bin ...ronUpgrade.png => copper_iron_upgrade.png} | Bin ...rUpgrade.png => copper_silver_upgrade.png} | Bin ...pgrade.png => diamond_crystal_upgrade.png} | Bin ...grade.png => diamond_obsidian_upgrade.png} | Bin ...ndUpgrade.png => gold_diamond_upgrade.png} | Bin ...nGoldUpgrade.png => iron_gold_upgrade.png} | Bin ...oldUpgrade.png => silver_gold_upgrade.png} | Bin ...perUpgrade.png => wood_copper_upgrade.png} | Bin ...dIronUpgrade.png => wood_iron_upgrade.png} | Bin .../{copperchest.png => copper_chest.png} | Bin .../{crystalchest.png => crystal_chest.png} | Bin .../{diamondchest.png => diamond_chest.png} | Bin .../model/{dirtchest.png => dirt_chest.png} | Bin .../model/{goldchest.png => gold_chest.png} | Bin .../model/{ironchest.png => iron_chest.png} | Bin .../{obsidianchest.png => obsidian_chest.png} | Bin .../{silverchest.png => silver_chest.png} | Bin 47 files changed, 376 insertions(+), 214 deletions(-) rename src/{main => }/api/java/invtweaks/api/container/ChestContainer.java (100%) delete mode 100644 src/main/resources/assets/ironchest/blockstates/ItemChestUpgrade.json rename src/main/resources/assets/ironchest/blockstates/{BlockIronChest.json => iron_chest.json} (52%) create mode 100644 src/main/resources/assets/ironchest/blockstates/iron_chest_upgrades.json create mode 100644 src/main/resources/assets/ironchest/lang/hu_HU.lang rename src/main/resources/assets/ironchest/models/block/{chest.json => iron_chest.json} (97%) rename src/main/resources/assets/ironchest/textures/blocks/{copperbreak.png => copper_break.png} (100%) rename src/main/resources/assets/ironchest/textures/blocks/{crystalbreak.png => crystal_break.png} (100%) rename src/main/resources/assets/ironchest/textures/blocks/{diamondbreak.png => diamond_break.png} (100%) rename src/main/resources/assets/ironchest/textures/blocks/{goldbreak.png => gold_break.png} (100%) rename src/main/resources/assets/ironchest/textures/blocks/{ironbreak.png => iron_break.png} (100%) rename src/main/resources/assets/ironchest/textures/blocks/{silverbreak.png => silver_break.png} (100%) rename src/main/resources/assets/ironchest/textures/gui/{coppercontainer.png => copper_container.png} (100%) mode change 100755 => 100644 rename src/main/resources/assets/ironchest/textures/gui/{diamondcontainer.png => diamond_container.png} (100%) mode change 100755 => 100644 rename src/main/resources/assets/ironchest/textures/gui/{dirtcontainer.png => dirt_container.png} (100%) mode change 100755 => 100644 rename src/main/resources/assets/ironchest/textures/gui/{goldcontainer.png => gold_container.png} (100%) mode change 100755 => 100644 rename src/main/resources/assets/ironchest/textures/gui/{ironcontainer.png => iron_container.png} (100%) mode change 100755 => 100644 rename src/main/resources/assets/ironchest/textures/gui/{silvercontainer.png => silver_container.png} (100%) mode change 100755 => 100644 rename src/main/resources/assets/ironchest/textures/items/{copperIronUpgrade.png => copper_iron_upgrade.png} (100%) mode change 100755 => 100644 rename src/main/resources/assets/ironchest/textures/items/{copperSilverUpgrade.png => copper_silver_upgrade.png} (100%) mode change 100755 => 100644 rename src/main/resources/assets/ironchest/textures/items/{diamondCrystalUpgrade.png => diamond_crystal_upgrade.png} (100%) mode change 100755 => 100644 rename src/main/resources/assets/ironchest/textures/items/{diamondObsidianUpgrade.png => diamond_obsidian_upgrade.png} (100%) mode change 100755 => 100644 rename src/main/resources/assets/ironchest/textures/items/{goldDiamondUpgrade.png => gold_diamond_upgrade.png} (100%) mode change 100755 => 100644 rename src/main/resources/assets/ironchest/textures/items/{ironGoldUpgrade.png => iron_gold_upgrade.png} (100%) mode change 100755 => 100644 rename src/main/resources/assets/ironchest/textures/items/{silverGoldUpgrade.png => silver_gold_upgrade.png} (100%) mode change 100755 => 100644 rename src/main/resources/assets/ironchest/textures/items/{woodCopperUpgrade.png => wood_copper_upgrade.png} (100%) mode change 100755 => 100644 rename src/main/resources/assets/ironchest/textures/items/{woodIronUpgrade.png => wood_iron_upgrade.png} (100%) mode change 100755 => 100644 rename src/main/resources/assets/ironchest/textures/model/{copperchest.png => copper_chest.png} (100%) mode change 100755 => 100644 rename src/main/resources/assets/ironchest/textures/model/{crystalchest.png => crystal_chest.png} (100%) mode change 100755 => 100644 rename src/main/resources/assets/ironchest/textures/model/{diamondchest.png => diamond_chest.png} (100%) mode change 100755 => 100644 rename src/main/resources/assets/ironchest/textures/model/{dirtchest.png => dirt_chest.png} (100%) mode change 100755 => 100644 rename src/main/resources/assets/ironchest/textures/model/{goldchest.png => gold_chest.png} (100%) mode change 100755 => 100644 rename src/main/resources/assets/ironchest/textures/model/{ironchest.png => iron_chest.png} (100%) mode change 100755 => 100644 rename src/main/resources/assets/ironchest/textures/model/{obsidianchest.png => obsidian_chest.png} (100%) mode change 100755 => 100644 rename src/main/resources/assets/ironchest/textures/model/{silverchest.png => silver_chest.png} (100%) mode change 100755 => 100644 diff --git a/build.gradle b/build.gradle index 855238c7..d4f59dd5 100755 --- a/build.gradle +++ b/build.gradle @@ -33,7 +33,7 @@ repositories { } dependencies { - //deobfCompile "mezz.jei:jei_1.10.2:3.7.6.232" + deobfCompile "mezz.jei:jei_1.11:4.0.1.191" } // This is our group. I'm cpw.mods diff --git a/src/main/api/java/invtweaks/api/container/ChestContainer.java b/src/api/java/invtweaks/api/container/ChestContainer.java similarity index 100% rename from src/main/api/java/invtweaks/api/container/ChestContainer.java rename to src/api/java/invtweaks/api/container/ChestContainer.java diff --git a/src/main/java/cpw/mods/ironchest/BlockIronChest.java b/src/main/java/cpw/mods/ironchest/BlockIronChest.java index e041d81a..33a7fa0a 100755 --- a/src/main/java/cpw/mods/ironchest/BlockIronChest.java +++ b/src/main/java/cpw/mods/ironchest/BlockIronChest.java @@ -47,7 +47,7 @@ public class BlockIronChest extends Block public BlockIronChest() { super(Material.IRON); - this.setRegistryName(new ResourceLocation(IronChest.MOD_ID, "BlockIronChest")); + this.setRegistryName(new ResourceLocation(IronChest.MOD_ID, "iron_chest")); this.setDefaultState(this.blockState.getBaseState().withProperty(VARIANT_PROP, IronChestType.IRON)); @@ -121,7 +121,7 @@ public TileEntity createTileEntity(World world, IBlockState state) @Override @SideOnly(Side.CLIENT) - //public void getSubBlocks(Item itemIn, CreativeTabs tab, List list) + // public void getSubBlocks(Item itemIn, CreativeTabs tab, List list) public void getSubBlocks(Item itemIn, CreativeTabs tab, NonNullList list) { for (IronChestType type : IronChestType.VALUES) diff --git a/src/main/java/cpw/mods/ironchest/ChestChangerType.java b/src/main/java/cpw/mods/ironchest/ChestChangerType.java index 07b91c5e..94a671d6 100755 --- a/src/main/java/cpw/mods/ironchest/ChestChangerType.java +++ b/src/main/java/cpw/mods/ironchest/ChestChangerType.java @@ -22,15 +22,15 @@ public enum ChestChangerType { //@formatter:off - IRONGOLD(IRON, GOLD, "ironGoldUpgrade", "mmm", "msm", "mmm"), - GOLDDIAMOND(GOLD, DIAMOND, "goldDiamondUpgrade", "GGG", "msm", "GGG"), - COPPERSILVER(COPPER, SILVER, "copperSilverUpgrade", "mmm", "msm", "mmm"), - SILVERGOLD(SILVER, GOLD, "silverGoldUpgrade", "mGm", "GsG", "mGm"), - COPPERIRON(COPPER, IRON, "copperIronUpgrade", "mGm", "GsG", "mGm"), - DIAMONDCRYSTAL(DIAMOND, CRYSTAL, "diamondCrystalUpgrade", "GGG", "GOG", "GGG"), - WOODIRON(WOOD, IRON, "woodIronUpgrade", "mmm", "msm", "mmm"), - WOODCOPPER(WOOD, COPPER, "woodCopperUpgrade", "mmm", "msm", "mmm"), - DIAMONDOBSIDIAN(DIAMOND, OBSIDIAN, "diamondObsidianUpgrade", "mmm", "mGm", "mmm"); + IRONGOLD(IRON, GOLD, "iron_gold_upgrade", "mmm", "msm", "mmm"), + GOLDDIAMOND(GOLD, DIAMOND, "gold_diamond_upgrade", "GGG", "msm", "GGG"), + COPPERSILVER(COPPER, SILVER, "copper_silver_upgrade", "mmm", "msm", "mmm"), + SILVERGOLD(SILVER, GOLD, "silver_gold_upgrade", "mGm", "GsG", "mGm"), + COPPERIRON(COPPER, IRON, "copper_iron_upgrade", "mGm", "GsG", "mGm"), + DIAMONDCRYSTAL(DIAMOND, CRYSTAL, "diamond_crystal_upgrade", "GGG", "GOG", "GGG"), + WOODIRON(WOOD, IRON, "wood_iron_upgrade", "mmm", "msm", "mmm"), + WOODCOPPER(WOOD, COPPER, "wood_copper_upgrade", "mmm", "msm", "mmm"), + DIAMONDOBSIDIAN(DIAMOND, OBSIDIAN, "diamond_obsidian_upgrade", "mmm", "mGm", "mmm"); //@formatter:on public static final ChestChangerType[] VALUES = values(); diff --git a/src/main/java/cpw/mods/ironchest/ContainerIronChest.java b/src/main/java/cpw/mods/ironchest/ContainerIronChest.java index 83819c36..5ef4f553 100755 --- a/src/main/java/cpw/mods/ironchest/ContainerIronChest.java +++ b/src/main/java/cpw/mods/ironchest/ContainerIronChest.java @@ -10,6 +10,7 @@ ******************************************************************************/ package cpw.mods.ironchest; +import invtweaks.api.container.ChestContainer; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; @@ -17,7 +18,7 @@ import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; -//@ChestContainer(isLargeChest = true) +@ChestContainer(isLargeChest = true) public class ContainerIronChest extends Container { private IronChestType type; @@ -123,9 +124,9 @@ public EntityPlayer getPlayer() return this.player; } - //@ChestContainer.RowSizeCallback - //public int getNumColumns() - //{ - // return this.type.rowLength; - //} + @ChestContainer.RowSizeCallback + public int getNumColumns() + { + return this.type.rowLength; + } } diff --git a/src/main/java/cpw/mods/ironchest/IronChest.java b/src/main/java/cpw/mods/ironchest/IronChest.java index ea641bad..5c7c8719 100755 --- a/src/main/java/cpw/mods/ironchest/IronChest.java +++ b/src/main/java/cpw/mods/ironchest/IronChest.java @@ -12,16 +12,24 @@ import java.util.Properties; +import javax.annotation.Nonnull; + +import net.minecraft.block.Block; +import net.minecraft.item.Item; +import net.minecraft.util.ResourceLocation; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventHandler; import net.minecraftforge.fml.common.Mod.Instance; import net.minecraftforge.fml.common.SidedProxy; +import net.minecraftforge.fml.common.event.FMLMissingMappingsEvent; +import net.minecraftforge.fml.common.event.FMLMissingMappingsEvent.MissingMapping; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.common.network.NetworkRegistry; +import net.minecraftforge.fml.common.registry.ForgeRegistries; import net.minecraftforge.fml.common.registry.GameRegistry; -@Mod(modid = IronChest.MOD_ID, name = "Iron Chests", /*dependencies = "required-after:Forge@[12.17.0.1909,)",*/ acceptedMinecraftVersions = "[1.11, 1.12)") +@Mod(modid = IronChest.MOD_ID, name = "Iron Chests", dependencies = "required-after:forge@[13.19.0.2142,);", acceptedMinecraftVersions = "[1.11, 1.12)") public class IronChest { public static final String MOD_ID = "ironchest"; @@ -67,4 +75,101 @@ public void preInit(FMLPreInitializationEvent event) proxy.registerRenderInformation(); MinecraftForge.EVENT_BUS.register(new OcelotsSitOnChestsHandler()); } + + @Mod.EventHandler + public void onMissingMappings(FMLMissingMappingsEvent event) + { + for (MissingMapping mapping : event.get()) + { + if (mapping.resourceLocation.getResourceDomain().equals(IronChest.MOD_ID)) + { + @Nonnull + String path = mapping.resourceLocation.getResourcePath(); + + if (path.endsWith("blockironchest")) + { + path = path.replace("blockironchest", "iron_chest"); + ResourceLocation newRes = new ResourceLocation(mapping.resourceLocation.getResourceDomain(), path); + Block block = ForgeRegistries.BLOCKS.getValue(newRes); + + if (block != null) + { + if (mapping.type == GameRegistry.Type.BLOCK) + { + mapping.remap(block); + } + else + { + mapping.remap(Item.getItemFromBlock(block)); + } + } + } + + if (path.endsWith("irongoldupgrade")) + { + path = path.replace("irongoldupgrade", "iron_gold_upgrade"); + replaceUpgradeItem(path, mapping); + } + + if (path.endsWith("golddiamondupgrade")) + { + path = path.replace("golddiamondupgrade", "gold_diamond_upgrade"); + replaceUpgradeItem(path, mapping); + } + + if (path.endsWith("coppersilverupgrade")) + { + path = path.replace("coppersilverupgrade", "copper_silver_upgrade"); + replaceUpgradeItem(path, mapping); + } + + if (path.endsWith("silvergoldupgrade")) + { + path = path.replace("silvergoldupgrade", "silver_gold_upgrade"); + replaceUpgradeItem(path, mapping); + } + + if (path.endsWith("copperironupgrade")) + { + path = path.replace("copperironupgrade", "copper_iron_upgrade"); + replaceUpgradeItem(path, mapping); + } + + if (path.endsWith("diamondcrystalupgrade")) + { + path = path.replace("diamondcrystalupgrade", "diamond_crystal_upgrade"); + replaceUpgradeItem(path, mapping); + } + + if (path.endsWith("woodironupgrade")) + { + path = path.replace("woodironupgrade", "wood_iron_upgrade"); + replaceUpgradeItem(path, mapping); + } + + if (path.endsWith("woodcopperupgrade")) + { + path = path.replace("woodcopperupgrade", "wood_copper_upgrade"); + replaceUpgradeItem(path, mapping); + } + + if (path.endsWith("diamondobsidianupgrade")) + { + path = path.replace("diamondobsidianupgrade", "diamond_obsidian_upgrade"); + replaceUpgradeItem(path, mapping); + } + } + } + } + + private static void replaceUpgradeItem(String path, MissingMapping mapping) + { + ResourceLocation newRes = new ResourceLocation(mapping.resourceLocation.getResourceDomain(), path); + Item item = ForgeRegistries.ITEMS.getValue(newRes); + + if (item != null) + { + mapping.remap(item); + } + } } diff --git a/src/main/java/cpw/mods/ironchest/IronChestAIOcelotSit.java b/src/main/java/cpw/mods/ironchest/IronChestAIOcelotSit.java index 4e74ffb1..50cbf5db 100755 --- a/src/main/java/cpw/mods/ironchest/IronChestAIOcelotSit.java +++ b/src/main/java/cpw/mods/ironchest/IronChestAIOcelotSit.java @@ -1,7 +1,10 @@ package cpw.mods.ironchest; +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.ai.EntityAIOcelotSit; import net.minecraft.entity.passive.EntityOcelot; +import net.minecraft.tileentity.TileEntity; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; @@ -12,14 +15,32 @@ public IronChestAIOcelotSit(EntityOcelot ocelotIn, float speedIn) super(ocelotIn, speedIn); } + /** + * Return true to set given position as destination + */ @Override protected boolean shouldMoveTo(World worldIn, BlockPos pos) { - if (worldIn.getBlockState(pos).getBlock() == IronChest.ironChestBlock) + if (!worldIn.isAirBlock(pos.up())) { - return true; + return false; } + else + { + IBlockState iblockstate = worldIn.getBlockState(pos); + Block block = iblockstate.getBlock(); + + if (block == IronChest.ironChestBlock) + { + TileEntity tileentity = worldIn.getTileEntity(pos); - return super.shouldMoveTo(worldIn, pos); + if (tileentity instanceof TileEntityIronChest && ((TileEntityIronChest) tileentity).numPlayersUsing < 1) + { + return true; + } + } + + return super.shouldMoveTo(worldIn, pos); + } } } diff --git a/src/main/java/cpw/mods/ironchest/IronChestType.java b/src/main/java/cpw/mods/ironchest/IronChestType.java index a9fdf36f..db0d4c2b 100755 --- a/src/main/java/cpw/mods/ironchest/IronChestType.java +++ b/src/main/java/cpw/mods/ironchest/IronChestType.java @@ -28,14 +28,14 @@ public enum IronChestType implements IStringSerializable { //@formatter:off - IRON(54, 9, true, "ironchest.png", Arrays.asList("ingotIron", "ingotRefinedIron"), TileEntityIronChest.class, 184, 202, "mmmmPmmmm", "mGmG3GmGm"), - GOLD(81, 9, true, "goldchest.png", Collections.singleton("ingotGold"), TileEntityGoldChest.class, 184, 256, "mmmmPmmmm", "mGmG4GmGm"), - DIAMOND(108, 12, true, "diamondchest.png", Collections.singleton("gemDiamond"), TileEntityDiamondChest.class, 184, 256, "GGGmPmGGG", "GGGG4Gmmm"), - COPPER(45, 9, false, "copperchest.png", Collections.singleton("ingotCopper"), TileEntityCopperChest.class, 184, 184, "mmmmCmmmm"), - SILVER(72, 9, false, "silverchest.png", Collections.singleton("ingotSilver"), TileEntitySilverChest.class, 184, 238, "mmmm3mmmm", "mGmG0GmGm"), - CRYSTAL(108, 12, true, "crystalchest.png", Collections.singleton("blockGlass"), TileEntityCrystalChest.class, 238, 256, "GGGGPGGGG"), - OBSIDIAN(108, 12, false, "obsidianchest.png", Collections.singleton("obsidian"), TileEntityObsidianChest.class, 238, 256, "mmmm2mmmm"), - DIRTCHEST9000(1, 1, false, "dirtchest.png", Collections.singleton("dirt"), TileEntityDirtChest.class, 184, 184, "mmmmCmmmm"), + IRON(54, 9, true, "iron_chest.png", Arrays.asList("ingotIron", "ingotRefinedIron"), TileEntityIronChest.class, 184, 202, "mmmmPmmmm", "mGmG3GmGm"), + GOLD(81, 9, true, "gold_chest.png", Collections.singleton("ingotGold"), TileEntityGoldChest.class, 184, 256, "mmmmPmmmm", "mGmG4GmGm"), + DIAMOND(108, 12, true, "diamond_chest.png", Collections.singleton("gemDiamond"), TileEntityDiamondChest.class, 184, 256, "GGGmPmGGG", "GGGG4Gmmm"), + COPPER(45, 9, false, "copper_chest.png", Collections.singleton("ingotCopper"), TileEntityCopperChest.class, 184, 184, "mmmmCmmmm"), + SILVER(72, 9, false, "silver_chest.png", Collections.singleton("ingotSilver"), TileEntitySilverChest.class, 184, 238, "mmmm3mmmm", "mGmG0GmGm"), + CRYSTAL(108, 12, true, "crystal_chest.png", Collections.singleton("blockGlass"), TileEntityCrystalChest.class, 238, 256, "GGGGPGGGG"), + OBSIDIAN(108, 12, false, "obsidian_chest.png", Collections.singleton("obsidian"), TileEntityObsidianChest.class, 238, 256, "mmmm2mmmm"), + DIRTCHEST9000(1, 1, false, "dirt_chest.png", Collections.singleton("dirt"), TileEntityDirtChest.class, 184, 184, "mmmmCmmmm"), WOOD(0, 0, false, "", Collections.singleton("plankWood"), null, 0, 0); //@formatter:on diff --git a/src/main/java/cpw/mods/ironchest/ItemIronChest.java b/src/main/java/cpw/mods/ironchest/ItemIronChest.java index 25a7eb3b..f53d61c7 100755 --- a/src/main/java/cpw/mods/ironchest/ItemIronChest.java +++ b/src/main/java/cpw/mods/ironchest/ItemIronChest.java @@ -20,7 +20,7 @@ public class ItemIronChest extends ItemBlock public ItemIronChest(Block block) { super(block); - this.setRegistryName(new ResourceLocation(IronChest.MOD_ID, "BlockIronChest")); + this.setRegistryName(new ResourceLocation(IronChest.MOD_ID, "iron_chest")); this.setMaxDamage(0); this.setHasSubtypes(true); diff --git a/src/main/java/cpw/mods/ironchest/TileEntityIronChest.java b/src/main/java/cpw/mods/ironchest/TileEntityIronChest.java index c8dcad68..ef8e2059 100755 --- a/src/main/java/cpw/mods/ironchest/TileEntityIronChest.java +++ b/src/main/java/cpw/mods/ironchest/TileEntityIronChest.java @@ -10,6 +10,9 @@ ******************************************************************************/ package cpw.mods.ironchest; +import java.util.Collections; +import java.util.Comparator; + import net.minecraft.block.state.IBlockState; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; @@ -19,6 +22,7 @@ import net.minecraft.inventory.ItemStackHelper; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; import net.minecraft.network.NetworkManager; import net.minecraft.network.play.server.SPacketUpdateTileEntity; import net.minecraft.tileentity.TileEntityLockableLoot; @@ -29,7 +33,7 @@ import net.minecraft.util.math.AxisAlignedBB; import net.minecraftforge.common.util.Constants; -public class TileEntityIronChest extends TileEntityLockableLoot implements ITickable//, IInventory +public class TileEntityIronChest extends TileEntityLockableLoot implements ITickable { /** The current angle of the lid (between 0 and 1) */ public float lidAngle; @@ -41,9 +45,9 @@ public class TileEntityIronChest extends TileEntityLockableLoot implements ITick private int ticksSinceSync = -1; - private int numPlayersUsing; + public int numPlayersUsing; - //private ItemStack[] topStacks; + private NonNullList topStacks; private EnumFacing facing; @@ -65,7 +69,7 @@ protected TileEntityIronChest(IronChestType type) super(); this.chestType = type; this.chestContents = NonNullList. func_191197_a(type.size, ItemStack.field_190927_a); - //this.topStacks = new ItemStack[8]; + this.topStacks = NonNullList. func_191197_a(8, ItemStack.field_190927_a); this.facing = EnumFacing.NORTH; } @@ -132,107 +136,106 @@ public void markDirty() { super.markDirty(); - //this.sortTopStacks(); + this.sortTopStacks(); } - /*protected void sortTopStacks() + protected void sortTopStacks() { if (!this.getType().isTransparent() || (this.worldObj != null && this.worldObj.isRemote)) { return; } - - ItemStack[] tempCopy = new ItemStack[this.getSizeInventory()]; - + + NonNullList tempCopy = NonNullList. func_191197_a(this.getSizeInventory(), ItemStack.field_190927_a); + boolean hasStuff = false; - + int compressedIdx = 0; - - mainLoop: - for (int i = 0; i < this.getSizeInventory(); i++) + + mainLoop: for (int i = 0; i < this.getSizeInventory(); i++) { - if (this.chestContents[i] != null) + if (this.chestContents.get(i) != ItemStack.field_190927_a) { for (int j = 0; j < compressedIdx; j++) { - if (tempCopy[j].isItemEqual(this.chestContents[i])) + if (tempCopy.get(j).isItemEqual(this.chestContents.get(i))) { - tempCopy[j].func_190920_e(tempCopy[j].func_190916_E() + this.chestContents[i].func_190916_E()); + tempCopy.get(j).func_190920_e(tempCopy.get(j).func_190916_E() + this.chestContents.get(i).func_190916_E()); continue mainLoop; } } - tempCopy[compressedIdx++] = this.chestContents[i].copy(); + tempCopy.set(compressedIdx++, this.chestContents.get(i).copy()); hasStuff = true; } } - + if (!hasStuff && this.hadStuff) { this.hadStuff = false; - - for (int i = 0; i < this.topStacks.length; i++) + + for (int i = 0; i < this.topStacks.size(); i++) { - this.topStacks[i] = null; + this.topStacks.set(i, ItemStack.field_190927_a); } - + if (this.worldObj != null) { IBlockState iblockstate = this.worldObj.getBlockState(this.pos); this.worldObj.notifyBlockUpdate(this.pos, iblockstate, iblockstate, 3); } - + return; } - + this.hadStuff = true; - - Arrays.sort(tempCopy, new Comparator() - { + + Collections.sort(tempCopy, new Comparator() { @Override - public int compare(ItemStack o1, ItemStack o2) + public int compare(ItemStack stack1, ItemStack stack2) { - if (o1 == null) + if (stack1 == null) { return 1; } - else if (o2 == null) + else if (stack2 == null) { return -1; } else { - return o2.func_190916_E() - o1.func_190916_E(); + return stack2.func_190916_E() - stack1.func_190916_E(); } } }); - + int p = 0; - - for (ItemStack element : tempCopy) + + for (int i = 0; i < tempCopy.size(); i++) { + ItemStack element = tempCopy.get(i); if (element != ItemStack.field_190927_a && element.func_190916_E() > 0) { - this.topStacks[p++] = element; - - if (p == this.topStacks.length) + this.topStacks.set(p++, element); + + if (p == this.topStacks.size()) { break; } } } - - for (int i = p; i < this.topStacks.length; i++) + + for (int i = p; i < this.topStacks.size(); i++) { - this.topStacks[i] = null; + this.topStacks.set(i, ItemStack.field_190927_a); } - + if (this.worldObj != null) { IBlockState iblockstate = this.worldObj.getBlockState(this.pos); - + this.worldObj.notifyBlockUpdate(this.pos, iblockstate, iblockstate, 3); } - }*/ + } @Override public String getName() @@ -270,7 +273,7 @@ public void readFromNBT(NBTTagCompound compound) this.facing = EnumFacing.VALUES[compound.getByte("facing")]; - //this.sortTopStacks(); + this.sortTopStacks(); } @Override @@ -348,7 +351,7 @@ public void update() { this.inventoryTouched = false; - //this.sortTopStacks(); + this.sortTopStacks(); } this.ticksSinceSync++; @@ -467,10 +470,10 @@ public void closeInventory(EntityPlayer player) } } - //public ItemStack[] getTopItemStacks() - //{ - // return this.topStacks; - //} + public NonNullList getTopItemStacks() + { + return this.topStacks; + } @Override public SPacketUpdateTileEntity getUpdatePacket() @@ -479,28 +482,28 @@ public SPacketUpdateTileEntity getUpdatePacket() compound.setByte("facing", (byte) this.facing.ordinal()); - /*ItemStack[] stacks = this.buildItemStackDataList(); - + NonNullList stacks = this.buildItemStackDataList(); + if (stacks != null) { NBTTagList itemList = new NBTTagList(); - - for (int slot = 0; slot < stacks.length; slot++) + + for (int slot = 0; slot < stacks.size(); slot++) { - if (stacks[slot] != null) + if (stacks.get(slot) != ItemStack.field_190927_a) { NBTTagCompound item = new NBTTagCompound(); - + item.setByte("Slot", (byte) slot); - - stacks[slot].writeToNBT(item); - + + stacks.get(slot).writeToNBT(item); + itemList.appendTag(item); } } - + compound.setTag("stacks", itemList); - }*/ + } return new SPacketUpdateTileEntity(this.pos, 0, compound); } @@ -514,68 +517,69 @@ public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt) this.facing = EnumFacing.VALUES[compound.getByte("facing")]; - /*NBTTagList itemList = compound.getTagList("stacks", Constants.NBT.TAG_COMPOUND); - - ItemStack[] stacks = new ItemStack[this.topStacks.length]; - + NBTTagList itemList = compound.getTagList("stacks", Constants.NBT.TAG_COMPOUND); + + ItemStack[] stacks = new ItemStack[this.topStacks.size()]; + for (int item = 0; item < stacks.length; item++) { - NBTTagCompound itemStack = itemList.getCompoundTagAt(item); - - int slot = itemStack.getByte("Slot") & 255; - + NBTTagCompound itemNBT = itemList.getCompoundTagAt(item); + + int slot = itemNBT.getByte("Slot") & 255; + if (slot >= 0 && slot < stacks.length) { - stacks[slot] = ItemStack.loadItemStackFromNBT(itemStack); + stacks[slot] = new ItemStack(itemNBT); } } - + if (this.getType().isTransparent() && stacks != null) { int pos = 0; - - for (int i = 0; i < this.topStacks.length; i++) + + for (int i = 0; i < this.topStacks.size(); i++) { if (stacks[pos] != null) { - this.topStacks[i] = stacks[pos]; + this.topStacks.set(i, stacks[pos]); } else { - this.topStacks[i] = null; + this.topStacks.set(i, ItemStack.field_190927_a); } - + pos++; } - }*/ + } } } - /*public ItemStack[] buildItemStackDataList() + public NonNullList buildItemStackDataList() { if (this.getType().isTransparent()) { - ItemStack[] sortList = new ItemStack[this.topStacks.length]; - + NonNullList sortList = NonNullList. func_191197_a(this.topStacks.size(), ItemStack.field_190927_a); + int pos = 0; - - for (ItemStack is : this.topStacks) + + for (int i = 0; i < this.topStacks.size(); i++) { + ItemStack is = this.topStacks.get(i); if (is != null) { - sortList[pos++] = is; + sortList.set(pos++, is); } else { - sortList[pos++] = null; + sortList.set(pos++, ItemStack.field_190927_a); } } - + return sortList; } - + return null; - }*/ + } @Override public boolean isItemValidForSlot(int index, ItemStack stack) @@ -601,7 +605,7 @@ public void removeAdornments() @Override public Container createContainer(InventoryPlayer playerInventory, EntityPlayer playerIn) { - this.fillWithLoot((EntityPlayer) null); + this.fillWithLoot(playerIn); return new ContainerIronChest(playerInventory, this, this.chestType, this.chestType.xSize, this.chestType.ySize); } diff --git a/src/main/java/cpw/mods/ironchest/client/ClientProxy.java b/src/main/java/cpw/mods/ironchest/client/ClientProxy.java index 9637c345..8856a447 100755 --- a/src/main/java/cpw/mods/ironchest/client/ClientProxy.java +++ b/src/main/java/cpw/mods/ironchest/client/ClientProxy.java @@ -50,7 +50,7 @@ public void registerRenderInformation() for (ChestChangerType type : ChestChangerType.VALUES) { //@formatter:off - ModelLoader.setCustomModelResourceLocation(type.item, 0, new ModelResourceLocation(new ResourceLocation(IronChest.MOD_ID, "ItemChestUpgrade"), "variant=" + type.itemName.toLowerCase())); + ModelLoader.setCustomModelResourceLocation(type.item, 0, new ModelResourceLocation(new ResourceLocation(IronChest.MOD_ID, "iron_chest_upgrades"), "variant=" + type.itemName.toLowerCase())); //@formatter:on } } diff --git a/src/main/java/cpw/mods/ironchest/client/GUIChest.java b/src/main/java/cpw/mods/ironchest/client/GUIChest.java index ae8f205a..9b404f88 100755 --- a/src/main/java/cpw/mods/ironchest/client/GUIChest.java +++ b/src/main/java/cpw/mods/ironchest/client/GUIChest.java @@ -24,12 +24,12 @@ public class GUIChest extends GuiContainer public enum ResourceList { //@formatter:off - IRON(new ResourceLocation("ironchest", "textures/gui/ironcontainer.png")), - COPPER(new ResourceLocation("ironchest", "textures/gui/coppercontainer.png")), - SILVER(new ResourceLocation("ironchest", "textures/gui/silvercontainer.png")), - GOLD(new ResourceLocation("ironchest", "textures/gui/goldcontainer.png")), - DIAMOND(new ResourceLocation("ironchest", "textures/gui/diamondcontainer.png")), - DIRT(new ResourceLocation("ironchest", "textures/gui/dirtcontainer.png")); + 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")); //@formatter:on public final ResourceLocation location; diff --git a/src/main/java/cpw/mods/ironchest/client/TileEntityIronChestRenderer.java b/src/main/java/cpw/mods/ironchest/client/TileEntityIronChestRenderer.java index c8335d3d..b0fecba0 100755 --- a/src/main/java/cpw/mods/ironchest/client/TileEntityIronChestRenderer.java +++ b/src/main/java/cpw/mods/ironchest/client/TileEntityIronChestRenderer.java @@ -12,17 +12,22 @@ import java.util.Random; +import com.google.common.primitives.SignedBytes; + import cpw.mods.ironchest.BlockIronChest; import cpw.mods.ironchest.IronChest; import cpw.mods.ironchest.IronChestType; import cpw.mods.ironchest.TileEntityIronChest; import net.minecraft.block.state.IBlockState; +import net.minecraft.client.Minecraft; import net.minecraft.client.model.ModelChest; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.entity.RenderEntityItem; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.entity.item.EntityItem; +import net.minecraft.item.ItemStack; import net.minecraft.util.EnumFacing; +import net.minecraft.util.NonNullList; public class TileEntityIronChestRenderer extends TileEntitySpecialRenderer { @@ -141,7 +146,7 @@ public void renderTileEntityAt(TileEntityIronChest tile, double x, double y, dou GlStateManager.popMatrix(); GlStateManager.color(1F, 1F, 1F, 1F); - /*if (type.isTransparent() + if (type.isTransparent() && tile.getDistanceSq(this.rendererDispatcher.entityX, this.rendererDispatcher.entityY, this.rendererDispatcher.entityZ) < 128d) { this.random.setSeed(254L); @@ -151,23 +156,28 @@ public void renderTileEntityAt(TileEntityIronChest tile, double x, double y, dou int shift = 0; float blockScale = 0.70F; float timeD = (float) (360D * (System.currentTimeMillis() & 0x3FFFL) / 0x3FFFL) - partialTick; - if (tile.getTopItemStacks()[1] == null) + + if (tile.getTopItemStacks().get(1) == ItemStack.field_190927_a) { shift = 8; blockScale = 0.85F; } + GlStateManager.pushMatrix(); GlStateManager.translate((float) x, (float) y, (float) z); - + customitem.setWorld(this.getWorld()); customitem.hoverStart = 0F; - for (ItemStack item : tile.getTopItemStacks()) + + NonNullList stacks = tile.getTopItemStacks(); + for (int i = 0; i < stacks.size(); i++) { + ItemStack item = stacks.get(i); if (shift > shifts.length) { break; } - if (item == null) + if (item == ItemStack.field_190927_a) { shift++; continue; @@ -181,22 +191,23 @@ public void renderTileEntityAt(TileEntityIronChest tile, double x, double y, dou GlStateManager.rotate(timeD, 0F, 1F, 0F); GlStateManager.scale(blockScale, blockScale, blockScale); customitem.setEntityItemStack(item); - + if (this.itemRenderer == null) { - this.itemRenderer = new RenderEntityItem(Minecraft.getMinecraft().getRenderManager(), Minecraft.getMinecraft().getRenderItem()) { + this.itemRenderer = new RenderEntityItem(Minecraft.getMinecraft().getRenderManager(), Minecraft.getMinecraft().getRenderItem()) + { @Override public int getModelCount(ItemStack stack) { return SignedBytes.saturatedCast(Math.min(stack.func_190916_E() / 32, 15) + 1); } - + @Override public boolean shouldBob() { return false; } - + @Override public boolean shouldSpreadItems() { @@ -204,13 +215,13 @@ public boolean shouldSpreadItems() } }; } - + this.itemRenderer.doRender(customitem, 0D, 0D, 0D, 0F, partialTick); GlStateManager.popMatrix(); } - + GlStateManager.popMatrix(); - }*/ + } } } diff --git a/src/main/resources/assets/ironchest/blockstates/ItemChestUpgrade.json b/src/main/resources/assets/ironchest/blockstates/ItemChestUpgrade.json deleted file mode 100644 index 108e2ba1..00000000 --- a/src/main/resources/assets/ironchest/blockstates/ItemChestUpgrade.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "forge_marker": 1, - "defaults": { - "model": "builtin/generated", - "transform": "forge:default-item" - }, - "variants": { - "variant": { - "irongoldupgrade": { - "textures": { - "layer0": "ironchest:items/ironGoldUpgrade" - } - }, - "coppersilverupgrade": { - "textures": { - "layer0": "ironchest:items/copperSilverUpgrade" - } - }, - "diamondcrystalupgrade": { - "textures": { - "layer0": "ironchest:items/diamondCrystalUpgrade" - } - }, - "diamondobsidianupgrade": { - "textures": { - "layer0": "ironchest:items/diamondObsidianUpgrade" - } - }, - "golddiamondupgrade": { - "textures": { - "layer0": "ironchest:items/goldDiamondUpgrade" - } - }, - "irongoldupgrade": { - "textures": { - "layer0": "ironchest:items/ironGoldUpgrade" - } - }, - "silvergoldupgrade": { - "textures": { - "layer0": "ironchest:items/silverGoldUpgrade" - } - }, - "woodcopperupgrade": { - "textures": { - "layer0": "ironchest:items/woodCopperUpgrade" - } - }, - "woodironupgrade": { - "textures": { - "layer0": "ironchest:items/woodIronUpgrade" - } - }, - "copperironupgrade": { - "textures": { - "layer0": "ironchest:items/copperIronUpgrade" - } - } - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/ironchest/blockstates/BlockIronChest.json b/src/main/resources/assets/ironchest/blockstates/iron_chest.json similarity index 52% rename from src/main/resources/assets/ironchest/blockstates/BlockIronChest.json rename to src/main/resources/assets/ironchest/blockstates/iron_chest.json index 96ad5142..662e399c 100644 --- a/src/main/resources/assets/ironchest/blockstates/BlockIronChest.json +++ b/src/main/resources/assets/ironchest/blockstates/iron_chest.json @@ -1,57 +1,57 @@ { "forge_marker": 1, "defaults": { - "model": "ironchest:chest", + "model": "ironchest:iron_chest", "transform": "forge:default-block" }, "variants": { "variant": { "iron": { "textures": { - "particle": "ironchest:blocks/ironbreak", - "texture": "ironchest:model/ironchest" + "particle": "ironchest:blocks/iron_break", + "texture": "ironchest:model/iron_chest" } }, "gold": { "textures": { - "particle": "ironchest:blocks/goldbreak", - "texture": "ironchest:model/goldchest" + "particle": "ironchest:blocks/gold_break", + "texture": "ironchest:model/gold_chest" } }, "diamond": { "textures": { - "particle": "ironchest:blocks/diamondbreak", - "texture": "ironchest:model/diamondchest" + "particle": "ironchest:blocks/diamond_break", + "texture": "ironchest:model/diamond_chest" } }, "copper": { "textures": { - "particle": "ironchest:blocks/copperbreak", - "texture": "ironchest:model/copperchest" + "particle": "ironchest:blocks/copper_break", + "texture": "ironchest:model/copper_chest" } }, "silver": { "textures": { - "particle": "ironchest:blocks/silverbreak", - "texture": "ironchest:model/silverchest" + "particle": "ironchest:blocks/silver_break", + "texture": "ironchest:model/silver_chest" } }, "crystal": { "textures": { - "particle": "ironchest:blocks/crystalbreak", - "texture": "ironchest:model/crystalchest" + "particle": "ironchest:blocks/crystal_break", + "texture": "ironchest:model/crystal_chest" } }, "obsidian": { "textures": { "particle": "minecraft:blocks/obsidian", - "texture": "ironchest:model/obsidianchest" + "texture": "ironchest:model/obsidian_chest" } }, "dirtchest9000": { "textures": { "particle": "minecraft:blocks/dirt", - "texture": "ironchest:model/dirtchest" + "texture": "ironchest:model/dirt_chest" } }, "wood": { diff --git a/src/main/resources/assets/ironchest/blockstates/iron_chest_upgrades.json b/src/main/resources/assets/ironchest/blockstates/iron_chest_upgrades.json new file mode 100644 index 00000000..9132a142 --- /dev/null +++ b/src/main/resources/assets/ironchest/blockstates/iron_chest_upgrades.json @@ -0,0 +1,56 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "builtin/generated", + "transform": "forge:default-item" + }, + "variants": { + "variant": { + "copper_silver_upgrade": { + "textures": { + "layer0": "ironchest:items/copper_silver_upgrade" + } + }, + "diamond_crystal_upgrade": { + "textures": { + "layer0": "ironchest:items/diamond_crystal_upgrade" + } + }, + "diamond_obsidian_upgrade": { + "textures": { + "layer0": "ironchest:items/diamond_obsidian_upgrade" + } + }, + "gold_diamond_upgrade": { + "textures": { + "layer0": "ironchest:items/gold_diamond_upgrade" + } + }, + "iron_gold_upgrade": { + "textures": { + "layer0": "ironchest:items/iron_gold_upgrade" + } + }, + "silver_gold_upgrade": { + "textures": { + "layer0": "ironchest:items/silver_gold_upgrade" + } + }, + "wood_copper_upgrade": { + "textures": { + "layer0": "ironchest:items/wood_copper_upgrade" + } + }, + "wood_iron_upgrade": { + "textures": { + "layer0": "ironchest:items/wood_iron_upgrade" + } + }, + "copper_iron_upgrade": { + "textures": { + "layer0": "ironchest:items/copper_iron_upgrade" + } + } + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/ironchest/lang/hu_HU.lang b/src/main/resources/assets/ironchest/lang/hu_HU.lang new file mode 100644 index 00000000..88d82d83 --- /dev/null +++ b/src/main/resources/assets/ironchest/lang/hu_HU.lang @@ -0,0 +1,25 @@ +tile.ironchest:IRON.name=Vas láda +tile.ironchest:GOLD.name=Arany láda +tile.ironchest:DIAMOND.name=Gyémánt láda +tile.ironchest:COPPER.name=Réz láda +tile.ironchest:SILVER.name=Ezüst láda +tile.ironchest:CRYSTAL.name=Kristály láda +tile.ironchest:OBSIDIAN.name=Obszidián láda +tile.ironchest:DIRTCHEST9000.name=DirtChest 9000! + +item.ironchest:IRONGOLD.name=Vasról arany ládára bővítő +item.ironchest:GOLDDIAMOND.name=Aranyról gyémánt ládára bővítő +item.ironchest:COPPERSILVER.name=Rézről ezüst ládára bővítő +item.ironchest:SILVERGOLD.name=Ezüstről arany ládára bővítő +item.ironchest:COPPERIRON.name=Részről vas ládára bővítő +item.ironchest:DIAMONDCRYSTAL.name=Gyémántról kristály ládára bővítő +item.ironchest:WOODIRON.name=Normálról (fa) vas ládára bővítő +item.ironchest:WOODCOPPER.name=Normálról (fa) réz ládára bővítő +item.ironchest:DIAMONDOBSIDIAN.name=Gyémántról obszidián ládára bővítő + +book.ironchest:dirtchest9000.title=Hogyan használd a DirtChest 9000-et! +book.ironchest:dirtchest9000.page1=Üdvözöl az új DirtChest 9000! Reméljük sok boldog évig élvezni fogod egy halom föld tárólásának eme vadiúj módját. +book.ironchest:dirtchest9000.page2=Használat: egyszerűen pakolj bele egy halom földet eme különlegesen érzékeny tárolóegységbe és élvezd a kényelmet, hogy egy halom föld mindig rendelkezésedre fog állni, bármikor nyitod is ki ezt a ládát. +book.ironchest:dirtchest9000.page3=Reméljük, hogy élvezted eme kézikönyv olvasgatását, és megfontolod más termékünk használatát is a jövöben. Üdvözlettel: A DirtChest 9000 kézikönyv írói. +book.ironchest:dirtchest9000.page4=Garancia: Ez a termék nem rendelkezik semmiféle garanciával. A belepakolt föld lehet, hogy nem is kerül tárolásra, elszivárog a környezetbe, vagy az is lehetséges hogy nem történik vele semmi. +book.ironchest:dirtchest9000.page5=A DirtChest 9000 környezetbarát termék. Kérjül fokozottan ügyelj erre a kézikönyv megsemmisitésekor, és semmiképpen se dobd lávába. Akkor ugyanis nagyon szomorúak leszünk. \ No newline at end of file diff --git a/src/main/resources/assets/ironchest/models/block/chest.json b/src/main/resources/assets/ironchest/models/block/iron_chest.json similarity index 97% rename from src/main/resources/assets/ironchest/models/block/chest.json rename to src/main/resources/assets/ironchest/models/block/iron_chest.json index eba0514b..9f41512f 100644 --- a/src/main/resources/assets/ironchest/models/block/chest.json +++ b/src/main/resources/assets/ironchest/models/block/iron_chest.json @@ -1,7 +1,7 @@ { "parent": "block/block", "textures": { - "texture": "ironchest:model/copperchest" + "texture": "ironchest:model/copper_chest" }, "elements": [ { "from": [ 1, 0, 1 ], diff --git a/src/main/resources/assets/ironchest/textures/blocks/copperbreak.png b/src/main/resources/assets/ironchest/textures/blocks/copper_break.png similarity index 100% rename from src/main/resources/assets/ironchest/textures/blocks/copperbreak.png rename to src/main/resources/assets/ironchest/textures/blocks/copper_break.png diff --git a/src/main/resources/assets/ironchest/textures/blocks/crystalbreak.png b/src/main/resources/assets/ironchest/textures/blocks/crystal_break.png similarity index 100% rename from src/main/resources/assets/ironchest/textures/blocks/crystalbreak.png rename to src/main/resources/assets/ironchest/textures/blocks/crystal_break.png diff --git a/src/main/resources/assets/ironchest/textures/blocks/diamondbreak.png b/src/main/resources/assets/ironchest/textures/blocks/diamond_break.png similarity index 100% rename from src/main/resources/assets/ironchest/textures/blocks/diamondbreak.png rename to src/main/resources/assets/ironchest/textures/blocks/diamond_break.png diff --git a/src/main/resources/assets/ironchest/textures/blocks/goldbreak.png b/src/main/resources/assets/ironchest/textures/blocks/gold_break.png similarity index 100% rename from src/main/resources/assets/ironchest/textures/blocks/goldbreak.png rename to src/main/resources/assets/ironchest/textures/blocks/gold_break.png diff --git a/src/main/resources/assets/ironchest/textures/blocks/ironbreak.png b/src/main/resources/assets/ironchest/textures/blocks/iron_break.png similarity index 100% rename from src/main/resources/assets/ironchest/textures/blocks/ironbreak.png rename to src/main/resources/assets/ironchest/textures/blocks/iron_break.png diff --git a/src/main/resources/assets/ironchest/textures/blocks/silverbreak.png b/src/main/resources/assets/ironchest/textures/blocks/silver_break.png similarity index 100% rename from src/main/resources/assets/ironchest/textures/blocks/silverbreak.png rename to src/main/resources/assets/ironchest/textures/blocks/silver_break.png diff --git a/src/main/resources/assets/ironchest/textures/gui/coppercontainer.png b/src/main/resources/assets/ironchest/textures/gui/copper_container.png old mode 100755 new mode 100644 similarity index 100% rename from src/main/resources/assets/ironchest/textures/gui/coppercontainer.png rename to src/main/resources/assets/ironchest/textures/gui/copper_container.png diff --git a/src/main/resources/assets/ironchest/textures/gui/diamondcontainer.png b/src/main/resources/assets/ironchest/textures/gui/diamond_container.png old mode 100755 new mode 100644 similarity index 100% rename from src/main/resources/assets/ironchest/textures/gui/diamondcontainer.png rename to src/main/resources/assets/ironchest/textures/gui/diamond_container.png diff --git a/src/main/resources/assets/ironchest/textures/gui/dirtcontainer.png b/src/main/resources/assets/ironchest/textures/gui/dirt_container.png old mode 100755 new mode 100644 similarity index 100% rename from src/main/resources/assets/ironchest/textures/gui/dirtcontainer.png rename to src/main/resources/assets/ironchest/textures/gui/dirt_container.png diff --git a/src/main/resources/assets/ironchest/textures/gui/goldcontainer.png b/src/main/resources/assets/ironchest/textures/gui/gold_container.png old mode 100755 new mode 100644 similarity index 100% rename from src/main/resources/assets/ironchest/textures/gui/goldcontainer.png rename to src/main/resources/assets/ironchest/textures/gui/gold_container.png diff --git a/src/main/resources/assets/ironchest/textures/gui/ironcontainer.png b/src/main/resources/assets/ironchest/textures/gui/iron_container.png old mode 100755 new mode 100644 similarity index 100% rename from src/main/resources/assets/ironchest/textures/gui/ironcontainer.png rename to src/main/resources/assets/ironchest/textures/gui/iron_container.png diff --git a/src/main/resources/assets/ironchest/textures/gui/silvercontainer.png b/src/main/resources/assets/ironchest/textures/gui/silver_container.png old mode 100755 new mode 100644 similarity index 100% rename from src/main/resources/assets/ironchest/textures/gui/silvercontainer.png rename to src/main/resources/assets/ironchest/textures/gui/silver_container.png diff --git a/src/main/resources/assets/ironchest/textures/items/copperIronUpgrade.png b/src/main/resources/assets/ironchest/textures/items/copper_iron_upgrade.png old mode 100755 new mode 100644 similarity index 100% rename from src/main/resources/assets/ironchest/textures/items/copperIronUpgrade.png rename to src/main/resources/assets/ironchest/textures/items/copper_iron_upgrade.png diff --git a/src/main/resources/assets/ironchest/textures/items/copperSilverUpgrade.png b/src/main/resources/assets/ironchest/textures/items/copper_silver_upgrade.png old mode 100755 new mode 100644 similarity index 100% rename from src/main/resources/assets/ironchest/textures/items/copperSilverUpgrade.png rename to src/main/resources/assets/ironchest/textures/items/copper_silver_upgrade.png diff --git a/src/main/resources/assets/ironchest/textures/items/diamondCrystalUpgrade.png b/src/main/resources/assets/ironchest/textures/items/diamond_crystal_upgrade.png old mode 100755 new mode 100644 similarity index 100% rename from src/main/resources/assets/ironchest/textures/items/diamondCrystalUpgrade.png rename to src/main/resources/assets/ironchest/textures/items/diamond_crystal_upgrade.png diff --git a/src/main/resources/assets/ironchest/textures/items/diamondObsidianUpgrade.png b/src/main/resources/assets/ironchest/textures/items/diamond_obsidian_upgrade.png old mode 100755 new mode 100644 similarity index 100% rename from src/main/resources/assets/ironchest/textures/items/diamondObsidianUpgrade.png rename to src/main/resources/assets/ironchest/textures/items/diamond_obsidian_upgrade.png diff --git a/src/main/resources/assets/ironchest/textures/items/goldDiamondUpgrade.png b/src/main/resources/assets/ironchest/textures/items/gold_diamond_upgrade.png old mode 100755 new mode 100644 similarity index 100% rename from src/main/resources/assets/ironchest/textures/items/goldDiamondUpgrade.png rename to src/main/resources/assets/ironchest/textures/items/gold_diamond_upgrade.png diff --git a/src/main/resources/assets/ironchest/textures/items/ironGoldUpgrade.png b/src/main/resources/assets/ironchest/textures/items/iron_gold_upgrade.png old mode 100755 new mode 100644 similarity index 100% rename from src/main/resources/assets/ironchest/textures/items/ironGoldUpgrade.png rename to src/main/resources/assets/ironchest/textures/items/iron_gold_upgrade.png diff --git a/src/main/resources/assets/ironchest/textures/items/silverGoldUpgrade.png b/src/main/resources/assets/ironchest/textures/items/silver_gold_upgrade.png old mode 100755 new mode 100644 similarity index 100% rename from src/main/resources/assets/ironchest/textures/items/silverGoldUpgrade.png rename to src/main/resources/assets/ironchest/textures/items/silver_gold_upgrade.png diff --git a/src/main/resources/assets/ironchest/textures/items/woodCopperUpgrade.png b/src/main/resources/assets/ironchest/textures/items/wood_copper_upgrade.png old mode 100755 new mode 100644 similarity index 100% rename from src/main/resources/assets/ironchest/textures/items/woodCopperUpgrade.png rename to src/main/resources/assets/ironchest/textures/items/wood_copper_upgrade.png diff --git a/src/main/resources/assets/ironchest/textures/items/woodIronUpgrade.png b/src/main/resources/assets/ironchest/textures/items/wood_iron_upgrade.png old mode 100755 new mode 100644 similarity index 100% rename from src/main/resources/assets/ironchest/textures/items/woodIronUpgrade.png rename to src/main/resources/assets/ironchest/textures/items/wood_iron_upgrade.png diff --git a/src/main/resources/assets/ironchest/textures/model/copperchest.png b/src/main/resources/assets/ironchest/textures/model/copper_chest.png old mode 100755 new mode 100644 similarity index 100% rename from src/main/resources/assets/ironchest/textures/model/copperchest.png rename to src/main/resources/assets/ironchest/textures/model/copper_chest.png diff --git a/src/main/resources/assets/ironchest/textures/model/crystalchest.png b/src/main/resources/assets/ironchest/textures/model/crystal_chest.png old mode 100755 new mode 100644 similarity index 100% rename from src/main/resources/assets/ironchest/textures/model/crystalchest.png rename to src/main/resources/assets/ironchest/textures/model/crystal_chest.png diff --git a/src/main/resources/assets/ironchest/textures/model/diamondchest.png b/src/main/resources/assets/ironchest/textures/model/diamond_chest.png old mode 100755 new mode 100644 similarity index 100% rename from src/main/resources/assets/ironchest/textures/model/diamondchest.png rename to src/main/resources/assets/ironchest/textures/model/diamond_chest.png diff --git a/src/main/resources/assets/ironchest/textures/model/dirtchest.png b/src/main/resources/assets/ironchest/textures/model/dirt_chest.png old mode 100755 new mode 100644 similarity index 100% rename from src/main/resources/assets/ironchest/textures/model/dirtchest.png rename to src/main/resources/assets/ironchest/textures/model/dirt_chest.png diff --git a/src/main/resources/assets/ironchest/textures/model/goldchest.png b/src/main/resources/assets/ironchest/textures/model/gold_chest.png old mode 100755 new mode 100644 similarity index 100% rename from src/main/resources/assets/ironchest/textures/model/goldchest.png rename to src/main/resources/assets/ironchest/textures/model/gold_chest.png diff --git a/src/main/resources/assets/ironchest/textures/model/ironchest.png b/src/main/resources/assets/ironchest/textures/model/iron_chest.png old mode 100755 new mode 100644 similarity index 100% rename from src/main/resources/assets/ironchest/textures/model/ironchest.png rename to src/main/resources/assets/ironchest/textures/model/iron_chest.png diff --git a/src/main/resources/assets/ironchest/textures/model/obsidianchest.png b/src/main/resources/assets/ironchest/textures/model/obsidian_chest.png old mode 100755 new mode 100644 similarity index 100% rename from src/main/resources/assets/ironchest/textures/model/obsidianchest.png rename to src/main/resources/assets/ironchest/textures/model/obsidian_chest.png diff --git a/src/main/resources/assets/ironchest/textures/model/silverchest.png b/src/main/resources/assets/ironchest/textures/model/silver_chest.png old mode 100755 new mode 100644 similarity index 100% rename from src/main/resources/assets/ironchest/textures/model/silverchest.png rename to src/main/resources/assets/ironchest/textures/model/silver_chest.png From ea5f84785d12c40b8628921af0dc99d3bfbca373 Mon Sep 17 00:00:00 2001 From: alexbegt Date: Fri, 18 Nov 2016 10:28:27 -0500 Subject: [PATCH 037/105] Remove dead code that has been commended out. --- src/main/java/cpw/mods/ironchest/BlockIronChest.java | 2 -- src/main/java/cpw/mods/ironchest/IronChest.java | 2 ++ src/main/java/cpw/mods/ironchest/ItemChestChanger.java | 3 +-- .../cpw/mods/ironchest/client/TileEntityIronChestRenderer.java | 3 +-- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/main/java/cpw/mods/ironchest/BlockIronChest.java b/src/main/java/cpw/mods/ironchest/BlockIronChest.java index 33a7fa0a..3d3a0714 100755 --- a/src/main/java/cpw/mods/ironchest/BlockIronChest.java +++ b/src/main/java/cpw/mods/ironchest/BlockIronChest.java @@ -83,7 +83,6 @@ public EnumBlockRenderType getRenderType(IBlockState state) @Override //@formatter:off public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing heldItem, float side, float hitX, float hitY) - //public boolean onBlockActivated(World world, BlockPos pos, IBlockState blockState, EntityPlayer player, EnumHand hand, ItemStack heldItem, EnumFacing direction, float hitX, float hitY, float hitZ) //@formatter:on { TileEntity te = worldIn.getTileEntity(pos); @@ -121,7 +120,6 @@ public TileEntity createTileEntity(World world, IBlockState state) @Override @SideOnly(Side.CLIENT) - // public void getSubBlocks(Item itemIn, CreativeTabs tab, List list) public void getSubBlocks(Item itemIn, CreativeTabs tab, NonNullList list) { for (IronChestType type : IronChestType.VALUES) diff --git a/src/main/java/cpw/mods/ironchest/IronChest.java b/src/main/java/cpw/mods/ironchest/IronChest.java index 5c7c8719..b11cf5d0 100755 --- a/src/main/java/cpw/mods/ironchest/IronChest.java +++ b/src/main/java/cpw/mods/ironchest/IronChest.java @@ -66,7 +66,9 @@ public void preInit(FMLPreInitializationEvent event) for (IronChestType typ : IronChestType.VALUES) { if (typ.clazz != null) + { GameRegistry.registerTileEntity(typ.clazz, "IronChest." + typ.name()); + } } IronChestType.registerBlocksAndRecipes(ironChestBlock); diff --git a/src/main/java/cpw/mods/ironchest/ItemChestChanger.java b/src/main/java/cpw/mods/ironchest/ItemChestChanger.java index 9da9e629..369cbf65 100755 --- a/src/main/java/cpw/mods/ironchest/ItemChestChanger.java +++ b/src/main/java/cpw/mods/ironchest/ItemChestChanger.java @@ -40,7 +40,6 @@ public ItemChestChanger(ChestChangerType type) @Override //@formatter:off public EnumActionResult onItemUseFirst(EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ, EnumHand hand) - //public EnumActionResult onItemUseFirst(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, EnumHand hand) //@formatter:on { if (world.isRemote) @@ -96,7 +95,7 @@ else if (te instanceof TileEntityChest) { return EnumActionResult.PASS; } - chestContents = NonNullList. func_191197_a(chest.getSizeInventory(), ItemStack.field_190927_a);//new ItemStack[chest.getSizeInventory()]; + chestContents = NonNullList. func_191197_a(chest.getSizeInventory(), ItemStack.field_190927_a); for (int i = 0; i < chestContents.size(); i++) { chestContents.set(i, chest.getStackInSlot(i)); diff --git a/src/main/java/cpw/mods/ironchest/client/TileEntityIronChestRenderer.java b/src/main/java/cpw/mods/ironchest/client/TileEntityIronChestRenderer.java index b0fecba0..de76f8ca 100755 --- a/src/main/java/cpw/mods/ironchest/client/TileEntityIronChestRenderer.java +++ b/src/main/java/cpw/mods/ironchest/client/TileEntityIronChestRenderer.java @@ -194,8 +194,7 @@ public void renderTileEntityAt(TileEntityIronChest tile, double x, double y, dou if (this.itemRenderer == null) { - this.itemRenderer = new RenderEntityItem(Minecraft.getMinecraft().getRenderManager(), Minecraft.getMinecraft().getRenderItem()) - { + this.itemRenderer = new RenderEntityItem(Minecraft.getMinecraft().getRenderManager(), Minecraft.getMinecraft().getRenderItem()) { @Override public int getModelCount(ItemStack stack) { From 5720fa20652b33b655b9f65bcb6c1fcb8af3b2e7 Mon Sep 17 00:00:00 2001 From: alexbegt Date: Fri, 18 Nov 2016 22:33:35 -0500 Subject: [PATCH 038/105] Update mappings for Iron Chests, and rename some parameters. --- build.gradle | 6 +- .../cpw/mods/ironchest/BlockIronChest.java | 16 +-- .../mods/ironchest/ContainerIronChest.java | 24 +++-- .../cpw/mods/ironchest/IronChestType.java | 2 +- .../cpw/mods/ironchest/ItemChestChanger.java | 8 +- .../mods/ironchest/TileEntityDirtChest.java | 4 +- .../mods/ironchest/TileEntityIronChest.java | 99 ++++++++++--------- .../cpw/mods/ironchest/ValidatingSlot.java | 4 +- .../cpw/mods/ironchest/client/GUIChest.java | 2 +- .../client/TileEntityIronChestRenderer.java | 35 ++++--- 10 files changed, 102 insertions(+), 98 deletions(-) diff --git a/build.gradle b/build.gradle index d4f59dd5..02cbb77d 100755 --- a/build.gradle +++ b/build.gradle @@ -33,7 +33,7 @@ repositories { } dependencies { - deobfCompile "mezz.jei:jei_1.11:4.0.1.191" + deobfCompile "mezz.jei:jei_1.11:4.0.1.193" } // This is our group. I'm cpw.mods @@ -43,8 +43,8 @@ archivesBaseName = "ironchest" // Setup the forge minecraft plugin data. Specify the preferred forge/minecraft version here minecraft { - version = "1.11-13.19.0.2148" - mappings = "snapshot_20161111" + version = "1.11-13.19.0.2153" + mappings = "snapshot_20161118" runDir = "run" } diff --git a/src/main/java/cpw/mods/ironchest/BlockIronChest.java b/src/main/java/cpw/mods/ironchest/BlockIronChest.java index 3d3a0714..5bd0b330 100755 --- a/src/main/java/cpw/mods/ironchest/BlockIronChest.java +++ b/src/main/java/cpw/mods/ironchest/BlockIronChest.java @@ -150,22 +150,22 @@ protected BlockStateContainer createBlockState() } @Override - public void onBlockAdded(World world, BlockPos pos, IBlockState blockState) + public void onBlockAdded(World world, BlockPos pos, IBlockState state) { - super.onBlockAdded(world, pos, blockState); - world.notifyBlockUpdate(pos, blockState, blockState, 3); + super.onBlockAdded(world, pos, state); + world.notifyBlockUpdate(pos, state, state, 3); } @Override - public void onBlockPlacedBy(World world, BlockPos pos, IBlockState blockState, EntityLivingBase entityliving, ItemStack itemStack) + public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) { - TileEntity te = world.getTileEntity(pos); + TileEntity te = worldIn.getTileEntity(pos); if (te != null && te instanceof TileEntityIronChest) { TileEntityIronChest teic = (TileEntityIronChest) te; - teic.wasPlaced(entityliving, itemStack); - teic.setFacing(entityliving.getHorizontalFacing().getOpposite()); - world.notifyBlockUpdate(pos, blockState, blockState, 3); + teic.wasPlaced(placer, stack); + teic.setFacing(placer.getHorizontalFacing().getOpposite()); + worldIn.notifyBlockUpdate(pos, state, state, 3); } } diff --git a/src/main/java/cpw/mods/ironchest/ContainerIronChest.java b/src/main/java/cpw/mods/ironchest/ContainerIronChest.java index 5ef4f553..443f876d 100755 --- a/src/main/java/cpw/mods/ironchest/ContainerIronChest.java +++ b/src/main/java/cpw/mods/ironchest/ContainerIronChest.java @@ -39,42 +39,46 @@ public ContainerIronChest(IInventory playerInventory, IInventory chestInventory, @Override public boolean canInteractWith(EntityPlayer player) { - return this.chest.isUseableByPlayer(player); + return this.chest.isUsableByPlayer(player); } @Override - public ItemStack transferStackInSlot(EntityPlayer p, int i) + public ItemStack transferStackInSlot(EntityPlayer playerIn, int index) { - ItemStack itemstack = ItemStack.field_190927_a; - Slot slot = this.inventorySlots.get(i); + ItemStack itemstack = ItemStack.EMPTY; + Slot slot = this.inventorySlots.get(index); + if (slot != null && slot.getHasStack()) { ItemStack itemstack1 = slot.getStack(); itemstack = itemstack1.copy(); - if (i < this.type.size) + + if (index < this.type.size) { if (!this.mergeItemStack(itemstack1, this.type.size, this.inventorySlots.size(), true)) { - return ItemStack.field_190927_a; + return ItemStack.EMPTY; } } else if (!this.type.acceptsStack(itemstack1)) { - return ItemStack.field_190927_a; + return ItemStack.EMPTY; } else if (!this.mergeItemStack(itemstack1, 0, this.type.size, false)) { - return ItemStack.field_190927_a; + return ItemStack.EMPTY; } - if (itemstack1.func_190916_E() == 0) + + if (itemstack1.isEmpty()) { - slot.putStack(ItemStack.field_190927_a); + slot.putStack(ItemStack.EMPTY); } else { slot.onSlotChanged(); } } + return itemstack; } diff --git a/src/main/java/cpw/mods/ironchest/IronChestType.java b/src/main/java/cpw/mods/ironchest/IronChestType.java index db0d4c2b..793ad53a 100755 --- a/src/main/java/cpw/mods/ironchest/IronChestType.java +++ b/src/main/java/cpw/mods/ironchest/IronChestType.java @@ -202,7 +202,7 @@ public boolean acceptsStack(ItemStack itemstack) { if (this == DIRTCHEST9000) { - return itemstack == ItemStack.field_190927_a || itemstack.getItem() == DIRT_ITEM; + return itemstack == ItemStack.EMPTY || itemstack.getItem() == DIRT_ITEM; } return true; diff --git a/src/main/java/cpw/mods/ironchest/ItemChestChanger.java b/src/main/java/cpw/mods/ironchest/ItemChestChanger.java index 369cbf65..b5b8d9fe 100755 --- a/src/main/java/cpw/mods/ironchest/ItemChestChanger.java +++ b/src/main/java/cpw/mods/ironchest/ItemChestChanger.java @@ -66,14 +66,14 @@ public EnumActionResult onItemUseFirst(EntityPlayer player, World world, BlockPo TileEntity te = world.getTileEntity(pos); TileEntityIronChest newchest = new TileEntityIronChest(); - NonNullList chestContents = NonNullList. func_191197_a(27, ItemStack.field_190927_a); + NonNullList chestContents = NonNullList. withSize(27, ItemStack.EMPTY); EnumFacing chestFacing = EnumFacing.DOWN; if (te != null) { if (te instanceof TileEntityIronChest) { - chestContents = ((TileEntityIronChest) te).func_190576_q(); + chestContents = ((TileEntityIronChest) te).getItems(); chestFacing = ((TileEntityIronChest) te).getFacing(); newchest = this.type.target.makeEntity(); if (newchest == null) @@ -95,7 +95,7 @@ else if (te instanceof TileEntityChest) { return EnumActionResult.PASS; } - chestContents = NonNullList. func_191197_a(chest.getSizeInventory(), ItemStack.field_190927_a); + chestContents = NonNullList. withSize(chest.getSizeInventory(), ItemStack.EMPTY); for (int i = 0; i < chestContents.size(); i++) { chestContents.set(i, chest.getStackInSlot(i)); @@ -131,7 +131,7 @@ else if (te instanceof TileEntityChest) ItemStack stack = player.getHeldItem(hand); - stack.func_190920_e(player.capabilities.isCreativeMode ? stack.func_190916_E() : stack.func_190916_E() - 1); + stack.setCount(player.capabilities.isCreativeMode ? stack.getCount() : stack.getCount() - 1); return EnumActionResult.SUCCESS; } diff --git a/src/main/java/cpw/mods/ironchest/TileEntityDirtChest.java b/src/main/java/cpw/mods/ironchest/TileEntityDirtChest.java index 0b04bb23..fa772460 100755 --- a/src/main/java/cpw/mods/ironchest/TileEntityDirtChest.java +++ b/src/main/java/cpw/mods/ironchest/TileEntityDirtChest.java @@ -42,9 +42,9 @@ public void wasPlaced(EntityLivingBase entityliving, ItemStack itemStack) @Override public void removeAdornments() { - if (this.func_190576_q().get(0) != ItemStack.field_190927_a && this.func_190576_q().get(0).isItemEqual(dirtChest9000GuideBook)) + if (this.getItems().get(0) != ItemStack.EMPTY && this.getItems().get(0).isItemEqual(dirtChest9000GuideBook)) { - this.func_190576_q().set(0, ItemStack.field_190927_a); + this.getItems().set(0, ItemStack.EMPTY); } } } diff --git a/src/main/java/cpw/mods/ironchest/TileEntityIronChest.java b/src/main/java/cpw/mods/ironchest/TileEntityIronChest.java index ef8e2059..353ad466 100755 --- a/src/main/java/cpw/mods/ironchest/TileEntityIronChest.java +++ b/src/main/java/cpw/mods/ironchest/TileEntityIronChest.java @@ -68,14 +68,14 @@ protected TileEntityIronChest(IronChestType type) { super(); this.chestType = type; - this.chestContents = NonNullList. func_191197_a(type.size, ItemStack.field_190927_a); - this.topStacks = NonNullList. func_191197_a(8, ItemStack.field_190927_a); + this.chestContents = NonNullList. withSize(type.size, ItemStack.EMPTY); + this.topStacks = NonNullList. withSize(8, ItemStack.EMPTY); this.facing = EnumFacing.NORTH; } public void setContents(NonNullList contents) { - this.chestContents = NonNullList. func_191197_a(this.getType().size, ItemStack.field_190927_a); + this.chestContents = NonNullList. withSize(this.getType().size, ItemStack.EMPTY); for (int i = 0; i < contents.size(); i++) { @@ -108,9 +108,9 @@ public IronChestType getType() { IronChestType type = IronChestType.IRON; - if (this.hasWorldObj()) + if (this.hasWorld()) { - IBlockState state = this.worldObj.getBlockState(this.pos); + IBlockState state = this.world.getBlockState(this.pos); if (state.getBlock() == IronChest.ironChestBlock) { @@ -128,7 +128,7 @@ public ItemStack getStackInSlot(int index) this.inventoryTouched = true; - return this.func_190576_q().get(index); + return this.getItems().get(index); } @Override @@ -141,12 +141,12 @@ public void markDirty() protected void sortTopStacks() { - if (!this.getType().isTransparent() || (this.worldObj != null && this.worldObj.isRemote)) + if (!this.getType().isTransparent() || (this.world != null && this.world.isRemote)) { return; } - NonNullList tempCopy = NonNullList. func_191197_a(this.getSizeInventory(), ItemStack.field_190927_a); + NonNullList tempCopy = NonNullList. withSize(this.getSizeInventory(), ItemStack.EMPTY); boolean hasStuff = false; @@ -154,13 +154,13 @@ protected void sortTopStacks() mainLoop: for (int i = 0; i < this.getSizeInventory(); i++) { - if (this.chestContents.get(i) != ItemStack.field_190927_a) + if (this.chestContents.get(i) != ItemStack.EMPTY) { for (int j = 0; j < compressedIdx; j++) { if (tempCopy.get(j).isItemEqual(this.chestContents.get(i))) { - tempCopy.get(j).func_190920_e(tempCopy.get(j).func_190916_E() + this.chestContents.get(i).func_190916_E()); + tempCopy.get(j).setCount(tempCopy.get(j).getCount() + this.chestContents.get(i).getCount()); continue mainLoop; } } @@ -175,13 +175,13 @@ protected void sortTopStacks() for (int i = 0; i < this.topStacks.size(); i++) { - this.topStacks.set(i, ItemStack.field_190927_a); + this.topStacks.set(i, ItemStack.EMPTY); } - if (this.worldObj != null) + if (this.world != null) { - IBlockState iblockstate = this.worldObj.getBlockState(this.pos); - this.worldObj.notifyBlockUpdate(this.pos, iblockstate, iblockstate, 3); + IBlockState iblockstate = this.world.getBlockState(this.pos); + this.world.notifyBlockUpdate(this.pos, iblockstate, iblockstate, 3); } return; @@ -203,7 +203,7 @@ else if (stack2 == null) } else { - return stack2.func_190916_E() - stack1.func_190916_E(); + return stack2.getCount() - stack1.getCount(); } } }); @@ -213,7 +213,7 @@ else if (stack2 == null) for (int i = 0; i < tempCopy.size(); i++) { ItemStack element = tempCopy.get(i); - if (element != ItemStack.field_190927_a && element.func_190916_E() > 0) + if (element != ItemStack.EMPTY && element.getCount() > 0) { this.topStacks.set(p++, element); @@ -226,14 +226,14 @@ else if (stack2 == null) for (int i = p; i < this.topStacks.size(); i++) { - this.topStacks.set(i, ItemStack.field_190927_a); + this.topStacks.set(i, ItemStack.EMPTY); } - if (this.worldObj != null) + if (this.world != null) { - IBlockState iblockstate = this.worldObj.getBlockState(this.pos); + IBlockState iblockstate = this.world.getBlockState(this.pos); - this.worldObj.notifyBlockUpdate(this.pos, iblockstate, iblockstate, 3); + this.world.notifyBlockUpdate(this.pos, iblockstate, iblockstate, 3); } } @@ -249,6 +249,7 @@ public boolean hasCustomName() return this.customName != null && this.customName.length() > 0; } + @Override public void setCustomName(String name) { this.customName = name; @@ -259,7 +260,7 @@ public void readFromNBT(NBTTagCompound compound) { super.readFromNBT(compound); - this.chestContents = NonNullList. func_191197_a(this.getSizeInventory(), ItemStack.field_190927_a); + this.chestContents = NonNullList. withSize(this.getSizeInventory(), ItemStack.EMPTY); if (compound.hasKey("CustomName", Constants.NBT.TAG_STRING)) { @@ -268,7 +269,7 @@ public void readFromNBT(NBTTagCompound compound) if (!this.checkLootAndRead(compound)) { - ItemStackHelper.func_191283_b(compound, this.chestContents); + ItemStackHelper.loadAllItems(compound, this.chestContents); } this.facing = EnumFacing.VALUES[compound.getByte("facing")]; @@ -283,7 +284,7 @@ public NBTTagCompound writeToNBT(NBTTagCompound compound) if (!this.checkLootAndWrite(compound)) { - ItemStackHelper.func_191282_a(compound, this.chestContents); + ItemStackHelper.saveAllItems(compound, this.chestContents); } compound.setByte("facing", (byte) this.facing.ordinal()); @@ -303,14 +304,14 @@ public int getInventoryStackLimit() } @Override - public boolean isUseableByPlayer(EntityPlayer player) + public boolean isUsableByPlayer(EntityPlayer player) { - if (this.worldObj == null) + if (this.world == null) { return true; } - if (this.worldObj.getTileEntity(this.pos) != this) + if (this.world.getTileEntity(this.pos) != this) { return false; } @@ -323,7 +324,7 @@ public void update() { // Resynchronizes clients with the server state //@formatter:off - if (this.worldObj != null && !this.worldObj.isRemote && this.numPlayersUsing != 0 && (this.ticksSinceSync + this.pos.getX() + this.pos.getY() + this.pos.getZ()) % 200 == 0) + if (this.world != null && !this.world.isRemote && this.numPlayersUsing != 0 && (this.ticksSinceSync + this.pos.getX() + this.pos.getY() + this.pos.getZ()) % 200 == 0) //@formatter:on { this.numPlayersUsing = 0; @@ -331,7 +332,7 @@ public void update() float f = 5.0F; //@formatter:off - for (EntityPlayer player : this.worldObj.getEntitiesWithinAABB(EntityPlayer.class, + for (EntityPlayer player : this.world.getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(this.pos.getX() - f, this.pos.getY() - f, this.pos.getZ() - f, this.pos.getX() + 1 + f, this.pos.getY() + 1 + f, this.pos.getZ() + 1 + f))) //@formatter:on { @@ -342,12 +343,12 @@ public void update() } } - if (this.worldObj != null && !this.worldObj.isRemote && this.ticksSinceSync < 0) + if (this.world != null && !this.world.isRemote && this.ticksSinceSync < 0) { - this.worldObj.addBlockEvent(this.pos, IronChest.ironChestBlock, 3, ((this.numPlayersUsing << 3) & 0xF8) | (this.facing.ordinal() & 0x7)); + this.world.addBlockEvent(this.pos, IronChest.ironChestBlock, 3, ((this.numPlayersUsing << 3) & 0xF8) | (this.facing.ordinal() & 0x7)); } - if (!this.worldObj.isRemote && this.inventoryTouched) + if (!this.world.isRemote && this.inventoryTouched) { this.inventoryTouched = false; @@ -367,7 +368,7 @@ public void update() double z = this.pos.getZ() + 0.5D; //@formatter:off - this.worldObj.playSound(null, x, y, z, SoundEvents.BLOCK_CHEST_OPEN, SoundCategory.BLOCKS, 0.5F, this.worldObj.rand.nextFloat() * 0.1F + 0.9F); + this.world.playSound(null, x, y, z, SoundEvents.BLOCK_CHEST_OPEN, SoundCategory.BLOCKS, 0.5F, this.world.rand.nextFloat() * 0.1F + 0.9F); //@formatter:on } @@ -398,7 +399,7 @@ public void update() double z = this.pos.getZ() + 0.5D; //@formatter:off - this.worldObj.playSound(null, x, y, z, SoundEvents.BLOCK_CHEST_CLOSE, SoundCategory.BLOCKS, 0.5F, this.worldObj.rand.nextFloat() * 0.1F + 0.9F); + this.world.playSound(null, x, y, z, SoundEvents.BLOCK_CHEST_CLOSE, SoundCategory.BLOCKS, 0.5F, this.world.rand.nextFloat() * 0.1F + 0.9F); //@formatter:on } @@ -434,7 +435,7 @@ public void openInventory(EntityPlayer player) { if (!player.isSpectator()) { - if (this.worldObj == null) + if (this.world == null) { return; } @@ -446,9 +447,9 @@ public void openInventory(EntityPlayer player) ++this.numPlayersUsing; - this.worldObj.addBlockEvent(this.pos, IronChest.ironChestBlock, 1, this.numPlayersUsing); - this.worldObj.notifyNeighborsOfStateChange(this.pos, IronChest.ironChestBlock, false); - this.worldObj.notifyNeighborsOfStateChange(this.pos.down(), IronChest.ironChestBlock, false); + this.world.addBlockEvent(this.pos, IronChest.ironChestBlock, 1, this.numPlayersUsing); + this.world.notifyNeighborsOfStateChange(this.pos, IronChest.ironChestBlock, false); + this.world.notifyNeighborsOfStateChange(this.pos.down(), IronChest.ironChestBlock, false); } } @@ -457,16 +458,16 @@ public void closeInventory(EntityPlayer player) { if (!player.isSpectator()) { - if (this.worldObj == null) + if (this.world == null) { return; } --this.numPlayersUsing; - this.worldObj.addBlockEvent(this.pos, IronChest.ironChestBlock, 1, this.numPlayersUsing); - this.worldObj.notifyNeighborsOfStateChange(this.pos, IronChest.ironChestBlock, false); - this.worldObj.notifyNeighborsOfStateChange(this.pos.down(), IronChest.ironChestBlock, false); + this.world.addBlockEvent(this.pos, IronChest.ironChestBlock, 1, this.numPlayersUsing); + this.world.notifyNeighborsOfStateChange(this.pos, IronChest.ironChestBlock, false); + this.world.notifyNeighborsOfStateChange(this.pos.down(), IronChest.ironChestBlock, false); } } @@ -490,7 +491,7 @@ public SPacketUpdateTileEntity getUpdatePacket() for (int slot = 0; slot < stacks.size(); slot++) { - if (stacks.get(slot) != ItemStack.field_190927_a) + if (stacks.get(slot) != ItemStack.EMPTY) { NBTTagCompound item = new NBTTagCompound(); @@ -545,7 +546,7 @@ public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt) } else { - this.topStacks.set(i, ItemStack.field_190927_a); + this.topStacks.set(i, ItemStack.EMPTY); } pos++; @@ -558,7 +559,7 @@ public NonNullList buildItemStackDataList() { if (this.getType().isTransparent()) { - NonNullList sortList = NonNullList. func_191197_a(this.topStacks.size(), ItemStack.field_190927_a); + NonNullList sortList = NonNullList. withSize(this.topStacks.size(), ItemStack.EMPTY); int pos = 0; @@ -571,7 +572,7 @@ public NonNullList buildItemStackDataList() } else { - sortList.set(pos++, ItemStack.field_190927_a); + sortList.set(pos++, ItemStack.EMPTY); } } @@ -591,7 +592,7 @@ public void rotateAround() { this.setFacing(this.facing.rotateY()); - this.worldObj.addBlockEvent(this.pos, IronChest.ironChestBlock, 2, this.facing.ordinal()); + this.world.addBlockEvent(this.pos, IronChest.ironChestBlock, 2, this.facing.ordinal()); } public void wasPlaced(EntityLivingBase entityliving, ItemStack stack) @@ -629,17 +630,17 @@ public NBTTagCompound getUpdateTag() } @Override - protected NonNullList func_190576_q() + protected NonNullList getItems() { return this.chestContents; } @Override - public boolean func_191420_l() + public boolean isEmpty() { for (ItemStack itemstack : this.chestContents) { - if (!itemstack.func_190926_b()) + if (!itemstack.isEmpty()) { return false; } diff --git a/src/main/java/cpw/mods/ironchest/ValidatingSlot.java b/src/main/java/cpw/mods/ironchest/ValidatingSlot.java index 24e661a6..5391f7fe 100755 --- a/src/main/java/cpw/mods/ironchest/ValidatingSlot.java +++ b/src/main/java/cpw/mods/ironchest/ValidatingSlot.java @@ -15,8 +15,8 @@ public ValidatingSlot(IInventory inventoryIn, int slotIndex, int xPosition, int } @Override - public boolean isItemValid(ItemStack par1ItemStack) + public boolean isItemValid(ItemStack stack) { - return this.type.acceptsStack(par1ItemStack); + return this.type.acceptsStack(stack); } } diff --git a/src/main/java/cpw/mods/ironchest/client/GUIChest.java b/src/main/java/cpw/mods/ironchest/client/GUIChest.java index 9b404f88..2de0f543 100755 --- a/src/main/java/cpw/mods/ironchest/client/GUIChest.java +++ b/src/main/java/cpw/mods/ironchest/client/GUIChest.java @@ -88,7 +88,7 @@ private GUIChest(GUI type, IInventory player, IInventory chest) } @Override - protected void drawGuiContainerBackgroundLayer(float f, int i, int j) + protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) { GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); // new "bind tex" diff --git a/src/main/java/cpw/mods/ironchest/client/TileEntityIronChestRenderer.java b/src/main/java/cpw/mods/ironchest/client/TileEntityIronChestRenderer.java index de76f8ca..fc769dbe 100755 --- a/src/main/java/cpw/mods/ironchest/client/TileEntityIronChestRenderer.java +++ b/src/main/java/cpw/mods/ironchest/client/TileEntityIronChestRenderer.java @@ -51,26 +51,26 @@ public TileEntityIronChestRenderer() } @Override - public void renderTileEntityAt(TileEntityIronChest tile, double x, double y, double z, float partialTick, int breakStage) + public void renderTileEntityAt(TileEntityIronChest te, double x, double y, double z, float partialTicks, int destroyStage) { - if (tile == null || tile.isInvalid()) + if (te == null || te.isInvalid()) { return; } EnumFacing facing = EnumFacing.SOUTH; - IronChestType type = tile.getType(); + IronChestType type = te.getType(); - if (tile.hasWorldObj() && tile.getWorld().getBlockState(tile.getPos()).getBlock() == IronChest.ironChestBlock) + if (te.hasWorld() && te.getWorld().getBlockState(te.getPos()).getBlock() == IronChest.ironChestBlock) { - facing = tile.getFacing(); - IBlockState state = tile.getWorld().getBlockState(tile.getPos()); + facing = te.getFacing(); + IBlockState state = te.getWorld().getBlockState(te.getPos()); type = state.getValue(BlockIronChest.VARIANT_PROP); } - if (breakStage >= 0) + if (destroyStage >= 0) { - this.bindTexture(DESTROY_STAGES[breakStage]); + this.bindTexture(DESTROY_STAGES[destroyStage]); GlStateManager.matrixMode(5890); GlStateManager.pushMatrix(); GlStateManager.scale(4F, 4F, 1F); @@ -121,7 +121,7 @@ public void renderTileEntityAt(TileEntityIronChest tile, double x, double y, dou } GlStateManager.translate(-0.5F, -0.5F, -0.5F); - float lidangle = tile.prevLidAngle + (tile.lidAngle - tile.prevLidAngle) * partialTick; + float lidangle = te.prevLidAngle + (te.lidAngle - te.prevLidAngle) * partialTicks; lidangle = 1F - lidangle; lidangle = 1F - lidangle * lidangle * lidangle; @@ -133,7 +133,7 @@ public void renderTileEntityAt(TileEntityIronChest tile, double x, double y, dou this.model.chestLid.rotateAngleX = -lidangle * halfPI; // Render the chest itself this.model.renderAll(); - if (breakStage >= 0) + if (destroyStage >= 0) { GlStateManager.matrixMode(5890); GlStateManager.popMatrix(); @@ -146,8 +146,7 @@ public void renderTileEntityAt(TileEntityIronChest tile, double x, double y, dou GlStateManager.popMatrix(); GlStateManager.color(1F, 1F, 1F, 1F); - if (type.isTransparent() - && tile.getDistanceSq(this.rendererDispatcher.entityX, this.rendererDispatcher.entityY, this.rendererDispatcher.entityZ) < 128d) + if (type.isTransparent() && te.getDistanceSq(this.rendererDispatcher.entityX, this.rendererDispatcher.entityY, this.rendererDispatcher.entityZ) < 128d) { this.random.setSeed(254L); float shiftX; @@ -155,9 +154,9 @@ public void renderTileEntityAt(TileEntityIronChest tile, double x, double y, dou float shiftZ; int shift = 0; float blockScale = 0.70F; - float timeD = (float) (360D * (System.currentTimeMillis() & 0x3FFFL) / 0x3FFFL) - partialTick; + float timeD = (float) (360D * (System.currentTimeMillis() & 0x3FFFL) / 0x3FFFL) - partialTicks; - if (tile.getTopItemStacks().get(1) == ItemStack.field_190927_a) + if (te.getTopItemStacks().get(1) == ItemStack.EMPTY) { shift = 8; blockScale = 0.85F; @@ -169,7 +168,7 @@ public void renderTileEntityAt(TileEntityIronChest tile, double x, double y, dou customitem.setWorld(this.getWorld()); customitem.hoverStart = 0F; - NonNullList stacks = tile.getTopItemStacks(); + NonNullList stacks = te.getTopItemStacks(); for (int i = 0; i < stacks.size(); i++) { ItemStack item = stacks.get(i); @@ -177,7 +176,7 @@ public void renderTileEntityAt(TileEntityIronChest tile, double x, double y, dou { break; } - if (item == ItemStack.field_190927_a) + if (item == ItemStack.EMPTY) { shift++; continue; @@ -198,7 +197,7 @@ public void renderTileEntityAt(TileEntityIronChest tile, double x, double y, dou @Override public int getModelCount(ItemStack stack) { - return SignedBytes.saturatedCast(Math.min(stack.func_190916_E() / 32, 15) + 1); + return SignedBytes.saturatedCast(Math.min(stack.getCount() / 32, 15) + 1); } @Override @@ -215,7 +214,7 @@ public boolean shouldSpreadItems() }; } - this.itemRenderer.doRender(customitem, 0D, 0D, 0D, 0F, partialTick); + this.itemRenderer.doRender(customitem, 0D, 0D, 0D, 0F, partialTicks); GlStateManager.popMatrix(); } From e5e601a1b8bbed1c993d8abc48fdc8939c84cf5b Mon Sep 17 00:00:00 2001 From: alexbegt Date: Sat, 19 Nov 2016 13:03:30 -0500 Subject: [PATCH 039/105] Fix IronChest's version check + Fix the dirt chest's book. --- src/main/java/cpw/mods/ironchest/IronChest.java | 3 +-- src/main/resources/assets/ironchest/lang/en_US.lang | 10 +++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/main/java/cpw/mods/ironchest/IronChest.java b/src/main/java/cpw/mods/ironchest/IronChest.java index b11cf5d0..946fbffc 100755 --- a/src/main/java/cpw/mods/ironchest/IronChest.java +++ b/src/main/java/cpw/mods/ironchest/IronChest.java @@ -29,7 +29,7 @@ import net.minecraftforge.fml.common.registry.ForgeRegistries; import net.minecraftforge.fml.common.registry.GameRegistry; -@Mod(modid = IronChest.MOD_ID, name = "Iron Chests", dependencies = "required-after:forge@[13.19.0.2142,);", acceptedMinecraftVersions = "[1.11, 1.12)") +@Mod(modid = IronChest.MOD_ID, name = "Iron Chests", dependencies = "required-after:forge@[13.19.0.2142,)", acceptedMinecraftVersions = "[1.11, 1.12)") public class IronChest { public static final String MOD_ID = "ironchest"; @@ -55,7 +55,6 @@ public void preInit(FMLPreInitializationEvent event) String minor = properties.getProperty("IronChest.build.minor.number"); String rev = properties.getProperty("IronChest.build.revision.number"); String build = properties.getProperty("IronChest.build.number"); - // String mcversion = properties.getProperty("IronChest.build.mcversion"); event.getModMetadata().version = String.format("%s.%s.%s build %s", major, minor, rev, build); } diff --git a/src/main/resources/assets/ironchest/lang/en_US.lang b/src/main/resources/assets/ironchest/lang/en_US.lang index c848ed80..be393376 100755 --- a/src/main/resources/assets/ironchest/lang/en_US.lang +++ b/src/main/resources/assets/ironchest/lang/en_US.lang @@ -18,8 +18,8 @@ item.ironchest:WOODCOPPER.name=Wood to Copper Chest Upgrade item.ironchest:DIAMONDOBSIDIAN.name=Diamond to Obsidian Chest Upgrade book.ironchest:dirtchest9000.title=How to use your DirtChest 9000! -book.ironchest:dirtchest9000.page1=Welcome to your new DirtChest 9000! We hope you will enjoy many happy years of storing your stack of dirt in our storage utility. -book.ironchest:dirtchest9000.page2=Usage: simply insert the stack of dirt of your choice into the highly receptive slot and enjoy the great convenience of having that dirt available to you, any time you pass by this chest! -book.ironchest:dirtchest9000.page3=We hope you have enjoyed reviewing this instruction manual, and hope you will consider using our products in future! Kind regards, The DirtChest 9000 manual writers incorporated. -book.ironchest:dirtchest9000.page4=Warranty: This product has no warranty of any kind. Your dirt may not be stored, it may slowly leech into the environment, or alternatively, it may not do anything at all. -book.ironchest:dirtchest9000.page5=DirtChest 9000 is kind to the environment. Please dispose of this guide book responsibly, and do not whatever you do just chuck it into some lava. We would be very sad. +book.ironchest:dirtchest9000.page1="Welcome to your new DirtChest 9000! We hope you will enjoy many happy years of storing your stack of dirt in our storage utility." +book.ironchest:dirtchest9000.page2="Usage: simply insert the stack of dirt of your choice into the highly receptive slot and enjoy the great convenience of having that dirt available to you, any time you pass by this chest!" +book.ironchest:dirtchest9000.page3="We hope you have enjoyed reviewing this instruction manual, and hope you will consider using our products in future! Kind regards, The DirtChest 9000 manual writers incorporated." +book.ironchest:dirtchest9000.page4="Warranty: This product has no warranty of any kind. Your dirt may not be stored, it may slowly leech into the environment, or alternatively, it may not do anything at all." +book.ironchest:dirtchest9000.page5="DirtChest 9000 is kind to the environment. Please dispose of this guide book responsibly, and do not whatever you do just chuck it into some lava. We would be very sad." From 9515e682ef519325e0dfee337a4db0e0da34b58f Mon Sep 17 00:00:00 2001 From: alexbegt Date: Sun, 5 Mar 2017 12:55:00 -0500 Subject: [PATCH 040/105] Update Iron Chests to 1.11.2! --- build.gradle | 4 +- .../mods/ironchest/ContainerIronChest.java | 14 +- .../java/cpw/mods/ironchest/IronChest.java | 2 +- .../cpw/mods/ironchest/ItemChestChanger.java | 45 +++--- .../mods/ironchest/TileEntityIronChest.java | 136 +++++++----------- .../client/TileEntityIronChestRenderer.java | 24 +++- 6 files changed, 106 insertions(+), 119 deletions(-) diff --git a/build.gradle b/build.gradle index 02cbb77d..539131a2 100755 --- a/build.gradle +++ b/build.gradle @@ -33,7 +33,7 @@ repositories { } dependencies { - deobfCompile "mezz.jei:jei_1.11:4.0.1.193" + deobfCompile "mezz.jei:jei_1.11.2:4.2.7.241" } // This is our group. I'm cpw.mods @@ -43,7 +43,7 @@ archivesBaseName = "ironchest" // Setup the forge minecraft plugin data. Specify the preferred forge/minecraft version here minecraft { - version = "1.11-13.19.0.2153" + version = "1.11.2-13.20.0.2252" mappings = "snapshot_20161118" runDir = "run" } diff --git a/src/main/java/cpw/mods/ironchest/ContainerIronChest.java b/src/main/java/cpw/mods/ironchest/ContainerIronChest.java index 443f876d..6ee41f7d 100755 --- a/src/main/java/cpw/mods/ironchest/ContainerIronChest.java +++ b/src/main/java/cpw/mods/ironchest/ContainerIronChest.java @@ -37,9 +37,9 @@ public ContainerIronChest(IInventory playerInventory, IInventory chestInventory, } @Override - public boolean canInteractWith(EntityPlayer player) + public boolean canInteractWith(EntityPlayer playerIn) { - return this.chest.isUsableByPlayer(player); + return this.chest.isUsableByPlayer(playerIn); } @Override @@ -83,10 +83,11 @@ else if (!this.mergeItemStack(itemstack1, 0, this.type.size, false)) } @Override - public void onContainerClosed(EntityPlayer entityplayer) + public void onContainerClosed(EntityPlayer playerIn) { - super.onContainerClosed(entityplayer); - this.chest.closeInventory(entityplayer); + super.onContainerClosed(playerIn); + + this.chest.closeInventory(playerIn); } protected void layoutContainer(IInventory playerInventory, IInventory chestInventory, IronChestType type, int xSize, int ySize) @@ -111,8 +112,7 @@ protected void layoutContainer(IInventory playerInventory, IInventory chestInven { for (int playerInvCol = 0; playerInvCol < 9; playerInvCol++) { - this.addSlotToContainer( - new Slot(playerInventory, playerInvCol + playerInvRow * 9 + 9, leftCol + playerInvCol * 18, ySize - (4 - playerInvRow) * 18 - 10)); + this.addSlotToContainer(new Slot(playerInventory, playerInvCol + playerInvRow * 9 + 9, leftCol + playerInvCol * 18, ySize - (4 - playerInvRow) * 18 - 10)); } } diff --git a/src/main/java/cpw/mods/ironchest/IronChest.java b/src/main/java/cpw/mods/ironchest/IronChest.java index 946fbffc..cffcb293 100755 --- a/src/main/java/cpw/mods/ironchest/IronChest.java +++ b/src/main/java/cpw/mods/ironchest/IronChest.java @@ -77,7 +77,7 @@ public void preInit(FMLPreInitializationEvent event) MinecraftForge.EVENT_BUS.register(new OcelotsSitOnChestsHandler()); } - @Mod.EventHandler + @EventHandler public void onMissingMappings(FMLMissingMappingsEvent event) { for (MissingMapping mapping : event.get()) diff --git a/src/main/java/cpw/mods/ironchest/ItemChestChanger.java b/src/main/java/cpw/mods/ironchest/ItemChestChanger.java index b5b8d9fe..2006e9df 100755 --- a/src/main/java/cpw/mods/ironchest/ItemChestChanger.java +++ b/src/main/java/cpw/mods/ironchest/ItemChestChanger.java @@ -37,35 +37,37 @@ public ItemChestChanger(ChestChangerType type) this.setCreativeTab(CreativeTabs.MISC); } + /** + * Called when a Block is right-clicked with this Item + */ @Override - //@formatter:off - public EnumActionResult onItemUseFirst(EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ, EnumHand hand) - //@formatter:on + public EnumActionResult onItemUse(EntityPlayer playerIn, World worldIn, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { - if (world.isRemote) + ItemStack itemstack = playerIn.getHeldItem(hand); + + if (worldIn.isRemote) { return EnumActionResult.PASS; } if (this.type.canUpgrade(IronChestType.WOOD)) { - if (!(world.getBlockState(pos).getBlock() instanceof BlockChest)) + if (!(worldIn.getBlockState(pos).getBlock() instanceof BlockChest)) { return EnumActionResult.PASS; } } else { - //@formatter:off - if (world.getBlockState(pos) != IronChest.ironChestBlock.getStateFromMeta(IronChestType.valueOf(this.type.source.getName().toUpperCase()).ordinal())) - //@formatter:on + if (worldIn.getBlockState(pos) != IronChest.ironChestBlock.getStateFromMeta(IronChestType.valueOf(this.type.source.getName().toUpperCase()).ordinal())) { return EnumActionResult.PASS; } } - TileEntity te = world.getTileEntity(pos); + TileEntity te = worldIn.getTileEntity(pos); TileEntityIronChest newchest = new TileEntityIronChest(); + NonNullList chestContents = NonNullList. withSize(27, ItemStack.EMPTY); EnumFacing chestFacing = EnumFacing.DOWN; @@ -76,6 +78,7 @@ public EnumActionResult onItemUseFirst(EntityPlayer player, World world, BlockPo chestContents = ((TileEntityIronChest) te).getItems(); chestFacing = ((TileEntityIronChest) te).getFacing(); newchest = this.type.target.makeEntity(); + if (newchest == null) { return EnumActionResult.PASS; @@ -83,7 +86,7 @@ public EnumActionResult onItemUseFirst(EntityPlayer player, World world, BlockPo } else if (te instanceof TileEntityChest) { - IBlockState chestState = world.getBlockState(pos); + IBlockState chestState = worldIn.getBlockState(pos); chestFacing = chestState.getValue(BlockChest.FACING); TileEntityChest chest = (TileEntityChest) te; @@ -95,11 +98,14 @@ else if (te instanceof TileEntityChest) { return EnumActionResult.PASS; } + chestContents = NonNullList. withSize(chest.getSizeInventory(), ItemStack.EMPTY); + for (int i = 0; i < chestContents.size(); i++) { chestContents.set(i, chest.getStackInSlot(i)); } + newchest = this.type.target.makeEntity(); } } @@ -111,17 +117,17 @@ else if (te instanceof TileEntityChest) ((TileEntityChest) te).checkForAdjacentChests(); } - world.removeTileEntity(pos); - world.setBlockToAir(pos); + worldIn.removeTileEntity(pos); + worldIn.setBlockToAir(pos); IBlockState iblockstate = IronChest.ironChestBlock.getDefaultState().withProperty(BlockIronChest.VARIANT_PROP, this.type.target); - world.setTileEntity(pos, newchest); - world.setBlockState(pos, iblockstate, 3); + worldIn.setTileEntity(pos, newchest); + worldIn.setBlockState(pos, iblockstate, 3); - world.notifyBlockUpdate(pos, iblockstate, iblockstate, 3); + worldIn.notifyBlockUpdate(pos, iblockstate, iblockstate, 3); - TileEntity te2 = world.getTileEntity(pos); + TileEntity te2 = worldIn.getTileEntity(pos); if (te2 instanceof TileEntityIronChest) { @@ -129,9 +135,10 @@ else if (te instanceof TileEntityChest) ((TileEntityIronChest) te2).setFacing(chestFacing); } - ItemStack stack = player.getHeldItem(hand); - - stack.setCount(player.capabilities.isCreativeMode ? stack.getCount() : stack.getCount() - 1); + if (!playerIn.capabilities.isCreativeMode) + { + itemstack.shrink(1); + } return EnumActionResult.SUCCESS; } diff --git a/src/main/java/cpw/mods/ironchest/TileEntityIronChest.java b/src/main/java/cpw/mods/ironchest/TileEntityIronChest.java index 353ad466..61ff5284 100755 --- a/src/main/java/cpw/mods/ironchest/TileEntityIronChest.java +++ b/src/main/java/cpw/mods/ironchest/TileEntityIronChest.java @@ -22,7 +22,6 @@ import net.minecraft.inventory.ItemStackHelper; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; import net.minecraft.network.NetworkManager; import net.minecraft.network.play.server.SPacketUpdateTileEntity; import net.minecraft.tileentity.TileEntityLockableLoot; @@ -35,24 +34,31 @@ public class TileEntityIronChest extends TileEntityLockableLoot implements ITickable { + /** Chest Contents */ + public NonNullList chestContents; + + /** Crystal chest top stacks */ + private NonNullList topStacks; + /** The current angle of the lid (between 0 and 1) */ public float lidAngle; /** The angle of the lid last tick */ public float prevLidAngle; - private NonNullList chestContents; - - private int ticksSinceSync = -1; - + /** The number of players currently using this chest */ public int numPlayersUsing; - private NonNullList topStacks; + /** Server sync counter (once per 20 ticks) */ + private int ticksSinceSync; + /** Direction chest is facing */ private EnumFacing facing; + /** If the inventory got touched */ private boolean inventoryTouched; + /** If the inventory had items */ private boolean hadStuff; private String customName; @@ -81,7 +87,7 @@ public void setContents(NonNullList contents) { if (i < this.chestContents.size()) { - this.chestContents.set(i, contents.get(i)); + this.getItems().set(i, contents.get(i)); } } @@ -91,7 +97,7 @@ public void setContents(NonNullList contents) @Override public int getSizeInventory() { - return this.chestContents.size(); + return this.getItems().size(); } public EnumFacing getFacing() @@ -99,11 +105,6 @@ public EnumFacing getFacing() return this.facing; } - public void setFacing(EnumFacing facing) - { - this.facing = facing; - } - public IronChestType getType() { IronChestType type = IronChestType.IRON; @@ -152,19 +153,22 @@ protected void sortTopStacks() int compressedIdx = 0; - mainLoop: for (int i = 0; i < this.getSizeInventory(); i++) + mainLoop: + for (int i = 0; i < this.getSizeInventory(); i++) { - if (this.chestContents.get(i) != ItemStack.EMPTY) + if (this.getItems().get(i) != ItemStack.EMPTY) { for (int j = 0; j < compressedIdx; j++) { - if (tempCopy.get(j).isItemEqual(this.chestContents.get(i))) + if (tempCopy.get(j).isItemEqual(this.getItems().get(i))) { - tempCopy.get(j).setCount(tempCopy.get(j).getCount() + this.chestContents.get(i).getCount()); + tempCopy.get(j).grow(this.getItems().get(i).getCount()); + continue mainLoop; } } - tempCopy.set(compressedIdx++, this.chestContents.get(i).copy()); + + tempCopy.set(compressedIdx++, this.getItems().get(i).copy()); hasStuff = true; } } @@ -173,9 +177,9 @@ protected void sortTopStacks() { this.hadStuff = false; - for (int i = 0; i < this.topStacks.size(); i++) + for (int i = 0; i < this.getTopItems().size(); i++) { - this.topStacks.set(i, ItemStack.EMPTY); + this.getTopItems().set(i, ItemStack.EMPTY); } if (this.world != null) @@ -189,15 +193,16 @@ protected void sortTopStacks() this.hadStuff = true; - Collections.sort(tempCopy, new Comparator() { + Collections.sort(tempCopy, new Comparator() + { @Override public int compare(ItemStack stack1, ItemStack stack2) { - if (stack1 == null) + if (stack1 == ItemStack.EMPTY) { return 1; } - else if (stack2 == null) + else if (stack2 == ItemStack.EMPTY) { return -1; } @@ -210,23 +215,22 @@ else if (stack2 == null) int p = 0; - for (int i = 0; i < tempCopy.size(); i++) + for (ItemStack element : tempCopy) { - ItemStack element = tempCopy.get(i); if (element != ItemStack.EMPTY && element.getCount() > 0) { - this.topStacks.set(p++, element); + this.getTopItems().set(p++, element); - if (p == this.topStacks.size()) + if (p == this.getTopItems().size()) { break; } } } - for (int i = p; i < this.topStacks.size(); i++) + for (int i = p; i < this.getTopItems().size(); i++) { - this.topStacks.set(i, ItemStack.EMPTY); + this.getTopItems().set(i, ItemStack.EMPTY); } if (this.world != null) @@ -323,18 +327,13 @@ public boolean isUsableByPlayer(EntityPlayer player) public void update() { // Resynchronizes clients with the server state - //@formatter:off if (this.world != null && !this.world.isRemote && this.numPlayersUsing != 0 && (this.ticksSinceSync + this.pos.getX() + this.pos.getY() + this.pos.getZ()) % 200 == 0) - //@formatter:on { this.numPlayersUsing = 0; float f = 5.0F; - //@formatter:off - for (EntityPlayer player : this.world.getEntitiesWithinAABB(EntityPlayer.class, - new AxisAlignedBB(this.pos.getX() - f, this.pos.getY() - f, this.pos.getZ() - f, this.pos.getX() + 1 + f, this.pos.getY() + 1 + f, this.pos.getZ() + 1 + f))) - //@formatter:on + for (EntityPlayer player : this.world.getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(this.pos.getX() - f, this.pos.getY() - f, this.pos.getZ() - f, this.pos.getX() + 1 + f, this.pos.getY() + 1 + f, this.pos.getZ() + 1 + f))) { if (player.openContainer instanceof ContainerIronChest) { @@ -367,9 +366,7 @@ public void update() double y = this.pos.getY() + 0.5D; double z = this.pos.getZ() + 0.5D; - //@formatter:off this.world.playSound(null, x, y, z, SoundEvents.BLOCK_CHEST_OPEN, SoundCategory.BLOCKS, 0.5F, this.world.rand.nextFloat() * 0.1F + 0.9F); - //@formatter:on } if (this.numPlayersUsing == 0 && this.lidAngle > 0.0F || this.numPlayersUsing > 0 && this.lidAngle < 1.0F) @@ -398,9 +395,7 @@ public void update() double y = this.pos.getY() + 0.5D; double z = this.pos.getZ() + 0.5D; - //@formatter:off this.world.playSound(null, x, y, z, SoundEvents.BLOCK_CHEST_CLOSE, SoundCategory.BLOCKS, 0.5F, this.world.rand.nextFloat() * 0.1F + 0.9F); - //@formatter:on } if (this.lidAngle < 0.0F) @@ -471,9 +466,9 @@ public void closeInventory(EntityPlayer player) } } - public NonNullList getTopItemStacks() + public void setFacing(EnumFacing facing) { - return this.topStacks; + this.facing = facing; } @Override @@ -485,26 +480,7 @@ public SPacketUpdateTileEntity getUpdatePacket() NonNullList stacks = this.buildItemStackDataList(); - if (stacks != null) - { - NBTTagList itemList = new NBTTagList(); - - for (int slot = 0; slot < stacks.size(); slot++) - { - if (stacks.get(slot) != ItemStack.EMPTY) - { - NBTTagCompound item = new NBTTagCompound(); - - item.setByte("Slot", (byte) slot); - - stacks.get(slot).writeToNBT(item); - - itemList.appendTag(item); - } - } - - compound.setTag("stacks", itemList); - } + ItemStackHelper.saveAllItems(compound, stacks); return new SPacketUpdateTileEntity(this.pos, 0, compound); } @@ -518,35 +494,23 @@ public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt) this.facing = EnumFacing.VALUES[compound.getByte("facing")]; - NBTTagList itemList = compound.getTagList("stacks", Constants.NBT.TAG_COMPOUND); + NonNullList stacks = NonNullList. withSize(this.getTopItems().size(), ItemStack.EMPTY); - ItemStack[] stacks = new ItemStack[this.topStacks.size()]; + ItemStackHelper.loadAllItems(compound, stacks); - for (int item = 0; item < stacks.length; item++) - { - NBTTagCompound itemNBT = itemList.getCompoundTagAt(item); - - int slot = itemNBT.getByte("Slot") & 255; - - if (slot >= 0 && slot < stacks.length) - { - stacks[slot] = new ItemStack(itemNBT); - } - } - - if (this.getType().isTransparent() && stacks != null) + if (this.getType().isTransparent()) { int pos = 0; - for (int i = 0; i < this.topStacks.size(); i++) + for (int i = 0; i < this.getTopItems().size(); i++) { - if (stacks[pos] != null) + if (stacks.get(pos) != ItemStack.EMPTY) { - this.topStacks.set(i, stacks[pos]); + this.getTopItems().set(i, stacks.get(pos)); } else { - this.topStacks.set(i, ItemStack.EMPTY); + this.getTopItems().set(i, ItemStack.EMPTY); } pos++; @@ -559,13 +523,12 @@ public NonNullList buildItemStackDataList() { if (this.getType().isTransparent()) { - NonNullList sortList = NonNullList. withSize(this.topStacks.size(), ItemStack.EMPTY); + NonNullList sortList = NonNullList. withSize(this.getTopItems().size(), ItemStack.EMPTY); int pos = 0; - for (int i = 0; i < this.topStacks.size(); i++) + for (ItemStack is : this.topStacks) { - ItemStack is = this.topStacks.get(i); if (is != null) { sortList.set(pos++, is); @@ -579,7 +542,7 @@ public NonNullList buildItemStackDataList() return sortList; } - return null; + return NonNullList. withSize(this.getTopItems().size(), ItemStack.EMPTY); } @Override @@ -635,6 +598,11 @@ protected NonNullList getItems() return this.chestContents; } + public NonNullList getTopItems() + { + return this.topStacks; + } + @Override public boolean isEmpty() { diff --git a/src/main/java/cpw/mods/ironchest/client/TileEntityIronChestRenderer.java b/src/main/java/cpw/mods/ironchest/client/TileEntityIronChestRenderer.java index fc769dbe..4c2e33b1 100755 --- a/src/main/java/cpw/mods/ironchest/client/TileEntityIronChestRenderer.java +++ b/src/main/java/cpw/mods/ironchest/client/TileEntityIronChestRenderer.java @@ -27,7 +27,6 @@ import net.minecraft.entity.item.EntityItem; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumFacing; -import net.minecraft.util.NonNullList; public class TileEntityIronChestRenderer extends TileEntitySpecialRenderer { @@ -81,11 +80,14 @@ public void renderTileEntityAt(TileEntityIronChest te, double x, double y, doubl { this.bindTexture(type.modelTexture); } + GlStateManager.pushMatrix(); + if (type == IronChestType.CRYSTAL) { GlStateManager.disableCull(); } + GlStateManager.color(1F, 1F, 1F, 1F); GlStateManager.translate((float) x, (float) y + 1F, (float) z + 1F); GlStateManager.scale(1F, -1F, -1F); @@ -121,7 +123,9 @@ public void renderTileEntityAt(TileEntityIronChest te, double x, double y, doubl } GlStateManager.translate(-0.5F, -0.5F, -0.5F); + float lidangle = te.prevLidAngle + (te.lidAngle - te.prevLidAngle) * partialTicks; + lidangle = 1F - lidangle; lidangle = 1F - lidangle * lidangle * lidangle; @@ -133,22 +137,26 @@ public void renderTileEntityAt(TileEntityIronChest te, double x, double y, doubl this.model.chestLid.rotateAngleX = -lidangle * halfPI; // Render the chest itself this.model.renderAll(); + if (destroyStage >= 0) { GlStateManager.matrixMode(5890); GlStateManager.popMatrix(); GlStateManager.matrixMode(5888); } + if (type == IronChestType.CRYSTAL) { GlStateManager.enableCull(); } + GlStateManager.popMatrix(); GlStateManager.color(1F, 1F, 1F, 1F); if (type.isTransparent() && te.getDistanceSq(this.rendererDispatcher.entityX, this.rendererDispatcher.entityY, this.rendererDispatcher.entityZ) < 128d) { this.random.setSeed(254L); + float shiftX; float shiftY; float shiftZ; @@ -156,7 +164,7 @@ public void renderTileEntityAt(TileEntityIronChest te, double x, double y, doubl float blockScale = 0.70F; float timeD = (float) (360D * (System.currentTimeMillis() & 0x3FFFL) / 0x3FFFL) - partialTicks; - if (te.getTopItemStacks().get(1) == ItemStack.EMPTY) + if (te.getTopItems().get(1).isEmpty()) { shift = 8; blockScale = 0.85F; @@ -168,32 +176,35 @@ public void renderTileEntityAt(TileEntityIronChest te, double x, double y, doubl customitem.setWorld(this.getWorld()); customitem.hoverStart = 0F; - NonNullList stacks = te.getTopItemStacks(); - for (int i = 0; i < stacks.size(); i++) + for (ItemStack item : te.getTopItems()) { - ItemStack item = stacks.get(i); if (shift > shifts.length) { break; } + if (item == ItemStack.EMPTY) { shift++; continue; } + shiftX = shifts[shift][0]; shiftY = shifts[shift][1]; shiftZ = shifts[shift][2]; shift++; + GlStateManager.pushMatrix(); GlStateManager.translate(shiftX, shiftY, shiftZ); GlStateManager.rotate(timeD, 0F, 1F, 0F); GlStateManager.scale(blockScale, blockScale, blockScale); + customitem.setEntityItemStack(item); if (this.itemRenderer == null) { - this.itemRenderer = new RenderEntityItem(Minecraft.getMinecraft().getRenderManager(), Minecraft.getMinecraft().getRenderItem()) { + this.itemRenderer = new RenderEntityItem(Minecraft.getMinecraft().getRenderManager(), Minecraft.getMinecraft().getRenderItem()) + { @Override public int getModelCount(ItemStack stack) { @@ -215,6 +226,7 @@ public boolean shouldSpreadItems() } this.itemRenderer.doRender(customitem, 0D, 0D, 0D, 0F, partialTicks); + GlStateManager.popMatrix(); } From 82f9d7cf8f0fbae56dc99d11d82ef55e60f91347 Mon Sep 17 00:00:00 2001 From: alexbegt Date: Wed, 17 May 2017 15:12:21 -0400 Subject: [PATCH 041/105] Fix Crystal Chest's crashing clients with ArrayIndexOutOfBoundsException due to two different items having two 64 stacks in the chest, also Items will now render if there is more than one item stack, but only one will be rendered. (Before it wouldn't render any items being in the chest) Closes #90 --- .../cpw/mods/ironchest/IronChestType.java | 2 +- .../mods/ironchest/TileEntityDirtChest.java | 2 +- .../mods/ironchest/TileEntityIronChest.java | 53 ++++++++++++------- .../client/TileEntityIronChestRenderer.java | 4 +- 4 files changed, 38 insertions(+), 23 deletions(-) diff --git a/src/main/java/cpw/mods/ironchest/IronChestType.java b/src/main/java/cpw/mods/ironchest/IronChestType.java index 793ad53a..d81bea30 100755 --- a/src/main/java/cpw/mods/ironchest/IronChestType.java +++ b/src/main/java/cpw/mods/ironchest/IronChestType.java @@ -202,7 +202,7 @@ public boolean acceptsStack(ItemStack itemstack) { if (this == DIRTCHEST9000) { - return itemstack == ItemStack.EMPTY || itemstack.getItem() == DIRT_ITEM; + return itemstack.isEmpty() || itemstack.getItem() == DIRT_ITEM; } return true; diff --git a/src/main/java/cpw/mods/ironchest/TileEntityDirtChest.java b/src/main/java/cpw/mods/ironchest/TileEntityDirtChest.java index fa772460..a6eea6a3 100755 --- a/src/main/java/cpw/mods/ironchest/TileEntityDirtChest.java +++ b/src/main/java/cpw/mods/ironchest/TileEntityDirtChest.java @@ -42,7 +42,7 @@ public void wasPlaced(EntityLivingBase entityliving, ItemStack itemStack) @Override public void removeAdornments() { - if (this.getItems().get(0) != ItemStack.EMPTY && this.getItems().get(0).isItemEqual(dirtChest9000GuideBook)) + if (!this.getItems().get(0).isEmpty() && this.getItems().get(0).isItemEqual(dirtChest9000GuideBook)) { this.getItems().set(0, ItemStack.EMPTY); } diff --git a/src/main/java/cpw/mods/ironchest/TileEntityIronChest.java b/src/main/java/cpw/mods/ironchest/TileEntityIronChest.java index 61ff5284..0ef935be 100755 --- a/src/main/java/cpw/mods/ironchest/TileEntityIronChest.java +++ b/src/main/java/cpw/mods/ironchest/TileEntityIronChest.java @@ -153,22 +153,31 @@ protected void sortTopStacks() int compressedIdx = 0; - mainLoop: - for (int i = 0; i < this.getSizeInventory(); i++) + mainLoop: for (int i = 0; i < this.getSizeInventory(); i++) { - if (this.getItems().get(i) != ItemStack.EMPTY) + ItemStack itemStack = this.getItems().get(i); + + if (!itemStack.isEmpty()) { for (int j = 0; j < compressedIdx; j++) { - if (tempCopy.get(j).isItemEqual(this.getItems().get(i))) + ItemStack tempCopyStack = tempCopy.get(j); + + if (ItemStack.areItemsEqual(tempCopyStack, itemStack)) { - tempCopy.get(j).grow(this.getItems().get(i).getCount()); + if (itemStack.getCount() != tempCopyStack.getCount()) + { + tempCopyStack.grow(itemStack.getCount()); + } continue mainLoop; } } - tempCopy.set(compressedIdx++, this.getItems().get(i).copy()); + tempCopy.set(compressedIdx, itemStack.copy()); + + compressedIdx++; + hasStuff = true; } } @@ -185,6 +194,7 @@ protected void sortTopStacks() if (this.world != null) { IBlockState iblockstate = this.world.getBlockState(this.pos); + this.world.notifyBlockUpdate(this.pos, iblockstate, iblockstate, 3); } @@ -193,16 +203,15 @@ protected void sortTopStacks() this.hadStuff = true; - Collections.sort(tempCopy, new Comparator() - { + Collections.sort(tempCopy, new Comparator() { @Override public int compare(ItemStack stack1, ItemStack stack2) { - if (stack1 == ItemStack.EMPTY) + if (stack1.isEmpty()) { return 1; } - else if (stack2 == ItemStack.EMPTY) + else if (stack2.isEmpty()) { return -1; } @@ -217,14 +226,16 @@ else if (stack2 == ItemStack.EMPTY) for (ItemStack element : tempCopy) { - if (element != ItemStack.EMPTY && element.getCount() > 0) + if (!element.isEmpty() && element.getCount() > 0) { - this.getTopItems().set(p++, element); - if (p == this.getTopItems().size()) { break; } + + this.getTopItems().set(p, element); + + p++; } } @@ -327,13 +338,15 @@ public boolean isUsableByPlayer(EntityPlayer player) public void update() { // Resynchronizes clients with the server state - if (this.world != null && !this.world.isRemote && this.numPlayersUsing != 0 && (this.ticksSinceSync + this.pos.getX() + this.pos.getY() + this.pos.getZ()) % 200 == 0) + if (this.world != null && !this.world.isRemote && this.numPlayersUsing != 0 + && (this.ticksSinceSync + this.pos.getX() + this.pos.getY() + this.pos.getZ()) % 200 == 0) { this.numPlayersUsing = 0; float f = 5.0F; - for (EntityPlayer player : this.world.getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(this.pos.getX() - f, this.pos.getY() - f, this.pos.getZ() - f, this.pos.getX() + 1 + f, this.pos.getY() + 1 + f, this.pos.getZ() + 1 + f))) + for (EntityPlayer player : this.world.getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(this.pos.getX() - f, this.pos.getY() - f, + this.pos.getZ() - f, this.pos.getX() + 1 + f, this.pos.getY() + 1 + f, this.pos.getZ() + 1 + f))) { if (player.openContainer instanceof ContainerIronChest) { @@ -504,7 +517,7 @@ public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt) for (int i = 0; i < this.getTopItems().size(); i++) { - if (stacks.get(pos) != ItemStack.EMPTY) + if (!stacks.get(pos).isEmpty()) { this.getTopItems().set(i, stacks.get(pos)); } @@ -529,14 +542,16 @@ public NonNullList buildItemStackDataList() for (ItemStack is : this.topStacks) { - if (is != null) + if (!is.isEmpty()) { - sortList.set(pos++, is); + sortList.set(pos, is); } else { - sortList.set(pos++, ItemStack.EMPTY); + sortList.set(pos, ItemStack.EMPTY); } + + pos++; } return sortList; diff --git a/src/main/java/cpw/mods/ironchest/client/TileEntityIronChestRenderer.java b/src/main/java/cpw/mods/ironchest/client/TileEntityIronChestRenderer.java index 4c2e33b1..067a83fd 100755 --- a/src/main/java/cpw/mods/ironchest/client/TileEntityIronChestRenderer.java +++ b/src/main/java/cpw/mods/ironchest/client/TileEntityIronChestRenderer.java @@ -37,7 +37,7 @@ public class TileEntityIronChestRenderer extends TileEntitySpecialRenderer Date: Sun, 11 Jun 2017 12:50:47 -0400 Subject: [PATCH 042/105] Add Iron Shulker Boxes, which function just like regular shulker boxes but with all the extra features the chest variants have. This version of the mod also has a reorganized code package (still in cpw.mods.ironchest) and resources have been moved around. --- build.gradle | 6 +- .../java/cpw/mods/ironchest/IronChest.java | 135 +-- .../cpw/mods/ironchest/ValidatingSlot.java | 22 - .../mods/ironchest/client/ClientProxy.java | 62 +- .../client/{ => gui/chest}/GUIChest.java | 12 +- .../client/gui/shulker/GUIShulkerChest.java | 102 +++ .../chest}/TileEntityIronChestRenderer.java | 20 +- .../TileEntityIronShulkerBoxRenderer.java | 238 ++++++ .../ironchest/{ => common}/CommonProxy.java | 19 +- .../cpw/mods/ironchest/common/ICContent.java | 222 +++++ .../{ => common/ai}/IronChestAIOcelotSit.java | 16 +- .../blocks/chest}/BlockIronChest.java | 49 +- .../blocks/chest}/IronChestType.java | 30 +- .../blocks/shulker/BlockIronShulkerBox.java | 493 +++++++++++ .../blocks/shulker/IronShulkerBoxType.java | 233 +++++ .../crafting/IronShulkerBoxColoring.java | 136 +++ .../gui/chest}/ContainerIronChest.java | 7 +- .../gui/chest/slot/ValidatingChestSlot.java | 33 + .../gui/shulker/ContainerIronShulkerBox.java | 138 +++ .../slot/ValidatingShulkerBoxSlot.java | 34 + .../{ => common/items}/ChestChangerType.java | 41 +- .../common/items/ShulkerBoxChangerType.java | 101 +++ .../items/chest}/ItemChestChanger.java | 28 +- .../items/chest}/ItemIronChest.java | 10 +- .../items/shulker/ItemIronShulkerBox.java | 49 ++ .../items/shulker/ItemShulkerBoxChanger.java | 213 +++++ .../network/MessageCrystalChestSync.java | 93 ++ .../network/MessageCrystalShulkerSync.java | 93 ++ .../chest}/TileEntityCopperChest.java | 4 +- .../chest}/TileEntityCrystalChest.java | 4 +- .../chest}/TileEntityDiamondChest.java | 4 +- .../chest}/TileEntityDirtChest.java | 15 +- .../chest}/TileEntityGoldChest.java | 4 +- .../chest}/TileEntityIronChest.java | 87 +- .../chest}/TileEntityObsidianChest.java | 4 +- .../chest}/TileEntitySilverChest.java | 4 +- .../shulker/TileEntityCopperShulkerBox.java | 29 + .../shulker/TileEntityCrystalShulkerBox.java | 29 + .../shulker/TileEntityDiamondShulkerBox.java | 29 + .../shulker/TileEntityGoldShulkerBox.java | 29 + .../shulker/TileEntityIronShulkerBox.java | 795 ++++++++++++++++++ .../shulker/TileEntityObsidianShulkerBox.java | 29 + .../shulker/TileEntitySilverShulkerBox.java | 29 + .../util/BehaviorDispenseIronShulkerBox.java | 64 ++ .../ironchest/common/util/CreativeTab.java | 55 ++ .../ironchest/common/util/ItemTooltip.java | 71 ++ .../common/util/MissingMappingsHandler.java | 190 +++++ .../util}/OcelotsSitOnChestsHandler.java | 13 +- .../ironchest/blockstates/iron_chest.json | 16 +- .../blockstates/iron_chest_upgrades.json | 36 +- .../blockstates/iron_shulker_box_black.json | 59 ++ .../blockstates/iron_shulker_box_blue.json | 59 ++ .../blockstates/iron_shulker_box_brown.json | 59 ++ .../blockstates/iron_shulker_box_cyan.json | 59 ++ .../blockstates/iron_shulker_box_gray.json | 59 ++ .../blockstates/iron_shulker_box_green.json | 59 ++ .../iron_shulker_box_light_blue.json | 59 ++ .../blockstates/iron_shulker_box_lime.json | 59 ++ .../blockstates/iron_shulker_box_magenta.json | 59 ++ .../blockstates/iron_shulker_box_orange.json | 59 ++ .../blockstates/iron_shulker_box_pink.json | 59 ++ .../blockstates/iron_shulker_box_purple.json | 59 ++ .../blockstates/iron_shulker_box_red.json | 59 ++ .../blockstates/iron_shulker_box_silver.json | 59 ++ .../iron_shulker_box_upgrades.json | 56 ++ .../blockstates/iron_shulker_box_white.json | 59 ++ .../blockstates/iron_shulker_box_yellow.json | 59 ++ .../assets/ironchest/lang/cs_CZ.lang | 36 +- .../assets/ironchest/lang/da_DK.lang | 36 +- .../assets/ironchest/lang/de_DE.lang | 50 +- .../assets/ironchest/lang/el_GR.lang | 36 +- .../assets/ironchest/lang/en_PT.lang | 50 +- .../assets/ironchest/lang/en_US.lang | 202 ++++- .../assets/ironchest/lang/es_ES.lang | 36 +- .../assets/ironchest/lang/et_EE.lang | 38 +- .../assets/ironchest/lang/fr_CA.lang | 50 +- .../assets/ironchest/lang/fr_FR.lang | 36 +- .../assets/ironchest/lang/hu_HU.lang | 50 +- .../assets/ironchest/lang/it_IT.lang | 50 +- .../assets/ironchest/lang/ko_KR.lang | 48 +- .../assets/ironchest/lang/nb_NO.lang | 50 +- .../assets/ironchest/lang/nl_NL.lang | 46 +- .../assets/ironchest/lang/pl_PL.lang | 36 +- .../assets/ironchest/lang/pt_BR.lang | 50 +- .../assets/ironchest/lang/pt_PT.lang | 36 +- .../assets/ironchest/lang/ru_RU.lang | 36 +- .../assets/ironchest/lang/sv_SE.lang | 36 +- .../assets/ironchest/lang/tr_TR.lang | 50 +- .../assets/ironchest/lang/zh_CN.lang | 50 +- .../assets/ironchest/lang/zh_TW.lang | 50 +- .../ironchest/models/block/iron_chest.json | 2 +- .../models/block/iron_shulker_box.json | 152 ++++ .../items/{ => chest}/copper_iron_upgrade.png | Bin .../{ => chest}/copper_silver_upgrade.png | Bin .../{ => chest}/diamond_crystal_upgrade.png | Bin .../{ => chest}/diamond_obsidian_upgrade.png | Bin .../{ => chest}/gold_diamond_upgrade.png | Bin .../items/{ => chest}/iron_gold_upgrade.png | Bin .../items/{ => chest}/silver_gold_upgrade.png | Bin .../items/{ => chest}/wood_copper_upgrade.png | Bin .../items/{ => chest}/wood_iron_upgrade.png | Bin .../items/shulker/copper_iron_upgrade.png | Bin 0 -> 363 bytes .../items/shulker/copper_silver_upgrade.png | Bin 0 -> 363 bytes .../items/shulker/diamond_crystal_upgrade.png | Bin 0 -> 281 bytes .../shulker/diamond_obsidian_upgrade.png | Bin 0 -> 350 bytes .../items/shulker/gold_diamond_upgrade.png | Bin 0 -> 363 bytes .../items/shulker/iron_gold_upgrade.png | Bin 0 -> 417 bytes .../items/shulker/silver_gold_upgrade.png | Bin 0 -> 414 bytes .../items/shulker/vanilla_copper_upgrade.png | Bin 0 -> 566 bytes .../items/shulker/vanilla_iron_upgrade.png | Bin 0 -> 566 bytes .../model/{ => chest}/copper_chest.png | Bin .../model/{ => chest}/crystal_chest.png | Bin .../model/{ => chest}/diamond_chest.png | Bin .../textures/model/{ => chest}/dirt_chest.png | Bin .../textures/model/{ => chest}/gold_chest.png | Bin .../textures/model/{ => chest}/iron_chest.png | Bin .../model/{ => chest}/obsidian_chest.png | Bin .../model/{ => chest}/silver_chest.png | Bin .../shulker/black/shulker_black_copper.png | Bin 0 -> 19631 bytes .../shulker/black/shulker_black_crystal.png | Bin 0 -> 19000 bytes .../shulker/black/shulker_black_diamond.png | Bin 0 -> 19636 bytes .../shulker/black/shulker_black_gold.png | Bin 0 -> 19619 bytes .../shulker/black/shulker_black_iron.png | Bin 0 -> 19628 bytes .../shulker/black/shulker_black_obsidian.png | Bin 0 -> 20770 bytes .../shulker/black/shulker_black_silver.png | Bin 0 -> 19640 bytes .../shulker/blue/shulker_blue_copper.png | Bin 0 -> 20011 bytes .../shulker/blue/shulker_blue_crystal.png | Bin 0 -> 19353 bytes .../shulker/blue/shulker_blue_diamond.png | Bin 0 -> 20007 bytes .../model/shulker/blue/shulker_blue_gold.png | Bin 0 -> 19941 bytes .../model/shulker/blue/shulker_blue_iron.png | Bin 0 -> 19982 bytes .../shulker/blue/shulker_blue_obsidian.png | Bin 0 -> 21529 bytes .../shulker/blue/shulker_blue_silver.png | Bin 0 -> 19968 bytes .../shulker/brown/shulker_brown_copper.png | Bin 0 -> 19917 bytes .../shulker/brown/shulker_brown_crystal.png | Bin 0 -> 19277 bytes .../shulker/brown/shulker_brown_diamond.png | Bin 0 -> 19989 bytes .../shulker/brown/shulker_brown_gold.png | Bin 0 -> 19914 bytes .../shulker/brown/shulker_brown_iron.png | Bin 0 -> 19957 bytes .../shulker/brown/shulker_brown_obsidian.png | Bin 0 -> 21436 bytes .../shulker/brown/shulker_brown_silver.png | Bin 0 -> 19913 bytes .../shulker/cyan/shulker_cyan_copper.png | Bin 0 -> 20019 bytes .../shulker/cyan/shulker_cyan_crystal.png | Bin 0 -> 19199 bytes .../shulker/cyan/shulker_cyan_diamond.png | Bin 0 -> 20014 bytes .../model/shulker/cyan/shulker_cyan_gold.png | Bin 0 -> 19977 bytes .../model/shulker/cyan/shulker_cyan_iron.png | Bin 0 -> 19981 bytes .../shulker/cyan/shulker_cyan_obsidian.png | Bin 0 -> 21493 bytes .../shulker/cyan/shulker_cyan_silver.png | Bin 0 -> 19966 bytes .../shulker/gray/shulker_gray_copper.png | Bin 0 -> 19924 bytes .../shulker/gray/shulker_gray_crystal.png | Bin 0 -> 19377 bytes .../shulker/gray/shulker_gray_diamond.png | Bin 0 -> 19982 bytes .../model/shulker/gray/shulker_gray_gold.png | Bin 0 -> 19882 bytes .../model/shulker/gray/shulker_gray_iron.png | Bin 0 -> 19967 bytes .../shulker/gray/shulker_gray_obsidian.png | Bin 0 -> 20736 bytes .../shulker/gray/shulker_gray_silver.png | Bin 0 -> 19904 bytes .../shulker/green/shulker_green_copper.png | Bin 0 -> 20016 bytes .../shulker/green/shulker_green_crystal.png | Bin 0 -> 19335 bytes .../shulker/green/shulker_green_diamond.png | Bin 0 -> 20068 bytes .../shulker/green/shulker_green_gold.png | Bin 0 -> 20005 bytes .../shulker/green/shulker_green_iron.png | Bin 0 -> 20036 bytes .../shulker/green/shulker_green_obsidian.png | Bin 0 -> 21422 bytes .../shulker/green/shulker_green_silver.png | Bin 0 -> 20037 bytes .../light_blue/shulker_light_blue_copper.png | Bin 0 -> 19754 bytes .../light_blue/shulker_light_blue_crystal.png | Bin 0 -> 19017 bytes .../light_blue/shulker_light_blue_diamond.png | Bin 0 -> 19752 bytes .../light_blue/shulker_light_blue_gold.png | Bin 0 -> 19700 bytes .../light_blue/shulker_light_blue_iron.png | Bin 0 -> 19747 bytes .../shulker_light_blue_obsidian.png | Bin 0 -> 21521 bytes .../light_blue/shulker_light_blue_silver.png | Bin 0 -> 19729 bytes .../shulker/lime/shulker_lime_copper.png | Bin 0 -> 19783 bytes .../shulker/lime/shulker_lime_crystal.png | Bin 0 -> 19038 bytes .../shulker/lime/shulker_lime_diamond.png | Bin 0 -> 19823 bytes .../model/shulker/lime/shulker_lime_gold.png | Bin 0 -> 19765 bytes .../model/shulker/lime/shulker_lime_iron.png | Bin 0 -> 19811 bytes .../shulker/lime/shulker_lime_obsidian.png | Bin 0 -> 21454 bytes .../shulker/lime/shulker_lime_silver.png | Bin 0 -> 19788 bytes .../magenta/shulker_magenta_copper.png | Bin 0 -> 19898 bytes .../magenta/shulker_magenta_crystal.png | Bin 0 -> 19122 bytes .../magenta/shulker_magenta_diamond.png | Bin 0 -> 19865 bytes .../shulker/magenta/shulker_magenta_gold.png | Bin 0 -> 19840 bytes .../shulker/magenta/shulker_magenta_iron.png | Bin 0 -> 19907 bytes .../magenta/shulker_magenta_obsidian.png | Bin 0 -> 21568 bytes .../magenta/shulker_magenta_silver.png | Bin 0 -> 19911 bytes .../shulker/orange/shulker_orange_copper.png | Bin 0 -> 19881 bytes .../shulker/orange/shulker_orange_crystal.png | Bin 0 -> 19109 bytes .../shulker/orange/shulker_orange_diamond.png | Bin 0 -> 19859 bytes .../shulker/orange/shulker_orange_gold.png | Bin 0 -> 19825 bytes .../shulker/orange/shulker_orange_iron.png | Bin 0 -> 19856 bytes .../orange/shulker_orange_obsidian.png | Bin 0 -> 21474 bytes .../shulker/orange/shulker_orange_silver.png | Bin 0 -> 19833 bytes .../shulker/pink/shulker_pink_copper.png | Bin 0 -> 19882 bytes .../shulker/pink/shulker_pink_crystal.png | Bin 0 -> 19253 bytes .../shulker/pink/shulker_pink_diamond.png | Bin 0 -> 19872 bytes .../model/shulker/pink/shulker_pink_gold.png | Bin 0 -> 19846 bytes .../model/shulker/pink/shulker_pink_iron.png | Bin 0 -> 19888 bytes .../shulker/pink/shulker_pink_obsidian.png | Bin 0 -> 21575 bytes .../shulker/pink/shulker_pink_silver.png | Bin 0 -> 19874 bytes .../shulker/purple/shulker_purple_copper.png | Bin 0 -> 20290 bytes .../shulker/purple/shulker_purple_crystal.png | Bin 0 -> 19408 bytes .../shulker/purple/shulker_purple_diamond.png | Bin 0 -> 20300 bytes .../shulker/purple/shulker_purple_gold.png | Bin 0 -> 20276 bytes .../shulker/purple/shulker_purple_iron.png | Bin 0 -> 20341 bytes .../purple/shulker_purple_obsidian.png | Bin 0 -> 21436 bytes .../shulker/purple/shulker_purple_silver.png | Bin 0 -> 20318 bytes .../model/shulker/red/shulker_red_copper.png | Bin 0 -> 19992 bytes .../model/shulker/red/shulker_red_crystal.png | Bin 0 -> 19166 bytes .../model/shulker/red/shulker_red_diamond.png | Bin 0 -> 19965 bytes .../model/shulker/red/shulker_red_gold.png | Bin 0 -> 19955 bytes .../model/shulker/red/shulker_red_iron.png | Bin 0 -> 19992 bytes .../shulker/red/shulker_red_obsidian.png | Bin 0 -> 21459 bytes .../model/shulker/red/shulker_red_silver.png | Bin 0 -> 19981 bytes .../shulker/silver/shulker_silver_copper.png | Bin 0 -> 20119 bytes .../shulker/silver/shulker_silver_crystal.png | Bin 0 -> 19292 bytes .../shulker/silver/shulker_silver_diamond.png | Bin 0 -> 20087 bytes .../shulker/silver/shulker_silver_gold.png | Bin 0 -> 20032 bytes .../shulker/silver/shulker_silver_iron.png | Bin 0 -> 20065 bytes .../silver/shulker_silver_obsidian.png | Bin 0 -> 21051 bytes .../shulker/silver/shulker_silver_silver.png | Bin 0 -> 20035 bytes .../shulker/white/shulker_white_copper.png | Bin 0 -> 19804 bytes .../shulker/white/shulker_white_crystal.png | Bin 0 -> 19238 bytes .../shulker/white/shulker_white_diamond.png | Bin 0 -> 19698 bytes .../shulker/white/shulker_white_gold.png | Bin 0 -> 19659 bytes .../shulker/white/shulker_white_iron.png | Bin 0 -> 19750 bytes .../shulker/white/shulker_white_obsidian.png | Bin 0 -> 21306 bytes .../shulker/white/shulker_white_silver.png | Bin 0 -> 19705 bytes .../shulker/yellow/shulker_yellow_copper.png | Bin 0 -> 19724 bytes .../shulker/yellow/shulker_yellow_crystal.png | Bin 0 -> 19128 bytes .../shulker/yellow/shulker_yellow_diamond.png | Bin 0 -> 19681 bytes .../shulker/yellow/shulker_yellow_gold.png | Bin 0 -> 19649 bytes .../shulker/yellow/shulker_yellow_iron.png | Bin 0 -> 19666 bytes .../yellow/shulker_yellow_obsidian.png | Bin 0 -> 21532 bytes .../shulker/yellow/shulker_yellow_silver.png | Bin 0 -> 19699 bytes 230 files changed, 5726 insertions(+), 761 deletions(-) delete mode 100755 src/main/java/cpw/mods/ironchest/ValidatingSlot.java rename src/main/java/cpw/mods/ironchest/client/{ => gui/chest}/GUIChest.java (93%) mode change 100755 => 100644 create mode 100644 src/main/java/cpw/mods/ironchest/client/gui/shulker/GUIShulkerChest.java rename src/main/java/cpw/mods/ironchest/client/{ => renderer/chest}/TileEntityIronChestRenderer.java (93%) mode change 100755 => 100644 create mode 100644 src/main/java/cpw/mods/ironchest/client/renderer/shulker/TileEntityIronShulkerBoxRenderer.java rename src/main/java/cpw/mods/ironchest/{ => common}/CommonProxy.java (69%) mode change 100755 => 100644 create mode 100644 src/main/java/cpw/mods/ironchest/common/ICContent.java rename src/main/java/cpw/mods/ironchest/{ => common/ai}/IronChestAIOcelotSit.java (63%) mode change 100755 => 100644 rename src/main/java/cpw/mods/ironchest/{ => common/blocks/chest}/BlockIronChest.java (91%) mode change 100755 => 100644 rename src/main/java/cpw/mods/ironchest/{ => common/blocks/chest}/IronChestType.java (87%) mode change 100755 => 100644 create mode 100644 src/main/java/cpw/mods/ironchest/common/blocks/shulker/BlockIronShulkerBox.java create mode 100644 src/main/java/cpw/mods/ironchest/common/blocks/shulker/IronShulkerBoxType.java create mode 100644 src/main/java/cpw/mods/ironchest/common/crafting/IronShulkerBoxColoring.java rename src/main/java/cpw/mods/ironchest/{ => common/gui/chest}/ContainerIronChest.java (93%) mode change 100755 => 100644 create mode 100644 src/main/java/cpw/mods/ironchest/common/gui/chest/slot/ValidatingChestSlot.java create mode 100644 src/main/java/cpw/mods/ironchest/common/gui/shulker/ContainerIronShulkerBox.java create mode 100644 src/main/java/cpw/mods/ironchest/common/gui/shulker/slot/ValidatingShulkerBoxSlot.java rename src/main/java/cpw/mods/ironchest/{ => common/items}/ChestChangerType.java (60%) mode change 100755 => 100644 create mode 100644 src/main/java/cpw/mods/ironchest/common/items/ShulkerBoxChangerType.java rename src/main/java/cpw/mods/ironchest/{ => common/items/chest}/ItemChestChanger.java (81%) mode change 100755 => 100644 rename src/main/java/cpw/mods/ironchest/{ => common/items/chest}/ItemIronChest.java (78%) mode change 100755 => 100644 create mode 100644 src/main/java/cpw/mods/ironchest/common/items/shulker/ItemIronShulkerBox.java create mode 100644 src/main/java/cpw/mods/ironchest/common/items/shulker/ItemShulkerBoxChanger.java create mode 100644 src/main/java/cpw/mods/ironchest/common/network/MessageCrystalChestSync.java create mode 100644 src/main/java/cpw/mods/ironchest/common/network/MessageCrystalShulkerSync.java rename src/main/java/cpw/mods/ironchest/{ => common/tileentity/chest}/TileEntityCopperChest.java (84%) mode change 100755 => 100644 rename src/main/java/cpw/mods/ironchest/{ => common/tileentity/chest}/TileEntityCrystalChest.java (84%) mode change 100755 => 100644 rename src/main/java/cpw/mods/ironchest/{ => common/tileentity/chest}/TileEntityDiamondChest.java (84%) mode change 100755 => 100644 rename src/main/java/cpw/mods/ironchest/{ => common/tileentity/chest}/TileEntityDirtChest.java (81%) mode change 100755 => 100644 rename src/main/java/cpw/mods/ironchest/{ => common/tileentity/chest}/TileEntityGoldChest.java (84%) mode change 100755 => 100644 rename src/main/java/cpw/mods/ironchest/{ => common/tileentity/chest}/TileEntityIronChest.java (88%) mode change 100755 => 100644 rename src/main/java/cpw/mods/ironchest/{ => common/tileentity/chest}/TileEntityObsidianChest.java (58%) mode change 100755 => 100644 rename src/main/java/cpw/mods/ironchest/{ => common/tileentity/chest}/TileEntitySilverChest.java (84%) mode change 100755 => 100644 create mode 100644 src/main/java/cpw/mods/ironchest/common/tileentity/shulker/TileEntityCopperShulkerBox.java create mode 100644 src/main/java/cpw/mods/ironchest/common/tileentity/shulker/TileEntityCrystalShulkerBox.java create mode 100644 src/main/java/cpw/mods/ironchest/common/tileentity/shulker/TileEntityDiamondShulkerBox.java create mode 100644 src/main/java/cpw/mods/ironchest/common/tileentity/shulker/TileEntityGoldShulkerBox.java create mode 100644 src/main/java/cpw/mods/ironchest/common/tileentity/shulker/TileEntityIronShulkerBox.java create mode 100644 src/main/java/cpw/mods/ironchest/common/tileentity/shulker/TileEntityObsidianShulkerBox.java create mode 100644 src/main/java/cpw/mods/ironchest/common/tileentity/shulker/TileEntitySilverShulkerBox.java create mode 100644 src/main/java/cpw/mods/ironchest/common/util/BehaviorDispenseIronShulkerBox.java create mode 100644 src/main/java/cpw/mods/ironchest/common/util/CreativeTab.java create mode 100644 src/main/java/cpw/mods/ironchest/common/util/ItemTooltip.java create mode 100644 src/main/java/cpw/mods/ironchest/common/util/MissingMappingsHandler.java rename src/main/java/cpw/mods/ironchest/{ => common/util}/OcelotsSitOnChestsHandler.java (67%) mode change 100755 => 100644 create mode 100644 src/main/resources/assets/ironchest/blockstates/iron_shulker_box_black.json create mode 100644 src/main/resources/assets/ironchest/blockstates/iron_shulker_box_blue.json create mode 100644 src/main/resources/assets/ironchest/blockstates/iron_shulker_box_brown.json create mode 100644 src/main/resources/assets/ironchest/blockstates/iron_shulker_box_cyan.json create mode 100644 src/main/resources/assets/ironchest/blockstates/iron_shulker_box_gray.json create mode 100644 src/main/resources/assets/ironchest/blockstates/iron_shulker_box_green.json create mode 100644 src/main/resources/assets/ironchest/blockstates/iron_shulker_box_light_blue.json create mode 100644 src/main/resources/assets/ironchest/blockstates/iron_shulker_box_lime.json create mode 100644 src/main/resources/assets/ironchest/blockstates/iron_shulker_box_magenta.json create mode 100644 src/main/resources/assets/ironchest/blockstates/iron_shulker_box_orange.json create mode 100644 src/main/resources/assets/ironchest/blockstates/iron_shulker_box_pink.json create mode 100644 src/main/resources/assets/ironchest/blockstates/iron_shulker_box_purple.json create mode 100644 src/main/resources/assets/ironchest/blockstates/iron_shulker_box_red.json create mode 100644 src/main/resources/assets/ironchest/blockstates/iron_shulker_box_silver.json create mode 100644 src/main/resources/assets/ironchest/blockstates/iron_shulker_box_upgrades.json create mode 100644 src/main/resources/assets/ironchest/blockstates/iron_shulker_box_white.json create mode 100644 src/main/resources/assets/ironchest/blockstates/iron_shulker_box_yellow.json create mode 100644 src/main/resources/assets/ironchest/models/block/iron_shulker_box.json rename src/main/resources/assets/ironchest/textures/items/{ => chest}/copper_iron_upgrade.png (100%) rename src/main/resources/assets/ironchest/textures/items/{ => chest}/copper_silver_upgrade.png (100%) rename src/main/resources/assets/ironchest/textures/items/{ => chest}/diamond_crystal_upgrade.png (100%) rename src/main/resources/assets/ironchest/textures/items/{ => chest}/diamond_obsidian_upgrade.png (100%) rename src/main/resources/assets/ironchest/textures/items/{ => chest}/gold_diamond_upgrade.png (100%) rename src/main/resources/assets/ironchest/textures/items/{ => chest}/iron_gold_upgrade.png (100%) rename src/main/resources/assets/ironchest/textures/items/{ => chest}/silver_gold_upgrade.png (100%) rename src/main/resources/assets/ironchest/textures/items/{ => chest}/wood_copper_upgrade.png (100%) rename src/main/resources/assets/ironchest/textures/items/{ => chest}/wood_iron_upgrade.png (100%) create mode 100644 src/main/resources/assets/ironchest/textures/items/shulker/copper_iron_upgrade.png create mode 100644 src/main/resources/assets/ironchest/textures/items/shulker/copper_silver_upgrade.png create mode 100644 src/main/resources/assets/ironchest/textures/items/shulker/diamond_crystal_upgrade.png create mode 100644 src/main/resources/assets/ironchest/textures/items/shulker/diamond_obsidian_upgrade.png create mode 100644 src/main/resources/assets/ironchest/textures/items/shulker/gold_diamond_upgrade.png create mode 100644 src/main/resources/assets/ironchest/textures/items/shulker/iron_gold_upgrade.png create mode 100644 src/main/resources/assets/ironchest/textures/items/shulker/silver_gold_upgrade.png create mode 100644 src/main/resources/assets/ironchest/textures/items/shulker/vanilla_copper_upgrade.png create mode 100644 src/main/resources/assets/ironchest/textures/items/shulker/vanilla_iron_upgrade.png rename src/main/resources/assets/ironchest/textures/model/{ => chest}/copper_chest.png (100%) rename src/main/resources/assets/ironchest/textures/model/{ => chest}/crystal_chest.png (100%) rename src/main/resources/assets/ironchest/textures/model/{ => chest}/diamond_chest.png (100%) rename src/main/resources/assets/ironchest/textures/model/{ => chest}/dirt_chest.png (100%) rename src/main/resources/assets/ironchest/textures/model/{ => chest}/gold_chest.png (100%) rename src/main/resources/assets/ironchest/textures/model/{ => chest}/iron_chest.png (100%) rename src/main/resources/assets/ironchest/textures/model/{ => chest}/obsidian_chest.png (100%) rename src/main/resources/assets/ironchest/textures/model/{ => chest}/silver_chest.png (100%) create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/black/shulker_black_copper.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/black/shulker_black_crystal.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/black/shulker_black_diamond.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/black/shulker_black_gold.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/black/shulker_black_iron.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/black/shulker_black_obsidian.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/black/shulker_black_silver.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/blue/shulker_blue_copper.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/blue/shulker_blue_crystal.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/blue/shulker_blue_diamond.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/blue/shulker_blue_gold.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/blue/shulker_blue_iron.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/blue/shulker_blue_obsidian.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/blue/shulker_blue_silver.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/brown/shulker_brown_copper.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/brown/shulker_brown_crystal.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/brown/shulker_brown_diamond.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/brown/shulker_brown_gold.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/brown/shulker_brown_iron.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/brown/shulker_brown_obsidian.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/brown/shulker_brown_silver.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/cyan/shulker_cyan_copper.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/cyan/shulker_cyan_crystal.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/cyan/shulker_cyan_diamond.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/cyan/shulker_cyan_gold.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/cyan/shulker_cyan_iron.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/cyan/shulker_cyan_obsidian.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/cyan/shulker_cyan_silver.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/gray/shulker_gray_copper.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/gray/shulker_gray_crystal.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/gray/shulker_gray_diamond.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/gray/shulker_gray_gold.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/gray/shulker_gray_iron.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/gray/shulker_gray_obsidian.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/gray/shulker_gray_silver.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/green/shulker_green_copper.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/green/shulker_green_crystal.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/green/shulker_green_diamond.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/green/shulker_green_gold.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/green/shulker_green_iron.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/green/shulker_green_obsidian.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/green/shulker_green_silver.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/light_blue/shulker_light_blue_copper.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/light_blue/shulker_light_blue_crystal.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/light_blue/shulker_light_blue_diamond.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/light_blue/shulker_light_blue_gold.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/light_blue/shulker_light_blue_iron.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/light_blue/shulker_light_blue_obsidian.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/light_blue/shulker_light_blue_silver.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/lime/shulker_lime_copper.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/lime/shulker_lime_crystal.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/lime/shulker_lime_diamond.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/lime/shulker_lime_gold.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/lime/shulker_lime_iron.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/lime/shulker_lime_obsidian.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/lime/shulker_lime_silver.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/magenta/shulker_magenta_copper.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/magenta/shulker_magenta_crystal.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/magenta/shulker_magenta_diamond.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/magenta/shulker_magenta_gold.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/magenta/shulker_magenta_iron.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/magenta/shulker_magenta_obsidian.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/magenta/shulker_magenta_silver.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/orange/shulker_orange_copper.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/orange/shulker_orange_crystal.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/orange/shulker_orange_diamond.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/orange/shulker_orange_gold.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/orange/shulker_orange_iron.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/orange/shulker_orange_obsidian.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/orange/shulker_orange_silver.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/pink/shulker_pink_copper.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/pink/shulker_pink_crystal.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/pink/shulker_pink_diamond.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/pink/shulker_pink_gold.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/pink/shulker_pink_iron.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/pink/shulker_pink_obsidian.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/pink/shulker_pink_silver.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/purple/shulker_purple_copper.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/purple/shulker_purple_crystal.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/purple/shulker_purple_diamond.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/purple/shulker_purple_gold.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/purple/shulker_purple_iron.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/purple/shulker_purple_obsidian.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/purple/shulker_purple_silver.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/red/shulker_red_copper.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/red/shulker_red_crystal.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/red/shulker_red_diamond.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/red/shulker_red_gold.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/red/shulker_red_iron.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/red/shulker_red_obsidian.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/red/shulker_red_silver.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/silver/shulker_silver_copper.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/silver/shulker_silver_crystal.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/silver/shulker_silver_diamond.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/silver/shulker_silver_gold.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/silver/shulker_silver_iron.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/silver/shulker_silver_obsidian.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/silver/shulker_silver_silver.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/white/shulker_white_copper.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/white/shulker_white_crystal.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/white/shulker_white_diamond.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/white/shulker_white_gold.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/white/shulker_white_iron.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/white/shulker_white_obsidian.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/white/shulker_white_silver.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/yellow/shulker_yellow_copper.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/yellow/shulker_yellow_crystal.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/yellow/shulker_yellow_diamond.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/yellow/shulker_yellow_gold.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/yellow/shulker_yellow_iron.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/yellow/shulker_yellow_obsidian.png create mode 100644 src/main/resources/assets/ironchest/textures/model/shulker/yellow/shulker_yellow_silver.png diff --git a/build.gradle b/build.gradle index 539131a2..bbc6963e 100755 --- a/build.gradle +++ b/build.gradle @@ -33,7 +33,7 @@ repositories { } dependencies { - deobfCompile "mezz.jei:jei_1.11.2:4.2.7.241" + deobfCompile "mezz.jei:jei_1.11.2:4.3.5.277" } // This is our group. I'm cpw.mods @@ -43,8 +43,8 @@ archivesBaseName = "ironchest" // Setup the forge minecraft plugin data. Specify the preferred forge/minecraft version here minecraft { - version = "1.11.2-13.20.0.2252" - mappings = "snapshot_20161118" + version = "1.11.2-13.20.0.2299" + mappings = "snapshot_20170519" runDir = "run" } diff --git a/src/main/java/cpw/mods/ironchest/IronChest.java b/src/main/java/cpw/mods/ironchest/IronChest.java index cffcb293..52155bd9 100755 --- a/src/main/java/cpw/mods/ironchest/IronChest.java +++ b/src/main/java/cpw/mods/ironchest/IronChest.java @@ -12,22 +12,23 @@ import java.util.Properties; -import javax.annotation.Nonnull; - -import net.minecraft.block.Block; -import net.minecraft.item.Item; -import net.minecraft.util.ResourceLocation; +import cpw.mods.ironchest.common.CommonProxy; +import cpw.mods.ironchest.common.ICContent; +import cpw.mods.ironchest.common.network.MessageCrystalChestSync; +import cpw.mods.ironchest.common.network.MessageCrystalShulkerSync; +import cpw.mods.ironchest.common.util.MissingMappingsHandler; +import cpw.mods.ironchest.common.util.OcelotsSitOnChestsHandler; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventHandler; import net.minecraftforge.fml.common.Mod.Instance; import net.minecraftforge.fml.common.SidedProxy; +import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLMissingMappingsEvent; -import net.minecraftforge.fml.common.event.FMLMissingMappingsEvent.MissingMapping; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.common.network.NetworkRegistry; -import net.minecraftforge.fml.common.registry.ForgeRegistries; -import net.minecraftforge.fml.common.registry.GameRegistry; +import net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper; +import net.minecraftforge.fml.relauncher.Side; @Mod(modid = IronChest.MOD_ID, name = "Iron Chests", dependencies = "required-after:forge@[13.19.0.2142,)", acceptedMinecraftVersions = "[1.11, 1.12)") public class IronChest @@ -37,12 +38,10 @@ public class IronChest @Instance(IronChest.MOD_ID) public static IronChest instance; - @SidedProxy(clientSide = "cpw.mods.ironchest.client.ClientProxy", serverSide = "cpw.mods.ironchest.CommonProxy") + @SidedProxy(clientSide = "cpw.mods.ironchest.client.ClientProxy", serverSide = "cpw.mods.ironchest.common.CommonProxy") public static CommonProxy proxy; - public static BlockIronChest ironChestBlock; - - public static ItemIronChest ironChestItemBlock; + public static final SimpleNetworkWrapper packetHandler = NetworkRegistry.INSTANCE.newSimpleChannel(MOD_ID); @EventHandler public void preInit(FMLPreInitializationEvent event) @@ -55,122 +54,28 @@ public void preInit(FMLPreInitializationEvent event) String minor = properties.getProperty("IronChest.build.minor.number"); String rev = properties.getProperty("IronChest.build.revision.number"); String build = properties.getProperty("IronChest.build.number"); + event.getModMetadata().version = String.format("%s.%s.%s build %s", major, minor, rev, build); } - ChestChangerType.buildItems(); - ironChestBlock = GameRegistry.register(new BlockIronChest()); - ironChestItemBlock = GameRegistry.register(new ItemIronChest(ironChestBlock)); + ICContent.preInit(); - for (IronChestType typ : IronChestType.VALUES) - { - if (typ.clazz != null) - { - GameRegistry.registerTileEntity(typ.clazz, "IronChest." + typ.name()); - } - } - - IronChestType.registerBlocksAndRecipes(ironChestBlock); - ChestChangerType.generateRecipes(); NetworkRegistry.INSTANCE.registerGuiHandler(instance, proxy); proxy.registerRenderInformation(); MinecraftForge.EVENT_BUS.register(new OcelotsSitOnChestsHandler()); } @EventHandler - public void onMissingMappings(FMLMissingMappingsEvent event) + public void init(FMLInitializationEvent event) { - for (MissingMapping mapping : event.get()) - { - if (mapping.resourceLocation.getResourceDomain().equals(IronChest.MOD_ID)) - { - @Nonnull - String path = mapping.resourceLocation.getResourcePath(); - - if (path.endsWith("blockironchest")) - { - path = path.replace("blockironchest", "iron_chest"); - ResourceLocation newRes = new ResourceLocation(mapping.resourceLocation.getResourceDomain(), path); - Block block = ForgeRegistries.BLOCKS.getValue(newRes); - - if (block != null) - { - if (mapping.type == GameRegistry.Type.BLOCK) - { - mapping.remap(block); - } - else - { - mapping.remap(Item.getItemFromBlock(block)); - } - } - } - - if (path.endsWith("irongoldupgrade")) - { - path = path.replace("irongoldupgrade", "iron_gold_upgrade"); - replaceUpgradeItem(path, mapping); - } - - if (path.endsWith("golddiamondupgrade")) - { - path = path.replace("golddiamondupgrade", "gold_diamond_upgrade"); - replaceUpgradeItem(path, mapping); - } - - if (path.endsWith("coppersilverupgrade")) - { - path = path.replace("coppersilverupgrade", "copper_silver_upgrade"); - replaceUpgradeItem(path, mapping); - } - - if (path.endsWith("silvergoldupgrade")) - { - path = path.replace("silvergoldupgrade", "silver_gold_upgrade"); - replaceUpgradeItem(path, mapping); - } - - if (path.endsWith("copperironupgrade")) - { - path = path.replace("copperironupgrade", "copper_iron_upgrade"); - replaceUpgradeItem(path, mapping); - } - - if (path.endsWith("diamondcrystalupgrade")) - { - path = path.replace("diamondcrystalupgrade", "diamond_crystal_upgrade"); - replaceUpgradeItem(path, mapping); - } - - if (path.endsWith("woodironupgrade")) - { - path = path.replace("woodironupgrade", "wood_iron_upgrade"); - replaceUpgradeItem(path, mapping); - } - - if (path.endsWith("woodcopperupgrade")) - { - path = path.replace("woodcopperupgrade", "wood_copper_upgrade"); - replaceUpgradeItem(path, mapping); - } - - if (path.endsWith("diamondobsidianupgrade")) - { - path = path.replace("diamondobsidianupgrade", "diamond_obsidian_upgrade"); - replaceUpgradeItem(path, mapping); - } - } - } + int messageId = 0; + packetHandler.registerMessage(MessageCrystalChestSync.Handler.class, MessageCrystalChestSync.class, messageId++, Side.CLIENT); + packetHandler.registerMessage(MessageCrystalShulkerSync.Handler.class, MessageCrystalShulkerSync.class, messageId++, Side.CLIENT); } - private static void replaceUpgradeItem(String path, MissingMapping mapping) + @EventHandler + public void onMissingMappings(FMLMissingMappingsEvent event) { - ResourceLocation newRes = new ResourceLocation(mapping.resourceLocation.getResourceDomain(), path); - Item item = ForgeRegistries.ITEMS.getValue(newRes); - - if (item != null) - { - mapping.remap(item); - } + MissingMappingsHandler.onMissingMappings(event); } } diff --git a/src/main/java/cpw/mods/ironchest/ValidatingSlot.java b/src/main/java/cpw/mods/ironchest/ValidatingSlot.java deleted file mode 100755 index 5391f7fe..00000000 --- a/src/main/java/cpw/mods/ironchest/ValidatingSlot.java +++ /dev/null @@ -1,22 +0,0 @@ -package cpw.mods.ironchest; - -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; - -public class ValidatingSlot extends Slot -{ - private IronChestType type; - - public ValidatingSlot(IInventory inventoryIn, int slotIndex, int xPosition, int yPosition, IronChestType type) - { - super(inventoryIn, slotIndex, xPosition, yPosition); - this.type = type; - } - - @Override - public boolean isItemValid(ItemStack stack) - { - return this.type.acceptsStack(stack); - } -} diff --git a/src/main/java/cpw/mods/ironchest/client/ClientProxy.java b/src/main/java/cpw/mods/ironchest/client/ClientProxy.java index 8856a447..9fbc0199 100755 --- a/src/main/java/cpw/mods/ironchest/client/ClientProxy.java +++ b/src/main/java/cpw/mods/ironchest/client/ClientProxy.java @@ -10,11 +10,21 @@ ******************************************************************************/ package cpw.mods.ironchest.client; -import cpw.mods.ironchest.ChestChangerType; -import cpw.mods.ironchest.CommonProxy; import cpw.mods.ironchest.IronChest; -import cpw.mods.ironchest.IronChestType; -import cpw.mods.ironchest.TileEntityIronChest; +import cpw.mods.ironchest.client.gui.chest.GUIChest; +import cpw.mods.ironchest.client.gui.shulker.GUIShulkerChest; +import cpw.mods.ironchest.client.renderer.chest.TileEntityIronChestRenderer; +import cpw.mods.ironchest.client.renderer.shulker.TileEntityIronShulkerBoxRenderer; +import cpw.mods.ironchest.common.CommonProxy; +import cpw.mods.ironchest.common.ICContent; +import cpw.mods.ironchest.common.blocks.chest.IronChestType; +import cpw.mods.ironchest.common.blocks.shulker.IronShulkerBoxType; +import cpw.mods.ironchest.common.items.ChestChangerType; +import cpw.mods.ironchest.common.items.ShulkerBoxChangerType; +import cpw.mods.ironchest.common.tileentity.chest.TileEntityIronChest; +import cpw.mods.ironchest.common.tileentity.shulker.TileEntityIronShulkerBox; +import net.minecraft.block.Block; +import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; @@ -33,7 +43,8 @@ public class ClientProxy extends CommonProxy @Override public void registerRenderInformation() { - Item chestItem = Item.getItemFromBlock(IronChest.ironChestBlock); + // Chests Start + Item chestItem = Item.getItemFromBlock(ICContent.ironChestBlock); for (IronChestType type : IronChestType.values()) { @@ -53,19 +64,60 @@ public void registerRenderInformation() ModelLoader.setCustomModelResourceLocation(type.item, 0, new ModelResourceLocation(new ResourceLocation(IronChest.MOD_ID, "iron_chest_upgrades"), "variant=" + type.itemName.toLowerCase())); //@formatter:on } + // Chests End + + // Shulkers Start + for (Block shulker : ICContent.SHULKER_BLOCKS) + { + Item shulkerBoxItem = Item.getItemFromBlock(shulker); + + for (IronShulkerBoxType type : IronShulkerBoxType.values()) + { + if (type != IronShulkerBoxType.VANILLA) + { + //@formatter:off + ModelLoader.setCustomModelResourceLocation(shulkerBoxItem, type.ordinal(), new ModelResourceLocation(shulkerBoxItem.getRegistryName(), "variant=" + type.getName())); + //@formatter:on + } + } + } + + for (IronShulkerBoxType type : IronShulkerBoxType.values()) + { + ClientRegistry.bindTileEntitySpecialRenderer(type.clazz, new TileEntityIronShulkerBoxRenderer()); + } + + for (ShulkerBoxChangerType type : ShulkerBoxChangerType.VALUES) + { + //@formatter:off + ModelLoader.setCustomModelResourceLocation(type.item, 0, new ModelResourceLocation(new ResourceLocation(IronChest.MOD_ID, "iron_shulker_box_upgrades"), "variant=" + type.itemName.toLowerCase())); + //@formatter:on + } + // Shulker End } @Override public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { TileEntity te = world.getTileEntity(new BlockPos(x, y, z)); + if (te != null && te instanceof TileEntityIronChest) { return GUIChest.GUI.buildGUI(IronChestType.values()[ID], player.inventory, (TileEntityIronChest) te); } + else if (te != null && te instanceof TileEntityIronShulkerBox) + { + return GUIShulkerChest.GUI.buildGUI(IronShulkerBoxType.values()[ID], player.inventory, (TileEntityIronShulkerBox) te); + } else { return null; } } + + @Override + public World getClientWorld() + { + return Minecraft.getMinecraft().world; + } } diff --git a/src/main/java/cpw/mods/ironchest/client/GUIChest.java b/src/main/java/cpw/mods/ironchest/client/gui/chest/GUIChest.java old mode 100755 new mode 100644 similarity index 93% rename from src/main/java/cpw/mods/ironchest/client/GUIChest.java rename to src/main/java/cpw/mods/ironchest/client/gui/chest/GUIChest.java index 2de0f543..dc5ddecf --- a/src/main/java/cpw/mods/ironchest/client/GUIChest.java +++ b/src/main/java/cpw/mods/ironchest/client/gui/chest/GUIChest.java @@ -8,11 +8,11 @@ * Contributors: * cpw - initial API and implementation ******************************************************************************/ -package cpw.mods.ironchest.client; +package cpw.mods.ironchest.client.gui.chest; -import cpw.mods.ironchest.ContainerIronChest; -import cpw.mods.ironchest.IronChestType; -import cpw.mods.ironchest.TileEntityIronChest; +import cpw.mods.ironchest.common.blocks.chest.IronChestType; +import cpw.mods.ironchest.common.gui.chest.ContainerIronChest; +import cpw.mods.ironchest.common.tileentity.chest.TileEntityIronChest; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.inventory.Container; @@ -91,10 +91,12 @@ private GUIChest(GUI type, IInventory player, IInventory chest) protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) { GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - // new "bind tex" + 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/cpw/mods/ironchest/client/gui/shulker/GUIShulkerChest.java b/src/main/java/cpw/mods/ironchest/client/gui/shulker/GUIShulkerChest.java new file mode 100644 index 00000000..0ad516a1 --- /dev/null +++ b/src/main/java/cpw/mods/ironchest/client/gui/shulker/GUIShulkerChest.java @@ -0,0 +1,102 @@ +/******************************************************************************* + * 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 cpw.mods.ironchest.client.gui.shulker; + +import cpw.mods.ironchest.common.blocks.shulker.IronShulkerBoxType; +import cpw.mods.ironchest.common.gui.shulker.ContainerIronShulkerBox; +import cpw.mods.ironchest.common.tileentity.shulker.TileEntityIronShulkerBox; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.IInventory; +import net.minecraft.util.ResourceLocation; + +public class GUIShulkerChest extends GuiContainer +{ + public enum ResourceList + { + //@formatter:off + 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")); + //@formatter:on + + public final ResourceLocation location; + + ResourceList(ResourceLocation loc) + { + this.location = loc; + } + } + + public enum GUI + { + //@formatter:off + IRON(184, 202, ResourceList.IRON, IronShulkerBoxType.IRON), + GOLD(184, 256, ResourceList.GOLD, IronShulkerBoxType.GOLD), + DIAMOND(238, 256, ResourceList.DIAMOND, IronShulkerBoxType.DIAMOND), + COPPER(184, 184, ResourceList.COPPER, IronShulkerBoxType.COPPER), + SILVER(184, 238, ResourceList.SILVER, IronShulkerBoxType.SILVER), + CRYSTAL(238, 256, ResourceList.DIAMOND, IronShulkerBoxType.CRYSTAL), + OBSIDIAN(238, 256, ResourceList.DIAMOND,IronShulkerBoxType.OBSIDIAN); + //@formatter:on + + private int xSize; + private int ySize; + private ResourceList guiResourceList; + private IronShulkerBoxType mainType; + + GUI(int xSize, int ySize, ResourceList guiResourceList, IronShulkerBoxType mainType) + { + this.xSize = xSize; + this.ySize = ySize; + this.guiResourceList = guiResourceList; + this.mainType = mainType; + } + + protected Container makeContainer(IInventory player, IInventory shulker) + { + return new ContainerIronShulkerBox(player, shulker, this.mainType, this.xSize, this.ySize); + } + + public static GUIShulkerChest buildGUI(IronShulkerBoxType type, IInventory playerInventory, TileEntityIronShulkerBox shulkerInventory) + { + return new GUIShulkerChest(values()[shulkerInventory.getType().ordinal()], playerInventory, shulkerInventory); + } + } + + private GUI type; + + private GUIShulkerChest(GUI type, IInventory player, IInventory shulker) + { + super(type.makeContainer(player, shulker)); + + this.type = type; + this.xSize = type.xSize; + this.ySize = type.ySize; + this.allowUserInput = false; + } + + @Override + protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) + { + GlStateManager.color(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/cpw/mods/ironchest/client/TileEntityIronChestRenderer.java b/src/main/java/cpw/mods/ironchest/client/renderer/chest/TileEntityIronChestRenderer.java old mode 100755 new mode 100644 similarity index 93% rename from src/main/java/cpw/mods/ironchest/client/TileEntityIronChestRenderer.java rename to src/main/java/cpw/mods/ironchest/client/renderer/chest/TileEntityIronChestRenderer.java index 067a83fd..45c5ab49 --- a/src/main/java/cpw/mods/ironchest/client/TileEntityIronChestRenderer.java +++ b/src/main/java/cpw/mods/ironchest/client/renderer/chest/TileEntityIronChestRenderer.java @@ -8,16 +8,16 @@ * Contributors: * cpw - initial API and implementation ******************************************************************************/ -package cpw.mods.ironchest.client; +package cpw.mods.ironchest.client.renderer.chest; import java.util.Random; import com.google.common.primitives.SignedBytes; -import cpw.mods.ironchest.BlockIronChest; -import cpw.mods.ironchest.IronChest; -import cpw.mods.ironchest.IronChestType; -import cpw.mods.ironchest.TileEntityIronChest; +import cpw.mods.ironchest.common.ICContent; +import cpw.mods.ironchest.common.blocks.chest.BlockIronChest; +import cpw.mods.ironchest.common.blocks.chest.IronChestType; +import cpw.mods.ironchest.common.tileentity.chest.TileEntityIronChest; import net.minecraft.block.state.IBlockState; import net.minecraft.client.Minecraft; import net.minecraft.client.model.ModelChest; @@ -36,8 +36,9 @@ public class TileEntityIronChestRenderer extends TileEntitySpecialRenderer + * Contributors: + * cpw - initial API and implementation + ******************************************************************************/ +package cpw.mods.ironchest.client.renderer.shulker; + +import java.util.Random; + +import com.google.common.primitives.SignedBytes; + +import cpw.mods.ironchest.common.blocks.shulker.BlockIronShulkerBox; +import cpw.mods.ironchest.common.blocks.shulker.IronShulkerBoxType; +import cpw.mods.ironchest.common.tileentity.shulker.TileEntityIronShulkerBox; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelShulker; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.entity.RenderEntityItem; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.ResourceLocation; + +public class TileEntityIronShulkerBoxRenderer extends TileEntitySpecialRenderer +{ + private Random random; + + private RenderEntityItem itemRenderer; + + private final ModelShulker model; + + //@formatter:off + private static float[][] shifts = { { 0.3F, 0.45F, 0.3F }, { 0.7F, 0.45F, 0.3F }, { 0.3F, 0.45F, 0.7F }, { 0.7F, 0.45F, 0.7F }, { 0.3F, 0.1F, 0.3F }, { 0.7F, 0.1F, 0.3F }, { 0.3F, 0.1F, 0.7F }, { 0.7F, 0.1F, 0.7F }, { 0.5F, 0.32F, 0.5F } }; + //@formatter:on + + private static EntityItem customitem = new EntityItem(null); + + public TileEntityIronShulkerBoxRenderer() + { + this.model = new ModelShulker(); + this.random = new Random(); + } + + @Override + public void renderTileEntityAt(TileEntityIronShulkerBox te, double x, double y, double z, float partialTicks, int destroyStage) + { + if (te == null || te.isInvalid()) + { + return; + } + + EnumFacing facing = EnumFacing.UP; + IronShulkerBoxType type = te.getType(); + + if (te.hasWorld()) + { + IBlockState iblockstate = this.getWorld().getBlockState(te.getPos()); + + if (iblockstate.getBlock() instanceof BlockIronShulkerBox) + { + facing = te.getFacing(); + type = iblockstate.getValue(BlockIronShulkerBox.VARIANT_PROP); + } + } + + GlStateManager.enableDepth(); + GlStateManager.depthFunc(515); + GlStateManager.depthMask(true); + GlStateManager.disableCull(); + + if (destroyStage >= 0) + { + this.bindTexture(DESTROY_STAGES[destroyStage]); + GlStateManager.matrixMode(5890); + GlStateManager.pushMatrix(); + GlStateManager.scale(4.0F, 4.0F, 1.0F); + GlStateManager.translate(0.0625F, 0.0625F, 0.0625F); + GlStateManager.matrixMode(5888); + } + else + { + //@formatter:off + ResourceLocation rs = new ResourceLocation("ironchest", "textures/model/shulker/" + te.getColor().getName() + "/shulker_" + te.getColor().getName() + type.modelTexture); + //@formatter:on + + this.bindTexture(rs); + } + + GlStateManager.pushMatrix(); + GlStateManager.enableRescaleNormal(); + + if (destroyStage < 0) + { + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + } + + GlStateManager.translate((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F); + GlStateManager.scale(1.0F, -1.0F, -1.0F); + GlStateManager.translate(0.0F, 1.0F, 0.0F); + GlStateManager.scale(0.9995F, 0.9995F, 0.9995F); + GlStateManager.translate(0.0F, -1.0F, 0.0F); + + switch (facing) + { + case DOWN: + GlStateManager.translate(0.0F, 2.0F, 0.0F); + GlStateManager.rotate(180.0F, 1.0F, 0.0F, 0.0F); + case UP: + default: + break; + case NORTH: + GlStateManager.translate(0.0F, 1.0F, 1.0F); + GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F); + GlStateManager.rotate(180.0F, 0.0F, 0.0F, 1.0F); + break; + case SOUTH: + GlStateManager.translate(0.0F, 1.0F, -1.0F); + GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F); + break; + case WEST: + GlStateManager.translate(-1.0F, 1.0F, 0.0F); + GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F); + GlStateManager.rotate(-90.0F, 0.0F, 0.0F, 1.0F); + break; + case EAST: + GlStateManager.translate(1.0F, 1.0F, 0.0F); + GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F); + GlStateManager.rotate(90.0F, 0.0F, 0.0F, 1.0F); + } + + this.model.base.render(0.0625F); + GlStateManager.translate(0.0F, -te.getProgress(partialTicks) * 0.5F, 0.0F); + GlStateManager.rotate(270.0F * te.getProgress(partialTicks), 0.0F, 1.0F, 0.0F); + this.model.lid.render(0.0625F); + GlStateManager.enableCull(); + GlStateManager.disableRescaleNormal(); + GlStateManager.popMatrix(); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + + if (destroyStage >= 0) + { + GlStateManager.matrixMode(5890); + GlStateManager.popMatrix(); + GlStateManager.matrixMode(5888); + } + + if (type == IronShulkerBoxType.CRYSTAL) + { + GlStateManager.enableCull(); + } + + if (type.isTransparent() && te.getDistanceSq(this.rendererDispatcher.entityX, this.rendererDispatcher.entityY, this.rendererDispatcher.entityZ) < 128d) + { + this.random.setSeed(254L); + + float shiftX; + float shiftY; + float shiftZ; + int shift = 0; + float blockScale = 0.70F; + float timeD = (float) (360D * (System.currentTimeMillis() & 0x3FFFL) / 0x3FFFL) - partialTicks; + + if (te.getTopItems().get(1).isEmpty()) + { + shift = 8; + blockScale = 0.85F; + } + + GlStateManager.pushMatrix(); + GlStateManager.translate((float) x, (float) y, (float) z); + + customitem.setWorld(this.getWorld()); + customitem.hoverStart = 0F; + + for (ItemStack item : te.getTopItems()) + { + if (shift > shifts.length) + { + break; + } + + if (item.isEmpty()) + { + shift++; + continue; + } + + shiftX = shifts[shift][0]; + shiftY = shifts[shift][1]; + shiftZ = shifts[shift][2]; + shift++; + + GlStateManager.pushMatrix(); + GlStateManager.translate(shiftX, shiftY, shiftZ); + GlStateManager.rotate(timeD, 0F, 1F, 0F); + GlStateManager.scale(blockScale, blockScale, blockScale); + + customitem.setEntityItemStack(item); + + if (this.itemRenderer == null) + { + this.itemRenderer = new RenderEntityItem(Minecraft.getMinecraft().getRenderManager(), Minecraft.getMinecraft().getRenderItem()) { + @Override + public int getModelCount(ItemStack stack) + { + return SignedBytes.saturatedCast(Math.min(stack.getCount() / 32, 15) + 1); + } + + @Override + public boolean shouldBob() + { + return false; + } + + @Override + public boolean shouldSpreadItems() + { + return true; + } + }; + } + + this.itemRenderer.doRender(customitem, 0D, 0D, 0D, 0F, partialTicks); + + GlStateManager.popMatrix(); + } + + GlStateManager.popMatrix(); + } + } +} diff --git a/src/main/java/cpw/mods/ironchest/CommonProxy.java b/src/main/java/cpw/mods/ironchest/common/CommonProxy.java old mode 100755 new mode 100644 similarity index 69% rename from src/main/java/cpw/mods/ironchest/CommonProxy.java rename to src/main/java/cpw/mods/ironchest/common/CommonProxy.java index 505be12e..4266c6c3 --- a/src/main/java/cpw/mods/ironchest/CommonProxy.java +++ b/src/main/java/cpw/mods/ironchest/common/CommonProxy.java @@ -8,8 +8,12 @@ * Contributors: * cpw - initial API and implementation ******************************************************************************/ -package cpw.mods.ironchest; +package cpw.mods.ironchest.common; +import cpw.mods.ironchest.common.gui.chest.ContainerIronChest; +import cpw.mods.ironchest.common.gui.shulker.ContainerIronShulkerBox; +import cpw.mods.ironchest.common.tileentity.chest.TileEntityIronChest; +import cpw.mods.ironchest.common.tileentity.shulker.TileEntityIronShulkerBox; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.math.BlockPos; @@ -32,14 +36,27 @@ public Object getClientGuiElement(int ID, EntityPlayer player, World world, int public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { TileEntity te = world.getTileEntity(new BlockPos(x, y, z)); + if (te != null && te instanceof TileEntityIronChest) { TileEntityIronChest icte = (TileEntityIronChest) te; + return new ContainerIronChest(player.inventory, icte, icte.getType(), 0, 0); } + else if (te != null && te instanceof TileEntityIronShulkerBox) + { + TileEntityIronShulkerBox icte = (TileEntityIronShulkerBox) te; + + return new ContainerIronShulkerBox(player.inventory, icte, icte.getType(), 0, 0); + } else { return null; } } + + public World getClientWorld() + { + return null; + } } \ No newline at end of file diff --git a/src/main/java/cpw/mods/ironchest/common/ICContent.java b/src/main/java/cpw/mods/ironchest/common/ICContent.java new file mode 100644 index 00000000..72fce4dc --- /dev/null +++ b/src/main/java/cpw/mods/ironchest/common/ICContent.java @@ -0,0 +1,222 @@ +/******************************************************************************* + * 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 cpw.mods.ironchest.common; + +import java.util.List; + +import com.google.common.collect.Lists; + +import cpw.mods.ironchest.IronChest; +import cpw.mods.ironchest.common.blocks.chest.BlockIronChest; +import cpw.mods.ironchest.common.blocks.chest.IronChestType; +import cpw.mods.ironchest.common.blocks.shulker.BlockIronShulkerBox; +import cpw.mods.ironchest.common.blocks.shulker.IronShulkerBoxType; +import cpw.mods.ironchest.common.crafting.IronShulkerBoxColoring; +import cpw.mods.ironchest.common.items.ChestChangerType; +import cpw.mods.ironchest.common.items.ShulkerBoxChangerType; +import cpw.mods.ironchest.common.items.chest.ItemIronChest; +import cpw.mods.ironchest.common.items.shulker.ItemIronShulkerBox; +import cpw.mods.ironchest.common.util.BehaviorDispenseIronShulkerBox; +import cpw.mods.ironchest.common.util.CreativeTab; +import net.minecraft.block.Block; +import net.minecraft.block.BlockDispenser; +import net.minecraft.block.BlockShulkerBox; +import net.minecraft.init.Blocks; +import net.minecraft.item.EnumDyeColor; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fml.common.registry.GameRegistry; +import net.minecraftforge.oredict.RecipeSorter; +import net.minecraftforge.oredict.RecipeSorter.Category; + +public class ICContent +{ + public static CreativeTab tabGeneral = new CreativeTab("IronChest", new ItemStack(Item.getItemFromBlock(Blocks.SLIME_BLOCK))); + + public static BlockIronChest ironChestBlock; + public static ItemIronChest ironChestItemBlock; + + public static BlockIronShulkerBox ironShulkerBoxWhiteBlock; + public static BlockIronShulkerBox ironShulkerBoxOrangeBlock; + public static BlockIronShulkerBox ironShulkerBoxMagentaBlock; + public static BlockIronShulkerBox ironShulkerBoxLightBlueBlock; + public static BlockIronShulkerBox ironShulkerBoxYellowBlock; + public static BlockIronShulkerBox ironShulkerBoxLimeBlock; + public static BlockIronShulkerBox ironShulkerBoxPinkBlock; + public static BlockIronShulkerBox ironShulkerBoxGrayBlock; + public static BlockIronShulkerBox ironShulkerBoxSilverBlock; + public static BlockIronShulkerBox ironShulkerBoxCyanBlock; + public static BlockIronShulkerBox ironShulkerBoxPurpleBlock; + public static BlockIronShulkerBox ironShulkerBoxBlueBlock; + public static BlockIronShulkerBox ironShulkerBoxBrownBlock; + public static BlockIronShulkerBox ironShulkerBoxGreenBlock; + public static BlockIronShulkerBox ironShulkerBoxRedBlock; + public static BlockIronShulkerBox ironShulkerBoxBlackBlock; + + public static ItemIronShulkerBox ironShulkerBoxWhiteItemBlock; + public static ItemIronShulkerBox ironShulkerBoxOrangeItemBlock; + public static ItemIronShulkerBox ironShulkerBoxMagentaItemBlock; + public static ItemIronShulkerBox ironShulkerBoxLightBlueItemBlock; + public static ItemIronShulkerBox ironShulkerBoxYellowItemBlock; + public static ItemIronShulkerBox ironShulkerBoxLimeItemBlock; + public static ItemIronShulkerBox ironShulkerBoxPinkItemBlock; + public static ItemIronShulkerBox ironShulkerBoxGrayItemBlock; + public static ItemIronShulkerBox ironShulkerBoxSilverItemBlock; + public static ItemIronShulkerBox ironShulkerBoxCyanItemBlock; + public static ItemIronShulkerBox ironShulkerBoxPurpleItemBlock; + public static ItemIronShulkerBox ironShulkerBoxBlueItemBlock; + public static ItemIronShulkerBox ironShulkerBoxBrownItemBlock; + public static ItemIronShulkerBox ironShulkerBoxGreenItemBlock; + public static ItemIronShulkerBox ironShulkerBoxRedItemBlock; + public static ItemIronShulkerBox ironShulkerBoxBlackItemBlock; + + public static final List SHULKER_BLOCKS = Lists.newArrayList(); + public static final List SHULKER_ITEM_BLOCKS = Lists.newArrayList(); + + public static final List VANILLA_SHULKER_BLOCKS = Lists.newArrayList(); + public static final List VANILLA_SHULKER_COLORS = Lists.newArrayList(); + + public static void preInit() + { + // Chests Start + ChestChangerType.buildItems(); + + ironChestBlock = GameRegistry.register(new BlockIronChest()); + ironChestItemBlock = GameRegistry.register(new ItemIronChest(ironChestBlock)); + + for (IronChestType typ : IronChestType.VALUES) + { + if (typ.clazz != null) + { + GameRegistry.registerTileEntity(typ.clazz, "IronChest." + typ.name()); + } + } + + IronChestType.registerBlocksAndRecipes(ironChestBlock); + ChestChangerType.generateRecipes(); + // Chests End + + // Shulkers Start + setVanillaShulkerList(); + + ShulkerBoxChangerType.buildItems(); + + registerShulkerBlocks(); + + registerShulkerItemBlocks(); + + for (IronShulkerBoxType typ : IronShulkerBoxType.VALUES) + { + if (typ.clazz != null) + { + GameRegistry.registerTileEntity(typ.clazz, "IronShulkerBox." + typ.name()); + } + } + + for (int i = 0; i < ICContent.SHULKER_BLOCKS.size(); i++) + { + IronShulkerBoxType.registerBlocksAndRecipes((BlockIronShulkerBox) SHULKER_BLOCKS.get(i), (BlockShulkerBox) VANILLA_SHULKER_BLOCKS.get(i)); + } + + for (ItemBlock block : SHULKER_ITEM_BLOCKS) + { + BlockDispenser.DISPENSE_BEHAVIOR_REGISTRY.putObject(block, new BehaviorDispenseIronShulkerBox()); + } + + GameRegistry.addRecipe(new IronShulkerBoxColoring()); + RecipeSorter.register(IronChest.MOD_ID, IronShulkerBoxColoring.class, Category.SHAPELESS, "after:forge:shapelessore"); + + ShulkerBoxChangerType.generateRecipes(); + // Shulkers End + + tabGeneral.setDisplayIcon(new ItemStack(ironChestBlock, 1, IronChestType.IRON.ordinal())); + } + + private static void registerShulkerBlocks() + { + SHULKER_BLOCKS.add(ironShulkerBoxWhiteBlock = GameRegistry.register(new BlockIronShulkerBox(EnumDyeColor.WHITE))); + SHULKER_BLOCKS.add(ironShulkerBoxOrangeBlock = GameRegistry.register(new BlockIronShulkerBox(EnumDyeColor.ORANGE))); + SHULKER_BLOCKS.add(ironShulkerBoxMagentaBlock = GameRegistry.register(new BlockIronShulkerBox(EnumDyeColor.MAGENTA))); + SHULKER_BLOCKS.add(ironShulkerBoxLightBlueBlock = GameRegistry.register(new BlockIronShulkerBox(EnumDyeColor.LIGHT_BLUE))); + SHULKER_BLOCKS.add(ironShulkerBoxYellowBlock = GameRegistry.register(new BlockIronShulkerBox(EnumDyeColor.YELLOW))); + SHULKER_BLOCKS.add(ironShulkerBoxLimeBlock = GameRegistry.register(new BlockIronShulkerBox(EnumDyeColor.LIME))); + SHULKER_BLOCKS.add(ironShulkerBoxPinkBlock = GameRegistry.register(new BlockIronShulkerBox(EnumDyeColor.PINK))); + SHULKER_BLOCKS.add(ironShulkerBoxGrayBlock = GameRegistry.register(new BlockIronShulkerBox(EnumDyeColor.GRAY))); + SHULKER_BLOCKS.add(ironShulkerBoxSilverBlock = GameRegistry.register(new BlockIronShulkerBox(EnumDyeColor.SILVER))); + SHULKER_BLOCKS.add(ironShulkerBoxCyanBlock = GameRegistry.register(new BlockIronShulkerBox(EnumDyeColor.CYAN))); + SHULKER_BLOCKS.add(ironShulkerBoxPurpleBlock = GameRegistry.register(new BlockIronShulkerBox(EnumDyeColor.PURPLE))); + SHULKER_BLOCKS.add(ironShulkerBoxBlueBlock = GameRegistry.register(new BlockIronShulkerBox(EnumDyeColor.BLUE))); + SHULKER_BLOCKS.add(ironShulkerBoxBrownBlock = GameRegistry.register(new BlockIronShulkerBox(EnumDyeColor.BROWN))); + SHULKER_BLOCKS.add(ironShulkerBoxGreenBlock = GameRegistry.register(new BlockIronShulkerBox(EnumDyeColor.GREEN))); + SHULKER_BLOCKS.add(ironShulkerBoxRedBlock = GameRegistry.register(new BlockIronShulkerBox(EnumDyeColor.RED))); + SHULKER_BLOCKS.add(ironShulkerBoxBlackBlock = GameRegistry.register(new BlockIronShulkerBox(EnumDyeColor.BLACK))); + } + + private static void registerShulkerItemBlocks() + { + //@formatter:off + SHULKER_ITEM_BLOCKS.add(ironShulkerBoxWhiteItemBlock = GameRegistry.register(new ItemIronShulkerBox(ironShulkerBoxWhiteBlock, EnumDyeColor.WHITE))); + SHULKER_ITEM_BLOCKS.add(ironShulkerBoxOrangeItemBlock = GameRegistry.register(new ItemIronShulkerBox(ironShulkerBoxOrangeBlock, EnumDyeColor.ORANGE))); + SHULKER_ITEM_BLOCKS.add(ironShulkerBoxMagentaItemBlock = GameRegistry.register(new ItemIronShulkerBox(ironShulkerBoxMagentaBlock, EnumDyeColor.MAGENTA))); + SHULKER_ITEM_BLOCKS.add(ironShulkerBoxLightBlueItemBlock = GameRegistry.register(new ItemIronShulkerBox(ironShulkerBoxLightBlueBlock, EnumDyeColor.LIGHT_BLUE))); + SHULKER_ITEM_BLOCKS.add(ironShulkerBoxYellowItemBlock = GameRegistry.register(new ItemIronShulkerBox(ironShulkerBoxYellowBlock, EnumDyeColor.YELLOW))); + SHULKER_ITEM_BLOCKS.add(ironShulkerBoxLimeItemBlock = GameRegistry.register(new ItemIronShulkerBox(ironShulkerBoxLimeBlock, EnumDyeColor.LIME))); + SHULKER_ITEM_BLOCKS.add(ironShulkerBoxPinkItemBlock = GameRegistry.register(new ItemIronShulkerBox(ironShulkerBoxPinkBlock, EnumDyeColor.PINK))); + SHULKER_ITEM_BLOCKS.add(ironShulkerBoxGrayItemBlock = GameRegistry.register(new ItemIronShulkerBox(ironShulkerBoxGrayBlock, EnumDyeColor.GRAY))); + SHULKER_ITEM_BLOCKS.add(ironShulkerBoxSilverItemBlock = GameRegistry.register(new ItemIronShulkerBox(ironShulkerBoxSilverBlock, EnumDyeColor.SILVER))); + SHULKER_ITEM_BLOCKS.add(ironShulkerBoxCyanItemBlock = GameRegistry.register(new ItemIronShulkerBox(ironShulkerBoxCyanBlock, EnumDyeColor.CYAN))); + SHULKER_ITEM_BLOCKS.add(ironShulkerBoxPurpleItemBlock = GameRegistry.register(new ItemIronShulkerBox(ironShulkerBoxPurpleBlock, EnumDyeColor.PURPLE))); + SHULKER_ITEM_BLOCKS.add(ironShulkerBoxBlueItemBlock = GameRegistry.register(new ItemIronShulkerBox(ironShulkerBoxBlueBlock, EnumDyeColor.BLUE))); + SHULKER_ITEM_BLOCKS.add(ironShulkerBoxBrownItemBlock = GameRegistry.register(new ItemIronShulkerBox(ironShulkerBoxBrownBlock, EnumDyeColor.BROWN))); + SHULKER_ITEM_BLOCKS.add(ironShulkerBoxGreenItemBlock = GameRegistry.register(new ItemIronShulkerBox(ironShulkerBoxGreenBlock, EnumDyeColor.GREEN))); + SHULKER_ITEM_BLOCKS.add(ironShulkerBoxRedItemBlock = GameRegistry.register(new ItemIronShulkerBox(ironShulkerBoxRedBlock, EnumDyeColor.RED))); + SHULKER_ITEM_BLOCKS.add(ironShulkerBoxBlackItemBlock = GameRegistry.register(new ItemIronShulkerBox(ironShulkerBoxBlackBlock, EnumDyeColor.BLACK))); + //@formatter:on + } + + private static void setVanillaShulkerList() + { + VANILLA_SHULKER_BLOCKS.add(Blocks.WHITE_SHULKER_BOX); + VANILLA_SHULKER_BLOCKS.add(Blocks.ORANGE_SHULKER_BOX); + VANILLA_SHULKER_BLOCKS.add(Blocks.MAGENTA_SHULKER_BOX); + VANILLA_SHULKER_BLOCKS.add(Blocks.LIGHT_BLUE_SHULKER_BOX); + VANILLA_SHULKER_BLOCKS.add(Blocks.YELLOW_SHULKER_BOX); + VANILLA_SHULKER_BLOCKS.add(Blocks.LIME_SHULKER_BOX); + VANILLA_SHULKER_BLOCKS.add(Blocks.PINK_SHULKER_BOX); + VANILLA_SHULKER_BLOCKS.add(Blocks.GRAY_SHULKER_BOX); + VANILLA_SHULKER_BLOCKS.add(Blocks.SILVER_SHULKER_BOX); + VANILLA_SHULKER_BLOCKS.add(Blocks.CYAN_SHULKER_BOX); + VANILLA_SHULKER_BLOCKS.add(Blocks.PURPLE_SHULKER_BOX); + VANILLA_SHULKER_BLOCKS.add(Blocks.BLUE_SHULKER_BOX); + VANILLA_SHULKER_BLOCKS.add(Blocks.BROWN_SHULKER_BOX); + VANILLA_SHULKER_BLOCKS.add(Blocks.GREEN_SHULKER_BOX); + VANILLA_SHULKER_BLOCKS.add(Blocks.RED_SHULKER_BOX); + VANILLA_SHULKER_BLOCKS.add(Blocks.BLACK_SHULKER_BOX); + + VANILLA_SHULKER_COLORS.add(EnumDyeColor.WHITE); + VANILLA_SHULKER_COLORS.add(EnumDyeColor.ORANGE); + VANILLA_SHULKER_COLORS.add(EnumDyeColor.MAGENTA); + VANILLA_SHULKER_COLORS.add(EnumDyeColor.LIGHT_BLUE); + VANILLA_SHULKER_COLORS.add(EnumDyeColor.YELLOW); + VANILLA_SHULKER_COLORS.add(EnumDyeColor.LIME); + VANILLA_SHULKER_COLORS.add(EnumDyeColor.PINK); + VANILLA_SHULKER_COLORS.add(EnumDyeColor.GRAY); + VANILLA_SHULKER_COLORS.add(EnumDyeColor.SILVER); + VANILLA_SHULKER_COLORS.add(EnumDyeColor.CYAN); + VANILLA_SHULKER_COLORS.add(EnumDyeColor.PURPLE); + VANILLA_SHULKER_COLORS.add(EnumDyeColor.BLUE); + VANILLA_SHULKER_COLORS.add(EnumDyeColor.BROWN); + VANILLA_SHULKER_COLORS.add(EnumDyeColor.GREEN); + VANILLA_SHULKER_COLORS.add(EnumDyeColor.RED); + VANILLA_SHULKER_COLORS.add(EnumDyeColor.BLACK); + } +} diff --git a/src/main/java/cpw/mods/ironchest/IronChestAIOcelotSit.java b/src/main/java/cpw/mods/ironchest/common/ai/IronChestAIOcelotSit.java old mode 100755 new mode 100644 similarity index 63% rename from src/main/java/cpw/mods/ironchest/IronChestAIOcelotSit.java rename to src/main/java/cpw/mods/ironchest/common/ai/IronChestAIOcelotSit.java index 50cbf5db..11ea4e91 --- a/src/main/java/cpw/mods/ironchest/IronChestAIOcelotSit.java +++ b/src/main/java/cpw/mods/ironchest/common/ai/IronChestAIOcelotSit.java @@ -1,5 +1,17 @@ -package cpw.mods.ironchest; +/******************************************************************************* + * 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 cpw.mods.ironchest.common.ai; +import cpw.mods.ironchest.common.ICContent; +import cpw.mods.ironchest.common.tileentity.chest.TileEntityIronChest; import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.ai.EntityAIOcelotSit; @@ -30,7 +42,7 @@ protected boolean shouldMoveTo(World worldIn, BlockPos pos) IBlockState iblockstate = worldIn.getBlockState(pos); Block block = iblockstate.getBlock(); - if (block == IronChest.ironChestBlock) + if (block == ICContent.ironChestBlock) { TileEntity tileentity = worldIn.getTileEntity(pos); diff --git a/src/main/java/cpw/mods/ironchest/BlockIronChest.java b/src/main/java/cpw/mods/ironchest/common/blocks/chest/BlockIronChest.java old mode 100755 new mode 100644 similarity index 91% rename from src/main/java/cpw/mods/ironchest/BlockIronChest.java rename to src/main/java/cpw/mods/ironchest/common/blocks/chest/BlockIronChest.java index 5bd0b330..7dafdba3 --- a/src/main/java/cpw/mods/ironchest/BlockIronChest.java +++ b/src/main/java/cpw/mods/ironchest/common/blocks/chest/BlockIronChest.java @@ -8,8 +8,13 @@ * Contributors: * cpw - initial API and implementation ******************************************************************************/ -package cpw.mods.ironchest; +package cpw.mods.ironchest.common.blocks.chest; +import javax.annotation.Nullable; + +import cpw.mods.ironchest.IronChest; +import cpw.mods.ironchest.common.ICContent; +import cpw.mods.ironchest.common.tileentity.chest.TileEntityIronChest; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.block.properties.PropertyEnum; @@ -20,7 +25,6 @@ import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.Container; -import net.minecraft.inventory.IInventory; import net.minecraft.inventory.InventoryHelper; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -34,6 +38,7 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.world.Explosion; import net.minecraft.world.IBlockAccess; +import net.minecraft.world.ILockableContainer; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @@ -47,13 +52,12 @@ public class BlockIronChest extends Block public BlockIronChest() { super(Material.IRON); - this.setRegistryName(new ResourceLocation(IronChest.MOD_ID, "iron_chest")); + this.setRegistryName(new ResourceLocation(IronChest.MOD_ID, "iron_chest")); this.setDefaultState(this.blockState.getBaseState().withProperty(VARIANT_PROP, IronChestType.IRON)); - this.setHardness(3.0F); this.setUnlocalizedName("IronChest"); - this.setCreativeTab(CreativeTabs.DECORATIONS); + this.setCreativeTab(ICContent.tabGeneral); } @Override @@ -80,6 +84,18 @@ public EnumBlockRenderType getRenderType(IBlockState state) return EnumBlockRenderType.ENTITYBLOCK_ANIMATED; } + @Nullable + public ILockableContainer getLockableContainer(World worldIn, BlockPos pos) + { + return this.getContainer(worldIn, pos, false); + } + + @Nullable + public ILockableContainer getContainer(World worldIn, BlockPos pos, boolean allowBlocking) + { + return null; + } + @Override //@formatter:off public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing heldItem, float side, float hitX, float hitY) @@ -103,6 +119,7 @@ public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, } playerIn.openGui(IronChest.instance, ((TileEntityIronChest) te).getType().ordinal(), worldIn, pos.getX(), pos.getY(), pos.getZ()); + return true; } @@ -160,11 +177,14 @@ public void onBlockAdded(World world, BlockPos pos, IBlockState state) public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) { TileEntity te = worldIn.getTileEntity(pos); + if (te != null && te instanceof TileEntityIronChest) { TileEntityIronChest teic = (TileEntityIronChest) te; + teic.wasPlaced(placer, stack); teic.setFacing(placer.getHorizontalFacing().getOpposite()); + worldIn.notifyBlockUpdate(pos, state, state, 3); } } @@ -186,6 +206,7 @@ public void breakBlock(World worldIn, BlockPos pos, IBlockState state) InventoryHelper.dropInventoryItems(worldIn, pos, tileentity); } + super.breakBlock(worldIn, pos, state); } @@ -193,14 +214,17 @@ public void breakBlock(World worldIn, BlockPos pos, IBlockState state) public float getExplosionResistance(World world, BlockPos pos, Entity exploder, Explosion explosion) { TileEntity te = world.getTileEntity(pos); + if (te instanceof TileEntityIronChest) { TileEntityIronChest teic = (TileEntityIronChest) te; + if (teic.getType().isExplosionResistant()) { return 10000F; } } + return super.getExplosionResistance(world, pos, exploder, explosion); } @@ -211,14 +235,9 @@ public boolean hasComparatorInputOverride(IBlockState state) } @Override - public int getComparatorInputOverride(IBlockState blockState, World world, BlockPos pos) + public int getComparatorInputOverride(IBlockState blockState, World worldIn, BlockPos pos) { - TileEntity te = world.getTileEntity(pos); - if (te instanceof IInventory) - { - return Container.calcRedstoneFromInventory((IInventory) te); - } - return 0; + return Container.calcRedstone(worldIn.getTileEntity(pos)); } private static final EnumFacing[] validRotationAxes = new EnumFacing[] { EnumFacing.UP, EnumFacing.DOWN }; @@ -236,14 +255,18 @@ public boolean rotateBlock(World worldObj, BlockPos pos, EnumFacing axis) { return false; } + if (axis == EnumFacing.UP || axis == EnumFacing.DOWN) { TileEntity tileEntity = worldObj.getTileEntity(pos); + if (tileEntity instanceof TileEntityIronChest) { TileEntityIronChest icte = (TileEntityIronChest) tileEntity; + icte.rotateAround(); } + return true; } return false; @@ -254,7 +277,9 @@ public boolean rotateBlock(World worldObj, BlockPos pos, EnumFacing axis) 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 && tileentity.receiveClientEvent(id, param); } } diff --git a/src/main/java/cpw/mods/ironchest/IronChestType.java b/src/main/java/cpw/mods/ironchest/common/blocks/chest/IronChestType.java old mode 100755 new mode 100644 similarity index 87% rename from src/main/java/cpw/mods/ironchest/IronChestType.java rename to src/main/java/cpw/mods/ironchest/common/blocks/chest/IronChestType.java index d81bea30..78de92bd --- a/src/main/java/cpw/mods/ironchest/IronChestType.java +++ b/src/main/java/cpw/mods/ironchest/common/blocks/chest/IronChestType.java @@ -8,12 +8,21 @@ * Contributors: * cpw - initial API and implementation ******************************************************************************/ -package cpw.mods.ironchest; +package cpw.mods.ironchest.common.blocks.chest; import java.util.Arrays; import java.util.Collection; import java.util.Collections; +import cpw.mods.ironchest.common.gui.chest.slot.ValidatingChestSlot; +import cpw.mods.ironchest.common.tileentity.chest.TileEntityCopperChest; +import cpw.mods.ironchest.common.tileentity.chest.TileEntityCrystalChest; +import cpw.mods.ironchest.common.tileentity.chest.TileEntityDiamondChest; +import cpw.mods.ironchest.common.tileentity.chest.TileEntityDirtChest; +import cpw.mods.ironchest.common.tileentity.chest.TileEntityGoldChest; +import cpw.mods.ironchest.common.tileentity.chest.TileEntityIronChest; +import cpw.mods.ironchest.common.tileentity.chest.TileEntityObsidianChest; +import cpw.mods.ironchest.common.tileentity.chest.TileEntitySilverChest; import net.minecraft.init.Blocks; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.Slot; @@ -71,7 +80,7 @@ public enum IronChestType implements IStringSerializable this.size = size; this.rowLength = rowLength; this.tieredChest = tieredChest; - this.modelTexture = new ResourceLocation("ironchest", "textures/model/" + modelTexture); + this.modelTexture = new ResourceLocation("ironchest", "textures/model/chest/" + modelTexture); this.matList = Collections.unmodifiableCollection(mats); this.clazz = clazz; this.recipes = Collections.unmodifiableCollection(Arrays.asList(recipes)); @@ -119,11 +128,13 @@ public String getName() public static void registerBlocksAndRecipes(BlockIronChest blockResult) { Object previous = "chestWood"; + for (IronChestType typ : values()) { generateRecipesForType(blockResult, previous, typ); + ItemStack chest = new ItemStack(blockResult, 1, typ.ordinal()); - // if (typ.isValidForCreativeMode()) GameRegistry.registerCustomItemStack(typ.friendlyName, chest);//TODO fix this!! + if (typ.tieredChest) { previous = chest; @@ -137,12 +148,17 @@ public static void generateRecipesForType(BlockIronChest blockResult, Object pre { String[] recipeSplit = new String[] { recipe.substring(0, 3), recipe.substring(3, 6), recipe.substring(6, 9) }; Object mainMaterial = null; + for (String mat : type.matList) { mainMaterial = translateOreName(mat); //@formatter:off - addRecipe(new ItemStack(blockResult, 1, type.ordinal()), recipeSplit, 'm', mainMaterial, 'P', previousTier, /* previous tier of chest */ - 'G', "blockGlass", 'C', "chestWood", '0', new ItemStack(blockResult, 1, 0), /* Iron Chest */ + addRecipe(new ItemStack(blockResult, 1, type.ordinal()), recipeSplit, + 'm', mainMaterial, + 'P', previousTier, /* previous tier of chest */ + 'G', "blockGlass", + 'C', "chestWood", + '0', new ItemStack(blockResult, 1, 0), /* Iron Chest */ '1', new ItemStack(blockResult, 1, 1), /* Gold Chest */ '2', new ItemStack(blockResult, 1, 2), /* Diamond Chest */ '3', new ItemStack(blockResult, 1, 3), /* Copper Chest */ @@ -162,12 +178,14 @@ else if (mat.equals("dirt")) { return Blocks.DIRT; } + return mat; } public static void addRecipe(ItemStack is, Object... parts) { ShapedOreRecipe oreRecipe = new ShapedOreRecipe(is, parts); + GameRegistry.addRecipe(oreRecipe); } @@ -193,7 +211,7 @@ public boolean isExplosionResistant() public Slot makeSlot(IInventory chestInventory, int index, int x, int y) { - return new ValidatingSlot(chestInventory, index, x, y, this); + return new ValidatingChestSlot(chestInventory, index, x, y, this); } private static final Item DIRT_ITEM = Item.getItemFromBlock(Blocks.DIRT); diff --git a/src/main/java/cpw/mods/ironchest/common/blocks/shulker/BlockIronShulkerBox.java b/src/main/java/cpw/mods/ironchest/common/blocks/shulker/BlockIronShulkerBox.java new file mode 100644 index 00000000..521c341b --- /dev/null +++ b/src/main/java/cpw/mods/ironchest/common/blocks/shulker/BlockIronShulkerBox.java @@ -0,0 +1,493 @@ +/******************************************************************************* + * 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 cpw.mods.ironchest.common.blocks.shulker; + +import java.util.List; + +import cpw.mods.ironchest.IronChest; +import cpw.mods.ironchest.common.ICContent; +import cpw.mods.ironchest.common.tileentity.shulker.TileEntityIronShulkerBox; +import net.minecraft.block.Block; +import net.minecraft.block.material.EnumPushReaction; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.PropertyEnum; +import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.ItemStackHelper; +import net.minecraft.item.EnumDyeColor; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.EnumBlockRenderType; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.NonNullList; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.text.TextFormatting; +import net.minecraft.util.text.translation.I18n; +import net.minecraft.world.Explosion; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + +@SuppressWarnings("deprecation") +public class BlockIronShulkerBox extends Block +{ + public static final PropertyEnum VARIANT_PROP = PropertyEnum.create("variant", IronShulkerBoxType.class); + private final EnumDyeColor color; + private EnumFacing facingDirection; + + public BlockIronShulkerBox(EnumDyeColor colorIn) + { + super(Material.IRON); + + this.color = colorIn; + this.setRegistryName(new ResourceLocation(IronChest.MOD_ID, "iron_shulker_box_" + colorIn.getName())); + this.setUnlocalizedName("IronShulkerBox" + colorIn.getName()); + this.setDefaultState(this.blockState.getBaseState().withProperty(VARIANT_PROP, IronShulkerBoxType.IRON)); + this.setHardness(3.0F); + this.setCreativeTab(ICContent.tabGeneral); + } + + /** + * Used to determine ambient occlusion and culling when rebuilding chunks for render + */ + @Override + public boolean isOpaqueCube(IBlockState state) + { + return false; + } + + @Override + public boolean causesSuffocation(IBlockState state) + { + return true; + } + + @Override + public boolean isFullCube(IBlockState state) + { + return false; + } + + @Override + @SideOnly(Side.CLIENT) + public boolean hasCustomBreakingProgress(IBlockState state) + { + return true; + } + + /** + * The type of render function called. MODEL for mixed tesr and static model, MODELBLOCK_ANIMATED for TESR-only, LIQUID for vanilla liquids, INVISIBLE to skip all rendering + */ + @Override + public EnumBlockRenderType getRenderType(IBlockState state) + { + return EnumBlockRenderType.ENTITYBLOCK_ANIMATED; + } + + @Override + //@formatter:off + public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing heldItem, float side, float hitX, float hitY) + //@formatter:on + { + if (worldIn.isRemote) + { + return true; + } + else if (playerIn.isSpectator()) + { + return true; + } + else + { + TileEntity tileentity = worldIn.getTileEntity(pos); + + if (tileentity instanceof TileEntityIronShulkerBox) + { + EnumFacing enumfacing = ((TileEntityIronShulkerBox) tileentity).getFacing(); + boolean flag; + + if (((TileEntityIronShulkerBox) tileentity).getAnimationStatus() == TileEntityIronShulkerBox.AnimationStatus.CLOSED) + { + //@formatter:off + AxisAlignedBB axisalignedbb = FULL_BLOCK_AABB.addCoord(0.5F * enumfacing.getFrontOffsetX(), 0.5F * enumfacing.getFrontOffsetY(), 0.5F * enumfacing.getFrontOffsetZ()).contract(enumfacing.getFrontOffsetX(), enumfacing.getFrontOffsetY(), enumfacing.getFrontOffsetZ()); + //@formatter:on + + flag = !worldIn.collidesWithAnyBlock(axisalignedbb.offset(pos.offset(enumfacing))); + } + else + { + flag = true; + } + + if (flag) + { + //@formatter:off + playerIn.openGui(IronChest.instance, ((TileEntityIronShulkerBox) tileentity).getType().ordinal(), worldIn, pos.getX(), pos.getY(), pos.getZ()); + //@formatter:on + } + + return true; + } + else + { + return false; + } + } + } + + @Override + public boolean hasTileEntity(IBlockState state) + { + return true; + } + + @Override + public TileEntity createTileEntity(World world, IBlockState state) + { + return state.getValue(VARIANT_PROP).makeEntity(this.color); + } + + @Override + @SideOnly(Side.CLIENT) + public void getSubBlocks(Item itemIn, CreativeTabs tab, NonNullList list) + { + for (IronShulkerBoxType type : IronShulkerBoxType.VALUES) + { + if (type.isValidForCreativeMode()) + { + list.add(new ItemStack(itemIn, 1, type.ordinal())); + } + } + } + + @Override + public IBlockState getStateFromMeta(int meta) + { + return this.getDefaultState().withProperty(VARIANT_PROP, IronShulkerBoxType.VALUES[meta]); + } + + @Override + public int getMetaFromState(IBlockState blockState) + { + return blockState.getValue(VARIANT_PROP).ordinal(); + } + + @Override + protected BlockStateContainer createBlockState() + { + return new BlockStateContainer(this, VARIANT_PROP); + } + + @Override + //@formatter:off + public IBlockState getStateForPlacement(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) + //@formatter:on + { + this.facingDirection = facing; + + return super.getStateForPlacement(worldIn, pos, facing, hitX, hitY, hitZ, meta, placer); + } + + @Override + public void onBlockAdded(World world, BlockPos pos, IBlockState state) + { + super.onBlockAdded(world, pos, state); + + world.notifyBlockUpdate(pos, state, state, 3); + } + + /** + * Called by ItemBlocks after a block is set in the world, to allow post-place logic + */ + @Override + public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) + { + if (stack.hasDisplayName()) + { + TileEntity tileentity = worldIn.getTileEntity(pos); + + if (tileentity instanceof TileEntityIronShulkerBox) + { + ((TileEntityIronShulkerBox) tileentity).setCustomName(stack.getDisplayName()); + + ((TileEntityIronShulkerBox) tileentity).setFacing(facingDirection); + + worldIn.notifyBlockUpdate(pos, state, state, 3); + } + } + else + { + TileEntity tileentity = worldIn.getTileEntity(pos); + + if (tileentity instanceof TileEntityIronShulkerBox) + { + TileEntityIronShulkerBox teic = (TileEntityIronShulkerBox) tileentity; + + teic.setFacing(facingDirection); + + worldIn.notifyBlockUpdate(pos, state, state, 3); + } + } + } + + @Override + public int damageDropped(IBlockState state) + { + return state.getValue(VARIANT_PROP).ordinal(); + } + + @Override + public void onBlockHarvested(World worldIn, BlockPos pos, IBlockState state, EntityPlayer player) + { + TileEntityIronShulkerBox tileentityironshulkerbox = (TileEntityIronShulkerBox) worldIn.getTileEntity(pos); + + tileentityironshulkerbox.setDestroyedByCreativePlayer(player.capabilities.isCreativeMode); + tileentityironshulkerbox.fillWithLoot(player); + } + + /** + * Spawns this Block's drops into the World as EntityItems. + */ + @Override + public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune) + { + } + + /** + * Called serverside after this block is replaced with another in Chunk, but before the Tile Entity is updated + */ + @Override + public void breakBlock(World worldIn, BlockPos pos, IBlockState state) + { + TileEntity tileentity = worldIn.getTileEntity(pos); + + if (tileentity instanceof TileEntityIronShulkerBox) + { + TileEntityIronShulkerBox tileentityironshulkerbox = (TileEntityIronShulkerBox) tileentity; + + if (!tileentityironshulkerbox.isCleared() && tileentityironshulkerbox.shouldDrop()) + { + if (!tileentityironshulkerbox.beenUpgraded()) + { + ItemStack itemstack = new ItemStack(Item.getItemFromBlock(this), 1, state.getValue(VARIANT_PROP).ordinal()); + NBTTagCompound nbttagcompound = new NBTTagCompound(); + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + + nbttagcompound.setTag("BlockEntityTag", ((TileEntityIronShulkerBox) tileentity).saveToNbt(nbttagcompound1)); + itemstack.setTagCompound(nbttagcompound); + + if (tileentityironshulkerbox.hasCustomName()) + { + itemstack.setStackDisplayName(tileentityironshulkerbox.getName()); + + tileentityironshulkerbox.setCustomName(""); + } + + spawnAsEntity(worldIn, pos, itemstack); + } + } + + worldIn.updateComparatorOutputLevel(pos, state.getBlock()); + } + + super.breakBlock(worldIn, pos, state); + } + + @Override + public float getExplosionResistance(World world, BlockPos pos, Entity exploder, Explosion explosion) + { + TileEntity te = world.getTileEntity(pos); + + if (te instanceof TileEntityIronShulkerBox) + { + TileEntityIronShulkerBox teic = (TileEntityIronShulkerBox) te; + + if (teic.getType().isExplosionResistant()) + { + return 10000F; + } + } + + return super.getExplosionResistance(world, pos, exploder, explosion); + } + + @Override + @SideOnly(Side.CLIENT) + public void addInformation(ItemStack stack, EntityPlayer player, List tooltip, boolean advanced) + { + super.addInformation(stack, player, tooltip, advanced); + + NBTTagCompound nbttagcompound = stack.getTagCompound(); + + if (nbttagcompound != null && nbttagcompound.hasKey("BlockEntityTag", 10)) + { + NBTTagCompound nbttagcompound1 = nbttagcompound.getCompoundTag("BlockEntityTag"); + + if (nbttagcompound1.hasKey("LootTable", 8)) + { + tooltip.add("???????"); + } + + if (nbttagcompound1.hasKey("Items", 9)) + { + if (nbttagcompound1.hasKey("ShulkerBoxSize", 3)) + { + NonNullList nonnulllist = NonNullList. withSize(nbttagcompound1.getInteger("ShulkerBoxSize"), ItemStack.EMPTY); + ItemStackHelper.loadAllItems(nbttagcompound1, nonnulllist); + int i = 0; + int j = 0; + + for (ItemStack itemstack : nonnulllist) + { + if (!itemstack.isEmpty()) + { + ++j; + + if (i <= 4) + { + ++i; + tooltip.add(String.format("%s x%d", new Object[] { itemstack.getDisplayName(), Integer.valueOf(itemstack.getCount()) })); + } + } + } + + if (j - i > 0) + { + //@formatter:off + tooltip.add(String.format(TextFormatting.ITALIC + I18n.translateToLocal("container.shulkerBox.more"), new Object[] {Integer.valueOf(j - i)})); + //@formatter:on + } + } + } + } + } + + @Override + public EnumPushReaction getMobilityFlag(IBlockState state) + { + return EnumPushReaction.DESTROY; + } + + @Override + public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) + { + TileEntity tileentity = source.getTileEntity(pos); + + return tileentity instanceof TileEntityIronShulkerBox ? ((TileEntityIronShulkerBox) tileentity).getBoundingBox() : FULL_BLOCK_AABB; + } + + @Override + public boolean hasComparatorInputOverride(IBlockState state) + { + return true; + } + + @Override + public int getComparatorInputOverride(IBlockState blockState, World worldIn, BlockPos pos) + { + return Container.calcRedstoneFromInventory((IInventory) worldIn.getTileEntity(pos)); + } + + @Override + public ItemStack getItem(World worldIn, BlockPos pos, IBlockState state) + { + ItemStack itemstack = super.getItem(worldIn, pos, state); + TileEntityIronShulkerBox tileentityironshulkerbox = (TileEntityIronShulkerBox) worldIn.getTileEntity(pos); + NBTTagCompound nbttagcompound = tileentityironshulkerbox.saveToNbt(new NBTTagCompound()); + + if (!nbttagcompound.hasNoTags()) + { + itemstack.setTagInfo("BlockEntityTag", nbttagcompound); + } + + return itemstack; + } + + public static Block getBlockByColor(EnumDyeColor colorIn) + { + switch (colorIn) + { + case WHITE: + return ICContent.ironShulkerBoxWhiteBlock; + case ORANGE: + return ICContent.ironShulkerBoxOrangeBlock; + case MAGENTA: + return ICContent.ironShulkerBoxMagentaBlock; + case LIGHT_BLUE: + return ICContent.ironShulkerBoxLightBlueBlock; + case YELLOW: + return ICContent.ironShulkerBoxYellowBlock; + case LIME: + return ICContent.ironShulkerBoxLimeBlock; + case PINK: + return ICContent.ironShulkerBoxPinkBlock; + case GRAY: + return ICContent.ironShulkerBoxGrayBlock; + case SILVER: + return ICContent.ironShulkerBoxSilverBlock; + case CYAN: + return ICContent.ironShulkerBoxCyanBlock; + case PURPLE: + default: + return ICContent.ironShulkerBoxPurpleBlock; + case BLUE: + return ICContent.ironShulkerBoxBlueBlock; + case BROWN: + return ICContent.ironShulkerBoxBrownBlock; + case GREEN: + return ICContent.ironShulkerBoxGreenBlock; + case RED: + return ICContent.ironShulkerBoxRedBlock; + case BLACK: + return ICContent.ironShulkerBoxBlackBlock; + } + } + + public static ItemStack getColoredItemStack(EnumDyeColor colorIn, int damageIn) + { + return new ItemStack(getBlockByColor(colorIn), 1, damageIn); + } + + @SideOnly(Side.CLIENT) + public static EnumDyeColor getColorFromBlock(Block blockIn) + { + return blockIn instanceof BlockIronShulkerBox ? ((BlockIronShulkerBox) blockIn).getColor() : EnumDyeColor.PURPLE; + } + + @SideOnly(Side.CLIENT) + public EnumDyeColor getColor() + { + return this.color; + } + + @Override + @Deprecated + 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 && tileentity.receiveClientEvent(id, param); + } +} diff --git a/src/main/java/cpw/mods/ironchest/common/blocks/shulker/IronShulkerBoxType.java b/src/main/java/cpw/mods/ironchest/common/blocks/shulker/IronShulkerBoxType.java new file mode 100644 index 00000000..fbaf4f81 --- /dev/null +++ b/src/main/java/cpw/mods/ironchest/common/blocks/shulker/IronShulkerBoxType.java @@ -0,0 +1,233 @@ +/******************************************************************************* + * 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 cpw.mods.ironchest.common.blocks.shulker; + +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; + +import cpw.mods.ironchest.common.gui.shulker.slot.ValidatingShulkerBoxSlot; +import cpw.mods.ironchest.common.tileentity.shulker.TileEntityCopperShulkerBox; +import cpw.mods.ironchest.common.tileentity.shulker.TileEntityCrystalShulkerBox; +import cpw.mods.ironchest.common.tileentity.shulker.TileEntityDiamondShulkerBox; +import cpw.mods.ironchest.common.tileentity.shulker.TileEntityGoldShulkerBox; +import cpw.mods.ironchest.common.tileentity.shulker.TileEntityIronShulkerBox; +import cpw.mods.ironchest.common.tileentity.shulker.TileEntityObsidianShulkerBox; +import cpw.mods.ironchest.common.tileentity.shulker.TileEntitySilverShulkerBox; +import net.minecraft.block.BlockShulkerBox; +import net.minecraft.init.Blocks; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.Slot; +import net.minecraft.item.EnumDyeColor; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IStringSerializable; +import net.minecraftforge.fml.common.registry.GameRegistry; +import net.minecraftforge.oredict.ShapedOreRecipe; + +public enum IronShulkerBoxType implements IStringSerializable +{ + //@formatter:off + IRON(54, 9, true, "_iron.png", TileEntityIronShulkerBox.class, 184, 202, Arrays.asList("ingotIron", "ingotRefinedIron"), "mmmmPmmmm", "mGmG3GmGm"), + GOLD(81, 9, true, "_gold.png", TileEntityGoldShulkerBox.class, 184, 256, Collections.singleton("ingotGold"), "mmmmPmmmm", "mGmG4GmGm"), + DIAMOND(108, 12, true, "_diamond.png", TileEntityDiamondShulkerBox.class, 184, 256, Collections.singleton("gemDiamond"), "GGGmPmGGG", "GGGG4Gmmm"), + COPPER(45, 9, false, "_copper.png", TileEntityCopperShulkerBox.class, 184, 184, Collections.singleton("ingotCopper"), "mmmmCmmmm"), + SILVER(72, 9, false, "_silver.png", TileEntitySilverShulkerBox.class, 184, 238, Collections.singleton("ingotSilver"), "mmmm3mmmm", "mGmG0GmGm"), + CRYSTAL(108, 12, true, "_crystal.png", TileEntityCrystalShulkerBox.class, 238, 256, Collections.singleton("blockGlass"), "GGGGPGGGG"), + OBSIDIAN(108, 12, false, "_obsidian.png", TileEntityObsidianShulkerBox.class, 238, 256, Collections.singleton("obsidian"), "mmmm2mmmm"), + VANILLA(0, 0, false, "", null, 0, 0, Collections.singleton("shulkerBox")); + //@formatter:on + + public static final IronShulkerBoxType VALUES[] = values(); + + public final String name; + + public final int size; + + public final int rowLength; + + public final boolean tieredChest; + + public final String modelTexture; + + public final Class clazz; + + public final int xSize; + + public final int ySize; + + public final Collection matList; + + public final Collection recipes; + + private String breakTexture; + + //@formatter:off + IronShulkerBoxType(int size, int rowLength, boolean tieredChest, String modelTexture, Class clazz, int xSize, int ySize, Collection mats, String... recipes) + //@formatter:on + { + this.name = this.name().toLowerCase(); + this.size = size; + this.rowLength = rowLength; + this.tieredChest = tieredChest; + this.modelTexture = modelTexture; + this.clazz = clazz; + this.xSize = xSize; + this.ySize = ySize; + this.matList = Collections.unmodifiableCollection(mats); + this.recipes = Collections.unmodifiableCollection(Arrays.asList(recipes)); + } + + @Override + public String getName() + { + return this.name; + } + + public String getBreakTexture() + { + if (this.breakTexture == null) + { + switch (this) + { + case OBSIDIAN: + { + this.breakTexture = "minecraft:blocks/obsidian"; + break; + } + case VANILLA: + { + this.breakTexture = "minecraft:blocks/planks_oak"; + break; + } + default: + { + this.breakTexture = "ironchest:blocks/" + this.getName() + "break"; + } + } + } + + return this.breakTexture; + } + + public static void registerBlocksAndRecipes(BlockIronShulkerBox blockResult, BlockShulkerBox shulkerBox) + { + Object previous = shulkerBox; + + for (IronShulkerBoxType typ : values()) + { + generateRecipesForType(blockResult, previous, typ); + + ItemStack chest = new ItemStack(blockResult, 1, typ.ordinal()); + + if (typ.tieredChest) + { + previous = chest; + } + } + } + + public static void generateRecipesForType(BlockIronShulkerBox blockResult, Object previousTier, IronShulkerBoxType type) + { + for (String recipe : type.recipes) + { + String[] recipeSplit = new String[] { recipe.substring(0, 3), recipe.substring(3, 6), recipe.substring(6, 9) }; + Object mainMaterial = null; + + for (String mat : type.matList) + { + mainMaterial = translateOreName(mat); + //@formatter:off + addRecipe(new ItemStack(blockResult, 1, type.ordinal()), recipeSplit, + 'm', mainMaterial, + 'P', previousTier, /* previous tier of chest */ + 'G', "blockGlass", + 'C', "chestWood", + '0', new ItemStack(blockResult, 1, 0), /* Iron Chest */ + '1', new ItemStack(blockResult, 1, 1), /* Gold Chest */ + '2', new ItemStack(blockResult, 1, 2), /* Diamond Chest */ + '3', new ItemStack(blockResult, 1, 3), /* Copper Chest */ + '4', new ItemStack(blockResult, 1, 4) /* Silver Chest */ + ); + //@formatter:on + } + } + } + + public static Object translateOreName(String mat) + { + if (mat.equals("shulkerBox")) + { + return Blocks.PURPLE_SHULKER_BOX; + } + + if (mat.equals("obsidian")) + { + return Blocks.OBSIDIAN; + } + + return mat; + } + + public static void addRecipe(ItemStack is, Object... parts) + { + ShapedOreRecipe oreRecipe = new ShapedOreRecipe(is, parts); + + GameRegistry.addRecipe(oreRecipe); + } + + public int getRowCount() + { + return this.size / this.rowLength; + } + + public boolean isTransparent() + { + return this == CRYSTAL; + } + + public boolean isValidForCreativeMode() + { + return this != VANILLA; + } + + public boolean isExplosionResistant() + { + return this == OBSIDIAN; + } + + public Slot makeSlot(IInventory chestInventory, int index, int x, int y) + { + return new ValidatingShulkerBoxSlot(chestInventory, index, x, y); + } + + public TileEntityIronShulkerBox makeEntity(EnumDyeColor colorIn) + { + switch (this) + { + case IRON: + return new TileEntityIronShulkerBox(colorIn); + case GOLD: + return new TileEntityGoldShulkerBox(colorIn); + case DIAMOND: + return new TileEntityDiamondShulkerBox(colorIn); + case COPPER: + return new TileEntityCopperShulkerBox(colorIn); + case SILVER: + return new TileEntitySilverShulkerBox(colorIn); + case CRYSTAL: + return new TileEntityCrystalShulkerBox(colorIn); + case OBSIDIAN: + return new TileEntityObsidianShulkerBox(colorIn); + default: + return null; + } + } +} diff --git a/src/main/java/cpw/mods/ironchest/common/crafting/IronShulkerBoxColoring.java b/src/main/java/cpw/mods/ironchest/common/crafting/IronShulkerBoxColoring.java new file mode 100644 index 00000000..6abb3c0d --- /dev/null +++ b/src/main/java/cpw/mods/ironchest/common/crafting/IronShulkerBoxColoring.java @@ -0,0 +1,136 @@ +/******************************************************************************* + * 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 cpw.mods.ironchest.common.crafting; + +import cpw.mods.ironchest.common.blocks.shulker.BlockIronShulkerBox; +import net.minecraft.block.Block; +import net.minecraft.init.Items; +import net.minecraft.inventory.InventoryCrafting; +import net.minecraft.item.EnumDyeColor; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.IRecipe; +import net.minecraft.util.NonNullList; +import net.minecraft.world.World; + +public class IronShulkerBoxColoring implements IRecipe +{ + public IronShulkerBoxColoring() + { + } + + /** + * Used to check if a recipe matches current crafting inventory + */ + @Override + public boolean matches(InventoryCrafting inv, World worldIn) + { + int i = 0; + int j = 0; + + for (int k = 0; k < inv.getSizeInventory(); ++k) + { + ItemStack itemstack = inv.getStackInSlot(k); + + if (!itemstack.isEmpty()) + { + if (Block.getBlockFromItem(itemstack.getItem()) instanceof BlockIronShulkerBox) + { + ++i; + } + else + { + if (itemstack.getItem() != Items.DYE) + { + return false; + } + + ++j; + } + + if (j > 1 || i > 1) + { + return false; + } + } + } + + return i == 1 && j == 1; + } + + /** + * Returns an Item that is the result of this recipe + */ + @Override + public ItemStack getCraftingResult(InventoryCrafting inv) + { + ItemStack itemstack = ItemStack.EMPTY; + ItemStack itemstack1 = ItemStack.EMPTY; + + for (int i = 0; i < inv.getSizeInventory(); ++i) + { + ItemStack itemstack2 = inv.getStackInSlot(i); + + if (!itemstack2.isEmpty()) + { + if (Block.getBlockFromItem(itemstack2.getItem()) instanceof BlockIronShulkerBox) + { + itemstack = itemstack2; + } + else if (itemstack2.getItem() == Items.DYE) + { + itemstack1 = itemstack2; + } + } + } + + ItemStack itemstack3 = BlockIronShulkerBox.getColoredItemStack(EnumDyeColor.byDyeDamage(itemstack1.getMetadata()), itemstack.getMetadata()); + + if (itemstack.hasTagCompound()) + { + itemstack3.setTagCompound(itemstack.getTagCompound().copy()); + } + + return itemstack3; + } + + /** + * Returns the size of the recipe area + */ + @Override + public int getRecipeSize() + { + return 10; + } + + @Override + public ItemStack getRecipeOutput() + { + return ItemStack.EMPTY; + } + + @Override + public NonNullList getRemainingItems(InventoryCrafting inv) + { + NonNullList nonnulllist = NonNullList. withSize(inv.getSizeInventory(), ItemStack.EMPTY); + + for (int i = 0; i < nonnulllist.size(); ++i) + { + ItemStack itemstack = inv.getStackInSlot(i); + + if (itemstack.getItem().hasContainerItem(itemstack)) + { + nonnulllist.set(i, new ItemStack(itemstack.getItem().getContainerItem())); + } + } + + return nonnulllist; + } +} diff --git a/src/main/java/cpw/mods/ironchest/ContainerIronChest.java b/src/main/java/cpw/mods/ironchest/common/gui/chest/ContainerIronChest.java old mode 100755 new mode 100644 similarity index 93% rename from src/main/java/cpw/mods/ironchest/ContainerIronChest.java rename to src/main/java/cpw/mods/ironchest/common/gui/chest/ContainerIronChest.java index 6ee41f7d..019045fe --- a/src/main/java/cpw/mods/ironchest/ContainerIronChest.java +++ b/src/main/java/cpw/mods/ironchest/common/gui/chest/ContainerIronChest.java @@ -8,8 +8,9 @@ * Contributors: * cpw - initial API and implementation ******************************************************************************/ -package cpw.mods.ironchest; +package cpw.mods.ironchest.common.gui.chest; +import cpw.mods.ironchest.common.blocks.chest.IronChestType; import invtweaks.api.container.ChestContainer; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; @@ -108,11 +109,13 @@ protected void layoutContainer(IInventory playerInventory, IInventory chestInven } int leftCol = (xSize - 162) / 2 + 1; + for (int playerInvRow = 0; playerInvRow < 3; playerInvRow++) { for (int playerInvCol = 0; playerInvCol < 9; playerInvCol++) { - this.addSlotToContainer(new Slot(playerInventory, playerInvCol + playerInvRow * 9 + 9, leftCol + playerInvCol * 18, ySize - (4 - playerInvRow) * 18 - 10)); + this.addSlotToContainer( + new Slot(playerInventory, playerInvCol + playerInvRow * 9 + 9, leftCol + playerInvCol * 18, ySize - (4 - playerInvRow) * 18 - 10)); } } diff --git a/src/main/java/cpw/mods/ironchest/common/gui/chest/slot/ValidatingChestSlot.java b/src/main/java/cpw/mods/ironchest/common/gui/chest/slot/ValidatingChestSlot.java new file mode 100644 index 00000000..1985faa5 --- /dev/null +++ b/src/main/java/cpw/mods/ironchest/common/gui/chest/slot/ValidatingChestSlot.java @@ -0,0 +1,33 @@ +/******************************************************************************* + * 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 cpw.mods.ironchest.common.gui.chest.slot; + +import cpw.mods.ironchest.common.blocks.chest.IronChestType; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; + +public class ValidatingChestSlot extends Slot +{ + private IronChestType type; + + public ValidatingChestSlot(IInventory inventoryIn, int slotIndex, int xPosition, int yPosition, IronChestType type) + { + super(inventoryIn, slotIndex, xPosition, yPosition); + this.type = type; + } + + @Override + public boolean isItemValid(ItemStack stack) + { + return this.type.acceptsStack(stack); + } +} diff --git a/src/main/java/cpw/mods/ironchest/common/gui/shulker/ContainerIronShulkerBox.java b/src/main/java/cpw/mods/ironchest/common/gui/shulker/ContainerIronShulkerBox.java new file mode 100644 index 00000000..2d657e63 --- /dev/null +++ b/src/main/java/cpw/mods/ironchest/common/gui/shulker/ContainerIronShulkerBox.java @@ -0,0 +1,138 @@ +/******************************************************************************* + * 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 cpw.mods.ironchest.common.gui.shulker; + +import cpw.mods.ironchest.common.blocks.shulker.IronShulkerBoxType; +import invtweaks.api.container.ChestContainer; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; + +@ChestContainer(isLargeChest = true) +public class ContainerIronShulkerBox extends Container +{ + private IronShulkerBoxType type; + + private EntityPlayer player; + + private IInventory inventory; + + public ContainerIronShulkerBox(IInventory playerInventory, IInventory shulkerBoxInventory, IronShulkerBoxType type, int xSize, int ySize) + { + this.inventory = shulkerBoxInventory; + this.player = ((InventoryPlayer) playerInventory).player; + this.type = type; + shulkerBoxInventory.openInventory(this.player); + this.layoutContainer(playerInventory, shulkerBoxInventory, type, xSize, ySize); + } + + protected void layoutContainer(IInventory playerInventory, IInventory shulkerBoxInventory, IronShulkerBoxType type, int xSize, int ySize) + { + for (int chestRow = 0; chestRow < type.getRowCount(); chestRow++) + { + for (int chestCol = 0; chestCol < type.rowLength; chestCol++) + { + this.addSlotToContainer(type.makeSlot(shulkerBoxInventory, 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++) + { + //@formatter:off + this.addSlotToContainer(new Slot(playerInventory, playerInvCol + playerInvRow * 9 + 9, leftCol + playerInvCol * 18, ySize - (4 - playerInvRow) * 18 - 10)); + //@formatter:on + } + + } + + for (int hotbarSlot = 0; hotbarSlot < 9; hotbarSlot++) + { + this.addSlotToContainer(new Slot(playerInventory, hotbarSlot, leftCol + hotbarSlot * 18, ySize - 24)); + } + } + + public EntityPlayer getPlayer() + { + return this.player; + } + + /** + * Determines whether supplied player can use this container + */ + @Override + public boolean canInteractWith(EntityPlayer playerIn) + { + return this.inventory.isUsableByPlayer(playerIn); + } + + /** + * Take a stack from the specified inventory slot. + */ + @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.mergeItemStack(itemstack1, 0, this.type.size, false)) + { + return ItemStack.EMPTY; + } + + if (itemstack1.isEmpty()) + { + slot.putStack(ItemStack.EMPTY); + } + else + { + slot.onSlotChanged(); + } + } + + return itemstack; + } + + /** + * Called when the container is closed. + */ + @Override + public void onContainerClosed(EntityPlayer playerIn) + { + super.onContainerClosed(playerIn); + + this.inventory.closeInventory(playerIn); + } + + @ChestContainer.RowSizeCallback + public int getNumColumns() + { + return this.type.rowLength; + } +} diff --git a/src/main/java/cpw/mods/ironchest/common/gui/shulker/slot/ValidatingShulkerBoxSlot.java b/src/main/java/cpw/mods/ironchest/common/gui/shulker/slot/ValidatingShulkerBoxSlot.java new file mode 100644 index 00000000..9ce22118 --- /dev/null +++ b/src/main/java/cpw/mods/ironchest/common/gui/shulker/slot/ValidatingShulkerBoxSlot.java @@ -0,0 +1,34 @@ +/******************************************************************************* + * 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 cpw.mods.ironchest.common.gui.shulker.slot; + +import cpw.mods.ironchest.common.blocks.shulker.BlockIronShulkerBox; +import net.minecraft.block.Block; +import net.minecraft.block.BlockShulkerBox; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; + +public class ValidatingShulkerBoxSlot extends Slot +{ + public ValidatingShulkerBoxSlot(IInventory inventoryIn, int slotIndex, int xPosition, int yPosition) + { + super(inventoryIn, slotIndex, xPosition, yPosition); + } + + @Override + public boolean isItemValid(ItemStack stack) + { + //@formatter:off + return !(Block.getBlockFromItem(stack.getItem()) instanceof BlockIronShulkerBox) && !(Block.getBlockFromItem(stack.getItem()) instanceof BlockShulkerBox); + //@formatter:on + } +} diff --git a/src/main/java/cpw/mods/ironchest/ChestChangerType.java b/src/main/java/cpw/mods/ironchest/common/items/ChestChangerType.java old mode 100755 new mode 100644 similarity index 60% rename from src/main/java/cpw/mods/ironchest/ChestChangerType.java rename to src/main/java/cpw/mods/ironchest/common/items/ChestChangerType.java index 94a671d6..5efbb5c0 --- a/src/main/java/cpw/mods/ironchest/ChestChangerType.java +++ b/src/main/java/cpw/mods/ironchest/common/items/ChestChangerType.java @@ -4,17 +4,19 @@ *

* Contributors: cpw - initial API and implementation ******************************************************************************/ -package cpw.mods.ironchest; +package cpw.mods.ironchest.common.items; -import static cpw.mods.ironchest.IronChestType.COPPER; -import static cpw.mods.ironchest.IronChestType.CRYSTAL; -import static cpw.mods.ironchest.IronChestType.DIAMOND; -import static cpw.mods.ironchest.IronChestType.GOLD; -import static cpw.mods.ironchest.IronChestType.IRON; -import static cpw.mods.ironchest.IronChestType.OBSIDIAN; -import static cpw.mods.ironchest.IronChestType.SILVER; -import static cpw.mods.ironchest.IronChestType.WOOD; +import static cpw.mods.ironchest.common.blocks.chest.IronChestType.COPPER; +import static cpw.mods.ironchest.common.blocks.chest.IronChestType.CRYSTAL; +import static cpw.mods.ironchest.common.blocks.chest.IronChestType.DIAMOND; +import static cpw.mods.ironchest.common.blocks.chest.IronChestType.GOLD; +import static cpw.mods.ironchest.common.blocks.chest.IronChestType.IRON; +import static cpw.mods.ironchest.common.blocks.chest.IronChestType.OBSIDIAN; +import static cpw.mods.ironchest.common.blocks.chest.IronChestType.SILVER; +import static cpw.mods.ironchest.common.blocks.chest.IronChestType.WOOD; +import cpw.mods.ironchest.common.blocks.chest.IronChestType; +import cpw.mods.ironchest.common.items.chest.ItemChestChanger; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraftforge.fml.common.registry.GameRegistry; @@ -22,15 +24,15 @@ public enum ChestChangerType { //@formatter:off - IRONGOLD(IRON, GOLD, "iron_gold_upgrade", "mmm", "msm", "mmm"), - GOLDDIAMOND(GOLD, DIAMOND, "gold_diamond_upgrade", "GGG", "msm", "GGG"), - COPPERSILVER(COPPER, SILVER, "copper_silver_upgrade", "mmm", "msm", "mmm"), - SILVERGOLD(SILVER, GOLD, "silver_gold_upgrade", "mGm", "GsG", "mGm"), - COPPERIRON(COPPER, IRON, "copper_iron_upgrade", "mGm", "GsG", "mGm"), - DIAMONDCRYSTAL(DIAMOND, CRYSTAL, "diamond_crystal_upgrade", "GGG", "GOG", "GGG"), - WOODIRON(WOOD, IRON, "wood_iron_upgrade", "mmm", "msm", "mmm"), - WOODCOPPER(WOOD, COPPER, "wood_copper_upgrade", "mmm", "msm", "mmm"), - DIAMONDOBSIDIAN(DIAMOND, OBSIDIAN, "diamond_obsidian_upgrade", "mmm", "mGm", "mmm"); + IRON_GOLD(IRON, GOLD, "iron_gold_chest_upgrade", "mmm", "msm", "mmm"), + GOLD_DIAMOND(GOLD, DIAMOND, "gold_diamond_chest_upgrade", "GGG", "msm", "GGG"), + COPPER_SILVER(COPPER, SILVER, "copper_silver_chest_upgrade", "mmm", "msm", "mmm"), + SILVER_GOLD(SILVER, GOLD, "silver_gold_chest_upgrade", "mGm", "GsG", "mGm"), + COPPER_IRON(COPPER, IRON, "copper_iron_chest_upgrade", "mGm", "GsG", "mGm"), + DIAMOND_CRYSTAL(DIAMOND, CRYSTAL, "diamond_crystal_chest_upgrade", "GGG", "GOG", "GGG"), + WOOD_IRON(WOOD, IRON, "wood_iron_chest_upgrade", "mmm", "msm", "mmm"), + WOOD_COPPER(WOOD, COPPER, "wood_copper_chest_upgrade", "mmm", "msm", "mmm"), + DIAMOND_OBSIDIAN(DIAMOND, OBSIDIAN, "diamond_obsidian_chest_upgrade", "mmm", "mGm", "mmm"); //@formatter:on public static final ChestChangerType[] VALUES = values(); @@ -57,8 +59,11 @@ public boolean canUpgrade(IronChestType from) public ItemChestChanger buildItem() { this.item = new ItemChestChanger(this); + this.item.setRegistryName(this.itemName); + GameRegistry.register(this.item); + return this.item; } diff --git a/src/main/java/cpw/mods/ironchest/common/items/ShulkerBoxChangerType.java b/src/main/java/cpw/mods/ironchest/common/items/ShulkerBoxChangerType.java new file mode 100644 index 00000000..aab7e444 --- /dev/null +++ b/src/main/java/cpw/mods/ironchest/common/items/ShulkerBoxChangerType.java @@ -0,0 +1,101 @@ +/******************************************************************************* + * 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 cpw.mods.ironchest.common.items; + +import static cpw.mods.ironchest.common.blocks.shulker.IronShulkerBoxType.COPPER; +import static cpw.mods.ironchest.common.blocks.shulker.IronShulkerBoxType.CRYSTAL; +import static cpw.mods.ironchest.common.blocks.shulker.IronShulkerBoxType.DIAMOND; +import static cpw.mods.ironchest.common.blocks.shulker.IronShulkerBoxType.GOLD; +import static cpw.mods.ironchest.common.blocks.shulker.IronShulkerBoxType.IRON; +import static cpw.mods.ironchest.common.blocks.shulker.IronShulkerBoxType.OBSIDIAN; +import static cpw.mods.ironchest.common.blocks.shulker.IronShulkerBoxType.SILVER; +import static cpw.mods.ironchest.common.blocks.shulker.IronShulkerBoxType.VANILLA; + +import cpw.mods.ironchest.common.blocks.shulker.IronShulkerBoxType; +import cpw.mods.ironchest.common.items.shulker.ItemShulkerBoxChanger; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fml.common.registry.GameRegistry; + +public enum ShulkerBoxChangerType +{ + //@formatter:off + IRON_GOLD(IRON, GOLD, "iron_gold_shulker_upgrade", "mmm", "msm", "mmm"), + GOLD_DIAMOND(GOLD, DIAMOND, "gold_diamond_shulker_upgrade", "GGG", "msm", "GGG"), + COPPER_SILVER(COPPER, SILVER, "copper_silver_shulker_upgrade", "mmm", "msm", "mmm"), + SILVER_GOLD(SILVER, GOLD, "silver_gold_shulker_upgrade", "mGm", "GsG", "mGm"), + COPPER_IRON(COPPER, IRON, "copper_iron_shulker_upgrade", "mGm", "GsG", "mGm"), + DIAMOND_CRYSTAL(DIAMOND, CRYSTAL, "diamond_crystal_shulker_upgrade", "GGG", "GOG", "GGG"), + VANILLA_IRON(VANILLA, IRON, "vanilla_iron_shulker_upgrade", "mmm", "msm", "mmm"), + VANILLA_COPPER(VANILLA, COPPER, "vanilla_copper_shulker_upgrade", "mmm", "msm", "mmm"), + DIAMOND_OBSIDIAN(DIAMOND, OBSIDIAN, "diamond_obsidian_shulker_upgrade", "mmm", "mGm", "mmm"); + //@formatter:on + + public static final ShulkerBoxChangerType[] VALUES = values(); + + public final IronShulkerBoxType source; + public final IronShulkerBoxType target; + public final String itemName; + public ItemShulkerBoxChanger item; + private String[] recipe; + + ShulkerBoxChangerType(IronShulkerBoxType source, IronShulkerBoxType target, String itemName, String... recipe) + { + this.source = source; + this.target = target; + this.itemName = itemName; + this.recipe = recipe; + } + + public boolean canUpgrade(IronShulkerBoxType from) + { + return from == this.source; + } + + public ItemShulkerBoxChanger buildItem() + { + this.item = new ItemShulkerBoxChanger(this); + + this.item.setRegistryName(this.itemName); + + GameRegistry.register(this.item); + + return this.item; + } + + public void addRecipes() + { + for (String sourceMat : this.source.matList) + { + for (String targetMat : this.target.matList) + { + Object targetMaterial = IronShulkerBoxType.translateOreName(targetMat); + Object sourceMaterial = IronShulkerBoxType.translateOreName(sourceMat); + + //@formatter:off + IronShulkerBoxType.addRecipe(new ItemStack(this.item), this.recipe, 'm', targetMaterial, 's', sourceMaterial, 'G', "blockGlass", 'O', Blocks.OBSIDIAN); + //@formatter:on + } + } + } + + public static void buildItems() + { + for (ShulkerBoxChangerType type : VALUES) + { + type.buildItem(); + } + } + + public static void generateRecipes() + { + for (ShulkerBoxChangerType item : VALUES) + { + item.addRecipes(); + } + } +} diff --git a/src/main/java/cpw/mods/ironchest/ItemChestChanger.java b/src/main/java/cpw/mods/ironchest/common/items/chest/ItemChestChanger.java old mode 100755 new mode 100644 similarity index 81% rename from src/main/java/cpw/mods/ironchest/ItemChestChanger.java rename to src/main/java/cpw/mods/ironchest/common/items/chest/ItemChestChanger.java index 2006e9df..0b59c916 --- a/src/main/java/cpw/mods/ironchest/ItemChestChanger.java +++ b/src/main/java/cpw/mods/ironchest/common/items/chest/ItemChestChanger.java @@ -8,13 +8,19 @@ * Contributors: * cpw - initial API and implementation ******************************************************************************/ -package cpw.mods.ironchest; +package cpw.mods.ironchest.common.items.chest; +import java.util.Locale; + +import cpw.mods.ironchest.common.ICContent; +import cpw.mods.ironchest.common.blocks.chest.BlockIronChest; +import cpw.mods.ironchest.common.blocks.chest.IronChestType; +import cpw.mods.ironchest.common.items.ChestChangerType; +import cpw.mods.ironchest.common.tileentity.chest.TileEntityIronChest; +import cpw.mods.ironchest.common.util.ItemTooltip; import net.minecraft.block.BlockChest; import net.minecraft.block.state.IBlockState; -import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityChest; @@ -25,7 +31,7 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -public class ItemChestChanger extends Item +public class ItemChestChanger extends ItemTooltip { public final ChestChangerType type; @@ -33,15 +39,17 @@ public ItemChestChanger(ChestChangerType type) { this.type = type; this.setMaxStackSize(1); - this.setUnlocalizedName("ironchest:" + type.name()); - this.setCreativeTab(CreativeTabs.MISC); + this.setUnlocalizedName("ironchest.chest." + type.name().toLowerCase(Locale.US)); + this.setCreativeTab(ICContent.tabGeneral); } /** * Called when a Block is right-clicked with this Item */ @Override - public EnumActionResult onItemUse(EntityPlayer playerIn, World worldIn, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) + //@formatter:off + public EnumActionResult onItemUseFirst(EntityPlayer playerIn, World worldIn, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ, EnumHand hand) + //@formatter:on { ItemStack itemstack = playerIn.getHeldItem(hand); @@ -59,7 +67,9 @@ public EnumActionResult onItemUse(EntityPlayer playerIn, World worldIn, BlockPos } else { - if (worldIn.getBlockState(pos) != IronChest.ironChestBlock.getStateFromMeta(IronChestType.valueOf(this.type.source.getName().toUpperCase()).ordinal())) + //@formatter:off + if (worldIn.getBlockState(pos) != ICContent.ironChestBlock.getStateFromMeta(IronChestType.valueOf(this.type.source.getName().toUpperCase()).ordinal())) + //@formatter:on { return EnumActionResult.PASS; } @@ -120,7 +130,7 @@ else if (te instanceof TileEntityChest) worldIn.removeTileEntity(pos); worldIn.setBlockToAir(pos); - IBlockState iblockstate = IronChest.ironChestBlock.getDefaultState().withProperty(BlockIronChest.VARIANT_PROP, this.type.target); + IBlockState iblockstate = ICContent.ironChestBlock.getDefaultState().withProperty(BlockIronChest.VARIANT_PROP, this.type.target); worldIn.setTileEntity(pos, newchest); worldIn.setBlockState(pos, iblockstate, 3); diff --git a/src/main/java/cpw/mods/ironchest/ItemIronChest.java b/src/main/java/cpw/mods/ironchest/common/items/chest/ItemIronChest.java old mode 100755 new mode 100644 similarity index 78% rename from src/main/java/cpw/mods/ironchest/ItemIronChest.java rename to src/main/java/cpw/mods/ironchest/common/items/chest/ItemIronChest.java index f53d61c7..c4850477 --- a/src/main/java/cpw/mods/ironchest/ItemIronChest.java +++ b/src/main/java/cpw/mods/ironchest/common/items/chest/ItemIronChest.java @@ -8,8 +8,12 @@ * Contributors: * cpw - initial API and implementation ******************************************************************************/ -package cpw.mods.ironchest; +package cpw.mods.ironchest.common.items.chest; +import java.util.Locale; + +import cpw.mods.ironchest.IronChest; +import cpw.mods.ironchest.common.blocks.chest.IronChestType; import net.minecraft.block.Block; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; @@ -20,8 +24,8 @@ public class ItemIronChest extends ItemBlock public ItemIronChest(Block block) { super(block); - this.setRegistryName(new ResourceLocation(IronChest.MOD_ID, "iron_chest")); + this.setRegistryName(new ResourceLocation(IronChest.MOD_ID, "iron_chest")); this.setMaxDamage(0); this.setHasSubtypes(true); } @@ -35,6 +39,6 @@ public int getMetadata(int meta) @Override public String getUnlocalizedName(ItemStack itemstack) { - return "tile.ironchest:" + IronChestType.VALUES[itemstack.getMetadata()].name(); + return "tile.ironchest.chest." + IronChestType.VALUES[itemstack.getMetadata()].name().toLowerCase(Locale.US); } } diff --git a/src/main/java/cpw/mods/ironchest/common/items/shulker/ItemIronShulkerBox.java b/src/main/java/cpw/mods/ironchest/common/items/shulker/ItemIronShulkerBox.java new file mode 100644 index 00000000..d33a2a9b --- /dev/null +++ b/src/main/java/cpw/mods/ironchest/common/items/shulker/ItemIronShulkerBox.java @@ -0,0 +1,49 @@ +/******************************************************************************* + * 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 cpw.mods.ironchest.common.items.shulker; + +import java.util.Locale; + +import cpw.mods.ironchest.IronChest; +import cpw.mods.ironchest.common.blocks.shulker.IronShulkerBoxType; +import net.minecraft.block.Block; +import net.minecraft.item.EnumDyeColor; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; + +public class ItemIronShulkerBox extends ItemBlock +{ + private final String colorName; + + public ItemIronShulkerBox(Block block, EnumDyeColor colorIn) + { + super(block); + + this.setRegistryName(new ResourceLocation(IronChest.MOD_ID, "iron_shulker_box_" + colorIn.getName())); + this.setMaxDamage(0); + this.setHasSubtypes(true); + this.setMaxStackSize(1); + this.colorName = colorIn.getName(); + } + + @Override + public int getMetadata(int meta) + { + return meta; + } + + @Override + public String getUnlocalizedName(ItemStack itemstack) + { + return "tile.ironchest.shulker_box." + IronShulkerBoxType.VALUES[itemstack.getMetadata()].name().toLowerCase(Locale.US) + "." + this.colorName; + } +} \ No newline at end of file diff --git a/src/main/java/cpw/mods/ironchest/common/items/shulker/ItemShulkerBoxChanger.java b/src/main/java/cpw/mods/ironchest/common/items/shulker/ItemShulkerBoxChanger.java new file mode 100644 index 00000000..1d3c3885 --- /dev/null +++ b/src/main/java/cpw/mods/ironchest/common/items/shulker/ItemShulkerBoxChanger.java @@ -0,0 +1,213 @@ +/******************************************************************************* + * 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 cpw.mods.ironchest.common.items.shulker; + +import java.util.Locale; + +import cpw.mods.ironchest.common.ICContent; +import cpw.mods.ironchest.common.blocks.shulker.BlockIronShulkerBox; +import cpw.mods.ironchest.common.blocks.shulker.IronShulkerBoxType; +import cpw.mods.ironchest.common.items.ShulkerBoxChangerType; +import cpw.mods.ironchest.common.tileentity.shulker.TileEntityIronShulkerBox; +import cpw.mods.ironchest.common.util.ItemTooltip; +import net.minecraft.block.Block; +import net.minecraft.block.BlockShulkerBox; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.EnumDyeColor; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityShulkerBox; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.NonNullList; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; + +public class ItemShulkerBoxChanger extends ItemTooltip +{ + public final ShulkerBoxChangerType type; + + public ItemShulkerBoxChanger(ShulkerBoxChangerType type) + { + this.type = type; + + this.setMaxStackSize(1); + this.setUnlocalizedName("ironchest.shulker_box." + type.name().toLowerCase(Locale.US)); + this.setCreativeTab(ICContent.tabGeneral); + } + + public EnumDyeColor getColorFromTileEntity(TileEntity te, World worldIn) + { + if (te != null) + { + if (te instanceof TileEntityIronShulkerBox) + { + TileEntityIronShulkerBox ironShulkerBox = (TileEntityIronShulkerBox) te; + + Block ironShulkerBoxBlock = worldIn.getBlockState(ironShulkerBox.getPos()).getBlock(); + + for (int i = 0; i < ICContent.SHULKER_BLOCKS.size(); i++) + { + if (ICContent.SHULKER_BLOCKS.get(i) == ironShulkerBoxBlock) + { + return ICContent.VANILLA_SHULKER_COLORS.get(i); + } + } + } + else if (te instanceof TileEntityShulkerBox) + { + TileEntityShulkerBox shulkerBox = (TileEntityShulkerBox) te; + + Block shulkerBoxBlock = worldIn.getBlockState(shulkerBox.getPos()).getBlock(); + + for (int i = 0; i < ICContent.VANILLA_SHULKER_BLOCKS.size(); i++) + { + if (ICContent.VANILLA_SHULKER_BLOCKS.get(i) == shulkerBoxBlock) + { + return ICContent.VANILLA_SHULKER_COLORS.get(i); + } + } + } + } + + return EnumDyeColor.PURPLE; + } + + /** + * Called when a Block is right-clicked with this Item + */ + @Override + //@formatter:off + public EnumActionResult onItemUseFirst(EntityPlayer playerIn, World worldIn, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ, EnumHand hand) + //@formatter:on + { + ItemStack itemstack = playerIn.getHeldItem(hand); + + if (worldIn.isRemote) + { + return EnumActionResult.PASS; + } + + if (this.type.canUpgrade(IronShulkerBoxType.VANILLA)) + { + if (!(worldIn.getBlockState(pos).getBlock() instanceof BlockShulkerBox)) + { + return EnumActionResult.PASS; + } + } + else + { + if ((worldIn.getBlockState(pos).getBlock() instanceof BlockIronShulkerBox)) + { + //@formatter:off + if (worldIn.getBlockState(pos) != ((BlockIronShulkerBox) worldIn.getBlockState(pos).getBlock()).getStateFromMeta(IronShulkerBoxType.valueOf(this.type.source.getName().toUpperCase()).ordinal())) + //@formatter:on + { + return EnumActionResult.PASS; + } + } + else + { + return EnumActionResult.PASS; + } + } + + TileEntity te = worldIn.getTileEntity(pos); + + TileEntityIronShulkerBox newShulkerBox = new TileEntityIronShulkerBox(); + + NonNullList shulkerBoxContents = NonNullList. withSize(27, ItemStack.EMPTY); + EnumFacing shulkerBoxFacing = EnumFacing.UP; + EnumDyeColor shulkerBoxColor = EnumDyeColor.PURPLE; + + if (te != null) + { + if (te instanceof TileEntityIronShulkerBox) + { + shulkerBoxContents = ((TileEntityIronShulkerBox) te).getItems(); + shulkerBoxFacing = ((TileEntityIronShulkerBox) te).getFacing(); + shulkerBoxColor = getColorFromTileEntity(te, worldIn); + ((TileEntityIronShulkerBox) te).setHasBeenUpgraded(); + + newShulkerBox = this.type.target.makeEntity(shulkerBoxColor); + + if (newShulkerBox == null) + { + return EnumActionResult.PASS; + } + } + else if (te instanceof TileEntityShulkerBox) + { + IBlockState shulkerBoxState = worldIn.getBlockState(pos); + shulkerBoxFacing = shulkerBoxState.getValue(BlockShulkerBox.FACING); + TileEntityShulkerBox shulkerBox = (TileEntityShulkerBox) te; + + if (!this.type.canUpgrade(IronShulkerBoxType.VANILLA)) + { + return EnumActionResult.PASS; + } + + shulkerBoxContents = NonNullList. withSize(shulkerBox.getSizeInventory(), ItemStack.EMPTY); + + for (int i = 0; i < shulkerBoxContents.size(); i++) + { + shulkerBoxContents.set(i, shulkerBox.getStackInSlot(i)); + } + + shulkerBoxColor = getColorFromTileEntity(te, worldIn); + + shulkerBox.clear(); + shulkerBox.setDestroyedByCreativePlayer(true); + + newShulkerBox = this.type.target.makeEntity(shulkerBoxColor); + } + } + + te.updateContainingBlockInfo(); + + worldIn.setBlockToAir(pos); + + IBlockState iblockstate = null; + + if (ICContent.SHULKER_BLOCKS.get(shulkerBoxColor.getMetadata()) != null) + { + Block block = ICContent.SHULKER_BLOCKS.get(shulkerBoxColor.getMetadata()); + + iblockstate = block.getDefaultState().withProperty(BlockIronShulkerBox.VARIANT_PROP, this.type.target); + } + else + { + return EnumActionResult.PASS; + } + + worldIn.setTileEntity(pos, newShulkerBox); + worldIn.setBlockState(pos, iblockstate, 3); + + worldIn.notifyBlockUpdate(pos, iblockstate, iblockstate, 3); + + TileEntity te2 = worldIn.getTileEntity(pos); + + if (te2 instanceof TileEntityIronShulkerBox) + { + ((TileEntityIronShulkerBox) te2).setContents(shulkerBoxContents); + ((TileEntityIronShulkerBox) te2).setFacing(shulkerBoxFacing); + } + + if (!playerIn.capabilities.isCreativeMode) + { + itemstack.shrink(1); + } + + return EnumActionResult.SUCCESS; + } +} diff --git a/src/main/java/cpw/mods/ironchest/common/network/MessageCrystalChestSync.java b/src/main/java/cpw/mods/ironchest/common/network/MessageCrystalChestSync.java new file mode 100644 index 00000000..2772cea8 --- /dev/null +++ b/src/main/java/cpw/mods/ironchest/common/network/MessageCrystalChestSync.java @@ -0,0 +1,93 @@ +/******************************************************************************* + * 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 cpw.mods.ironchest.common.network; + +import cpw.mods.ironchest.IronChest; +import cpw.mods.ironchest.common.tileentity.chest.TileEntityIronChest; +import io.netty.buffer.ByteBuf; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.NonNullList; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraftforge.fml.common.network.ByteBufUtils; +import net.minecraftforge.fml.common.network.simpleimpl.IMessage; +import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler; +import net.minecraftforge.fml.common.network.simpleimpl.MessageContext; + +public class MessageCrystalChestSync implements IMessage +{ + int dimension; + BlockPos pos; + private NonNullList topStacks; + + public MessageCrystalChestSync(TileEntityIronChest tile, NonNullList stack) + { + this.dimension = tile.getWorld().provider.getDimension(); + this.pos = tile.getPos(); + this.topStacks = stack; + } + + public MessageCrystalChestSync() + { + } + + @Override + public void fromBytes(ByteBuf buf) + { + this.dimension = buf.readInt(); + this.pos = new BlockPos(buf.readInt(), buf.readInt(), buf.readInt()); + + int size = buf.readInt(); + this.topStacks = NonNullList. withSize(size, ItemStack.EMPTY); + + for (int i = 0; i < size; i++) + { + ItemStack itemstack = ByteBufUtils.readItemStack(buf); + + this.topStacks.set(i, itemstack); + } + } + + @Override + public void toBytes(ByteBuf buf) + { + buf.writeInt(this.dimension); + buf.writeInt(this.pos.getX()); + buf.writeInt(this.pos.getY()); + buf.writeInt(this.pos.getZ()); + buf.writeInt(this.topStacks.size()); + + for (ItemStack stack : this.topStacks) + { + ByteBufUtils.writeItemStack(buf, stack); + } + } + + public static class Handler implements IMessageHandler + { + @Override + public IMessage onMessage(MessageCrystalChestSync message, MessageContext ctx) + { + World world = IronChest.proxy.getClientWorld(); + + if (world != null) + { + TileEntity tile = world.getTileEntity(message.pos); + + if (tile instanceof TileEntityIronChest) + ((TileEntityIronChest) tile).receiveMessageFromServer(message.topStacks); + } + + return null; + } + } +} \ No newline at end of file diff --git a/src/main/java/cpw/mods/ironchest/common/network/MessageCrystalShulkerSync.java b/src/main/java/cpw/mods/ironchest/common/network/MessageCrystalShulkerSync.java new file mode 100644 index 00000000..bae53acd --- /dev/null +++ b/src/main/java/cpw/mods/ironchest/common/network/MessageCrystalShulkerSync.java @@ -0,0 +1,93 @@ +/******************************************************************************* + * 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 cpw.mods.ironchest.common.network; + +import cpw.mods.ironchest.IronChest; +import cpw.mods.ironchest.common.tileentity.shulker.TileEntityIronShulkerBox; +import io.netty.buffer.ByteBuf; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.NonNullList; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraftforge.fml.common.network.ByteBufUtils; +import net.minecraftforge.fml.common.network.simpleimpl.IMessage; +import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler; +import net.minecraftforge.fml.common.network.simpleimpl.MessageContext; + +public class MessageCrystalShulkerSync implements IMessage +{ + int dimension; + BlockPos pos; + private NonNullList topStacks; + + public MessageCrystalShulkerSync(TileEntityIronShulkerBox tile, NonNullList stack) + { + this.dimension = tile.getWorld().provider.getDimension(); + this.pos = tile.getPos(); + this.topStacks = stack; + } + + public MessageCrystalShulkerSync() + { + } + + @Override + public void fromBytes(ByteBuf buf) + { + this.dimension = buf.readInt(); + this.pos = new BlockPos(buf.readInt(), buf.readInt(), buf.readInt()); + + int size = buf.readInt(); + this.topStacks = NonNullList. withSize(size, ItemStack.EMPTY); + + for (int i = 0; i < size; i++) + { + ItemStack itemstack = ByteBufUtils.readItemStack(buf); + + this.topStacks.set(i, itemstack); + } + } + + @Override + public void toBytes(ByteBuf buf) + { + buf.writeInt(this.dimension); + buf.writeInt(this.pos.getX()); + buf.writeInt(this.pos.getY()); + buf.writeInt(this.pos.getZ()); + buf.writeInt(this.topStacks.size()); + + for (ItemStack stack : this.topStacks) + { + ByteBufUtils.writeItemStack(buf, stack); + } + } + + public static class Handler implements IMessageHandler + { + @Override + public IMessage onMessage(MessageCrystalShulkerSync message, MessageContext ctx) + { + World world = IronChest.proxy.getClientWorld(); + + if (world != null) + { + TileEntity tile = world.getTileEntity(message.pos); + + if (tile instanceof TileEntityIronShulkerBox) + ((TileEntityIronShulkerBox) tile).receiveMessageFromServer(message.topStacks); + } + + return null; + } + } +} \ No newline at end of file diff --git a/src/main/java/cpw/mods/ironchest/TileEntityCopperChest.java b/src/main/java/cpw/mods/ironchest/common/tileentity/chest/TileEntityCopperChest.java old mode 100755 new mode 100644 similarity index 84% rename from src/main/java/cpw/mods/ironchest/TileEntityCopperChest.java rename to src/main/java/cpw/mods/ironchest/common/tileentity/chest/TileEntityCopperChest.java index f3929efc..59e30f51 --- a/src/main/java/cpw/mods/ironchest/TileEntityCopperChest.java +++ b/src/main/java/cpw/mods/ironchest/common/tileentity/chest/TileEntityCopperChest.java @@ -8,7 +8,9 @@ * Contributors: * cpw - initial API and implementation ******************************************************************************/ -package cpw.mods.ironchest; +package cpw.mods.ironchest.common.tileentity.chest; + +import cpw.mods.ironchest.common.blocks.chest.IronChestType; public class TileEntityCopperChest extends TileEntityIronChest { diff --git a/src/main/java/cpw/mods/ironchest/TileEntityCrystalChest.java b/src/main/java/cpw/mods/ironchest/common/tileentity/chest/TileEntityCrystalChest.java old mode 100755 new mode 100644 similarity index 84% rename from src/main/java/cpw/mods/ironchest/TileEntityCrystalChest.java rename to src/main/java/cpw/mods/ironchest/common/tileentity/chest/TileEntityCrystalChest.java index 6a652622..e0f333c4 --- a/src/main/java/cpw/mods/ironchest/TileEntityCrystalChest.java +++ b/src/main/java/cpw/mods/ironchest/common/tileentity/chest/TileEntityCrystalChest.java @@ -8,7 +8,9 @@ * Contributors: * cpw - initial API and implementation ******************************************************************************/ -package cpw.mods.ironchest; +package cpw.mods.ironchest.common.tileentity.chest; + +import cpw.mods.ironchest.common.blocks.chest.IronChestType; public class TileEntityCrystalChest extends TileEntityIronChest { diff --git a/src/main/java/cpw/mods/ironchest/TileEntityDiamondChest.java b/src/main/java/cpw/mods/ironchest/common/tileentity/chest/TileEntityDiamondChest.java old mode 100755 new mode 100644 similarity index 84% rename from src/main/java/cpw/mods/ironchest/TileEntityDiamondChest.java rename to src/main/java/cpw/mods/ironchest/common/tileentity/chest/TileEntityDiamondChest.java index f81ab571..3adf7edd --- a/src/main/java/cpw/mods/ironchest/TileEntityDiamondChest.java +++ b/src/main/java/cpw/mods/ironchest/common/tileentity/chest/TileEntityDiamondChest.java @@ -8,7 +8,9 @@ * Contributors: * cpw - initial API and implementation ******************************************************************************/ -package cpw.mods.ironchest; +package cpw.mods.ironchest.common.tileentity.chest; + +import cpw.mods.ironchest.common.blocks.chest.IronChestType; public class TileEntityDiamondChest extends TileEntityIronChest { diff --git a/src/main/java/cpw/mods/ironchest/TileEntityDirtChest.java b/src/main/java/cpw/mods/ironchest/common/tileentity/chest/TileEntityDirtChest.java old mode 100755 new mode 100644 similarity index 81% rename from src/main/java/cpw/mods/ironchest/TileEntityDirtChest.java rename to src/main/java/cpw/mods/ironchest/common/tileentity/chest/TileEntityDirtChest.java index a6eea6a3..dd802c0d --- a/src/main/java/cpw/mods/ironchest/TileEntityDirtChest.java +++ b/src/main/java/cpw/mods/ironchest/common/tileentity/chest/TileEntityDirtChest.java @@ -1,5 +1,6 @@ -package cpw.mods.ironchest; +package cpw.mods.ironchest.common.tileentity.chest; +import cpw.mods.ironchest.common.blocks.chest.IronChestType; import net.minecraft.entity.EntityLivingBase; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; @@ -15,13 +16,13 @@ public class TileEntityDirtChest extends TileEntityIronChest static { dirtChest9000GuideBook.setTagInfo("author", new NBTTagString("cpw")); - dirtChest9000GuideBook.setTagInfo("title", new NBTTagString(I18n.translateToLocal("book.ironchest:dirtchest9000.title"))); + dirtChest9000GuideBook.setTagInfo("title", new NBTTagString(I18n.translateToLocal("book.ironchest.dirtchest9000.title"))); NBTTagList pages = new NBTTagList(); - pages.appendTag(new NBTTagString(I18n.translateToLocal("book.ironchest:dirtchest9000.page1"))); - pages.appendTag(new NBTTagString(I18n.translateToLocal("book.ironchest:dirtchest9000.page2"))); - pages.appendTag(new NBTTagString(I18n.translateToLocal("book.ironchest:dirtchest9000.page3"))); - pages.appendTag(new NBTTagString(I18n.translateToLocal("book.ironchest:dirtchest9000.page4"))); - pages.appendTag(new NBTTagString(I18n.translateToLocal("book.ironchest:dirtchest9000.page5"))); + pages.appendTag(new NBTTagString(I18n.translateToLocal("book.ironchest.dirtchest9000.page1"))); + pages.appendTag(new NBTTagString(I18n.translateToLocal("book.ironchest.dirtchest9000.page2"))); + pages.appendTag(new NBTTagString(I18n.translateToLocal("book.ironchest.dirtchest9000.page3"))); + pages.appendTag(new NBTTagString(I18n.translateToLocal("book.ironchest.dirtchest9000.page4"))); + pages.appendTag(new NBTTagString(I18n.translateToLocal("book.ironchest.dirtchest9000.page5"))); dirtChest9000GuideBook.setTagInfo("pages", pages); } diff --git a/src/main/java/cpw/mods/ironchest/TileEntityGoldChest.java b/src/main/java/cpw/mods/ironchest/common/tileentity/chest/TileEntityGoldChest.java old mode 100755 new mode 100644 similarity index 84% rename from src/main/java/cpw/mods/ironchest/TileEntityGoldChest.java rename to src/main/java/cpw/mods/ironchest/common/tileentity/chest/TileEntityGoldChest.java index 16776ed5..d6f0e792 --- a/src/main/java/cpw/mods/ironchest/TileEntityGoldChest.java +++ b/src/main/java/cpw/mods/ironchest/common/tileentity/chest/TileEntityGoldChest.java @@ -8,7 +8,9 @@ * Contributors: * cpw - initial API and implementation ******************************************************************************/ -package cpw.mods.ironchest; +package cpw.mods.ironchest.common.tileentity.chest; + +import cpw.mods.ironchest.common.blocks.chest.IronChestType; public class TileEntityGoldChest extends TileEntityIronChest { diff --git a/src/main/java/cpw/mods/ironchest/TileEntityIronChest.java b/src/main/java/cpw/mods/ironchest/common/tileentity/chest/TileEntityIronChest.java old mode 100755 new mode 100644 similarity index 88% rename from src/main/java/cpw/mods/ironchest/TileEntityIronChest.java rename to src/main/java/cpw/mods/ironchest/common/tileentity/chest/TileEntityIronChest.java index 0ef935be..69b8e030 --- a/src/main/java/cpw/mods/ironchest/TileEntityIronChest.java +++ b/src/main/java/cpw/mods/ironchest/common/tileentity/chest/TileEntityIronChest.java @@ -8,11 +8,17 @@ * Contributors: * cpw - initial API and implementation ******************************************************************************/ -package cpw.mods.ironchest; +package cpw.mods.ironchest.common.tileentity.chest; import java.util.Collections; import java.util.Comparator; +import cpw.mods.ironchest.IronChest; +import cpw.mods.ironchest.common.ICContent; +import cpw.mods.ironchest.common.blocks.chest.BlockIronChest; +import cpw.mods.ironchest.common.blocks.chest.IronChestType; +import cpw.mods.ironchest.common.gui.chest.ContainerIronChest; +import cpw.mods.ironchest.common.network.MessageCrystalChestSync; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; @@ -31,13 +37,14 @@ import net.minecraft.util.SoundCategory; import net.minecraft.util.math.AxisAlignedBB; import net.minecraftforge.common.util.Constants; +import net.minecraftforge.fml.common.network.NetworkRegistry.TargetPoint; public class TileEntityIronChest extends TileEntityLockableLoot implements ITickable { /** Chest Contents */ public NonNullList chestContents; - /** Crystal chest top stacks */ + /** Crystal Chest top stacks */ private NonNullList topStacks; /** The current angle of the lid (between 0 and 1) */ @@ -113,7 +120,7 @@ public IronChestType getType() { IBlockState state = this.world.getBlockState(this.pos); - if (state.getBlock() == IronChest.ironChestBlock) + if (state.getBlock() == ICContent.ironChestBlock) { type = state.getValue(BlockIronChest.VARIANT_PROP); } @@ -163,7 +170,7 @@ protected void sortTopStacks() { ItemStack tempCopyStack = tempCopy.get(j); - if (ItemStack.areItemsEqual(tempCopyStack, itemStack)) + if (ItemStack.areItemsEqualIgnoreDurability(tempCopyStack, itemStack)) { if (itemStack.getCount() != tempCopyStack.getCount()) { @@ -250,6 +257,8 @@ else if (stack2.isEmpty()) this.world.notifyBlockUpdate(this.pos, iblockstate, iblockstate, 3); } + + sendTopStacksPacket(); } @Override @@ -338,15 +347,17 @@ public boolean isUsableByPlayer(EntityPlayer player) public void update() { // Resynchronizes clients with the server state - if (this.world != null && !this.world.isRemote && this.numPlayersUsing != 0 - && (this.ticksSinceSync + this.pos.getX() + this.pos.getY() + this.pos.getZ()) % 200 == 0) + //@formatter:off + if (this.world != null && !this.world.isRemote && this.numPlayersUsing != 0 && (this.ticksSinceSync + this.pos.getX() + this.pos.getY() + this.pos.getZ()) % 200 == 0) + //@formatter:on { this.numPlayersUsing = 0; float f = 5.0F; - for (EntityPlayer player : this.world.getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(this.pos.getX() - f, this.pos.getY() - f, - this.pos.getZ() - f, this.pos.getX() + 1 + f, this.pos.getY() + 1 + f, this.pos.getZ() + 1 + f))) + //@formatter:off + for (EntityPlayer player : this.world.getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(this.pos.getX() - f, this.pos.getY() - f, this.pos.getZ() - f, this.pos.getX() + 1 + f, this.pos.getY() + 1 + f, this.pos.getZ() + 1 + f))) + //@formatter:on { if (player.openContainer instanceof ContainerIronChest) { @@ -357,7 +368,7 @@ public void update() if (this.world != null && !this.world.isRemote && this.ticksSinceSync < 0) { - this.world.addBlockEvent(this.pos, IronChest.ironChestBlock, 3, ((this.numPlayersUsing << 3) & 0xF8) | (this.facing.ordinal() & 0x7)); + this.world.addBlockEvent(this.pos, ICContent.ironChestBlock, 3, ((this.numPlayersUsing << 3) & 0xF8) | (this.facing.ordinal() & 0x7)); } if (!this.world.isRemote && this.inventoryTouched) @@ -455,9 +466,9 @@ public void openInventory(EntityPlayer player) ++this.numPlayersUsing; - this.world.addBlockEvent(this.pos, IronChest.ironChestBlock, 1, this.numPlayersUsing); - this.world.notifyNeighborsOfStateChange(this.pos, IronChest.ironChestBlock, false); - this.world.notifyNeighborsOfStateChange(this.pos.down(), IronChest.ironChestBlock, false); + this.world.addBlockEvent(this.pos, ICContent.ironChestBlock, 1, this.numPlayersUsing); + this.world.notifyNeighborsOfStateChange(this.pos, ICContent.ironChestBlock, false); + this.world.notifyNeighborsOfStateChange(this.pos.down(), ICContent.ironChestBlock, false); } } @@ -473,9 +484,9 @@ public void closeInventory(EntityPlayer player) --this.numPlayersUsing; - this.world.addBlockEvent(this.pos, IronChest.ironChestBlock, 1, this.numPlayersUsing); - this.world.notifyNeighborsOfStateChange(this.pos, IronChest.ironChestBlock, false); - this.world.notifyNeighborsOfStateChange(this.pos.down(), IronChest.ironChestBlock, false); + this.world.addBlockEvent(this.pos, ICContent.ironChestBlock, 1, this.numPlayersUsing); + this.world.notifyNeighborsOfStateChange(this.pos, ICContent.ironChestBlock, false); + this.world.notifyNeighborsOfStateChange(this.pos.down(), ICContent.ironChestBlock, false); } } @@ -491,10 +502,6 @@ public SPacketUpdateTileEntity getUpdatePacket() compound.setByte("facing", (byte) this.facing.ordinal()); - NonNullList stacks = this.buildItemStackDataList(); - - ItemStackHelper.saveAllItems(compound, stacks); - return new SPacketUpdateTileEntity(this.pos, 0, compound); } @@ -506,29 +513,6 @@ public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt) NBTTagCompound compound = pkt.getNbtCompound(); this.facing = EnumFacing.VALUES[compound.getByte("facing")]; - - NonNullList stacks = NonNullList. withSize(this.getTopItems().size(), ItemStack.EMPTY); - - ItemStackHelper.loadAllItems(compound, stacks); - - if (this.getType().isTransparent()) - { - int pos = 0; - - for (int i = 0; i < this.getTopItems().size(); i++) - { - if (!stacks.get(pos).isEmpty()) - { - this.getTopItems().set(i, stacks.get(pos)); - } - else - { - this.getTopItems().set(i, ItemStack.EMPTY); - } - - pos++; - } - } } } @@ -570,7 +554,7 @@ public void rotateAround() { this.setFacing(this.facing.rotateY()); - this.world.addBlockEvent(this.pos, IronChest.ironChestBlock, 2, this.facing.ordinal()); + this.world.addBlockEvent(this.pos, ICContent.ironChestBlock, 2, this.facing.ordinal()); } public void wasPlaced(EntityLivingBase entityliving, ItemStack stack) @@ -592,7 +576,7 @@ public Container createContainer(InventoryPlayer playerInventory, EntityPlayer p @Override public String getGuiID() { - return "IronChest:" + this.getType().name(); + return "IronChest:" + this.getType().name() + "_chest"; } @Override @@ -608,7 +592,7 @@ public NBTTagCompound getUpdateTag() } @Override - protected NonNullList getItems() + public NonNullList getItems() { return this.chestContents; } @@ -631,4 +615,17 @@ public boolean isEmpty() return true; } + + protected void sendTopStacksPacket() + { + NonNullList stacks = this.buildItemStackDataList(); + //@formatter:off + IronChest.packetHandler.sendToAllAround(new MessageCrystalChestSync(this, stacks), new TargetPoint(world.provider.getDimension(), getPos().getX(), getPos().getY(), getPos().getZ(), 128)); + //@formatter:on + } + + public void receiveMessageFromServer(NonNullList topStacks) + { + this.topStacks = topStacks; + } } diff --git a/src/main/java/cpw/mods/ironchest/TileEntityObsidianChest.java b/src/main/java/cpw/mods/ironchest/common/tileentity/chest/TileEntityObsidianChest.java old mode 100755 new mode 100644 similarity index 58% rename from src/main/java/cpw/mods/ironchest/TileEntityObsidianChest.java rename to src/main/java/cpw/mods/ironchest/common/tileentity/chest/TileEntityObsidianChest.java index db21645c..0a878416 --- a/src/main/java/cpw/mods/ironchest/TileEntityObsidianChest.java +++ b/src/main/java/cpw/mods/ironchest/common/tileentity/chest/TileEntityObsidianChest.java @@ -1,4 +1,6 @@ -package cpw.mods.ironchest; +package cpw.mods.ironchest.common.tileentity.chest; + +import cpw.mods.ironchest.common.blocks.chest.IronChestType; public class TileEntityObsidianChest extends TileEntityIronChest { diff --git a/src/main/java/cpw/mods/ironchest/TileEntitySilverChest.java b/src/main/java/cpw/mods/ironchest/common/tileentity/chest/TileEntitySilverChest.java old mode 100755 new mode 100644 similarity index 84% rename from src/main/java/cpw/mods/ironchest/TileEntitySilverChest.java rename to src/main/java/cpw/mods/ironchest/common/tileentity/chest/TileEntitySilverChest.java index 17691862..9da06a60 --- a/src/main/java/cpw/mods/ironchest/TileEntitySilverChest.java +++ b/src/main/java/cpw/mods/ironchest/common/tileentity/chest/TileEntitySilverChest.java @@ -8,7 +8,9 @@ * Contributors: * cpw - initial API and implementation ******************************************************************************/ -package cpw.mods.ironchest; +package cpw.mods.ironchest.common.tileentity.chest; + +import cpw.mods.ironchest.common.blocks.chest.IronChestType; public class TileEntitySilverChest extends TileEntityIronChest { diff --git a/src/main/java/cpw/mods/ironchest/common/tileentity/shulker/TileEntityCopperShulkerBox.java b/src/main/java/cpw/mods/ironchest/common/tileentity/shulker/TileEntityCopperShulkerBox.java new file mode 100644 index 00000000..a70e3a00 --- /dev/null +++ b/src/main/java/cpw/mods/ironchest/common/tileentity/shulker/TileEntityCopperShulkerBox.java @@ -0,0 +1,29 @@ +/******************************************************************************* + * 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 cpw.mods.ironchest.common.tileentity.shulker; + +import javax.annotation.Nullable; + +import cpw.mods.ironchest.common.blocks.shulker.IronShulkerBoxType; +import net.minecraft.item.EnumDyeColor; + +public class TileEntityCopperShulkerBox extends TileEntityIronShulkerBox +{ + public TileEntityCopperShulkerBox() + { + this(null); + } + + public TileEntityCopperShulkerBox(@Nullable EnumDyeColor colorIn) + { + super(colorIn, IronShulkerBoxType.COPPER); + } +} diff --git a/src/main/java/cpw/mods/ironchest/common/tileentity/shulker/TileEntityCrystalShulkerBox.java b/src/main/java/cpw/mods/ironchest/common/tileentity/shulker/TileEntityCrystalShulkerBox.java new file mode 100644 index 00000000..066b5717 --- /dev/null +++ b/src/main/java/cpw/mods/ironchest/common/tileentity/shulker/TileEntityCrystalShulkerBox.java @@ -0,0 +1,29 @@ +/******************************************************************************* + * 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 cpw.mods.ironchest.common.tileentity.shulker; + +import javax.annotation.Nullable; + +import cpw.mods.ironchest.common.blocks.shulker.IronShulkerBoxType; +import net.minecraft.item.EnumDyeColor; + +public class TileEntityCrystalShulkerBox extends TileEntityIronShulkerBox +{ + public TileEntityCrystalShulkerBox() + { + this(null); + } + + public TileEntityCrystalShulkerBox(@Nullable EnumDyeColor colorIn) + { + super(colorIn, IronShulkerBoxType.CRYSTAL); + } +} diff --git a/src/main/java/cpw/mods/ironchest/common/tileentity/shulker/TileEntityDiamondShulkerBox.java b/src/main/java/cpw/mods/ironchest/common/tileentity/shulker/TileEntityDiamondShulkerBox.java new file mode 100644 index 00000000..b8b5915a --- /dev/null +++ b/src/main/java/cpw/mods/ironchest/common/tileentity/shulker/TileEntityDiamondShulkerBox.java @@ -0,0 +1,29 @@ +/******************************************************************************* + * 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 cpw.mods.ironchest.common.tileentity.shulker; + +import javax.annotation.Nullable; + +import cpw.mods.ironchest.common.blocks.shulker.IronShulkerBoxType; +import net.minecraft.item.EnumDyeColor; + +public class TileEntityDiamondShulkerBox extends TileEntityIronShulkerBox +{ + public TileEntityDiamondShulkerBox() + { + this(null); + } + + public TileEntityDiamondShulkerBox(@Nullable EnumDyeColor colorIn) + { + super(colorIn, IronShulkerBoxType.DIAMOND); + } +} diff --git a/src/main/java/cpw/mods/ironchest/common/tileentity/shulker/TileEntityGoldShulkerBox.java b/src/main/java/cpw/mods/ironchest/common/tileentity/shulker/TileEntityGoldShulkerBox.java new file mode 100644 index 00000000..51c874ad --- /dev/null +++ b/src/main/java/cpw/mods/ironchest/common/tileentity/shulker/TileEntityGoldShulkerBox.java @@ -0,0 +1,29 @@ +/******************************************************************************* + * 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 cpw.mods.ironchest.common.tileentity.shulker; + +import javax.annotation.Nullable; + +import cpw.mods.ironchest.common.blocks.shulker.IronShulkerBoxType; +import net.minecraft.item.EnumDyeColor; + +public class TileEntityGoldShulkerBox extends TileEntityIronShulkerBox +{ + public TileEntityGoldShulkerBox() + { + this(null); + } + + public TileEntityGoldShulkerBox(@Nullable EnumDyeColor colorIn) + { + super(colorIn, IronShulkerBoxType.GOLD); + } +} diff --git a/src/main/java/cpw/mods/ironchest/common/tileentity/shulker/TileEntityIronShulkerBox.java b/src/main/java/cpw/mods/ironchest/common/tileentity/shulker/TileEntityIronShulkerBox.java new file mode 100644 index 00000000..51db8298 --- /dev/null +++ b/src/main/java/cpw/mods/ironchest/common/tileentity/shulker/TileEntityIronShulkerBox.java @@ -0,0 +1,795 @@ +/******************************************************************************* + * 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 cpw.mods.ironchest.common.tileentity.shulker; + +import java.util.Collections; +import java.util.Comparator; +import java.util.List; + +import javax.annotation.Nullable; + +import cpw.mods.ironchest.IronChest; +import cpw.mods.ironchest.common.blocks.shulker.BlockIronShulkerBox; +import cpw.mods.ironchest.common.blocks.shulker.IronShulkerBoxType; +import cpw.mods.ironchest.common.gui.shulker.ContainerIronShulkerBox; +import cpw.mods.ironchest.common.network.MessageCrystalShulkerSync; +import net.minecraft.block.Block; +import net.minecraft.block.BlockShulkerBox; +import net.minecraft.block.material.EnumPushReaction; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.Entity; +import net.minecraft.entity.MoverType; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.init.SoundEvents; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.ISidedInventory; +import net.minecraft.inventory.ItemStackHelper; +import net.minecraft.item.EnumDyeColor; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.play.server.SPacketUpdateTileEntity; +import net.minecraft.tileentity.TileEntityLockableLoot; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.ITickable; +import net.minecraft.util.NonNullList; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraftforge.fml.common.network.NetworkRegistry.TargetPoint; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + +public class TileEntityIronShulkerBox extends TileEntityLockableLoot implements ITickable, ISidedInventory +{ + private final int[] SLOTS; + + /** Shulker Box Contents */ + private NonNullList items; + + /** Crystal Shulker Boxes top stacks */ + private NonNullList topStacks; + + /** Direction Shulker ox is facing */ + private EnumFacing facing; + + /** If the inventory got touched */ + private boolean inventoryTouched; + + /** Server sync counter (once per 20 ticks) */ + private int ticksSinceSync; + + /** If the inventory had items */ + private boolean hadStuff; + + private boolean hasBeenCleared; + private int openCount; + private AnimationStatus animationStatus; + private float progress; + private float progressOld; + private EnumDyeColor color; + private boolean destroyedByCreativePlayer; + private boolean hasBeenUpgraded; + + /** The Variant of the Shulker Box (Not Color) */ + private IronShulkerBoxType shulkerBoxType; + + public TileEntityIronShulkerBox() + { + this(null); + } + + public TileEntityIronShulkerBox(@Nullable EnumDyeColor colorIn) + { + this(colorIn, IronShulkerBoxType.IRON); + } + + public TileEntityIronShulkerBox(@Nullable EnumDyeColor colorIn, IronShulkerBoxType typeIn) + { + super(); + + this.shulkerBoxType = typeIn; + + this.SLOTS = new int[typeIn.size]; + + this.items = NonNullList. withSize(typeIn.size, ItemStack.EMPTY); + this.topStacks = NonNullList. withSize(8, ItemStack.EMPTY); + + this.animationStatus = AnimationStatus.CLOSED; + this.color = colorIn; + + this.facing = EnumFacing.UP; + + this.hasBeenUpgraded = false; + } + + public void setContents(NonNullList contents) + { + this.items = NonNullList. withSize(this.getType().size, ItemStack.EMPTY); + + for (int i = 0; i < contents.size(); i++) + { + if (i < this.items.size()) + { + this.getItems().set(i, contents.get(i)); + } + } + + this.inventoryTouched = true; + } + + @Override + public int getSizeInventory() + { + return this.getItems().size(); + } + + public EnumFacing getFacing() + { + return this.facing; + } + + public IronShulkerBoxType getType() + { + IronShulkerBoxType type = IronShulkerBoxType.IRON; + + if (this.hasWorld()) + { + IBlockState state = this.world.getBlockState(this.pos); + + if (state.getBlock() instanceof BlockIronShulkerBox) + { + type = state.getValue(BlockIronShulkerBox.VARIANT_PROP); + } + } + + return type; + } + + @Override + public ItemStack getStackInSlot(int index) + { + this.fillWithLoot((EntityPlayer) null); + + this.inventoryTouched = true; + + return this.getItems().get(index); + } + + @Override + public void markDirty() + { + super.markDirty(); + + this.sortTopStacks(); + } + + protected void sortTopStacks() + { + if (!this.getType().isTransparent() || (this.world != null && this.world.isRemote)) + { + return; + } + + NonNullList tempCopy = NonNullList. withSize(this.getSizeInventory(), ItemStack.EMPTY); + + boolean hasStuff = false; + + int compressedIdx = 0; + + mainLoop: for (int i = 0; i < this.getSizeInventory(); i++) + { + ItemStack itemStack = this.getItems().get(i); + + if (!itemStack.isEmpty()) + { + for (int j = 0; j < compressedIdx; j++) + { + ItemStack tempCopyStack = tempCopy.get(j); + + if (ItemStack.areItemsEqualIgnoreDurability(tempCopyStack, itemStack)) + { + if (itemStack.getCount() != tempCopyStack.getCount()) + { + tempCopyStack.grow(itemStack.getCount()); + } + + continue mainLoop; + } + } + + tempCopy.set(compressedIdx, itemStack.copy()); + + compressedIdx++; + + hasStuff = true; + } + } + + if (!hasStuff && this.hadStuff) + { + this.hadStuff = false; + + for (int i = 0; i < this.getTopItems().size(); i++) + { + this.getTopItems().set(i, ItemStack.EMPTY); + } + + return; + } + + this.hadStuff = true; + + Collections.sort(tempCopy, new Comparator() { + @Override + public int compare(ItemStack stack1, ItemStack stack2) + { + if (stack1.isEmpty()) + { + return 1; + } + else if (stack2.isEmpty()) + { + return -1; + } + else + { + return stack2.getCount() - stack1.getCount(); + } + } + }); + + int p = 0; + + for (ItemStack element : tempCopy) + { + if (!element.isEmpty() && element.getCount() > 0) + { + if (p == this.getTopItems().size()) + { + break; + } + + this.getTopItems().set(p, element); + + p++; + } + } + + for (int i = p; i < this.getTopItems().size(); i++) + { + this.getTopItems().set(i, ItemStack.EMPTY); + } + + sendTopStacksPacket(); + } + + /** + * Get the name of this object. For players this returns their username + */ + @Override + public String getName() + { + return this.hasCustomName() ? this.customName : this.getType().name(); + } + + @Override + public void readFromNBT(NBTTagCompound compound) + { + super.readFromNBT(compound); + + this.loadFromNbt(compound); + } + + @Override + public NBTTagCompound writeToNBT(NBTTagCompound compound) + { + super.writeToNBT(compound); + + return this.saveToNbt(compound); + } + + public void loadFromNbt(NBTTagCompound compound) + { + this.items = NonNullList. withSize(this.getSizeInventory(), ItemStack.EMPTY); + + if (!this.checkLootAndRead(compound) && compound.hasKey("Items", 9)) + { + ItemStackHelper.loadAllItems(compound, this.items); + } + + if (compound.hasKey("CustomName", 8)) + { + this.customName = compound.getString("CustomName"); + } + + this.facing = EnumFacing.VALUES[compound.getByte("facing")]; + + this.sortTopStacks(); + } + + public NBTTagCompound saveToNbt(NBTTagCompound compound) + { + if (!this.checkLootAndWrite(compound)) + { + ItemStackHelper.saveAllItems(compound, this.items, false); + } + + compound.setInteger("ShulkerBoxSize", this.getSizeInventory()); + + compound.setByte("facing", (byte) this.facing.ordinal()); + + if (this.hasCustomName()) + { + compound.setString("CustomName", this.customName); + } + + if (!compound.hasKey("Lock") && this.isLocked()) + { + this.getLockCode().toNBT(compound); + } + + return compound; + } + + /** + * Returns the maximum stack size for a inventory slot. Seems to always be 64, possibly will be extended. + */ + @Override + public int getInventoryStackLimit() + { + return 64; + } + + /** + * Like the old updateEntity(), except more generic. + */ + @Override + public void update() + { + this.updateAnimation(); + + if (this.animationStatus == AnimationStatus.OPENING || this.animationStatus == AnimationStatus.CLOSING) + { + this.moveCollidedEntities(); + } + + if (this.world != null && !this.world.isRemote && this.ticksSinceSync < 0) + { + this.world.addBlockEvent(this.pos, this.getBlockType(), 3, ((this.openCount << 3) & 0xF8) | (this.facing.ordinal() & 0x7)); + } + + if (!this.world.isRemote && this.inventoryTouched) + { + this.inventoryTouched = false; + + this.sortTopStacks(); + } + + this.ticksSinceSync++; + } + + protected void updateAnimation() + { + this.progressOld = this.progress; + + switch (this.animationStatus) + { + case CLOSED: + this.progress = 0.0F; + break; + case OPENING: + this.progress += 0.1F; + + if (this.progress >= 1.0F) + { + this.moveCollidedEntities(); + this.animationStatus = AnimationStatus.OPENED; + this.progress = 1.0F; + } + + break; + case CLOSING: + this.progress -= 0.1F; + + if (this.progress <= 0.0F) + { + this.animationStatus = AnimationStatus.CLOSED; + this.progress = 0.0F; + } + + break; + case OPENED: + this.progress = 1.0F; + } + } + + public AnimationStatus getAnimationStatus() + { + return this.animationStatus; + } + + public AxisAlignedBB getBoundingBox() + { + return this.getBoundingBox(this.getFacing()); + } + + public AxisAlignedBB getBoundingBox(EnumFacing facing) + { + //@formatter:off + return Block.FULL_BLOCK_AABB.addCoord(0.5F * this.getProgress(1.0F) * facing.getFrontOffsetX(), 0.5F * this.getProgress(1.0F) * facing.getFrontOffsetY(), 0.5F * this.getProgress(1.0F) * facing.getFrontOffsetZ()); + //@formatter:on + } + + private AxisAlignedBB getTopBoundingBox(EnumFacing facing) + { + EnumFacing enumfacing = facing.getOpposite(); + + return this.getBoundingBox(facing).contract(enumfacing.getFrontOffsetX(), enumfacing.getFrontOffsetY(), enumfacing.getFrontOffsetZ()); + } + + private void moveCollidedEntities() + { + IBlockState iblockstate = this.world.getBlockState(this.getPos()); + + if (iblockstate.getBlock() instanceof BlockIronShulkerBox) + { + EnumFacing enumfacing = this.getFacing(); + AxisAlignedBB axisalignedbb = this.getTopBoundingBox(enumfacing).offset(this.pos); + List list = this.world.getEntitiesWithinAABBExcludingEntity((Entity) null, axisalignedbb); + + if (!list.isEmpty()) + { + for (int i = 0; i < list.size(); ++i) + { + Entity entity = list.get(i); + + if (entity.getPushReaction() != EnumPushReaction.IGNORE) + { + double d0 = 0.0D; + double d1 = 0.0D; + double d2 = 0.0D; + AxisAlignedBB axisalignedbb1 = entity.getEntityBoundingBox(); + + switch (enumfacing.getAxis()) + { + case X: + + if (enumfacing.getAxisDirection() == EnumFacing.AxisDirection.POSITIVE) + { + d0 = axisalignedbb.maxX - axisalignedbb1.minX; + } + else + { + d0 = axisalignedbb1.maxX - axisalignedbb.minX; + } + + d0 = d0 + 0.01D; + break; + case Y: + + if (enumfacing.getAxisDirection() == EnumFacing.AxisDirection.POSITIVE) + { + d1 = axisalignedbb.maxY - axisalignedbb1.minY; + } + else + { + d1 = axisalignedbb1.maxY - axisalignedbb.minY; + } + + d1 = d1 + 0.01D; + break; + case Z: + + if (enumfacing.getAxisDirection() == EnumFacing.AxisDirection.POSITIVE) + { + d2 = axisalignedbb.maxZ - axisalignedbb1.minZ; + } + else + { + d2 = axisalignedbb1.maxZ - axisalignedbb.minZ; + } + + d2 = d2 + 0.01D; + } + + //@formatter:off + entity.move(MoverType.SHULKER_BOX, d0 * enumfacing.getFrontOffsetX(), d1 * enumfacing.getFrontOffsetY(), d2 * enumfacing.getFrontOffsetZ()); + //@formatter:on + } + } + } + } + } + + @Override + public boolean receiveClientEvent(int id, int type) + { + if (id == 1) + { + this.openCount = type; + + if (type == 0) + { + this.animationStatus = AnimationStatus.CLOSING; + } + + if (type == 1) + { + this.animationStatus = AnimationStatus.OPENING; + } + + return true; + } + else if (id == 2) + { + this.facing = EnumFacing.VALUES[type]; + + return true; + } + else if (id == 3) + { + this.facing = EnumFacing.VALUES[type & 0x7]; + + this.openCount = (type & 0xF8) >> 3; + + return true; + } + else + { + return super.receiveClientEvent(id, type); + } + } + + @Override + public void openInventory(EntityPlayer player) + { + if (!player.isSpectator()) + { + if (this.openCount < 0) + { + this.openCount = 0; + } + + ++this.openCount; + + this.world.addBlockEvent(this.pos, this.getBlockType(), 1, this.openCount); + + if (this.openCount == 1) + { + //@formatter:off + this.world.playSound((EntityPlayer) null, this.pos, SoundEvents.BLOCK_SHULKER_BOX_OPEN, SoundCategory.BLOCKS, 0.5F, this.world.rand.nextFloat() * 0.1F + 0.9F); + //@formatter:on + } + } + } + + @Override + public void closeInventory(EntityPlayer player) + { + if (!player.isSpectator()) + { + --this.openCount; + + this.world.addBlockEvent(this.pos, this.getBlockType(), 1, this.openCount); + + if (this.openCount <= 0) + { + //@formatter:off + this.world.playSound((EntityPlayer) null, this.pos, SoundEvents.BLOCK_SHULKER_BOX_CLOSE, SoundCategory.BLOCKS, 0.5F, this.world.rand.nextFloat() * 0.1F + 0.9F); + //@formatter:on + } + } + } + + public void setFacing(EnumFacing facing) + { + this.facing = facing; + } + + @Override + @Nullable + public SPacketUpdateTileEntity getUpdatePacket() + { + NBTTagCompound compound = new NBTTagCompound(); + + compound.setByte("facing", (byte) this.facing.ordinal()); + + return new SPacketUpdateTileEntity(this.pos, 0, compound); + } + + @Override + public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt) + { + if (pkt.getTileEntityType() == 0) + { + NBTTagCompound compound = pkt.getNbtCompound(); + + this.facing = EnumFacing.VALUES[compound.getByte("facing")]; + } + } + + public NonNullList buildItemStackDataList() + { + if (this.getType().isTransparent()) + { + NonNullList sortList = NonNullList. withSize(this.getTopItems().size(), ItemStack.EMPTY); + + int pos = 0; + + for (ItemStack is : this.topStacks) + { + if (!is.isEmpty()) + { + sortList.set(pos, is); + } + else + { + sortList.set(pos, ItemStack.EMPTY); + } + + pos++; + } + + return sortList; + } + + return NonNullList. withSize(this.getTopItems().size(), ItemStack.EMPTY); + } + + @Override + public Container createContainer(InventoryPlayer playerInventory, EntityPlayer playerIn) + { + this.fillWithLoot(playerIn); + + return new ContainerIronShulkerBox(playerInventory, this, this.shulkerBoxType, this.shulkerBoxType.xSize, this.shulkerBoxType.ySize); + } + + @Override + public String getGuiID() + { + return "IronChest:" + this.getType().name() + "_shulker_box"; + } + + @Override + public boolean canRenderBreaking() + { + return true; + } + + @Override + public NBTTagCompound getUpdateTag() + { + return this.writeToNBT(new NBTTagCompound()); + } + + @Override + public NonNullList getItems() + { + return this.items; + } + + public NonNullList getTopItems() + { + return this.topStacks; + } + + @Override + public boolean isEmpty() + { + for (ItemStack itemstack : this.items) + { + if (!itemstack.isEmpty()) + { + return false; + } + } + + return true; + } + + @Override + public int[] getSlotsForFace(EnumFacing side) + { + return SLOTS; + } + + /** + * Returns true if automation can insert the given item in the given slot from the given side. + */ + @Override + public boolean canInsertItem(int index, ItemStack itemStackIn, EnumFacing direction) + { + //@formatter:off + return !(Block.getBlockFromItem(itemStackIn.getItem()) instanceof BlockIronShulkerBox) && !(Block.getBlockFromItem(itemStackIn.getItem()) instanceof BlockShulkerBox); + //@formatter:on + } + + /** + * Returns true if automation can extract the given item in the given slot from the given side. + */ + @Override + public boolean canExtractItem(int index, ItemStack stack, EnumFacing direction) + { + return true; + } + + @Override + public void clear() + { + this.hasBeenCleared = true; + super.clear(); + } + + public boolean isCleared() + { + return this.hasBeenCleared; + } + + public void setHasBeenUpgraded() + { + this.hasBeenUpgraded = true; + } + + public boolean beenUpgraded() + { + return this.hasBeenUpgraded; + } + + public float getProgress(float partialTicks) + { + return this.progressOld + (this.progress - this.progressOld) * partialTicks; + } + + @SideOnly(Side.CLIENT) + public EnumDyeColor getColor() + { + if (this.color == null) + { + this.color = BlockIronShulkerBox.getColorFromBlock(this.getBlockType()); + } + + return this.color; + } + + public boolean isDestroyedByCreativePlayer() + { + return this.destroyedByCreativePlayer; + } + + public void setDestroyedByCreativePlayer(boolean destoryedByCreativeUser) + { + this.destroyedByCreativePlayer = destoryedByCreativeUser; + } + + public boolean shouldDrop() + { + return !this.isDestroyedByCreativePlayer() || !this.isEmpty() || this.hasCustomName() || this.lootTable != null; + } + + protected void sendTopStacksPacket() + { + NonNullList stacks = this.buildItemStackDataList(); + //@formatter:off + IronChest.packetHandler.sendToAllAround(new MessageCrystalShulkerSync(this, stacks), new TargetPoint(world.provider.getDimension(), getPos().getX(), getPos().getY(), getPos().getZ(), 128)); + //@formatter:on + } + + public void receiveMessageFromServer(NonNullList topStacks) + { + this.topStacks = topStacks; + } + + public static enum AnimationStatus + { + CLOSED, OPENING, OPENED, CLOSING; + } +} diff --git a/src/main/java/cpw/mods/ironchest/common/tileentity/shulker/TileEntityObsidianShulkerBox.java b/src/main/java/cpw/mods/ironchest/common/tileentity/shulker/TileEntityObsidianShulkerBox.java new file mode 100644 index 00000000..daf3a2ff --- /dev/null +++ b/src/main/java/cpw/mods/ironchest/common/tileentity/shulker/TileEntityObsidianShulkerBox.java @@ -0,0 +1,29 @@ +/******************************************************************************* + * 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 cpw.mods.ironchest.common.tileentity.shulker; + +import javax.annotation.Nullable; + +import cpw.mods.ironchest.common.blocks.shulker.IronShulkerBoxType; +import net.minecraft.item.EnumDyeColor; + +public class TileEntityObsidianShulkerBox extends TileEntityIronShulkerBox +{ + public TileEntityObsidianShulkerBox() + { + this(null); + } + + public TileEntityObsidianShulkerBox(@Nullable EnumDyeColor colorIn) + { + super(colorIn, IronShulkerBoxType.OBSIDIAN); + } +} diff --git a/src/main/java/cpw/mods/ironchest/common/tileentity/shulker/TileEntitySilverShulkerBox.java b/src/main/java/cpw/mods/ironchest/common/tileentity/shulker/TileEntitySilverShulkerBox.java new file mode 100644 index 00000000..b116394c --- /dev/null +++ b/src/main/java/cpw/mods/ironchest/common/tileentity/shulker/TileEntitySilverShulkerBox.java @@ -0,0 +1,29 @@ +/******************************************************************************* + * 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 cpw.mods.ironchest.common.tileentity.shulker; + +import javax.annotation.Nullable; + +import cpw.mods.ironchest.common.blocks.shulker.IronShulkerBoxType; +import net.minecraft.item.EnumDyeColor; + +public class TileEntitySilverShulkerBox extends TileEntityIronShulkerBox +{ + public TileEntitySilverShulkerBox() + { + this(null); + } + + public TileEntitySilverShulkerBox(@Nullable EnumDyeColor colorIn) + { + super(colorIn, IronShulkerBoxType.SILVER); + } +} diff --git a/src/main/java/cpw/mods/ironchest/common/util/BehaviorDispenseIronShulkerBox.java b/src/main/java/cpw/mods/ironchest/common/util/BehaviorDispenseIronShulkerBox.java new file mode 100644 index 00000000..7a16110c --- /dev/null +++ b/src/main/java/cpw/mods/ironchest/common/util/BehaviorDispenseIronShulkerBox.java @@ -0,0 +1,64 @@ +/******************************************************************************* + * 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 cpw.mods.ironchest.common.util; + +import cpw.mods.ironchest.common.blocks.shulker.BlockIronShulkerBox; +import cpw.mods.ironchest.common.blocks.shulker.IronShulkerBoxType; +import cpw.mods.ironchest.common.tileentity.shulker.TileEntityIronShulkerBox; +import net.minecraft.block.Block; +import net.minecraft.block.BlockDispenser; +import net.minecraft.block.state.IBlockState; +import net.minecraft.dispenser.IBlockSource; +import net.minecraft.entity.Entity; +import net.minecraft.init.Bootstrap.BehaviorDispenseOptional; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; + +public class BehaviorDispenseIronShulkerBox extends BehaviorDispenseOptional +{ + @Override + protected ItemStack dispenseStack(IBlockSource source, ItemStack stack) + { + Block block = Block.getBlockFromItem(stack.getItem()); + World world = source.getWorld(); + EnumFacing enumfacing = source.getBlockState().getValue(BlockDispenser.FACING); + BlockPos blockpos = source.getBlockPos().offset(enumfacing); + this.successful = world.mayPlace(block, blockpos, false, EnumFacing.DOWN, (Entity) null); + + if (this.successful) + { + EnumFacing enumfacing1 = world.isAirBlock(blockpos.down()) ? enumfacing : EnumFacing.UP; + IBlockState iblockstate = block.getDefaultState().withProperty(BlockIronShulkerBox.VARIANT_PROP, IronShulkerBoxType.VALUES[stack.getMetadata()]); + world.setBlockState(blockpos, iblockstate); + TileEntity tileentity = world.getTileEntity(blockpos); + ItemStack itemstack = stack.splitStack(1); + + ((TileEntityIronShulkerBox) tileentity).setFacing(enumfacing1); + + if (itemstack.hasTagCompound()) + { + ((TileEntityIronShulkerBox) tileentity).loadFromNbt(itemstack.getTagCompound().getCompoundTag("BlockEntityTag")); + } + + if (itemstack.hasDisplayName()) + { + ((TileEntityIronShulkerBox) tileentity).setCustomName(itemstack.getDisplayName()); + } + + world.updateComparatorOutputLevel(blockpos, iblockstate.getBlock()); + } + + return stack; + } +} diff --git a/src/main/java/cpw/mods/ironchest/common/util/CreativeTab.java b/src/main/java/cpw/mods/ironchest/common/util/CreativeTab.java new file mode 100644 index 00000000..5a3a3847 --- /dev/null +++ b/src/main/java/cpw/mods/ironchest/common/util/CreativeTab.java @@ -0,0 +1,55 @@ +/******************************************************************************* + * 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 cpw.mods.ironchest.common.util; + +import javax.annotation.Nonnull; + +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + +public class CreativeTab extends CreativeTabs +{ + private ItemStack icon; + + // a vanilla icon in case the other one isn't present + public CreativeTab(String label, ItemStack backupIcon) + { + super(label); + + this.icon = backupIcon; + } + + public void setDisplayIcon(ItemStack displayIcon) + { + if (!displayIcon.isEmpty()) + { + this.icon = displayIcon; + } + } + + @Nonnull + @SideOnly(Side.CLIENT) + @Override + public ItemStack getIconItemStack() + { + return icon; + } + + @Nonnull + @SideOnly(Side.CLIENT) + @Override + public ItemStack getTabIconItem() + { + return icon; + } +} \ No newline at end of file diff --git a/src/main/java/cpw/mods/ironchest/common/util/ItemTooltip.java b/src/main/java/cpw/mods/ironchest/common/util/ItemTooltip.java new file mode 100644 index 00000000..bd47c70f --- /dev/null +++ b/src/main/java/cpw/mods/ironchest/common/util/ItemTooltip.java @@ -0,0 +1,71 @@ +/******************************************************************************* + * 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 cpw.mods.ironchest.common.util; + +import java.util.List; + +import com.google.common.collect.Lists; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.text.TextFormatting; +import net.minecraft.util.text.translation.I18n; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + +@SuppressWarnings("deprecation") +public class ItemTooltip extends Item +{ + @Override + @SideOnly(Side.CLIENT) + public void addInformation(ItemStack stack, EntityPlayer playerIn, List tooltip, boolean advanced) + { + addOptionalTooltip(stack, tooltip); + + super.addInformation(stack, playerIn, tooltip, advanced); + } + + public static void addOptionalTooltip(ItemStack stack, List tooltip) + { + if (I18n.canTranslate(stack.getUnlocalizedName() + ".tooltip")) + { + tooltip.addAll(getTooltips(TextFormatting.GRAY.toString() + translateRecursive(stack.getUnlocalizedName() + ".tooltip"))); + } + else if (I18n.canTranslate(stack.getUnlocalizedName() + ".tooltip")) + { + tooltip.addAll(getTooltips(TextFormatting.GRAY.toString() + translateRecursive(stack.getUnlocalizedName() + ".tooltip"))); + } + } + + public static String translateRecursive(String key, Object... params) + { + return I18n.translateToLocal(I18n.translateToLocalFormatted(key, params)); + } + + public static List getTooltips(String text) + { + List list = Lists.newLinkedList(); + if (text == null) + return list; + int j = 0; + int k; + while ((k = text.indexOf("\\n", j)) >= 0) + { + list.add(text.substring(j, k)); + j = k + 2; + } + + list.add(text.substring(j, text.length())); + + return list; + } +} \ No newline at end of file diff --git a/src/main/java/cpw/mods/ironchest/common/util/MissingMappingsHandler.java b/src/main/java/cpw/mods/ironchest/common/util/MissingMappingsHandler.java new file mode 100644 index 00000000..1546c057 --- /dev/null +++ b/src/main/java/cpw/mods/ironchest/common/util/MissingMappingsHandler.java @@ -0,0 +1,190 @@ +/******************************************************************************* + * 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 cpw.mods.ironchest.common.util; + +import javax.annotation.Nonnull; + +import cpw.mods.ironchest.IronChest; +import net.minecraft.block.Block; +import net.minecraft.item.Item; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.fml.common.event.FMLMissingMappingsEvent; +import net.minecraftforge.fml.common.event.FMLMissingMappingsEvent.MissingMapping; +import net.minecraftforge.fml.common.registry.ForgeRegistries; +import net.minecraftforge.fml.common.registry.GameRegistry; + +public class MissingMappingsHandler +{ + public static void onMissingMappings(FMLMissingMappingsEvent event) + { + for (MissingMapping mapping : event.get()) + { + if (mapping.resourceLocation.getResourceDomain().equals(IronChest.MOD_ID)) + { + @Nonnull + String path = mapping.resourceLocation.getResourcePath(); + + replaceOldChest(path, mapping); + + replaceOldUpgrades(path, mapping); + + replaceNewUpgrades(path, mapping); + } + } + } + + private static void replaceOldChest(String path, MissingMapping mapping) + { + if (path.endsWith("blockironchest")) + { + path = path.replace("blockironchest", "iron_chest"); + ResourceLocation newRes = new ResourceLocation(mapping.resourceLocation.getResourceDomain(), path); + Block block = ForgeRegistries.BLOCKS.getValue(newRes); + + if (block != null) + { + if (mapping.type == GameRegistry.Type.BLOCK) + { + mapping.remap(block); + } + else + { + mapping.remap(Item.getItemFromBlock(block)); + } + } + } + } + + private static void replaceOldUpgrades(String path, MissingMapping mapping) + { + if (path.endsWith("irongoldupgrade")) + { + path = path.replace("irongoldupgrade", "iron_gold_chest_upgrade"); + replaceUpgradeItem(path, mapping); + } + + if (path.endsWith("golddiamondupgrade")) + { + path = path.replace("golddiamondupgrade", "gold_diamond_chest_upgrade"); + replaceUpgradeItem(path, mapping); + } + + if (path.endsWith("coppersilverupgrade")) + { + path = path.replace("coppersilverupgrade", "copper_silver_chest_upgrade"); + replaceUpgradeItem(path, mapping); + } + + if (path.endsWith("silvergoldupgrade")) + { + path = path.replace("silvergoldupgrade", "silver_gold_chest_upgrade"); + replaceUpgradeItem(path, mapping); + } + + if (path.endsWith("copperironupgrade")) + { + path = path.replace("copperironupgrade", "copper_iron_chest_upgrade"); + replaceUpgradeItem(path, mapping); + } + + if (path.endsWith("diamondcrystalupgrade")) + { + path = path.replace("diamondcrystalupgrade", "diamond_crystal_chest_upgrade"); + replaceUpgradeItem(path, mapping); + } + + if (path.endsWith("woodironupgrade")) + { + path = path.replace("woodironupgrade", "wood_iron_chest_upgrade"); + replaceUpgradeItem(path, mapping); + } + + if (path.endsWith("woodcopperupgrade")) + { + path = path.replace("woodcopperupgrade", "wood_copper_chest_upgrade"); + replaceUpgradeItem(path, mapping); + } + + if (path.endsWith("diamondobsidianupgrade")) + { + path = path.replace("diamondobsidianupgrade", "diamond_obsidian_chest_upgrade"); + replaceUpgradeItem(path, mapping); + } + } + + private static void replaceNewUpgrades(String path, MissingMapping mapping) + { + if (path.endsWith("iron_gold_upgrade")) + { + path = path.replace("iron_gold_upgrade", "iron_gold_chest_upgrade"); + replaceUpgradeItem(path, mapping); + } + + if (path.endsWith("gold_diamond_upgrade")) + { + path = path.replace("gold_diamond_upgrade", "gold_diamond_chest_upgrade"); + replaceUpgradeItem(path, mapping); + } + + if (path.endsWith("copper_silver_upgrade")) + { + path = path.replace("copper_silver_upgrade", "copper_silver_chest_upgrade"); + replaceUpgradeItem(path, mapping); + } + + if (path.endsWith("silver_gold_upgrade")) + { + path = path.replace("silver_gold_upgrade", "silver_gold_chest_upgrade"); + replaceUpgradeItem(path, mapping); + } + + if (path.endsWith("copper_iron_upgrade")) + { + path = path.replace("copper_iron_upgrade", "copper_iron_chest_upgrade"); + replaceUpgradeItem(path, mapping); + } + + if (path.endsWith("diamond_crystal_upgrade")) + { + path = path.replace("diamond_crystal_upgrade", "diamond_crystal_chest_upgrade"); + replaceUpgradeItem(path, mapping); + } + + if (path.endsWith("wood_iron_upgrade")) + { + path = path.replace("wood_iron_upgrade", "wood_iron_chest_upgrade"); + replaceUpgradeItem(path, mapping); + } + + if (path.endsWith("wood_copper_upgrade")) + { + path = path.replace("wood_copper_upgrade", "wood_copper_chest_upgrade"); + replaceUpgradeItem(path, mapping); + } + + if (path.endsWith("diamond_obsidian_upgrade")) + { + path = path.replace("diamond_obsidian_upgrade", "diamond_obsidian_chest_upgrade"); + replaceUpgradeItem(path, mapping); + } + } + + private static void replaceUpgradeItem(String path, MissingMapping mapping) + { + ResourceLocation newRes = new ResourceLocation(mapping.resourceLocation.getResourceDomain(), path); + Item item = ForgeRegistries.ITEMS.getValue(newRes); + + if (item != null) + { + mapping.remap(item); + } + } +} diff --git a/src/main/java/cpw/mods/ironchest/OcelotsSitOnChestsHandler.java b/src/main/java/cpw/mods/ironchest/common/util/OcelotsSitOnChestsHandler.java old mode 100755 new mode 100644 similarity index 67% rename from src/main/java/cpw/mods/ironchest/OcelotsSitOnChestsHandler.java rename to src/main/java/cpw/mods/ironchest/common/util/OcelotsSitOnChestsHandler.java index 04145afe..1f28813e --- a/src/main/java/cpw/mods/ironchest/OcelotsSitOnChestsHandler.java +++ b/src/main/java/cpw/mods/ironchest/common/util/OcelotsSitOnChestsHandler.java @@ -1,7 +1,18 @@ -package cpw.mods.ironchest; +/******************************************************************************* + * 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 cpw.mods.ironchest.common.util; import java.util.HashSet; +import cpw.mods.ironchest.common.ai.IronChestAIOcelotSit; import net.minecraft.entity.ai.EntityAIOcelotSit; import net.minecraft.entity.ai.EntityAITasks.EntityAITaskEntry; import net.minecraft.entity.passive.EntityOcelot; diff --git a/src/main/resources/assets/ironchest/blockstates/iron_chest.json b/src/main/resources/assets/ironchest/blockstates/iron_chest.json index 662e399c..aee9e352 100644 --- a/src/main/resources/assets/ironchest/blockstates/iron_chest.json +++ b/src/main/resources/assets/ironchest/blockstates/iron_chest.json @@ -9,49 +9,49 @@ "iron": { "textures": { "particle": "ironchest:blocks/iron_break", - "texture": "ironchest:model/iron_chest" + "texture": "ironchest:model/chest/iron_chest" } }, "gold": { "textures": { "particle": "ironchest:blocks/gold_break", - "texture": "ironchest:model/gold_chest" + "texture": "ironchest:model/chest/gold_chest" } }, "diamond": { "textures": { "particle": "ironchest:blocks/diamond_break", - "texture": "ironchest:model/diamond_chest" + "texture": "ironchest:model/chest/diamond_chest" } }, "copper": { "textures": { "particle": "ironchest:blocks/copper_break", - "texture": "ironchest:model/copper_chest" + "texture": "ironchest:model/chest/copper_chest" } }, "silver": { "textures": { "particle": "ironchest:blocks/silver_break", - "texture": "ironchest:model/silver_chest" + "texture": "ironchest:model/chest/silver_chest" } }, "crystal": { "textures": { "particle": "ironchest:blocks/crystal_break", - "texture": "ironchest:model/crystal_chest" + "texture": "ironchest:model/chest/crystal_chest" } }, "obsidian": { "textures": { "particle": "minecraft:blocks/obsidian", - "texture": "ironchest:model/obsidian_chest" + "texture": "ironchest:model/chest/obsidian_chest" } }, "dirtchest9000": { "textures": { "particle": "minecraft:blocks/dirt", - "texture": "ironchest:model/dirt_chest" + "texture": "ironchest:model/chest/dirt_chest" } }, "wood": { diff --git a/src/main/resources/assets/ironchest/blockstates/iron_chest_upgrades.json b/src/main/resources/assets/ironchest/blockstates/iron_chest_upgrades.json index 9132a142..02347a4d 100644 --- a/src/main/resources/assets/ironchest/blockstates/iron_chest_upgrades.json +++ b/src/main/resources/assets/ironchest/blockstates/iron_chest_upgrades.json @@ -6,49 +6,49 @@ }, "variants": { "variant": { - "copper_silver_upgrade": { + "copper_silver_chest_upgrade": { "textures": { - "layer0": "ironchest:items/copper_silver_upgrade" + "layer0": "ironchest:items/chest/copper_silver_upgrade" } }, - "diamond_crystal_upgrade": { + "diamond_crystal_chest_upgrade": { "textures": { - "layer0": "ironchest:items/diamond_crystal_upgrade" + "layer0": "ironchest:items/chest/diamond_crystal_upgrade" } }, - "diamond_obsidian_upgrade": { + "diamond_obsidian_chest_upgrade": { "textures": { - "layer0": "ironchest:items/diamond_obsidian_upgrade" + "layer0": "ironchest:items/chest/diamond_obsidian_upgrade" } }, - "gold_diamond_upgrade": { + "gold_diamond_chest_upgrade": { "textures": { - "layer0": "ironchest:items/gold_diamond_upgrade" + "layer0": "ironchest:items/chest/gold_diamond_upgrade" } }, - "iron_gold_upgrade": { + "iron_gold_chest_upgrade": { "textures": { - "layer0": "ironchest:items/iron_gold_upgrade" + "layer0": "ironchest:items/chest/iron_gold_upgrade" } }, - "silver_gold_upgrade": { + "silver_gold_chest_upgrade": { "textures": { - "layer0": "ironchest:items/silver_gold_upgrade" + "layer0": "ironchest:items/chest/silver_gold_upgrade" } }, - "wood_copper_upgrade": { + "wood_copper_chest_upgrade": { "textures": { - "layer0": "ironchest:items/wood_copper_upgrade" + "layer0": "ironchest:items/chest/wood_copper_upgrade" } }, - "wood_iron_upgrade": { + "wood_iron_chest_upgrade": { "textures": { - "layer0": "ironchest:items/wood_iron_upgrade" + "layer0": "ironchest:items/chest/wood_iron_upgrade" } }, - "copper_iron_upgrade": { + "copper_iron_chest_upgrade": { "textures": { - "layer0": "ironchest:items/copper_iron_upgrade" + "layer0": "ironchest:items/chest/copper_iron_upgrade" } } } diff --git a/src/main/resources/assets/ironchest/blockstates/iron_shulker_box_black.json b/src/main/resources/assets/ironchest/blockstates/iron_shulker_box_black.json new file mode 100644 index 00000000..f931a736 --- /dev/null +++ b/src/main/resources/assets/ironchest/blockstates/iron_shulker_box_black.json @@ -0,0 +1,59 @@ +{ + "forge_marker":1, + "defaults":{ + "model":"ironchest:iron_shulker_box", + "transform":"forge:default-block" + }, + "variants":{ + "variant":{ + "iron":{ + "textures":{ + "particle":"ironchest:blocks/iron_break", + "texture":"ironchest:model/shulker/black/shulker_black_iron" + } + }, + "gold":{ + "textures":{ + "particle":"ironchest:blocks/gold_break", + "texture":"ironchest:model/shulker/black/shulker_black_gold" + } + }, + "diamond":{ + "textures":{ + "particle":"ironchest:blocks/diamond_break", + "texture":"ironchest:model/shulker/black/shulker_black_diamond" + } + }, + "copper":{ + "textures":{ + "particle":"ironchest:blocks/copper_break", + "texture":"ironchest:model/shulker/black/shulker_black_copper" + } + }, + "silver":{ + "textures":{ + "particle":"ironchest:blocks/silver_break", + "texture":"ironchest:model/shulker/black/shulker_black_silver" + } + }, + "crystal":{ + "textures":{ + "particle":"ironchest:blocks/crystal_break", + "texture":"ironchest:model/shulker/black/shulker_black_crystal" + } + }, + "obsidian":{ + "textures":{ + "particle":"minecraft:blocks/obsidian", + "texture":"ironchest:model/shulker/black/shulker_black_obsidian" + } + }, + "vanilla":{ + "textures":{ + "particle":"minecraft:blocks/shulker_top_black", + "texture":"minecraft:entity/shulker/shulker_black" + } + } + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/ironchest/blockstates/iron_shulker_box_blue.json b/src/main/resources/assets/ironchest/blockstates/iron_shulker_box_blue.json new file mode 100644 index 00000000..87b64063 --- /dev/null +++ b/src/main/resources/assets/ironchest/blockstates/iron_shulker_box_blue.json @@ -0,0 +1,59 @@ +{ + "forge_marker":1, + "defaults":{ + "model":"ironchest:iron_shulker_box", + "transform":"forge:default-block" + }, + "variants":{ + "variant":{ + "iron":{ + "textures":{ + "particle":"ironchest:blocks/iron_break", + "texture":"ironchest:model/shulker/blue/shulker_blue_iron" + } + }, + "gold":{ + "textures":{ + "particle":"ironchest:blocks/gold_break", + "texture":"ironchest:model/shulker/blue/shulker_blue_gold" + } + }, + "diamond":{ + "textures":{ + "particle":"ironchest:blocks/diamond_break", + "texture":"ironchest:model/shulker/blue/shulker_blue_diamond" + } + }, + "copper":{ + "textures":{ + "particle":"ironchest:blocks/copper_break", + "texture":"ironchest:model/shulker/blue/shulker_blue_copper" + } + }, + "silver":{ + "textures":{ + "particle":"ironchest:blocks/silver_break", + "texture":"ironchest:model/shulker/blue/shulker_blue_silver" + } + }, + "crystal":{ + "textures":{ + "particle":"ironchest:blocks/crystal_break", + "texture":"ironchest:model/shulker/blue/shulker_blue_crystal" + } + }, + "obsidian":{ + "textures":{ + "particle":"minecraft:blocks/obsidian", + "texture":"ironchest:model/shulker/blue/shulker_blue_obsidian" + } + }, + "vanilla":{ + "textures":{ + "particle":"minecraft:blocks/shulker_top_blue", + "texture":"minecraft:entity/shulker/shulker_blue" + } + } + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/ironchest/blockstates/iron_shulker_box_brown.json b/src/main/resources/assets/ironchest/blockstates/iron_shulker_box_brown.json new file mode 100644 index 00000000..d4c9ac06 --- /dev/null +++ b/src/main/resources/assets/ironchest/blockstates/iron_shulker_box_brown.json @@ -0,0 +1,59 @@ +{ + "forge_marker":1, + "defaults":{ + "model":"ironchest:iron_shulker_box", + "transform":"forge:default-block" + }, + "variants":{ + "variant":{ + "iron":{ + "textures":{ + "particle":"ironchest:blocks/iron_break", + "texture":"ironchest:model/shulker/brown/shulker_brown_iron" + } + }, + "gold":{ + "textures":{ + "particle":"ironchest:blocks/gold_break", + "texture":"ironchest:model/shulker/brown/shulker_brown_gold" + } + }, + "diamond":{ + "textures":{ + "particle":"ironchest:blocks/diamond_break", + "texture":"ironchest:model/shulker/brown/shulker_brown_diamond" + } + }, + "copper":{ + "textures":{ + "particle":"ironchest:blocks/copper_break", + "texture":"ironchest:model/shulker/brown/shulker_brown_copper" + } + }, + "silver":{ + "textures":{ + "particle":"ironchest:blocks/silver_break", + "texture":"ironchest:model/shulker/brown/shulker_brown_silver" + } + }, + "crystal":{ + "textures":{ + "particle":"ironchest:blocks/crystal_break", + "texture":"ironchest:model/shulker/brown/shulker_brown_crystal" + } + }, + "obsidian":{ + "textures":{ + "particle":"minecraft:blocks/obsidian", + "texture":"ironchest:model/shulker/brown/shulker_brown_obsidian" + } + }, + "vanilla":{ + "textures":{ + "particle":"minecraft:blocks/shulker_top_brown", + "texture":"minecraft:entity/shulker/shulker_brown" + } + } + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/ironchest/blockstates/iron_shulker_box_cyan.json b/src/main/resources/assets/ironchest/blockstates/iron_shulker_box_cyan.json new file mode 100644 index 00000000..10b80a86 --- /dev/null +++ b/src/main/resources/assets/ironchest/blockstates/iron_shulker_box_cyan.json @@ -0,0 +1,59 @@ +{ + "forge_marker":1, + "defaults":{ + "model":"ironchest:iron_shulker_box", + "transform":"forge:default-block" + }, + "variants":{ + "variant":{ + "iron":{ + "textures":{ + "particle":"ironchest:blocks/iron_break", + "texture":"ironchest:model/shulker/cyan/shulker_cyan_iron" + } + }, + "gold":{ + "textures":{ + "particle":"ironchest:blocks/gold_break", + "texture":"ironchest:model/shulker/cyan/shulker_cyan_gold" + } + }, + "diamond":{ + "textures":{ + "particle":"ironchest:blocks/diamond_break", + "texture":"ironchest:model/shulker/cyan/shulker_cyan_diamond" + } + }, + "copper":{ + "textures":{ + "particle":"ironchest:blocks/copper_break", + "texture":"ironchest:model/shulker/cyan/shulker_cyan_copper" + } + }, + "silver":{ + "textures":{ + "particle":"ironchest:blocks/silver_break", + "texture":"ironchest:model/shulker/cyan/shulker_cyan_silver" + } + }, + "crystal":{ + "textures":{ + "particle":"ironchest:blocks/crystal_break", + "texture":"ironchest:model/shulker/cyan/shulker_cyan_crystal" + } + }, + "obsidian":{ + "textures":{ + "particle":"minecraft:blocks/obsidian", + "texture":"ironchest:model/shulker/cyan/shulker_cyan_obsidian" + } + }, + "vanilla":{ + "textures":{ + "particle":"minecraft:blocks/shulker_top_cyan", + "texture":"minecraft:entity/shulker/shulker_cyan" + } + } + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/ironchest/blockstates/iron_shulker_box_gray.json b/src/main/resources/assets/ironchest/blockstates/iron_shulker_box_gray.json new file mode 100644 index 00000000..67885e3c --- /dev/null +++ b/src/main/resources/assets/ironchest/blockstates/iron_shulker_box_gray.json @@ -0,0 +1,59 @@ +{ + "forge_marker":1, + "defaults":{ + "model":"ironchest:iron_shulker_box", + "transform":"forge:default-block" + }, + "variants":{ + "variant":{ + "iron":{ + "textures":{ + "particle":"ironchest:blocks/iron_break", + "texture":"ironchest:model/shulker/gray/shulker_gray_iron" + } + }, + "gold":{ + "textures":{ + "particle":"ironchest:blocks/gold_break", + "texture":"ironchest:model/shulker/gray/shulker_gray_gold" + } + }, + "diamond":{ + "textures":{ + "particle":"ironchest:blocks/diamond_break", + "texture":"ironchest:model/shulker/gray/shulker_gray_diamond" + } + }, + "copper":{ + "textures":{ + "particle":"ironchest:blocks/copper_break", + "texture":"ironchest:model/shulker/gray/shulker_gray_copper" + } + }, + "silver":{ + "textures":{ + "particle":"ironchest:blocks/silver_break", + "texture":"ironchest:model/shulker/gray/shulker_gray_silver" + } + }, + "crystal":{ + "textures":{ + "particle":"ironchest:blocks/crystal_break", + "texture":"ironchest:model/shulker/gray/shulker_gray_crystal" + } + }, + "obsidian":{ + "textures":{ + "particle":"minecraft:blocks/obsidian", + "texture":"ironchest:model/shulker/gray/shulker_gray_obsidian" + } + }, + "vanilla":{ + "textures":{ + "particle":"minecraft:blocks/shulker_top_gray", + "texture":"minecraft:entity/shulker/shulker_gray" + } + } + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/ironchest/blockstates/iron_shulker_box_green.json b/src/main/resources/assets/ironchest/blockstates/iron_shulker_box_green.json new file mode 100644 index 00000000..15a14229 --- /dev/null +++ b/src/main/resources/assets/ironchest/blockstates/iron_shulker_box_green.json @@ -0,0 +1,59 @@ +{ + "forge_marker":1, + "defaults":{ + "model":"ironchest:iron_shulker_box", + "transform":"forge:default-block" + }, + "variants":{ + "variant":{ + "iron":{ + "textures":{ + "particle":"ironchest:blocks/iron_break", + "texture":"ironchest:model/shulker/green/shulker_green_iron" + } + }, + "gold":{ + "textures":{ + "particle":"ironchest:blocks/gold_break", + "texture":"ironchest:model/shulker/green/shulker_green_gold" + } + }, + "diamond":{ + "textures":{ + "particle":"ironchest:blocks/diamond_break", + "texture":"ironchest:model/shulker/green/shulker_green_diamond" + } + }, + "copper":{ + "textures":{ + "particle":"ironchest:blocks/copper_break", + "texture":"ironchest:model/shulker/green/shulker_green_copper" + } + }, + "silver":{ + "textures":{ + "particle":"ironchest:blocks/silver_break", + "texture":"ironchest:model/shulker/green/shulker_green_silver" + } + }, + "crystal":{ + "textures":{ + "particle":"ironchest:blocks/crystal_break", + "texture":"ironchest:model/shulker/green/shulker_green_crystal" + } + }, + "obsidian":{ + "textures":{ + "particle":"minecraft:blocks/obsidian", + "texture":"ironchest:model/shulker/green/shulker_green_obsidian" + } + }, + "vanilla":{ + "textures":{ + "particle":"minecraft:blocks/shulker_top_green", + "texture":"minecraft:entity/shulker/shulker_green" + } + } + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/ironchest/blockstates/iron_shulker_box_light_blue.json b/src/main/resources/assets/ironchest/blockstates/iron_shulker_box_light_blue.json new file mode 100644 index 00000000..d7869917 --- /dev/null +++ b/src/main/resources/assets/ironchest/blockstates/iron_shulker_box_light_blue.json @@ -0,0 +1,59 @@ +{ + "forge_marker":1, + "defaults":{ + "model":"ironchest:iron_shulker_box", + "transform":"forge:default-block" + }, + "variants":{ + "variant":{ + "iron":{ + "textures":{ + "particle":"ironchest:blocks/iron_break", + "texture":"ironchest:model/shulker/light_blue/shulker_light_blue_iron" + } + }, + "gold":{ + "textures":{ + "particle":"ironchest:blocks/gold_break", + "texture":"ironchest:model/shulker/light_blue/shulker_light_blue_gold" + } + }, + "diamond":{ + "textures":{ + "particle":"ironchest:blocks/diamond_break", + "texture":"ironchest:model/shulker/light_blue/shulker_light_blue_diamond" + } + }, + "copper":{ + "textures":{ + "particle":"ironchest:blocks/copper_break", + "texture":"ironchest:model/shulker/light_blue/shulker_light_blue_copper" + } + }, + "silver":{ + "textures":{ + "particle":"ironchest:blocks/silver_break", + "texture":"ironchest:model/shulker/light_blue/shulker_light_blue_silver" + } + }, + "crystal":{ + "textures":{ + "particle":"ironchest:blocks/crystal_break", + "texture":"ironchest:model/shulker/light_blue/shulker_light_blue_crystal" + } + }, + "obsidian":{ + "textures":{ + "particle":"minecraft:blocks/obsidian", + "texture":"ironchest:model/shulker/light_blue/shulker_light_blue_obsidian" + } + }, + "vanilla":{ + "textures":{ + "particle":"minecraft:blocks/shulker_top_light_blue", + "texture":"minecraft:entity/shulker/shulker_light_blue" + } + } + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/ironchest/blockstates/iron_shulker_box_lime.json b/src/main/resources/assets/ironchest/blockstates/iron_shulker_box_lime.json new file mode 100644 index 00000000..30e4a884 --- /dev/null +++ b/src/main/resources/assets/ironchest/blockstates/iron_shulker_box_lime.json @@ -0,0 +1,59 @@ +{ + "forge_marker":1, + "defaults":{ + "model":"ironchest:iron_shulker_box", + "transform":"forge:default-block" + }, + "variants":{ + "variant":{ + "iron":{ + "textures":{ + "particle":"ironchest:blocks/iron_break", + "texture":"ironchest:model/shulker/lime/shulker_lime_iron" + } + }, + "gold":{ + "textures":{ + "particle":"ironchest:blocks/gold_break", + "texture":"ironchest:model/shulker/lime/shulker_lime_gold" + } + }, + "diamond":{ + "textures":{ + "particle":"ironchest:blocks/diamond_break", + "texture":"ironchest:model/shulker/lime/shulker_lime_diamond" + } + }, + "copper":{ + "textures":{ + "particle":"ironchest:blocks/copper_break", + "texture":"ironchest:model/shulker/lime/shulker_lime_copper" + } + }, + "silver":{ + "textures":{ + "particle":"ironchest:blocks/silver_break", + "texture":"ironchest:model/shulker/lime/shulker_lime_silver" + } + }, + "crystal":{ + "textures":{ + "particle":"ironchest:blocks/crystal_break", + "texture":"ironchest:model/shulker/lime/shulker_lime_crystal" + } + }, + "obsidian":{ + "textures":{ + "particle":"minecraft:blocks/obsidian", + "texture":"ironchest:model/shulker/lime/shulker_lime_obsidian" + } + }, + "vanilla":{ + "textures":{ + "particle":"minecraft:blocks/shulker_top_lime", + "texture":"minecraft:entity/shulker/shulker_lime" + } + } + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/ironchest/blockstates/iron_shulker_box_magenta.json b/src/main/resources/assets/ironchest/blockstates/iron_shulker_box_magenta.json new file mode 100644 index 00000000..4976efe1 --- /dev/null +++ b/src/main/resources/assets/ironchest/blockstates/iron_shulker_box_magenta.json @@ -0,0 +1,59 @@ +{ + "forge_marker":1, + "defaults":{ + "model":"ironchest:iron_shulker_box", + "transform":"forge:default-block" + }, + "variants":{ + "variant":{ + "iron":{ + "textures":{ + "particle":"ironchest:blocks/iron_break", + "texture":"ironchest:model/shulker/magenta/shulker_magenta_iron" + } + }, + "gold":{ + "textures":{ + "particle":"ironchest:blocks/gold_break", + "texture":"ironchest:model/shulker/magenta/shulker_magenta_gold" + } + }, + "diamond":{ + "textures":{ + "particle":"ironchest:blocks/diamond_break", + "texture":"ironchest:model/shulker/magenta/shulker_magenta_diamond" + } + }, + "copper":{ + "textures":{ + "particle":"ironchest:blocks/copper_break", + "texture":"ironchest:model/shulker/magenta/shulker_magenta_copper" + } + }, + "silver":{ + "textures":{ + "particle":"ironchest:blocks/silver_break", + "texture":"ironchest:model/shulker/magenta/shulker_magenta_silver" + } + }, + "crystal":{ + "textures":{ + "particle":"ironchest:blocks/crystal_break", + "texture":"ironchest:model/shulker/magenta/shulker_magenta_crystal" + } + }, + "obsidian":{ + "textures":{ + "particle":"minecraft:blocks/obsidian", + "texture":"ironchest:model/shulker/magenta/shulker_magenta_obsidian" + } + }, + "vanilla":{ + "textures":{ + "particle":"minecraft:blocks/shulker_top_magenta", + "texture":"minecraft:entity/shulker/shulker_magenta" + } + } + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/ironchest/blockstates/iron_shulker_box_orange.json b/src/main/resources/assets/ironchest/blockstates/iron_shulker_box_orange.json new file mode 100644 index 00000000..ff4b7450 --- /dev/null +++ b/src/main/resources/assets/ironchest/blockstates/iron_shulker_box_orange.json @@ -0,0 +1,59 @@ +{ + "forge_marker":1, + "defaults":{ + "model":"ironchest:iron_shulker_box", + "transform":"forge:default-block" + }, + "variants":{ + "variant":{ + "iron":{ + "textures":{ + "particle":"ironchest:blocks/iron_break", + "texture":"ironchest:model/shulker/orange/shulker_orange_iron" + } + }, + "gold":{ + "textures":{ + "particle":"ironchest:blocks/gold_break", + "texture":"ironchest:model/shulker/orange/shulker_orange_gold" + } + }, + "diamond":{ + "textures":{ + "particle":"ironchest:blocks/diamond_break", + "texture":"ironchest:model/shulker/orange/shulker_orange_diamond" + } + }, + "copper":{ + "textures":{ + "particle":"ironchest:blocks/copper_break", + "texture":"ironchest:model/shulker/orange/shulker_orange_copper" + } + }, + "silver":{ + "textures":{ + "particle":"ironchest:blocks/silver_break", + "texture":"ironchest:model/shulker/orange/shulker_orange_silver" + } + }, + "crystal":{ + "textures":{ + "particle":"ironchest:blocks/crystal_break", + "texture":"ironchest:model/shulker/orange/shulker_orange_crystal" + } + }, + "obsidian":{ + "textures":{ + "particle":"minecraft:blocks/obsidian", + "texture":"ironchest:model/shulker/orange/shulker_orange_obsidian" + } + }, + "vanilla":{ + "textures":{ + "particle":"minecraft:blocks/shulker_top_orange", + "texture":"minecraft:entity/shulker/shulker_orange" + } + } + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/ironchest/blockstates/iron_shulker_box_pink.json b/src/main/resources/assets/ironchest/blockstates/iron_shulker_box_pink.json new file mode 100644 index 00000000..859e355a --- /dev/null +++ b/src/main/resources/assets/ironchest/blockstates/iron_shulker_box_pink.json @@ -0,0 +1,59 @@ +{ + "forge_marker":1, + "defaults":{ + "model":"ironchest:iron_shulker_box", + "transform":"forge:default-block" + }, + "variants":{ + "variant":{ + "iron":{ + "textures":{ + "particle":"ironchest:blocks/iron_break", + "texture":"ironchest:model/shulker/pink/shulker_pink_iron" + } + }, + "gold":{ + "textures":{ + "particle":"ironchest:blocks/gold_break", + "texture":"ironchest:model/shulker/pink/shulker_pink_gold" + } + }, + "diamond":{ + "textures":{ + "particle":"ironchest:blocks/diamond_break", + "texture":"ironchest:model/shulker/pink/shulker_pink_diamond" + } + }, + "copper":{ + "textures":{ + "particle":"ironchest:blocks/copper_break", + "texture":"ironchest:model/shulker/pink/shulker_pink_copper" + } + }, + "silver":{ + "textures":{ + "particle":"ironchest:blocks/silver_break", + "texture":"ironchest:model/shulker/pink/shulker_pink_silver" + } + }, + "crystal":{ + "textures":{ + "particle":"ironchest:blocks/crystal_break", + "texture":"ironchest:model/shulker/pink/shulker_pink_crystal" + } + }, + "obsidian":{ + "textures":{ + "particle":"minecraft:blocks/obsidian", + "texture":"ironchest:model/shulker/pink/shulker_pink_obsidian" + } + }, + "vanilla":{ + "textures":{ + "particle":"minecraft:blocks/shulker_top_pink", + "texture":"minecraft:entity/shulker/shulker_pink" + } + } + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/ironchest/blockstates/iron_shulker_box_purple.json b/src/main/resources/assets/ironchest/blockstates/iron_shulker_box_purple.json new file mode 100644 index 00000000..7965a771 --- /dev/null +++ b/src/main/resources/assets/ironchest/blockstates/iron_shulker_box_purple.json @@ -0,0 +1,59 @@ +{ + "forge_marker":1, + "defaults":{ + "model":"ironchest:iron_shulker_box", + "transform":"forge:default-block" + }, + "variants":{ + "variant":{ + "iron":{ + "textures":{ + "particle":"ironchest:blocks/iron_break", + "texture":"ironchest:model/shulker/purple/shulker_purple_iron" + } + }, + "gold":{ + "textures":{ + "particle":"ironchest:blocks/gold_break", + "texture":"ironchest:model/shulker/purple/shulker_purple_gold" + } + }, + "diamond":{ + "textures":{ + "particle":"ironchest:blocks/diamond_break", + "texture":"ironchest:model/shulker/purple/shulker_purple_diamond" + } + }, + "copper":{ + "textures":{ + "particle":"ironchest:blocks/copper_break", + "texture":"ironchest:model/shulker/purple/shulker_purple_copper" + } + }, + "silver":{ + "textures":{ + "particle":"ironchest:blocks/silver_break", + "texture":"ironchest:model/shulker/purple/shulker_purple_silver" + } + }, + "crystal":{ + "textures":{ + "particle":"ironchest:blocks/crystal_break", + "texture":"ironchest:model/shulker/purple/shulker_purple_crystal" + } + }, + "obsidian":{ + "textures":{ + "particle":"minecraft:blocks/obsidian", + "texture":"ironchest:model/shulker/purple/shulker_purple_obsidian" + } + }, + "vanilla":{ + "textures":{ + "particle":"minecraft:blocks/shulker_top_purple", + "texture":"minecraft:entity/shulker/shulker_purple" + } + } + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/ironchest/blockstates/iron_shulker_box_red.json b/src/main/resources/assets/ironchest/blockstates/iron_shulker_box_red.json new file mode 100644 index 00000000..b3f96446 --- /dev/null +++ b/src/main/resources/assets/ironchest/blockstates/iron_shulker_box_red.json @@ -0,0 +1,59 @@ +{ + "forge_marker":1, + "defaults":{ + "model":"ironchest:iron_shulker_box", + "transform":"forge:default-block" + }, + "variants":{ + "variant":{ + "iron":{ + "textures":{ + "particle":"ironchest:blocks/iron_break", + "texture":"ironchest:model/shulker/red/shulker_red_iron" + } + }, + "gold":{ + "textures":{ + "particle":"ironchest:blocks/gold_break", + "texture":"ironchest:model/shulker/red/shulker_red_gold" + } + }, + "diamond":{ + "textures":{ + "particle":"ironchest:blocks/diamond_break", + "texture":"ironchest:model/shulker/red/shulker_red_diamond" + } + }, + "copper":{ + "textures":{ + "particle":"ironchest:blocks/copper_break", + "texture":"ironchest:model/shulker/red/shulker_red_copper" + } + }, + "silver":{ + "textures":{ + "particle":"ironchest:blocks/silver_break", + "texture":"ironchest:model/shulker/red/shulker_red_silver" + } + }, + "crystal":{ + "textures":{ + "particle":"ironchest:blocks/crystal_break", + "texture":"ironchest:model/shulker/red/shulker_red_crystal" + } + }, + "obsidian":{ + "textures":{ + "particle":"minecraft:blocks/obsidian", + "texture":"ironchest:model/shulker/red/shulker_red_obsidian" + } + }, + "vanilla":{ + "textures":{ + "particle":"minecraft:blocks/shulker_top_red", + "texture":"minecraft:entity/shulker/shulker_red" + } + } + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/ironchest/blockstates/iron_shulker_box_silver.json b/src/main/resources/assets/ironchest/blockstates/iron_shulker_box_silver.json new file mode 100644 index 00000000..5a07481e --- /dev/null +++ b/src/main/resources/assets/ironchest/blockstates/iron_shulker_box_silver.json @@ -0,0 +1,59 @@ +{ + "forge_marker":1, + "defaults":{ + "model":"ironchest:iron_shulker_box", + "transform":"forge:default-block" + }, + "variants":{ + "variant":{ + "iron":{ + "textures":{ + "particle":"ironchest:blocks/iron_break", + "texture":"ironchest:model/shulker/silver/shulker_silver_iron" + } + }, + "gold":{ + "textures":{ + "particle":"ironchest:blocks/gold_break", + "texture":"ironchest:model/shulker/silver/shulker_silver_gold" + } + }, + "diamond":{ + "textures":{ + "particle":"ironchest:blocks/diamond_break", + "texture":"ironchest:model/shulker/silver/shulker_silver_diamond" + } + }, + "copper":{ + "textures":{ + "particle":"ironchest:blocks/copper_break", + "texture":"ironchest:model/shulker/silver/shulker_silver_copper" + } + }, + "silver":{ + "textures":{ + "particle":"ironchest:blocks/silver_break", + "texture":"ironchest:model/shulker/silver/shulker_silver_silver" + } + }, + "crystal":{ + "textures":{ + "particle":"ironchest:blocks/crystal_break", + "texture":"ironchest:model/shulker/silver/shulker_silver_crystal" + } + }, + "obsidian":{ + "textures":{ + "particle":"minecraft:blocks/obsidian", + "texture":"ironchest:model/shulker/silver/shulker_silver_obsidian" + } + }, + "vanilla":{ + "textures":{ + "particle":"minecraft:blocks/shulker_top_silver", + "texture":"minecraft:entity/shulker/shulker_silver" + } + } + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/ironchest/blockstates/iron_shulker_box_upgrades.json b/src/main/resources/assets/ironchest/blockstates/iron_shulker_box_upgrades.json new file mode 100644 index 00000000..70b9b482 --- /dev/null +++ b/src/main/resources/assets/ironchest/blockstates/iron_shulker_box_upgrades.json @@ -0,0 +1,56 @@ +{ + "forge_marker":1, + "defaults":{ + "model":"builtin/generated", + "transform":"forge:default-item" + }, + "variants":{ + "variant":{ + "copper_silver_shulker_upgrade":{ + "textures":{ + "layer0":"ironchest:items/shulker/copper_silver_upgrade" + } + }, + "diamond_crystal_shulker_upgrade":{ + "textures":{ + "layer0":"ironchest:items/shulker/diamond_crystal_upgrade" + } + }, + "diamond_obsidian_shulker_upgrade":{ + "textures":{ + "layer0":"ironchest:items/shulker/diamond_obsidian_upgrade" + } + }, + "gold_diamond_shulker_upgrade":{ + "textures":{ + "layer0":"ironchest:items/shulker/gold_diamond_upgrade" + } + }, + "iron_gold_shulker_upgrade":{ + "textures":{ + "layer0":"ironchest:items/shulker/iron_gold_upgrade" + } + }, + "silver_gold_shulker_upgrade":{ + "textures":{ + "layer0":"ironchest:items/shulker/silver_gold_upgrade" + } + }, + "vanilla_copper_shulker_upgrade":{ + "textures":{ + "layer0":"ironchest:items/shulker/vanilla_copper_upgrade" + } + }, + "vanilla_iron_shulker_upgrade":{ + "textures":{ + "layer0":"ironchest:items/shulker/vanilla_iron_upgrade" + } + }, + "copper_iron_shulker_upgrade":{ + "textures":{ + "layer0":"ironchest:items/shulker/copper_iron_upgrade" + } + } + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/ironchest/blockstates/iron_shulker_box_white.json b/src/main/resources/assets/ironchest/blockstates/iron_shulker_box_white.json new file mode 100644 index 00000000..2bbd7d76 --- /dev/null +++ b/src/main/resources/assets/ironchest/blockstates/iron_shulker_box_white.json @@ -0,0 +1,59 @@ +{ + "forge_marker":1, + "defaults":{ + "model":"ironchest:iron_shulker_box", + "transform":"forge:default-block" + }, + "variants":{ + "variant":{ + "iron":{ + "textures":{ + "particle":"ironchest:blocks/iron_break", + "texture":"ironchest:model/shulker/white/shulker_white_iron" + } + }, + "gold":{ + "textures":{ + "particle":"ironchest:blocks/gold_break", + "texture":"ironchest:model/shulker/white/shulker_white_gold" + } + }, + "diamond":{ + "textures":{ + "particle":"ironchest:blocks/diamond_break", + "texture":"ironchest:model/shulker/white/shulker_white_diamond" + } + }, + "copper":{ + "textures":{ + "particle":"ironchest:blocks/copper_break", + "texture":"ironchest:model/shulker/white/shulker_white_copper" + } + }, + "silver":{ + "textures":{ + "particle":"ironchest:blocks/silver_break", + "texture":"ironchest:model/shulker/white/shulker_white_silver" + } + }, + "crystal":{ + "textures":{ + "particle":"ironchest:blocks/crystal_break", + "texture":"ironchest:model/shulker/white/shulker_white_crystal" + } + }, + "obsidian":{ + "textures":{ + "particle":"minecraft:blocks/obsidian", + "texture":"ironchest:model/shulker/white/shulker_white_obsidian" + } + }, + "vanilla":{ + "textures":{ + "particle":"minecraft:blocks/shulker_top_white", + "texture":"minecraft:entity/shulker/shulker_white" + } + } + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/ironchest/blockstates/iron_shulker_box_yellow.json b/src/main/resources/assets/ironchest/blockstates/iron_shulker_box_yellow.json new file mode 100644 index 00000000..5da91c30 --- /dev/null +++ b/src/main/resources/assets/ironchest/blockstates/iron_shulker_box_yellow.json @@ -0,0 +1,59 @@ +{ + "forge_marker":1, + "defaults":{ + "model":"ironchest:iron_shulker_box", + "transform":"forge:default-block" + }, + "variants":{ + "variant":{ + "iron":{ + "textures":{ + "particle":"ironchest:blocks/iron_break", + "texture":"ironchest:model/shulker/yellow/shulker_yellow_iron" + } + }, + "gold":{ + "textures":{ + "particle":"ironchest:blocks/gold_break", + "texture":"ironchest:model/shulker/yellow/shulker_yellow_gold" + } + }, + "diamond":{ + "textures":{ + "particle":"ironchest:blocks/diamond_break", + "texture":"ironchest:model/shulker/yellow/shulker_yellow_diamond" + } + }, + "copper":{ + "textures":{ + "particle":"ironchest:blocks/copper_break", + "texture":"ironchest:model/shulker/yellow/shulker_yellow_copper" + } + }, + "silver":{ + "textures":{ + "particle":"ironchest:blocks/silver_break", + "texture":"ironchest:model/shulker/yellow/shulker_yellow_silver" + } + }, + "crystal":{ + "textures":{ + "particle":"ironchest:blocks/crystal_break", + "texture":"ironchest:model/shulker/yellow/shulker_yellow_crystal" + } + }, + "obsidian":{ + "textures":{ + "particle":"minecraft:blocks/obsidian", + "texture":"ironchest:model/shulker/yellow/shulker_yellow_obsidian" + } + }, + "vanilla":{ + "textures":{ + "particle":"minecraft:blocks/shulker_top_yellow", + "texture":"minecraft:entity/shulker/shulker_yellow" + } + } + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/ironchest/lang/cs_CZ.lang b/src/main/resources/assets/ironchest/lang/cs_CZ.lang index a202085b..76000eb4 100755 --- a/src/main/resources/assets/ironchest/lang/cs_CZ.lang +++ b/src/main/resources/assets/ironchest/lang/cs_CZ.lang @@ -1,17 +1,21 @@ -tile.ironchest:IRON.name=Železná truhla -tile.ironchest:GOLD.name=Zlatá truhla -tile.ironchest:DIAMOND.name=Diamantová truhla -tile.ironchest:COPPER.name=Měděná truhla -tile.ironchest:SILVER.name=Stříbrná truhla -tile.ironchest:CRYSTAL.name=Krystalová truhla -tile.ironchest:OBSIDIAN.name=Obsidiánová truhla +################ +# Chests # +################ -item.ironchest:IRONGOLD.name=Vylepšení železné truhly na zlatou -item.ironchest:GOLDDIAMOND.name=Vylepšení zlaté truhly na diamantovou -item.ironchest:COPPERSILVER.name=Vylepšení měděné truhly na stříbrnou -item.ironchest:SILVERGOLD.name=Vylepšení stříbrné truhly na zlatou -item.ironchest:COPPERIRON.name=Vylepšení měděné truhly na železnou -item.ironchest:DIAMONDCRYSTAL.name=Vylepšení diamantové truhly na krystalovou -item.ironchest:WOODIRON.name=Vylepšení dřevěné truhly na železnou -item.ironchest:WOODCOPPER.name=Vylepšení dřevěné truhly na měděnou -item.ironchest:DIAMONDOBSIDIAN.name=Vylepšení diamantové truhly na obsidiánovou +tile.ironchest.chest.iron.name=Železná truhla +tile.ironchest.chest.gold.name=Zlatá truhla +tile.ironchest.chest.diamond.name=Diamantová truhla +tile.ironchest.chest.copper.name=Měděná truhla +tile.ironchest.chest.silver.name=Stříbrná truhla +tile.ironchest.chest.crystal.name=Krystalová truhla +tile.ironchest.chest.obsidian.name=Obsidiánová truhla + +item.ironchest.chest.iron_gold.name=Vylepšení železné truhly na zlatou +item.ironchest.chest.gold_diamond.name=Vylepšení zlaté truhly na diamantovou +item.ironchest.chest.copper_silver.name=Vylepšení měděné truhly na stříbrnou +item.ironchest.chest.silver_gold.name=Vylepšení stříbrné truhly na zlatou +item.ironchest.chest.copper_iron.name=Vylepšení měděné truhly na železnou +item.ironchest.chest.diamond_crystal.name=Vylepšení diamantové truhly na krystalovou +item.ironchest.chest.wood_iron.name=Vylepšení dřevěné truhly na železnou +item.ironchest.chest.wood_copper.name=Vylepšení dřevěné truhly na měděnou +item.ironchest.chest.diamond_obsidian.name=Vylepšení diamantové truhly na obsidiánovou diff --git a/src/main/resources/assets/ironchest/lang/da_DK.lang b/src/main/resources/assets/ironchest/lang/da_DK.lang index 7e40e342..7dfe72ae 100755 --- a/src/main/resources/assets/ironchest/lang/da_DK.lang +++ b/src/main/resources/assets/ironchest/lang/da_DK.lang @@ -1,17 +1,21 @@ -tile.ironchest:IRON.name=Jern Kiste -tile.ironchest:GOLD.name=Guld Kiste -tile.ironchest:DIAMOND.name=Diamant Kiste -tile.ironchest:COPPER.name=Kobber Kiste -tile.ironchest:SILVER.name=Sølv Kiste -tile.ironchest:CRYSTAL.name=Krystal Kiste -tile.ironchest:OBSIDIAN.name=Obsidian Kiste +################ +# Chests # +################ -item.ironchest:IRONGOLD.name=Jern til Guld Kiste Opgradering -item.ironchest:GOLDDIAMOND.name=Guld til Diamant Kiste Opgradering -item.ironchest:COPPERSILVER.name=Kobber til Sølv Kiste Opgradering -item.ironchest:SILVERGOLD.name=Sølv til Guld Kiste Opgradering -item.ironchest:COPPERIRON.name=Kobber til Jern Kiste Opgradering -item.ironchest:DIAMONDCRYSTAL.name=Diamant til Krystal Kiste Opgradering -item.ironchest:WOODIRON.name=Træ til Jern Kiste Opgradering -item.ironchest:WOODCOPPER.name=Træ til Kobber Kiste Opgradering -item.ironchest:DIAMONDOBSIDIAN.name=Diamant til Obsidian Kiste Opgradering +tile.ironchest.chest.iron.name=Jern Kiste +tile.ironchest.chest.gold.name=Guld Kiste +tile.ironchest.chest.diamond.name=Diamant Kiste +tile.ironchest.chest.copper.name=Kobber Kiste +tile.ironchest.chest.silver.name=Sølv Kiste +tile.ironchest.chest.crystal.name=Krystal Kiste +tile.ironchest.chest.obsidian.name=Obsidian Kiste + +item.ironchest.chest.iron_gold.name=Jern til Guld Kiste Opgradering +item.ironchest.chest.gold_diamond.name=Guld til Diamant Kiste Opgradering +item.ironchest.chest.copper_silver.name=Kobber til Sølv Kiste Opgradering +item.ironchest.chest.silver_gold.name=Sølv til Guld Kiste Opgradering +item.ironchest.chest.copper_iron.name=Kobber til Jern Kiste Opgradering +item.ironchest.chest.diamond_crystal.name=Diamant til Krystal Kiste Opgradering +item.ironchest.chest.wood_iron.name=Træ til Jern Kiste Opgradering +item.ironchest.chest.wood_copper.name=Træ til Kobber Kiste Opgradering +item.ironchest.chest.diamond_obsidian.name=Diamant til Obsidian Kiste Opgradering diff --git a/src/main/resources/assets/ironchest/lang/de_DE.lang b/src/main/resources/assets/ironchest/lang/de_DE.lang index fd6c4037..87e1956a 100755 --- a/src/main/resources/assets/ironchest/lang/de_DE.lang +++ b/src/main/resources/assets/ironchest/lang/de_DE.lang @@ -1,25 +1,29 @@ -tile.ironchest:IRON.name=Eisentruhe -tile.ironchest:GOLD.name=Goldtruhe -tile.ironchest:DIAMOND.name=Diamanttruhe -tile.ironchest:COPPER.name=Kupfertruhe -tile.ironchest:SILVER.name=Silbertruhe -tile.ironchest:CRYSTAL.name=Kristalltruhe -tile.ironchest:OBSIDIAN.name=Obsidiantruhe -tile.ironchest:DIRTCHEST9000.name=DirtChest 9000! +################ +# Chests # +################ -item.ironchest:IRONGOLD.name=Eisen-zu-Goldtruhen-Upgrade -item.ironchest:GOLDDIAMOND.name=Gold-zu-Diamanttruhen-Upgrade -item.ironchest:COPPERSILVER.name=Kupfer-zu-Silbertruhen-Upgrade -item.ironchest:SILVERGOLD.name=Silber-zu-Goldtruhen-Upgrade -item.ironchest:COPPERIRON.name=Kupfer-zu-Eisentruhen-Upgrade -item.ironchest:DIAMONDCRYSTAL.name=Diamant-zu-Kristalltruhen-Upgrade -item.ironchest:WOODIRON.name=Holz-zu-Eisentruhen-Upgrade -item.ironchest:WOODCOPPER.name=Holz-zu-Kupfertruhen-Upgrade -item.ironchest:DIAMONDOBSIDIAN.name=Diamant-zu-Obsidiantruhen-Upgrade +tile.ironchest.chest.iron.name=Eisentruhe +tile.ironchest.chest.gold.name=Goldtruhe +tile.ironchest.chest.diamond.name=Diamanttruhe +tile.ironchest.chest.copper.name=Kupfertruhe +tile.ironchest.chest.silver.name=Silbertruhe +tile.ironchest.chest.crystal.name=Kristalltruhe +tile.ironchest.chest.obsidian.name=Obsidiantruhe +tile.ironchest.chest.dirtchest9000.name=DirtChest 9000! -book.ironchest:dirtchest9000.title=Wie du deine neue DirtChest 9000 nutzt! -book.ironchest:dirtchest9000.page1=Willkommen zu Ihrer neuen DirtChest 9000! Wir hoffen, dass Sie viele freudige Jahre genießen werden, wenn Sie Ihre Erd-Stacks in unserem nützlichen Speichergerät lagern. -book.ironchest:dirtchest9000.page2=Nutzung: Werfen Sie einfach den Erd-Stack Ihrer Wahl in den äußerst rezeptiven Slot und genießen Sie die Annehmlichkeit, diese Erde für Sie verfügbar zu haben, jedes mal, wenn Sie diese Truhe passieren! -book.ironchest:dirtchest9000.page3=Wir hoffen, Sie haben das Durchgehen dieser Bedienungsanleitung genossen, und hoffen, dass sie sich weiterhin entscheiden werden, in Zukunft unsere Produkte zu nutzen! Mit freundlichen Grüßen, Die DirtChest 9000 manual writers incorporated. -book.ironchest:dirtchest9000.page4=Garantie: Dieses Produkt hat keine Garantie jeglicher Sorte. Ihre Erde könnte nicht gespeichert werden, er könnte langsam in die Umwelt gesaugt werden, oder stattdessen könnte das Produkt gar nichts machen. -book.ironchest:dirtchest9000.page5=DirtChest 9000 ist freundlich zur Umwelt. Bitte entsorgen Sie diesen Guide verantwortungsbewusst, und tun sie nicht, was Sie immer tun und schmeißen ihn in irgendwelche Lava. Wir würden sehr traurig sein. +item.ironchest.chest.iron_gold.name=Eisen-zu-Goldtruhen-Upgrade +item.ironchest.chest.gold_diamond.name=Gold-zu-Diamanttruhen-Upgrade +item.ironchest.chest.copper_silver.name=Kupfer-zu-Silbertruhen-Upgrade +item.ironchest.chest.silver_gold.name=Silber-zu-Goldtruhen-Upgrade +item.ironchest.chest.copper_iron.name=Kupfer-zu-Eisentruhen-Upgrade +item.ironchest.chest.diamond_crystal.name=Diamant-zu-Kristalltruhen-Upgrade +item.ironchest.chest.wood_iron.name=Holz-zu-Eisentruhen-Upgrade +item.ironchest.chest.wood_copper.name=Holz-zu-Kupfertruhen-Upgrade +item.ironchest.chest.diamond_obsidian.name=Diamant-zu-Obsidiantruhen-Upgrade + +book.ironchest.dirtchest9000.title=Wie du deine neue DirtChest 9000 nutzt! +book.ironchest.dirtchest9000.page1=Willkommen zu Ihrer neuen DirtChest 9000! Wir hoffen, dass Sie viele freudige Jahre genießen werden, wenn Sie Ihre Erd-Stacks in unserem nützlichen Speichergerät lagern. +book.ironchest.dirtchest9000.page2=Nutzung: Werfen Sie einfach den Erd-Stack Ihrer Wahl in den äußerst rezeptiven Slot und genießen Sie die Annehmlichkeit, diese Erde für Sie verfügbar zu haben, jedes mal, wenn Sie diese Truhe passieren! +book.ironchest.dirtchest9000.page3=Wir hoffen, Sie haben das Durchgehen dieser Bedienungsanleitung genossen, und hoffen, dass sie sich weiterhin entscheiden werden, in Zukunft unsere Produkte zu nutzen! Mit freundlichen Grüßen, Die DirtChest 9000 manual writers incorporated. +book.ironchest.dirtchest9000.page4=Garantie: Dieses Produkt hat keine Garantie jeglicher Sorte. Ihre Erde könnte nicht gespeichert werden, er könnte langsam in die Umwelt gesaugt werden, oder stattdessen könnte das Produkt gar nichts machen. +book.ironchest.dirtchest9000.page5=DirtChest 9000 ist freundlich zur Umwelt. Bitte entsorgen Sie diesen Guide verantwortungsbewusst, und tun sie nicht, was Sie immer tun und schmeißen ihn in irgendwelche Lava. Wir würden sehr traurig sein. diff --git a/src/main/resources/assets/ironchest/lang/el_GR.lang b/src/main/resources/assets/ironchest/lang/el_GR.lang index 67285bbd..53fbd942 100755 --- a/src/main/resources/assets/ironchest/lang/el_GR.lang +++ b/src/main/resources/assets/ironchest/lang/el_GR.lang @@ -1,17 +1,21 @@ -tile.ironchest:IRON.name=Σιδερένιο Σεντούκι -tile.ironchest:GOLD.name=Χρυσό Σεντούκι -tile.ironchest:DIAMOND.name=Διαμαντένιο Σεντούκι -tile.ironchest:COPPER.name=Χάλκινο Σεντούκι -tile.ironchest:SILVER.name=Ασημένιο Σεντούκι -tile.ironchest:CRYSTAL.name=Κρυστάλλινο Σεντούκι -tile.ironchest:OBSIDIAN.name=Σεντούκι Οψιδιανού +################ +# Chests # +################ -item.ironchest:IRONGOLD.name=Αναβάθμιση από Σιδερένιο σε Χρυσό Σεντούκι -item.ironchest:GOLDDIAMOND.name=Αναβάθμιση από Χρυσό σε Διαμαντένιο Σεντούκι -item.ironchest:COPPERSILVER.name=Αναβάθμιση από Χάλκινο σε Ασημένιο Σεντούκι -item.ironchest:SILVERGOLD.name=Αναβάθμιση από Ασημένιο σε Χρυσό Σεντούκι -item.ironchest:COPPERIRON.name=Αναβάθμιση από Χάλκινο σε Σιδερένιο Σεντούκι -item.ironchest:DIAMONDCRYSTAL.name=Αναβάθμιση από Διαμαντένιο σε Κρυστάλλινο Σεντούκι -item.ironchest:WOODIRON.name=Αναβάθμιση από Ξύλινο σε Σιδερένιο Σεντούκι -item.ironchest:WOODCOPPER.name=Αναβάθμιση από Ξύλινο σε Χάλκινο Σεντούκι -item.ironchest:DIAMONDOBSIDIAN.name=Αναβάθμιση από Διαμαντένιο σε Σεντούκι Οψιδιανού +tile.ironchest.chest.iron.name=Σιδερένιο Σεντούκι +tile.ironchest.chest.gold.name=Χρυσό Σεντούκι +tile.ironchest.chest.diamond.name=Διαμαντένιο Σεντούκι +tile.ironchest.chest.copper.name=Χάλκινο Σεντούκι +tile.ironchest.chest.silver.name=Ασημένιο Σεντούκι +tile.ironchest.chest.crystal.name=Κρυστάλλινο Σεντούκι +tile.ironchest.chest.obsidian.name=Σεντούκι Οψιδιανού + +item.ironchest.chest.iron_gold.name=Αναβάθμιση από Σιδερένιο σε Χρυσό Σεντούκι +item.ironchest.chest.gold_diamond.name=Αναβάθμιση από Χρυσό σε Διαμαντένιο Σεντούκι +item.ironchest.chest.copper_silver.name=Αναβάθμιση από Χάλκινο σε Ασημένιο Σεντούκι +item.ironchest.chest.silver_gold.name=Αναβάθμιση από Ασημένιο σε Χρυσό Σεντούκι +item.ironchest.chest.copper_iron.name=Αναβάθμιση από Χάλκινο σε Σιδερένιο Σεντούκι +item.ironchest.chest.diamond_crystal.name=Αναβάθμιση από Διαμαντένιο σε Κρυστάλλινο Σεντούκι +item.ironchest.chest.wood_iron.name=Αναβάθμιση από Ξύλινο σε Σιδερένιο Σεντούκι +item.ironchest.chest.wood_copper.name=Αναβάθμιση από Ξύλινο σε Χάλκινο Σεντούκι +item.ironchest.chest.diamond_obsidian.name=Αναβάθμιση από Διαμαντένιο σε Σεντούκι Οψιδιανού diff --git a/src/main/resources/assets/ironchest/lang/en_PT.lang b/src/main/resources/assets/ironchest/lang/en_PT.lang index ea69e274..15955812 100755 --- a/src/main/resources/assets/ironchest/lang/en_PT.lang +++ b/src/main/resources/assets/ironchest/lang/en_PT.lang @@ -1,25 +1,29 @@ -tile.ironchest:IRON.name=Steel Coffer -tile.ironchest:GOLD.name=Gold Coffer -tile.ironchest:DIAMOND.name=Diamond Coffer -tile.ironchest:COPPER.name=Copper Coffer -tile.ironchest:SILVER.name=Silver Coffer -tile.ironchest:CRYSTAL.name=Shinin' Coffer -tile.ironchest:OBSIDIAN.name=Coffer o' tears -tile.ironchest:DIRTCHEST9000.name=FilthCoffer 9000! +################ +# Chests # +################ -item.ironchest:IRONGOLD.name=Steel to Gold Coffer Upgradin' -item.ironchest:GOLDDIAMOND.name=Gold to Diamond Coffer Upgradin' -item.ironchest:COPPERSILVER.name=Copper to Silver Coffer Upgradin' -item.ironchest:SILVERGOLD.name=Silver to Gold Coffer Upgradin' -item.ironchest:COPPERIRON.name=Copper to Steel Coffer Upgradin' -item.ironchest:DIAMONDCRYSTAL.name=Diamond to Shinin' Coffer Upgradin' -item.ironchest:WOODIRON.name=Timber to Steel Coffer Upgradin' -item.ironchest:WOODCOPPER.name=Wood to Copper Coffer Upgradin' -item.ironchest:DIAMONDOBSIDIAN.name=Diamond to Coffer o' Tears Upgradin' +tile.ironchest.chest.iron.name=Steel Coffer +tile.ironchest.chest.gold.name=Gold Coffer +tile.ironchest.chest.diamond.name=Diamond Coffer +tile.ironchest.chest.copper.name=Copper Coffer +tile.ironchest.chest.silver.name=Silver Coffer +tile.ironchest.chest.crystal.name=Shinin' Coffer +tile.ironchest.chest.obsidian.name=Coffer o' tears +tile.ironchest.chest.dirtchest9000.name=FilthCoffer 9000! -book.ironchest:dirtchest9000.title=How to use yer FilthCoffer 9000! -book.ironchest:dirtchest9000.page1=Welcome to yer new FilthCoffer 9000! We hope ye will enjoy many happy years of storing yer filth wit yer coffer . -book.ironchest:dirtchest9000.page2=Usage: simply put yer filth in yer slot and yer got yerself some filth any time ye need it! -book.ironchest:dirtchest9000.page3=We hope you have enjoyed reviewing this instruction manual, and hope you will consider using our products in future! Kind regards, The DirtChest 9000 manual writers incorporated. -book.ironchest:dirtchest9000.page4=Warranty: We can't keep yer filth from pirates. Yer filth may not be stored, it may slowly return to yer world, or it may stay in yer coffer. -book.ironchest:dirtchest9000.page5=FilthCoffer 9000 is kind to yer voyage. Throw yer paper in a coffer near by wit yer booty, and don't just chuck it into some molten rock. We wouldn't be the happiest o' pirates. +item.ironchest.chest.iron_gold.name=Steel to Gold Coffer Upgradin' +item.ironchest.chest.gold_diamond.name=Gold to Diamond Coffer Upgradin' +item.ironchest.chest.copper_silver.name=Copper to Silver Coffer Upgradin' +item.ironchest.chest.silver_gold.name=Silver to Gold Coffer Upgradin' +item.ironchest.chest.copper_iron.name=Copper to Steel Coffer Upgradin' +item.ironchest.chest.diamond_crystal.name=Diamond to Shinin' Coffer Upgradin' +item.ironchest.chest.wood_iron.name=Timber to Steel Coffer Upgradin' +item.ironchest.chest.wood_copper.name=Wood to Copper Coffer Upgradin' +item.ironchest.chest.diamond_obsidian.name=Diamond to Coffer o' Tears Upgradin' + +book.ironchest.dirtchest9000.title=How to use yer FilthCoffer 9000! +book.ironchest.dirtchest9000.page1=Welcome to yer new FilthCoffer 9000! We hope ye will enjoy many happy years of storing yer filth wit yer coffer . +book.ironchest.dirtchest9000.page2=Usage: simply put yer filth in yer slot and yer got yerself some filth any time ye need it! +book.ironchest.dirtchest9000.page3=We hope you have enjoyed reviewing this instruction manual, and hope you will consider using our products in future! Kind regards, The DirtChest 9000 manual writers incorporated. +book.ironchest.dirtchest9000.page4=Warranty: We can't keep yer filth from pirates. Yer filth may not be stored, it may slowly return to yer world, or it may stay in yer coffer. +book.ironchest.dirtchest9000.page5=FilthCoffer 9000 is kind to yer voyage. Throw yer paper in a coffer near by wit yer booty, and don't just chuck it into some molten rock. We wouldn't be the happiest o' pirates. diff --git a/src/main/resources/assets/ironchest/lang/en_US.lang b/src/main/resources/assets/ironchest/lang/en_US.lang index be393376..9abd9cb1 100755 --- a/src/main/resources/assets/ironchest/lang/en_US.lang +++ b/src/main/resources/assets/ironchest/lang/en_US.lang @@ -1,25 +1,177 @@ -tile.ironchest:IRON.name=Iron Chest -tile.ironchest:GOLD.name=Gold Chest -tile.ironchest:DIAMOND.name=Diamond Chest -tile.ironchest:COPPER.name=Copper Chest -tile.ironchest:SILVER.name=Silver Chest -tile.ironchest:CRYSTAL.name=Crystal Chest -tile.ironchest:OBSIDIAN.name=Obsidian Chest -tile.ironchest:DIRTCHEST9000.name=DirtChest 9000! - -item.ironchest:IRONGOLD.name=Iron to Gold Chest Upgrade -item.ironchest:GOLDDIAMOND.name=Gold to Diamond Chest Upgrade -item.ironchest:COPPERSILVER.name=Copper to Silver Chest Upgrade -item.ironchest:SILVERGOLD.name=Silver to Gold Chest Upgrade -item.ironchest:COPPERIRON.name=Copper to Iron Chest Upgrade -item.ironchest:DIAMONDCRYSTAL.name=Diamond to Crystal Chest Upgrade -item.ironchest:WOODIRON.name=Wood to Iron Chest Upgrade -item.ironchest:WOODCOPPER.name=Wood to Copper Chest Upgrade -item.ironchest:DIAMONDOBSIDIAN.name=Diamond to Obsidian Chest Upgrade - -book.ironchest:dirtchest9000.title=How to use your DirtChest 9000! -book.ironchest:dirtchest9000.page1="Welcome to your new DirtChest 9000! We hope you will enjoy many happy years of storing your stack of dirt in our storage utility." -book.ironchest:dirtchest9000.page2="Usage: simply insert the stack of dirt of your choice into the highly receptive slot and enjoy the great convenience of having that dirt available to you, any time you pass by this chest!" -book.ironchest:dirtchest9000.page3="We hope you have enjoyed reviewing this instruction manual, and hope you will consider using our products in future! Kind regards, The DirtChest 9000 manual writers incorporated." -book.ironchest:dirtchest9000.page4="Warranty: This product has no warranty of any kind. Your dirt may not be stored, it may slowly leech into the environment, or alternatively, it may not do anything at all." -book.ironchest:dirtchest9000.page5="DirtChest 9000 is kind to the environment. Please dispose of this guide book responsibly, and do not whatever you do just chuck it into some lava. We would be very sad." +################ +# Chests # +################ + +tile.ironchest.chest.iron.name=Iron Chest +tile.ironchest.chest.gold.name=Gold Chest +tile.ironchest.chest.diamond.name=Diamond Chest +tile.ironchest.chest.copper.name=Copper Chest +tile.ironchest.chest.silver.name=Silver Chest +tile.ironchest.chest.crystal.name=Crystal Chest +tile.ironchest.chest.obsidian.name=Obsidian Chest +tile.ironchest.chest.dirtchest9000.name=DirtChest 9000! + +item.ironchest.chest.iron_gold.name=Iron to Gold Chest Upgrade +item.ironchest.chest.gold_diamond.name=Gold to Diamond Chest Upgrade +item.ironchest.chest.copper_silver.name=Copper to Silver Chest Upgrade +item.ironchest.chest.silver_gold.name=Silver to Gold Chest Upgrade +item.ironchest.chest.copper_iron.name=Copper to Iron Chest Upgrade +item.ironchest.chest.diamond_crystal.name=Diamond to Crystal Chest Upgrade +item.ironchest.chest.wood_iron.name=Wood to Iron Chest Upgrade +item.ironchest.chest.wood_copper.name=Wood to Copper Chest Upgrade +item.ironchest.chest.diamond_obsidian.name=Diamond to Obsidian Chest Upgrade + +book.ironchest.dirtchest9000.title=How to use your DirtChest 9000! +book.ironchest.dirtchest9000.page1="Welcome to your new DirtChest 9000! We hope you will enjoy many happy years of storing your stack of dirt in our storage utility." +book.ironchest.dirtchest9000.page2="Usage: simply insert the stack of dirt of your choice into the highly receptive slot and enjoy the great convenience of having that dirt available to you, any time you pass by this chest!" +book.ironchest.dirtchest9000.page3="We hope you have enjoyed reviewing this instruction manual, and hope you will consider using our products in future! Kind regards, The DirtChest 9000 manual writers incorporated." +book.ironchest.dirtchest9000.page4="Warranty: This product has no warranty of any kind. Your dirt may not be stored, it may slowly leech into the environment, or alternatively, it may not do anything at all." +book.ironchest.dirtchest9000.page5="DirtChest 9000 is kind to the environment. Please dispose of this guide book responsibly, and do not whatever you do just chuck it into some lava. We would be very sad." + +####################### +# Shulker Boxes # +####################### + +tile.ironchest.shulker_box.iron.white.name=White Iron Shulker Box +tile.ironchest.shulker_box.iron.orange.name=Orange Iron Shulker Box +tile.ironchest.shulker_box.iron.magenta.name=Magenta Iron Shulker Box +tile.ironchest.shulker_box.iron.light_blue.name=Light Blue Iron Shulker Box +tile.ironchest.shulker_box.iron.yellow.name=Yellow Iron Shulker Box +tile.ironchest.shulker_box.iron.lime.name=Lime Iron Shulker Box +tile.ironchest.shulker_box.iron.pink.name=Pink Iron Shulker Box +tile.ironchest.shulker_box.iron.gray.name=Gray Iron Shulker Box +tile.ironchest.shulker_box.iron.silver.name=Silver Iron Shulker Box +tile.ironchest.shulker_box.iron.cyan.name=Cyan Iron Shulker Box +tile.ironchest.shulker_box.iron.purple.name=Purple Iron Shulker Box +tile.ironchest.shulker_box.iron.blue.name=Blue Iron Shulker Box +tile.ironchest.shulker_box.iron.brown.name=Brown Iron Shulker Box +tile.ironchest.shulker_box.iron.green.name=Green Iron Shulker Box +tile.ironchest.shulker_box.iron.red.name=Red Iron Shulker Box +tile.ironchest.shulker_box.iron.black.name=Black Iron Shulker Box + +tile.ironchest.shulker_box.gold.white.name=White Gold Shulker Box +tile.ironchest.shulker_box.gold.orange.name=Orange Gold Shulker Box +tile.ironchest.shulker_box.gold.magenta.name=Magenta Gold Shulker Box +tile.ironchest.shulker_box.gold.light_blue.name=Light Blue Gold Shulker Box +tile.ironchest.shulker_box.gold.yellow.name=Yellow Gold Shulker Box +tile.ironchest.shulker_box.gold.lime.name=Lime Gold Shulker Box +tile.ironchest.shulker_box.gold.pink.name=Pink Gold Shulker Box +tile.ironchest.shulker_box.gold.gray.name=Gray Gold Shulker Box +tile.ironchest.shulker_box.gold.silver.name=Silver Gold Shulker Box +tile.ironchest.shulker_box.gold.cyan.name=Cyan Gold Shulker Box +tile.ironchest.shulker_box.gold.purple.name=Purple Gold Shulker Box +tile.ironchest.shulker_box.gold.blue.name=Blue Gold Shulker Box +tile.ironchest.shulker_box.gold.brown.name=Brown Gold Shulker Box +tile.ironchest.shulker_box.gold.green.name=Green Gold Shulker Box +tile.ironchest.shulker_box.gold.red.name=Red Gold Shulker Box +tile.ironchest.shulker_box.gold.black.name=Black Gold Shulker Box + +tile.ironchest.shulker_box.diamond.white.name=White Diamond Shulker Box +tile.ironchest.shulker_box.diamond.orange.name=Orange Diamond Shulker Box +tile.ironchest.shulker_box.diamond.magenta.name=Magenta Diamond Shulker Box +tile.ironchest.shulker_box.diamond.light_blue.name=Light Blue Diamond Shulker Box +tile.ironchest.shulker_box.diamond.yellow.name=Yellow Diamond Shulker Box +tile.ironchest.shulker_box.diamond.lime.name=Lime Diamond Shulker Box +tile.ironchest.shulker_box.diamond.pink.name=Pink Diamond Shulker Box +tile.ironchest.shulker_box.diamond.gray.name=Gray Diamond Shulker Box +tile.ironchest.shulker_box.diamond.silver.name=Silver Diamond Shulker Box +tile.ironchest.shulker_box.diamond.cyan.name=Cyan Diamond Shulker Box +tile.ironchest.shulker_box.diamond.purple.name=Purple Diamond Shulker Box +tile.ironchest.shulker_box.diamond.blue.name=Blue Diamond Shulker Box +tile.ironchest.shulker_box.diamond.brown.name=Brown Diamond Shulker Box +tile.ironchest.shulker_box.diamond.green.name=Green Diamond Shulker Box +tile.ironchest.shulker_box.diamond.red.name=Red Diamond Shulker Box +tile.ironchest.shulker_box.diamond.black.name=Black Diamond Shulker Box + +tile.ironchest.shulker_box.copper.white.name=White Copper Shulker Box +tile.ironchest.shulker_box.copper.orange.name=Orange Copper Shulker Box +tile.ironchest.shulker_box.copper.magenta.name=Magenta Copper Shulker Box +tile.ironchest.shulker_box.copper.light_blue.name=Light Blue Copper Shulker Box +tile.ironchest.shulker_box.copper.yellow.name=Yellow Copper Shulker Box +tile.ironchest.shulker_box.copper.lime.name=Lime Copper Shulker Box +tile.ironchest.shulker_box.copper.pink.name=Pink Copper Shulker Box +tile.ironchest.shulker_box.copper.gray.name=Gray Copper Shulker Box +tile.ironchest.shulker_box.copper.silver.name=Silver Copper Shulker Box +tile.ironchest.shulker_box.copper.cyan.name=Cyan Copper Shulker Box +tile.ironchest.shulker_box.copper.purple.name=Purple Copper Shulker Box +tile.ironchest.shulker_box.copper.blue.name=Blue Copper Shulker Box +tile.ironchest.shulker_box.copper.brown.name=Brown Copper Shulker Box +tile.ironchest.shulker_box.copper.green.name=Green Copper Shulker Box +tile.ironchest.shulker_box.copper.red.name=Red Copper Shulker Box +tile.ironchest.shulker_box.copper.black.name=Black Copper Shulker Box + +tile.ironchest.shulker_box.silver.white.name=White Silver Shulker Box +tile.ironchest.shulker_box.silver.orange.name=Orange Silver Shulker Box +tile.ironchest.shulker_box.silver.magenta.name=Magenta Silver Shulker Box +tile.ironchest.shulker_box.silver.light_blue.name=Light Blue Silver Shulker Box +tile.ironchest.shulker_box.silver.yellow.name=Yellow Silver Shulker Box +tile.ironchest.shulker_box.silver.lime.name=Lime Silver Shulker Box +tile.ironchest.shulker_box.silver.pink.name=Pink Silver Shulker Box +tile.ironchest.shulker_box.silver.gray.name=Gray Silver Shulker Box +tile.ironchest.shulker_box.silver.silver.name=Silver Silver Shulker Box +tile.ironchest.shulker_box.silver.cyan.name=Cyan Silver Shulker Box +tile.ironchest.shulker_box.silver.purple.name=Purple Silver Shulker Box +tile.ironchest.shulker_box.silver.blue.name=Blue Silver Shulker Box +tile.ironchest.shulker_box.silver.brown.name=Brown Silver Shulker Box +tile.ironchest.shulker_box.silver.green.name=Green Silver Shulker Box +tile.ironchest.shulker_box.silver.red.name=Red Silver Shulker Box +tile.ironchest.shulker_box.silver.black.name=Black Silver Shulker Box + +tile.ironchest.shulker_box.crystal.white.name=White Crystal Shulker Box +tile.ironchest.shulker_box.crystal.orange.name=Orange Crystal Shulker Box +tile.ironchest.shulker_box.crystal.magenta.name=Magenta Crystal Shulker Box +tile.ironchest.shulker_box.crystal.light_blue.name=Light Blue Crystal Shulker Box +tile.ironchest.shulker_box.crystal.yellow.name=Yellow Crystal Shulker Box +tile.ironchest.shulker_box.crystal.lime.name=Lime Crystal Shulker Box +tile.ironchest.shulker_box.crystal.pink.name=Pink Crystal Shulker Box +tile.ironchest.shulker_box.crystal.gray.name=Gray Crystal Shulker Box +tile.ironchest.shulker_box.crystal.silver.name=Silver Crystal Shulker Box +tile.ironchest.shulker_box.crystal.cyan.name=Cyan Crystal Shulker Box +tile.ironchest.shulker_box.crystal.purple.name=Purple Crystal Shulker Box +tile.ironchest.shulker_box.crystal.blue.name=Blue Crystal Shulker Box +tile.ironchest.shulker_box.crystal.brown.name=Brown Crystal Shulker Box +tile.ironchest.shulker_box.crystal.green.name=Green Crystal Shulker Box +tile.ironchest.shulker_box.crystal.red.name=Red Crystal Shulker Box +tile.ironchest.shulker_box.crystal.black.name=Black Crystal Shulker Box + +tile.ironchest.shulker_box.obsidian.white.name=White Obsidian Shulker Box +tile.ironchest.shulker_box.obsidian.orange.name=Orange Obsidian Shulker Box +tile.ironchest.shulker_box.obsidian.magenta.name=Magenta Obsidian Shulker Box +tile.ironchest.shulker_box.obsidian.light_blue.name=Light Blue Obsidian Shulker Box +tile.ironchest.shulker_box.obsidian.yellow.name=Yellow Obsidian Shulker Box +tile.ironchest.shulker_box.obsidian.lime.name=Lime Obsidian Shulker Box +tile.ironchest.shulker_box.obsidian.pink.name=Pink Obsidian Shulker Box +tile.ironchest.shulker_box.obsidian.gray.name=Gray Obsidian Shulker Box +tile.ironchest.shulker_box.obsidian.silver.name=Silver Obsidian Shulker Box +tile.ironchest.shulker_box.obsidian.cyan.name=Cyan Obsidian Shulker Box +tile.ironchest.shulker_box.obsidian.purple.name=Purple Obsidian Shulker Box +tile.ironchest.shulker_box.obsidian.blue.name=Blue Obsidian Shulker Box +tile.ironchest.shulker_box.obsidian.brown.name=Brown Obsidian Shulker Box +tile.ironchest.shulker_box.obsidian.green.name=Green Obsidian Shulker Box +tile.ironchest.shulker_box.obsidian.red.name=Red Obsidian Shulker Box +tile.ironchest.shulker_box.obsidian.black.name=Black Obsidian Shulker Box + +item.ironchest.shulker_box.iron_gold.name=Iron to Gold Shulker Box Upgrade +item.ironchest.shulker_box.iron_gold.tooltip=Used to upgrade a Iron Shulker Box to a Gold Shulker Box\nThe color of the Shulker Box will stay the same. +item.ironchest.shulker_box.gold_diamond.name=Gold to Diamond Shulker Box Upgrade +item.ironchest.shulker_box.gold_diamond.tooltip=Used to upgrade a Gold Shulker Box to a Diamond Shulker Box\nThe color of the Shulker Box will stay the same. +item.ironchest.shulker_box.copper_silver.name=Copper to Silver Shulker Box Upgrade +item.ironchest.shulker_box.copper_silver.tooltip=Used to upgrade a Copper Shulker Box to a Silver Shulker Box\nThe color of the Shulker Box will stay the same. +item.ironchest.shulker_box.silver_gold.name=Silver to Gold Shulker Box Upgrade +item.ironchest.shulker_box.silver_gold.tooltip=Used to upgrade a Silver Shulker Box to a Gold Shulker Box\nThe color of the Shulker Box will stay the same. +item.ironchest.shulker_box.copper_iron.name=Copper to Iron Shulker Box Upgrade +item.ironchest.shulker_box.copper_iron.tooltip=Used to upgrade a Copper Shulker Box to a Iron Shulker Box\nThe color of the Shulker Box will stay the same. +item.ironchest.shulker_box.diamond_crystal.name=Diamond to Crystal Shulker Box Upgrade +item.ironchest.shulker_box.diamond_crystal.tooltip=Used to upgrade a Diamond Shulker Box to a Crystal Shulker Box\nThe color of the Shulker Box will stay the same. +item.ironchest.shulker_box.vanilla_iron.name=Vanilla to Iron Shulker Box Upgrade +item.ironchest.shulker_box.vanilla_iron.tooltip=Used to upgrade a Vanilla Shulker Box to a Iron Shulker Box\nThe color of the Shulker Box will stay the same. +item.ironchest.shulker_box.vanilla_copper.name=Vanilla to Copper Shulker Box Upgrade +item.ironchest.shulker_box.vanilla_copper.tooltip=Used to upgrade a Vanilla Shulker Box to a Copper Shulker Box\nThe color of the Shulker Box will stay the same. +item.ironchest.shulker_box.diamond_obsidian.name=Diamond to Obsidian Shulker Box Upgrade +item.ironchest.shulker_box.diamond_obsidian.tooltip=Used to upgrade a Diamond Shulker Box to a Obsidian Shulker Box\nThe color of the Shulker Box will stay the same. + +############## +# GUIs # +############## + +itemGroup.IronChest=Iron Chests diff --git a/src/main/resources/assets/ironchest/lang/es_ES.lang b/src/main/resources/assets/ironchest/lang/es_ES.lang index b770efc1..e96ac0e6 100755 --- a/src/main/resources/assets/ironchest/lang/es_ES.lang +++ b/src/main/resources/assets/ironchest/lang/es_ES.lang @@ -1,17 +1,21 @@ -tile.ironchest:IRON.name=Cofre de Hierro -tile.ironchest:GOLD.name=Cofre de Oro -tile.ironchest:DIAMOND.name=Cofre de Diamante -tile.ironchest:COPPER.name=Cofre de Cobre -tile.ironchest:SILVER.name=Cofre de Plata -tile.ironchest:CRYSTAL.name=Cofre de Cristal -tile.ironchest:OBSIDIAN.name=Cofre de Obsidiana +################ +# Chests # +################ -item.ironchest:IRONGOLD.name=Mejora de Cofre de Hierro a Oro -item.ironchest:GOLDDIAMOND.name=Mejora de Cofre de Oro a Diamante -item.ironchest:COPPERSILVER.name=Mejora de Cofre de Cobre a Plata -item.ironchest:SILVERGOLD.name=Mejora de Cofre de Plata a Oro -item.ironchest:COPPERIRON.name=Mejora de Cofre de Cobre a Hierro -item.ironchest:DIAMONDCRYSTAL.name=Mejora de Cofre de Diamante a Cristal -item.ironchest:WOODIRON.name=Mejora de Cofre de Madera a Hierro -item.ironchest:WOODCOPPER.name=Mejora de Cofre de Madera a Cobre -item.ironchest:DIAMONDOBSIDIAN.name=Mejora de Cofre de Diamante a Obsidiana +tile.ironchest.chest.iron.name=Cofre de Hierro +tile.ironchest.chest.gold.name=Cofre de Oro +tile.ironchest.chest.diamond.name=Cofre de Diamante +tile.ironchest.chest.copper.name=Cofre de Cobre +tile.ironchest.chest.silver.name=Cofre de Plata +tile.ironchest.chest.crystal.name=Cofre de Cristal +tile.ironchest.chest.obsidian.name=Cofre de Obsidiana + +item.ironchest.chest.iron_gold.name=Mejora de Cofre de Hierro a Oro +item.ironchest.chest.gold_diamond.name=Mejora de Cofre de Oro a Diamante +item.ironchest.chest.copper_silver.name=Mejora de Cofre de Cobre a Plata +item.ironchest.chest.silver_gold.name=Mejora de Cofre de Plata a Oro +item.ironchest.chest.copper_iron.name=Mejora de Cofre de Cobre a Hierro +item.ironchest.chest.diamond_crystal.name=Mejora de Cofre de Diamante a Cristal +item.ironchest.chest.wood_iron.name=Mejora de Cofre de Madera a Hierro +item.ironchest.chest.wood_copper.name=Mejora de Cofre de Madera a Cobre +item.ironchest.chest.diamond_obsidian.name=Mejora de Cofre de Diamante a Obsidiana diff --git a/src/main/resources/assets/ironchest/lang/et_EE.lang b/src/main/resources/assets/ironchest/lang/et_EE.lang index c0b3776c..a52d0919 100755 --- a/src/main/resources/assets/ironchest/lang/et_EE.lang +++ b/src/main/resources/assets/ironchest/lang/et_EE.lang @@ -1,18 +1,22 @@ -tile.ironchest:IRON.name=Raudkirst -tile.ironchest:GOLD.name=Kuldkirst -tile.ironchest:DIAMOND.name=Teemantkirst -tile.ironchest:COPPER.name=Vaskkirst -tile.ironchest:SILVER.name=Hõbekirst -tile.ironchest:CRYSTAL.name=Kristallkirst -tile.ironchest:OBSIDIAN.name=Obsidiaankirst -tile.ironchest:DIRTCHEST9000.name=Muldkirst 9000! +################ +# Chests # +################ -item.ironchest:IRONGOLD.name=Raudkirst kuld kirstuks -item.ironchest:GOLDDIAMOND.name=Kuldkirst teemandist kirstuks -item.ironchest:COPPERSILVER.name=Vaskkirst hõbedast kirstuks -item.ironchest:SILVERGOLD.name=Hõbekirst kullast kirstuks -item.ironchest:COPPERIRON.name=Vaskkirst rauast kirstuks -item.ironchest:DIAMONDCRYSTAL.name=Teemantkirst kristallist kirstuks -item.ironchest:WOODIRON.name=Puukirst rauast kirstuks -item.ironchest:WOODCOPPER.name=Puukirst vasest kirstuks -item.ironchest:DIAMONDOBSIDIAN.name=Teemantkirst obsidiaanist kirstuks +tile.ironchest.chest.iron.name=Raudkirst +tile.ironchest.chest.gold.name=Kuldkirst +tile.ironchest.chest.diamond.name=Teemantkirst +tile.ironchest.chest.copper.name=Vaskkirst +tile.ironchest.chest.silver.name=Hõbekirst +tile.ironchest.chest.crystal.name=Kristallkirst +tile.ironchest.chest.obsidian.name=Obsidiaankirst +tile.ironchest.chest.dirtchest9000.name=Muldkirst 9000! + +item.ironchest.chest.iron_gold.name=Raudkirst kuld kirstuks +item.ironchest.chest.gold_diamond.name=Kuldkirst teemandist kirstuks +item.ironchest.chest.copper_silver.name=Vaskkirst hõbedast kirstuks +item.ironchest.chest.silver_gold.name=Hõbekirst kullast kirstuks +item.ironchest.chest.copper_iron.name=Vaskkirst rauast kirstuks +item.ironchest.chest.diamond_crystal.name=Teemantkirst kristallist kirstuks +item.ironchest.chest.wood_iron.name=Puukirst rauast kirstuks +item.ironchest.chest.wood_copper.name=Puukirst vasest kirstuks +item.ironchest.chest.diamond_obsidian.name=Teemantkirst obsidiaanist kirstuks diff --git a/src/main/resources/assets/ironchest/lang/fr_CA.lang b/src/main/resources/assets/ironchest/lang/fr_CA.lang index d6095136..12233206 100644 --- a/src/main/resources/assets/ironchest/lang/fr_CA.lang +++ b/src/main/resources/assets/ironchest/lang/fr_CA.lang @@ -1,25 +1,29 @@ -tile.ironchest:IRON.name=Coffre en fer -tile.ironchest:GOLD.name=Coffre en or -tile.ironchest:DIAMOND.name=Coffre en diamant -tile.ironchest:COPPER.name=Coffre en cuivre -tile.ironchest:SILVER.name=Coffre en argent -tile.ironchest:CRYSTAL.name=Coffre en cristal -tile.ironchest:OBSIDIAN.name=Coffre en obsidienne -tile.ironchest:DIRTCHEST9000.name=DirtChest 9000 ! +################ +# Chests # +################ -item.ironchest:IRONGOLD.name=Upgrade de coffre en fer à l'or -item.ironchest:GOLDDIAMOND.name=Upgrade de coffre en or au diamant -item.ironchest:COPPERSILVER.name=Upgrade de coffre en cuivre à l'argent -item.ironchest:SILVERGOLD.name=Upgrade de coffre en argent à l'or -item.ironchest:COPPERIRON.name=Upgrade de coffre en cuivre au fer -item.ironchest:DIAMONDCRYSTAL.name=Upgrade de coffre en diamant au cristal -item.ironchest:WOODIRON.name=Upgrade de coffre en bois au fer -item.ironchest:WOODCOPPER.name=Upgrade de coffre en bois au cuivre -item.ironchest:DIAMONDOBSIDIAN.name=Upgrade de coffre en diamant à l'obsidienne +tile.ironchest.chest.iron.name=Coffre en fer +tile.ironchest.chest.gold.name=Coffre en or +tile.ironchest.chest.diamond.name=Coffre en diamant +tile.ironchest.chest.copper.name=Coffre en cuivre +tile.ironchest.chest.silver.name=Coffre en argent +tile.ironchest.chest.crystal.name=Coffre en cristal +tile.ironchest.chest.obsidian.name=Coffre en obsidienne +tile.ironchest.chest.dirtchest9000.name=DirtChest 9000 ! -book.ironchest:dirtchest9000.title=Comment utiliser votre DirtChest 9000 ! -book.ironchest:dirtchest9000.page1=Bienvenue à votre nouveau DirtChest 9000 ! Nous espérons que vous apprécierez les innombrables années heureuses à emmagasiner votre stack de terre dans notre utilitaire de stockage. -book.ironchest:dirtchest9000.page2=Utilisation : insérez tout simplement le stack de terre de votre choix dans la case hautement réceptive et appréciez l'immense commodité d'avoir cette terre disponible à portée de la main, à tout moment où vous passez devant ce coffre ! -book.ironchest:dirtchest9000.page3=Nous espérons que vous avez apprécié faire la critique de ce manuel d'instruction, et espérons que vous allez considérer utiliser nos produits dans le futur ! Nos meilleures salutations, les rédacteurs du manuel DirtChest 9000 inc. -book.ironchest:dirtchest9000.page4=Garantie : ce produit n'a aucune garantie quelconque. Votre terre peut ne pas être stockée, elle peut se fondre lentement dans l'environnement, ou encore, elle peut ne rien faire du tout. -book.ironchest:dirtchest9000.page5=DirtChest 9000 respecte l'environnement. Veuillez disposer de ce guide de manière responsable, et quoique vous fassiez, ne le balancez juste pas dans de la lave. Nous en serions attristés. +item.ironchest.chest.iron_gold.name=Upgrade de coffre en fer à l'or +item.ironchest.chest.gold_diamond.name=Upgrade de coffre en or au diamant +item.ironchest.chest.copper_silver.name=Upgrade de coffre en cuivre à l'argent +item.ironchest.chest.silver_gold.name=Upgrade de coffre en argent à l'or +item.ironchest.chest.copper_iron.name=Upgrade de coffre en cuivre au fer +item.ironchest.chest.diamond_crystal.name=Upgrade de coffre en diamant au cristal +item.ironchest.chest.wood_iron.name=Upgrade de coffre en bois au fer +item.ironchest.chest.wood_copper.name=Upgrade de coffre en bois au cuivre +item.ironchest.chest.diamond_obsidian.name=Upgrade de coffre en diamant à l'obsidienne + +book.ironchest.dirtchest9000.title=Comment utiliser votre DirtChest 9000 ! +book.ironchest.dirtchest9000.page1=Bienvenue à votre nouveau DirtChest 9000 ! Nous espérons que vous apprécierez les innombrables années heureuses à emmagasiner votre stack de terre dans notre utilitaire de stockage. +book.ironchest.dirtchest9000.page2=Utilisation : insérez tout simplement le stack de terre de votre choix dans la case hautement réceptive et appréciez l'immense commodité d'avoir cette terre disponible à portée de la main, à tout moment où vous passez devant ce coffre ! +book.ironchest.dirtchest9000.page3=Nous espérons que vous avez apprécié faire la critique de ce manuel d'instruction, et espérons que vous allez considérer utiliser nos produits dans le futur ! Nos meilleures salutations, les rédacteurs du manuel DirtChest 9000 inc. +book.ironchest.dirtchest9000.page4=Garantie : ce produit n'a aucune garantie quelconque. Votre terre peut ne pas être stockée, elle peut se fondre lentement dans l'environnement, ou encore, elle peut ne rien faire du tout. +book.ironchest.dirtchest9000.page5=DirtChest 9000 respecte l'environnement. Veuillez disposer de ce guide de manière responsable, et quoique vous fassiez, ne le balancez juste pas dans de la lave. Nous en serions attristés. diff --git a/src/main/resources/assets/ironchest/lang/fr_FR.lang b/src/main/resources/assets/ironchest/lang/fr_FR.lang index c1714d6c..5e66670a 100755 --- a/src/main/resources/assets/ironchest/lang/fr_FR.lang +++ b/src/main/resources/assets/ironchest/lang/fr_FR.lang @@ -1,19 +1,21 @@ -#fr_FR translated by robin4002 +################ +# Chests # +################ -tile.ironchest:IRON.name=Coffre en Fer -tile.ironchest:GOLD.name=Coffre en Or -tile.ironchest:DIAMOND.name=Coffre en Diamant -tile.ironchest:COPPER.name=Coffre en Cuivre -tile.ironchest:SILVER.name=Coffre en Argent -tile.ironchest:CRYSTAL.name=Coffre en Cristal -tile.ironchest:OBSIDIAN.name=Coffre en Obsidienne +tile.ironchest.chest.iron.name=Coffre en Fer +tile.ironchest.chest.gold.name=Coffre en Or +tile.ironchest.chest.diamond.name=Coffre en Diamant +tile.ironchest.chest.copper.name=Coffre en Cuivre +tile.ironchest.chest.silver.name=Coffre en Argent +tile.ironchest.chest.crystal.name=Coffre en Cristal +tile.ironchest.chest.obsidian.name=Coffre en Obsidienne -item.ironchest:IRONGOLD.name=Amélioration de coffre en fer à or -item.ironchest:GOLDDIAMOND.name=Amélioration de coffre en or à diamant -item.ironchest:COPPERSILVER.name=Amélioration de coffre en cuivre à argent -item.ironchest:SILVERGOLD.name=Amélioration de coffre en argent à or -item.ironchest:COPPERIRON.name=Amélioration de coffre en cuivre à fer -item.ironchest:DIAMONDCRYSTAL.name=Amélioration de coffre en diamant à crital -item.ironchest:WOODIRON.name=Amélioration de coffre en bois à fer -item.ironchest:WOODCOPPER.name=Amélioration de coffre en bois à cuivre -item.ironchest:DIAMONDOBSIDIAN.name=Amélioration de coffre en diamant à obsidienne +item.ironchest.chest.iron_gold.name=Amélioration de coffre en fer à or +item.ironchest.chest.gold_diamond.name=Amélioration de coffre en or à diamant +item.ironchest.chest.copper_silver.name=Amélioration de coffre en cuivre à argent +item.ironchest.chest.silver_gold.name=Amélioration de coffre en argent à or +item.ironchest.chest.copper_iron.name=Amélioration de coffre en cuivre à fer +item.ironchest.chest.diamond_crystal.name=Amélioration de coffre en diamant à crital +item.ironchest.chest.wood_iron.name=Amélioration de coffre en bois à fer +item.ironchest.chest.wood_copper.name=Amélioration de coffre en bois à cuivre +item.ironchest.chest.diamond_obsidian.name=Amélioration de coffre en diamant à obsidienne diff --git a/src/main/resources/assets/ironchest/lang/hu_HU.lang b/src/main/resources/assets/ironchest/lang/hu_HU.lang index 88d82d83..df8f0854 100644 --- a/src/main/resources/assets/ironchest/lang/hu_HU.lang +++ b/src/main/resources/assets/ironchest/lang/hu_HU.lang @@ -1,25 +1,29 @@ -tile.ironchest:IRON.name=Vas láda -tile.ironchest:GOLD.name=Arany láda -tile.ironchest:DIAMOND.name=Gyémánt láda -tile.ironchest:COPPER.name=Réz láda -tile.ironchest:SILVER.name=Ezüst láda -tile.ironchest:CRYSTAL.name=Kristály láda -tile.ironchest:OBSIDIAN.name=Obszidián láda -tile.ironchest:DIRTCHEST9000.name=DirtChest 9000! +################ +# Chests # +################ -item.ironchest:IRONGOLD.name=Vasról arany ládára bővítő -item.ironchest:GOLDDIAMOND.name=Aranyról gyémánt ládára bővítő -item.ironchest:COPPERSILVER.name=Rézről ezüst ládára bővítő -item.ironchest:SILVERGOLD.name=Ezüstről arany ládára bővítő -item.ironchest:COPPERIRON.name=Részről vas ládára bővítő -item.ironchest:DIAMONDCRYSTAL.name=Gyémántról kristály ládára bővítő -item.ironchest:WOODIRON.name=Normálról (fa) vas ládára bővítő -item.ironchest:WOODCOPPER.name=Normálról (fa) réz ládára bővítő -item.ironchest:DIAMONDOBSIDIAN.name=Gyémántról obszidián ládára bővítő +tile.ironchest.chest.iron.name=Vas láda +tile.ironchest.chest.gold.name=Arany láda +tile.ironchest.chest.diamond.name=Gyémánt láda +tile.ironchest.chest.copper.name=Réz láda +tile.ironchest.chest.silver.name=Ezüst láda +tile.ironchest.chest.crystal.name=Kristály láda +tile.ironchest.chest.obsidian.name=Obszidián láda +tile.ironchest.chest.dirtchest9000.name=DirtChest 9000! -book.ironchest:dirtchest9000.title=Hogyan használd a DirtChest 9000-et! -book.ironchest:dirtchest9000.page1=Üdvözöl az új DirtChest 9000! Reméljük sok boldog évig élvezni fogod egy halom föld tárólásának eme vadiúj módját. -book.ironchest:dirtchest9000.page2=Használat: egyszerűen pakolj bele egy halom földet eme különlegesen érzékeny tárolóegységbe és élvezd a kényelmet, hogy egy halom föld mindig rendelkezésedre fog állni, bármikor nyitod is ki ezt a ládát. -book.ironchest:dirtchest9000.page3=Reméljük, hogy élvezted eme kézikönyv olvasgatását, és megfontolod más termékünk használatát is a jövöben. Üdvözlettel: A DirtChest 9000 kézikönyv írói. -book.ironchest:dirtchest9000.page4=Garancia: Ez a termék nem rendelkezik semmiféle garanciával. A belepakolt föld lehet, hogy nem is kerül tárolásra, elszivárog a környezetbe, vagy az is lehetséges hogy nem történik vele semmi. -book.ironchest:dirtchest9000.page5=A DirtChest 9000 környezetbarát termék. Kérjül fokozottan ügyelj erre a kézikönyv megsemmisitésekor, és semmiképpen se dobd lávába. Akkor ugyanis nagyon szomorúak leszünk. \ No newline at end of file +item.ironchest.chest.iron_gold.name=Vasról arany ládára bővítő +item.ironchest.chest.gold_diamond.name=Aranyról gyémánt ládára bővítő +item.ironchest.chest.copper_silver.name=Rézről ezüst ládára bővítő +item.ironchest.chest.silver_gold.name=Ezüstről arany ládára bővítő +item.ironchest.chest.copper_iron.name=Részről vas ládára bővítő +item.ironchest.chest.diamond_crystal.name=Gyémántról kristály ládára bővítő +item.ironchest.chest.wood_iron.name=Normálról (fa) vas ládára bővítő +item.ironchest.chest.wood_copper.name=Normálról (fa) réz ládára bővítő +item.ironchest.chest.diamond_obsidian.name=Gyémántról obszidián ládára bővítő + +book.ironchest.dirtchest9000.title=Hogyan használd a DirtChest 9000-et! +book.ironchest.dirtchest9000.page1=Üdvözöl az új DirtChest 9000! Reméljük sok boldog évig élvezni fogod egy halom föld tárólásának eme vadiúj módját. +book.ironchest.dirtchest9000.page2=Használat: egyszerűen pakolj bele egy halom földet eme különlegesen érzékeny tárolóegységbe és élvezd a kényelmet, hogy egy halom föld mindig rendelkezésedre fog állni, bármikor nyitod is ki ezt a ládát. +book.ironchest.dirtchest9000.page3=Reméljük, hogy élvezted eme kézikönyv olvasgatását, és megfontolod más termékünk használatát is a jövöben. Üdvözlettel: A DirtChest 9000 kézikönyv írói. +book.ironchest.dirtchest9000.page4=Garancia: Ez a termék nem rendelkezik semmiféle garanciával. A belepakolt föld lehet, hogy nem is kerül tárolásra, elszivárog a környezetbe, vagy az is lehetséges hogy nem történik vele semmi. +book.ironchest.dirtchest9000.page5=A DirtChest 9000 környezetbarát termék. Kérjül fokozottan ügyelj erre a kézikönyv megsemmisitésekor, és semmiképpen se dobd lávába. Akkor ugyanis nagyon szomorúak leszünk. \ No newline at end of file diff --git a/src/main/resources/assets/ironchest/lang/it_IT.lang b/src/main/resources/assets/ironchest/lang/it_IT.lang index fc3d82cd..610d317e 100755 --- a/src/main/resources/assets/ironchest/lang/it_IT.lang +++ b/src/main/resources/assets/ironchest/lang/it_IT.lang @@ -1,25 +1,29 @@ -tile.ironchest:IRON.name=Baule di ferro -tile.ironchest:GOLD.name=Baule d'oro -tile.ironchest:DIAMOND.name=Baule di diamante -tile.ironchest:COPPER.name=Baule di rame -tile.ironchest:SILVER.name=Baule d'argento -tile.ironchest:CRYSTAL.name=Baule di cristallo -tile.ironchest:OBSIDIAN.name=Baule di ossidiana -tile.ironchest:DIRTCHEST9000.name=DirtChest 9000! +################ +# Chests # +################ -item.ironchest:IRONGOLD.name=Potenziamento da ferro a oro -item.ironchest:GOLDDIAMOND.name=Potenziamento da oro a diamante -item.ironchest:COPPERSILVER.name=Potenziamento da rame a argento -item.ironchest:SILVERGOLD.name=Potenziamento da argento a oro -item.ironchest:COPPERIRON.name=Potenziamento da rame a ferro -item.ironchest:DIAMONDCRYSTAL.name=Potenziamento da diamante a cristallo -item.ironchest:WOODIRON.name=Potenziamento da legno a ferro -item.ironchest:WOODCOPPER.name=Potenziamento da legno a rame -item.ironchest:DIAMONDOBSIDIAN.name=Potenziamento da diamante a ossidiana +tile.ironchest.chest.iron.name=Baule di ferro +tile.ironchest.chest.gold.name=Baule d'oro +tile.ironchest.chest.diamond.name=Baule di diamante +tile.ironchest.chest.copper.name=Baule di rame +tile.ironchest.chest.silver.name=Baule d'argento +tile.ironchest.chest.crystal.name=Baule di cristallo +tile.ironchest.chest.obsidian.name=Baule di ossidiana +tile.ironchest.chest.dirtchest9000.name=DirtChest 9000! -book.ironchest:dirtchest9000.title=Come usare la tua DirtChest 9000! -book.ironchest:dirtchest9000.page1=Benvenuto alla tua nuova DirtChest 9000! Speriamo che possiate godere di molti anni felici in cui imagazzinate grandi quantità di terra nei nostri contenitori. -book.ironchest:dirtchest9000.page2=Uso: inserisci uno stack di terra nello slot e goditi la grande convenienza di avere della terra a tua disposizione ogni volta che passi vicino alla cassa! -book.ironchest:dirtchest9000.page3=Speriamo che questo manuale vi sia stato utile, e speriamo che prenderete in considerazione usare i nostri prodotti in futuro ! I migliori saluti, i scrittori del manuale per la DirtChest 9000. -book.ironchest:dirtchest9000.page4=Garanzia: Questo prodotto non ha nessuna garanzia di alcun tipo. La tua terra potrebbe non essere imagazzinata, potrebbe lentamente fuoriuscire nell'ambiente, oppure, non farà niente. -book.ironchest:dirtchest9000.page5=La DirtChest 9000 è amico dell'ambiente. Per favore conservate questo libro in un modo responsabile, e non buttatelo nella lava come un oggetto qualsiasi. Saremmo veramente tristi. +item.ironchest.chest.iron_gold.name=Potenziamento da ferro a oro +item.ironchest.chest.gold_diamond.name=Potenziamento da oro a diamante +item.ironchest.chest.copper_silver.name=Potenziamento da rame a argento +item.ironchest.chest.silver_gold.name=Potenziamento da argento a oro +item.ironchest.chest.copper_iron.name=Potenziamento da rame a ferro +item.ironchest.chest.diamond_crystal.name=Potenziamento da diamante a cristallo +item.ironchest.chest.wood_iron.name=Potenziamento da legno a ferro +item.ironchest.chest.wood_copper.name=Potenziamento da legno a rame +item.ironchest.chest.diamond_obsidian.name=Potenziamento da diamante a ossidiana + +book.ironchest.dirtchest9000.title=Come usare la tua DirtChest 9000! +book.ironchest.dirtchest9000.page1=Benvenuto alla tua nuova DirtChest 9000! Speriamo che possiate godere di molti anni felici in cui imagazzinate grandi quantità di terra nei nostri contenitori. +book.ironchest.dirtchest9000.page2=Uso: inserisci uno stack di terra nello slot e goditi la grande convenienza di avere della terra a tua disposizione ogni volta che passi vicino alla cassa! +book.ironchest.dirtchest9000.page3=Speriamo che questo manuale vi sia stato utile, e speriamo che prenderete in considerazione usare i nostri prodotti in futuro ! I migliori saluti, i scrittori del manuale per la DirtChest 9000. +book.ironchest.dirtchest9000.page4=Garanzia: Questo prodotto non ha nessuna garanzia di alcun tipo. La tua terra potrebbe non essere imagazzinata, potrebbe lentamente fuoriuscire nell'ambiente, oppure, non farà niente. +book.ironchest.dirtchest9000.page5=La DirtChest 9000 è amico dell'ambiente. Per favore conservate questo libro in un modo responsabile, e non buttatelo nella lava come un oggetto qualsiasi. Saremmo veramente tristi. diff --git a/src/main/resources/assets/ironchest/lang/ko_KR.lang b/src/main/resources/assets/ironchest/lang/ko_KR.lang index 837ae58b..7f475e7a 100755 --- a/src/main/resources/assets/ironchest/lang/ko_KR.lang +++ b/src/main/resources/assets/ironchest/lang/ko_KR.lang @@ -1,25 +1,29 @@ -tile.ironchest:IRON.name=철 상자 -tile.ironchest:GOLD.name=금 상자 -tile.ironchest:DIAMOND.name=다이아몬드 상자 -tile.ironchest:COPPER.name=구리 상자 -tile.ironchest:SILVER.name=은 상자 -tile.ironchest:CRYSTAL.name=수정 상자 -tile.ironchest:OBSIDIAN.name=흑요석 상자 -tile.ironchest:DIRTCHEST9000.name=흙 상자 9000! +################ +# Chests # +################ -item.ironchest:IRONGOLD.name=철 상자를 금 상자로 업그레이드 -item.ironchest:GOLDDIAMOND.name=금 상자를 다이아몬드 상자로 업그레이드 -item.ironchest:COPPERSILVER.name=구리 상자를 은 상자로 업그레이드 -item.ironchest:SILVERGOLD.name=은 상자를 금 상자로 업그레이드 -item.ironchest:COPPERIRON.name=구리 상자를 철 상자로 업그레이드 -item.ironchest:DIAMONDCRYSTAL.name=다이아몬드 상자를 수정 상자로 업그레이드 -item.ironchest:WOODIRON.name=나무 상자를 철 상자로 업그레이드 -item.ironchest:WOODCOPPER.name=나무 상자를 구리 상자로 업그레이드 -item.ironchest:DIAMONDOBSIDIAN.name=다이아몬드 상자를 흑요석 상자로 업그레이드 +tile.ironchest.chest.iron.name=철 상자 +tile.ironchest.chest.gold.name=금 상자 +tile.ironchest.chest.diamond.name=다이아몬드 상자 +tile.ironchest.chest.copper.name=구리 상자 +tile.ironchest.chest.silver.name=은 상자 +tile.ironchest.chest.crystal.name=수정 상자 +tile.ironchest.chest.obsidian.name=흑요석 상자 +tile.ironchest.chest.dirtchest9000.name=흙 상자 9000! -book.ironchest:dirtchest9000.title=흙 상자 9000을 사용하는 방법! -book.ironchest:dirtchest9000.page1=새로운 흙 상자 9000을 사용하게 되신 것을 환영합니다! 우리는 당신이 이 저장 도구에서 흙들을 많은 해 동안 행복하게 저장하기를 기원합니다. +item.ironchest.chest.iron_gold.name=철 상자를 금 상자로 업그레이드 +item.ironchest.chest.gold_diamond.name=금 상자를 다이아몬드 상자로 업그레이드 +item.ironchest.chest.copper_silver.name=구리 상자를 은 상자로 업그레이드 +item.ironchest.chest.silver_gold.name=은 상자를 금 상자로 업그레이드 +item.ironchest.chest.copper_iron.name=구리 상자를 철 상자로 업그레이드 +item.ironchest.chest.diamond_crystal.name=다이아몬드 상자를 수정 상자로 업그레이드 +item.ironchest.chest.wood_iron.name=나무 상자를 철 상자로 업그레이드 +item.ironchest.chest.wood_copper.name=나무 상자를 구리 상자로 업그레이드 +item.ironchest.chest.diamond_obsidian.name=다이아몬드 상자를 흑요석 상자로 업그레이드 + +book.ironchest.dirtchest9000.title=흙 상자 9000을 사용하는 방법! +book.ironchest.dirtchest9000.page1=새로운 흙 상자 9000을 사용하게 되신 것을 환영합니다! 우리는 당신이 이 저장 도구에서 흙들을 많은 해 동안 행복하게 저장하기를 기원합니다. 사용법: 단순히 흙 뭉치들을 아이템 슬롯에 넣고 이 상자를 지나갈 때마다 언제나 당신에게 제공되어지는 흙들의 편리함을 누리세요! -book.ironchest:dirtchest9000.page3=우리는 당신이 이 사용설명서를 즐겁게 읽었고, 나중에 이 제품을 사용하기를 바랍니다! 흙 상자 9000 매뉴얼 -book.ironchest:dirtchest9000.page4=주의: 이 제품에는 어떤 종류의 보증도 하지 않습니다 당신의 흙들은 저장되지 않을 수도 있습니다. 그러면 이 흙 상자는 천천히 환경 속으로 돌아가거나, 혹은 아무것도 하지 않을 것입니다. -book.ironchest:dirtchest9000.page5=흙 상자 9000은 환경 친화적입니다. 가이드북의 처분에는 책임이 따릅니다, 그러니 어떠한 경우라도 용암에 버리지 마세요. 우리는 매우 슬플 것입니다. +book.ironchest.dirtchest9000.page3=우리는 당신이 이 사용설명서를 즐겁게 읽었고, 나중에 이 제품을 사용하기를 바랍니다! 흙 상자 9000 매뉴얼 +book.ironchest.dirtchest9000.page4=주의: 이 제품에는 어떤 종류의 보증도 하지 않습니다 당신의 흙들은 저장되지 않을 수도 있습니다. 그러면 이 흙 상자는 천천히 환경 속으로 돌아가거나, 혹은 아무것도 하지 않을 것입니다. +book.ironchest.dirtchest9000.page5=흙 상자 9000은 환경 친화적입니다. 가이드북의 처분에는 책임이 따릅니다, 그러니 어떠한 경우라도 용암에 버리지 마세요. 우리는 매우 슬플 것입니다. diff --git a/src/main/resources/assets/ironchest/lang/nb_NO.lang b/src/main/resources/assets/ironchest/lang/nb_NO.lang index c5beb18e..5c823e6c 100755 --- a/src/main/resources/assets/ironchest/lang/nb_NO.lang +++ b/src/main/resources/assets/ironchest/lang/nb_NO.lang @@ -1,25 +1,29 @@ -tile.ironchest:IRON.name=Jernkiste -tile.ironchest:GOLD.name=Gullkiste -tile.ironchest:DIAMOND.name=Diamantkiste -tile.ironchest:COPPER.name=Kobberkiste -tile.ironchest:SILVER.name=Sølvkiste -tile.ironchest:CRYSTAL.name=Krystallkiste -tile.ironchest:OBSIDIAN.name=Obsidiankiste -tile.ironchest:DIRTCHEST9000.name=JordKiste 9000! +################ +# Chests # +################ -item.ironchest:IRONGOLD.name=Jern til Gull Kisteoppgradering -item.ironchest:GOLDDIAMOND.name=Gull til Diamant Kisteoppgradering -item.ironchest:COPPERSILVER.name=Kobber til Sølv Kisteoppgradering -item.ironchest:SILVERGOLD.name=Sølv til Gull Kisteoppgradering -item.ironchest:COPPERIRON.name=Kobber til Jern Kisteoppgradering -item.ironchest:DIAMONDCRYSTAL.name=Diamant til Krystall Kisteoppgradering -item.ironchest:WOODIRON.name=Tre til Jern Kisteoppgradering -item.ironchest:WOODCOPPER.name=Tre til Kobber Kisteoppgradering -item.ironchest:DIAMONDOBSIDIAN.name=Diamant til Obsidian Kisteoppgradering +tile.ironchest.chest.iron.name=Jernkiste +tile.ironchest.chest.gold.name=Gullkiste +tile.ironchest.chest.diamond.name=Diamantkiste +tile.ironchest.chest.copper.name=Kobberkiste +tile.ironchest.chest.silver.name=Sølvkiste +tile.ironchest.chest.crystal.name=Krystallkiste +tile.ironchest.chest.obsidian.name=Obsidiankiste +tile.ironchest.chest.dirtchest9000.name=JordKiste 9000! -book.ironchest:dirtchest9000.title=Hvordan bruker din JordKiste 9000! -book.ironchest:dirtchest9000.page1=Velkommen til din nye JordKiste9000! Vi håper du vil nyte mange lykkelige år med lagring av din stabel av jord i vå lager verktøy. -book.ironchest:dirtchest9000.page2=Bruk: bare å sette bunken med jord av ditt valg i den svært mottakelige sporet og nyte den store fordelen med åa den jorden tilgjengelig for deg, nådu passerer denne kisten! -book.ironchest:dirtchest9000.page3=Vi håper du har hatt en god fornøyelse gjennom denne bruksanvisningen, og hår du vil vurdere å bruke vå produkter i fremtiden! Vennlig hilsen, JordKiste9000 manual forfattere innarbeidet. -book.ironchest:dirtchest9000.page4=Garanti: Dette produktet har ingen garantier av noe slag. Din jord kan ikke lagres, det kan sakte lekke ut i miljøet, eller alternativt, kan det ikke gjøre noe i det hele tatt. -book.ironchest:dirtchest9000.page5=JordKiste 9000 er snill mot miljøet. Vennligst ta hånd om denne veileder boken ansvarlig, og hva du enn gjør ikke kast den inn i noe lav. Vi ville bli veldig trist. +item.ironchest.chest.iron_gold.name=Jern til Gull Kisteoppgradering +item.ironchest.chest.gold_diamond.name=Gull til Diamant Kisteoppgradering +item.ironchest.chest.copper_silver.name=Kobber til Sølv Kisteoppgradering +item.ironchest.chest.silver_gold.name=Sølv til Gull Kisteoppgradering +item.ironchest.chest.copper_iron.name=Kobber til Jern Kisteoppgradering +item.ironchest.chest.diamond_crystal.name=Diamant til Krystall Kisteoppgradering +item.ironchest.chest.wood_iron.name=Tre til Jern Kisteoppgradering +item.ironchest.chest.wood_copper.name=Tre til Kobber Kisteoppgradering +item.ironchest.chest.diamond_obsidian.name=Diamant til Obsidian Kisteoppgradering + +book.ironchest.dirtchest9000.title=Hvordan bruker din JordKiste 9000! +book.ironchest.dirtchest9000.page1=Velkommen til din nye JordKiste9000! Vi håper du vil nyte mange lykkelige år med lagring av din stabel av jord i vå lager verktøy. +book.ironchest.dirtchest9000.page2=Bruk: bare å sette bunken med jord av ditt valg i den svært mottakelige sporet og nyte den store fordelen med åa den jorden tilgjengelig for deg, nådu passerer denne kisten! +book.ironchest.dirtchest9000.page3=Vi håper du har hatt en god fornøyelse gjennom denne bruksanvisningen, og hår du vil vurdere å bruke vå produkter i fremtiden! Vennlig hilsen, JordKiste9000 manual forfattere innarbeidet. +book.ironchest.dirtchest9000.page4=Garanti: Dette produktet har ingen garantier av noe slag. Din jord kan ikke lagres, det kan sakte lekke ut i miljøet, eller alternativt, kan det ikke gjøre noe i det hele tatt. +book.ironchest.dirtchest9000.page5=JordKiste 9000 er snill mot miljøet. Vennligst ta hånd om denne veileder boken ansvarlig, og hva du enn gjør ikke kast den inn i noe lav. Vi ville bli veldig trist. diff --git a/src/main/resources/assets/ironchest/lang/nl_NL.lang b/src/main/resources/assets/ironchest/lang/nl_NL.lang index fb3a2f59..343148f3 100755 --- a/src/main/resources/assets/ironchest/lang/nl_NL.lang +++ b/src/main/resources/assets/ironchest/lang/nl_NL.lang @@ -1,25 +1,25 @@ -tile.ironchest:IRON.name=Ijzeren Kist -tile.ironchest:GOLD.name=Gouden Kist -tile.ironchest:DIAMOND.name=Diamanten Kist -tile.ironchest:COPPER.name=Koperen Kist -tile.ironchest:SILVER.name=Zilveren Kist -tile.ironchest:CRYSTAL.name=Kristallen Kist -tile.ironchest:OBSIDIAN.name=Obsidiaanen Kist -tile.ironchest:DIRTCHEST9000.name=Aarden Kist 9000! +tile.ironchest.chest.iron.name=Ijzeren Kist +tile.ironchest.chest.gold.name=Gouden Kist +tile.ironchest.chest.diamond.name=Diamanten Kist +tile.ironchest.chest.copper.name=Koperen Kist +tile.ironchest.chest.silver.name=Zilveren Kist +tile.ironchest.chest.crystal.name=Kristallen Kist +tile.ironchest.chest.obsidian.name=Obsidiaanen Kist +tile.ironchest.chest.dirtchest9000.name=Aarden Kist 9000! -item.ironchest:IRONGOLD.name=Ijzeren naar Gouden Kist Transformatie -item.ironchest:GOLDDIAMOND.name=Gouden naar Diamanten Kist Transformatie -item.ironchest:COPPERSILVER.name=Koperen naar Zilveren Kist Transformatie -item.ironchest:SILVERGOLD.name=Zilveren naar Gouden Kist Transformatie -item.ironchest:COPPERIRON.name=Koperen naar Ijzeren Kist Transformatie -item.ironchest:DIAMONDCRYSTAL.name=Diamanten naar Kristallen Kist Transformatie -item.ironchest:WOODIRON.name=Houten naar Ijzeren Kist Transformatie -item.ironchest:WOODCOPPER.name=Houten naar Koperen Kist Transformatie -item.ironchest:DIAMONDOBSIDIAN.name=Diamanten naar Obsidiaanen Kist Transformatie +item.ironchest.chest.iron_gold.name=Ijzeren naar Gouden Kist Transformatie +item.ironchest.chest.gold_diamond.name=Gouden naar Diamanten Kist Transformatie +item.ironchest.chest.copper_silver.name=Koperen naar Zilveren Kist Transformatie +item.ironchest.chest.silver_gold.name=Zilveren naar Gouden Kist Transformatie +item.ironchest.chest.copper_iron.name=Koperen naar Ijzeren Kist Transformatie +item.ironchest.chest.diamond_crystal.name=Diamanten naar Kristallen Kist Transformatie +item.ironchest.chest.wood_iron.name=Houten naar Ijzeren Kist Transformatie +item.ironchest.chest.wood_copper.name=Houten naar Koperen Kist Transformatie +item.ironchest.chest.diamond_obsidian.name=Diamanten naar Obsidiaanen Kist Transformatie -book.ironchest:dirtchest9000.title=Hoe gebruik je uw Aarden Kist 9000! -book.ironchest:dirtchest9000.page1=Welkom voor uw nieuwe Aarden Kist 9000! We hopen dat je veel geluk zal beleven om uw hoop aarde te bewaren in onze stokeer faciliteit. -book.ironchest:dirtchest9000.page2=Gebruik: Plaats simpelweg uw hoop aarde naar uw keuze in de zeer ontvankelijke gleuf en geniet van de geriefelijkheid om dat hoop aarde altijd beschikbaar tot u te hebben, wanneer dan ook! -book.ironchest:dirtchest9000.page3=We hopen dat u heeft genoten om deze handleiding te lezen en we hopen dat u overweegt om onze producten in de toekomst te gebruiken! Met vriendelijke groeten, De Aarden Kist 9000 Handleiding Auteurs. -book.ironchest:dirtchest9000.page4=Garantie: Deze product biedt geen enkele garantie. Uw aarde kan mogenlijk niet gestockeerd worden, het kan langzaam verdampen of het kan ook helemaal niks doen. -book.ironchest:dirtchest9000.page5=Aarden Kist 9000 is mileuvriendelijk. Gelieve deze handleiding verantwoordlijk te ontdoen en gooi het niet zomaar in wat lava. We zouden zeer verdrietig zijn. +book.ironchest.dirtchest9000.title=Hoe gebruik je uw Aarden Kist 9000! +book.ironchest.dirtchest9000.page1=Welkom voor uw nieuwe Aarden Kist 9000! We hopen dat je veel geluk zal beleven om uw hoop aarde te bewaren in onze stokeer faciliteit. +book.ironchest.dirtchest9000.page2=Gebruik: Plaats simpelweg uw hoop aarde naar uw keuze in de zeer ontvankelijke gleuf en geniet van de geriefelijkheid om dat hoop aarde altijd beschikbaar tot u te hebben, wanneer dan ook! +book.ironchest.dirtchest9000.page3=We hopen dat u heeft genoten om deze handleiding te lezen en we hopen dat u overweegt om onze producten in de toekomst te gebruiken! Met vriendelijke groeten, De Aarden Kist 9000 Handleiding Auteurs. +book.ironchest.dirtchest9000.page4=Garantie: Deze product biedt geen enkele garantie. Uw aarde kan mogenlijk niet gestockeerd worden, het kan langzaam verdampen of het kan ook helemaal niks doen. +book.ironchest.dirtchest9000.page5=Aarden Kist 9000 is mileuvriendelijk. Gelieve deze handleiding verantwoordlijk te ontdoen en gooi het niet zomaar in wat lava. We zouden zeer verdrietig zijn. diff --git a/src/main/resources/assets/ironchest/lang/pl_PL.lang b/src/main/resources/assets/ironchest/lang/pl_PL.lang index c5ffc855..45d20273 100755 --- a/src/main/resources/assets/ironchest/lang/pl_PL.lang +++ b/src/main/resources/assets/ironchest/lang/pl_PL.lang @@ -1,17 +1,21 @@ -tile.ironchest:IRON.name=Żelazna skrzynia -tile.ironchest:GOLD.name=Złota skrzynia -tile.ironchest:DIAMOND.name=Diamentowa skrzynia -tile.ironchest:COPPER.name=Miedziana skrzynia -tile.ironchest:SILVER.name=Srebrna skrzynia -tile.ironchest:CRYSTAL.name=Kryształowa skrzynia -tile.ironchest:OBSIDIAN.name=Obsydianowa skrzynia +################ +# Chests # +################ -item.ironchest:IRONGOLD.name=Ulepszenie żelaznej skrzyni na złotą -item.ironchest:GOLDDIAMOND.name=Ulepszenie złotej skrzyni na diamentową -item.ironchest:COPPERSILVER.name=Ulepszenie miedzianej skrzyni na srebrną -item.ironchest:SILVERGOLD.name=Ulepszenie srebrnej skrzyni na złotą -item.ironchest:COPPERIRON.name=Ulepszenie miedzianej skrzyni na żelazną -item.ironchest:DIAMONDCRYSTAL.name=Ulepszenie diamentowej skrzyni na kryształową -item.ironchest:WOODIRON.name=Ulepszenie drewnianej skrzyni na żelazną -item.ironchest:WOODCOPPER.name=Ulepszenie drewnianej skrzyni na miedzianą -item.ironchest:DIAMONDOBSIDIAN.name=Ulepszenie diamentowej skrzyni na obsydianową +tile.ironchest.chest.iron.name=Żelazna skrzynia +tile.ironchest.chest.gold.name=Złota skrzynia +tile.ironchest.chest.diamond.name=Diamentowa skrzynia +tile.ironchest.chest.copper.name=Miedziana skrzynia +tile.ironchest.chest.silver.name=Srebrna skrzynia +tile.ironchest.chest.crystal.name=Kryształowa skrzynia +tile.ironchest.chest.obsidian.name=Obsydianowa skrzynia + +item.ironchest.chest.iron_gold.name=Ulepszenie żelaznej skrzyni na złotą +item.ironchest.chest.gold_diamond.name=Ulepszenie złotej skrzyni na diamentową +item.ironchest.chest.copper_silver.name=Ulepszenie miedzianej skrzyni na srebrną +item.ironchest.chest.silver_gold.name=Ulepszenie srebrnej skrzyni na złotą +item.ironchest.chest.copper_iron.name=Ulepszenie miedzianej skrzyni na żelazną +item.ironchest.chest.diamond_crystal.name=Ulepszenie diamentowej skrzyni na kryształową +item.ironchest.chest.wood_iron.name=Ulepszenie drewnianej skrzyni na żelazną +item.ironchest.chest.wood_copper.name=Ulepszenie drewnianej skrzyni na miedzianą +item.ironchest.chest.diamond_obsidian.name=Ulepszenie diamentowej skrzyni na obsydianową diff --git a/src/main/resources/assets/ironchest/lang/pt_BR.lang b/src/main/resources/assets/ironchest/lang/pt_BR.lang index 38c0e346..aefa3575 100755 --- a/src/main/resources/assets/ironchest/lang/pt_BR.lang +++ b/src/main/resources/assets/ironchest/lang/pt_BR.lang @@ -1,25 +1,29 @@ -tile.ironchest:IRON.name=Baú de Ferro -tile.ironchest:GOLD.name=Baú de Ouro -tile.ironchest:DIAMOND.name=Baú de Diamante -tile.ironchest:COPPER.name=Baú de Cobre -tile.ironchest:SILVER.name=Baú de Prata -tile.ironchest:CRYSTAL.name=Baú de Cristal -tile.ironchest:OBSIDIAN.name=Baú de Obsidiana -tile.ironchest:DIRTCHEST9000.name=BaúDeSujeira 9000! +################ +# Chests # +################ -item.ironchest:IRONGOLD.name=Aprimoramento de Baú de Ferro para Ouro -item.ironchest:GOLDDIAMOND.name=Aprimoramento de Baú de Ouro para Diamante -item.ironchest:COPPERSILVER.name=Aprimoramento de Baú de Cobre para Prata -item.ironchest:SILVERGOLD.name=Aprimoramento de Baú de Prata para Ouro -item.ironchest:COPPERIRON.name=Aprimoramento de Baú de Cobre para Ferro -item.ironchest:DIAMONDCRYSTAL.name=Aprimoramento de Baú de Diamante para Cristal -item.ironchest:WOODIRON.name=Aprimoramento de Baú de Madeira para Ferro -item.ironchest:WOODCOPPER.name=Aprimoramento de Baú de Madeira para Cobre -item.ironchest:DIAMONDOBSIDIAN.name=Aprimoramento de Baú de Diamante para Obsidiana +tile.ironchest.chest.iron.name=Baú de Ferro +tile.ironchest.chest.gold.name=Baú de Ouro +tile.ironchest.chest.diamond.name=Baú de Diamante +tile.ironchest.chest.copper.name=Baú de Cobre +tile.ironchest.chest.silver.name=Baú de Prata +tile.ironchest.chest.crystal.name=Baú de Cristal +tile.ironchest.chest.obsidian.name=Baú de Obsidiana +tile.ironchest.chest.dirtchest9000.name=BaúDeSujeira 9000! -book.ironchest:dirtchest9000.title=Como utilizar seu BaúDeSujeira 9000! -book.ironchest:dirtchest9000.page1=Bem-vindo ao seu novo BaúDeSujeira 9000! Esperamos que desfrute de muitos anos felizes de armazenagem de sua pilha de sujeira em nosso utilitário de armazenamento. -book.ironchest:dirtchest9000.page2=Uso: basta inserir o monte de sujeira de sua escolha no slot altamente receptivo e apreciar a grande conveniência de ter essa sujeira disponíveis para você, a qualquer momento que você passar pelo baú! -book.ironchest:dirtchest9000.page3=Esperamos que tenham gostado de rever este manual de instruções, e espero que você considere o uso de nossos produtos no futuro! Atenciosamente, manual do BaúDeSujeira 9000 escritores incorporados. -book.ironchest:dirtchest9000.page4=Garantia: Este produto não tem qualquer tipo de garantia. Sua sujeira pode não ser armazenada, pode vazar lentamente para o ambiente, ou alternativamente, pode não fazer absolutamente nada. -book.ironchest:dirtchest9000.page5=BaúDeSujeira 9000 é bom para o meio ambiente. Elimine este guia de forma responsável, e não o que você faz apenas lançando-o em alguma lava. Ficaríamos muito triste. +item.ironchest.chest.iron_gold.name=Aprimoramento de Baú de Ferro para Ouro +item.ironchest.chest.gold_diamond.name=Aprimoramento de Baú de Ouro para Diamante +item.ironchest.chest.copper_silver.name=Aprimoramento de Baú de Cobre para Prata +item.ironchest.chest.silver_gold.name=Aprimoramento de Baú de Prata para Ouro +item.ironchest.chest.copper_iron.name=Aprimoramento de Baú de Cobre para Ferro +item.ironchest.chest.diamond_crystal.name=Aprimoramento de Baú de Diamante para Cristal +item.ironchest.chest.wood_iron.name=Aprimoramento de Baú de Madeira para Ferro +item.ironchest.chest.wood_copper.name=Aprimoramento de Baú de Madeira para Cobre +item.ironchest.chest.diamond_obsidian.name=Aprimoramento de Baú de Diamante para Obsidiana + +book.ironchest.dirtchest9000.title=Como utilizar seu BaúDeSujeira 9000! +book.ironchest.dirtchest9000.page1=Bem-vindo ao seu novo BaúDeSujeira 9000! Esperamos que desfrute de muitos anos felizes de armazenagem de sua pilha de sujeira em nosso utilitário de armazenamento. +book.ironchest.dirtchest9000.page2=Uso: basta inserir o monte de sujeira de sua escolha no slot altamente receptivo e apreciar a grande conveniência de ter essa sujeira disponíveis para você, a qualquer momento que você passar pelo baú! +book.ironchest.dirtchest9000.page3=Esperamos que tenham gostado de rever este manual de instruções, e espero que você considere o uso de nossos produtos no futuro! Atenciosamente, manual do BaúDeSujeira 9000 escritores incorporados. +book.ironchest.dirtchest9000.page4=Garantia: Este produto não tem qualquer tipo de garantia. Sua sujeira pode não ser armazenada, pode vazar lentamente para o ambiente, ou alternativamente, pode não fazer absolutamente nada. +book.ironchest.dirtchest9000.page5=BaúDeSujeira 9000 é bom para o meio ambiente. Elimine este guia de forma responsável, e não o que você faz apenas lançando-o em alguma lava. Ficaríamos muito triste. diff --git a/src/main/resources/assets/ironchest/lang/pt_PT.lang b/src/main/resources/assets/ironchest/lang/pt_PT.lang index cb29cb28..d84b696f 100755 --- a/src/main/resources/assets/ironchest/lang/pt_PT.lang +++ b/src/main/resources/assets/ironchest/lang/pt_PT.lang @@ -1,17 +1,21 @@ -tile.ironchest:IRON.name=Baú de Ferro -tile.ironchest:GOLD.name=Baú de Ouro -tile.ironchest:DIAMOND.name=Baú de Diamante -tile.ironchest:COPPER.name=Baú de Cobre -tile.ironchest:SILVER.name=Baú de Prata -tile.ironchest:CRYSTAL.name=Baú de Cristal -tile.ironchest:OBSIDIAN.name=Baú de Obsidiana +################ +# Chests # +################ -item.ironchest:IRONGOLD.name=Melhoria de Baú de Ferro para Ouro -item.ironchest:GOLDDIAMOND.name=Melhoria de Baú de Ouro para Diamante -item.ironchest:COPPERSILVER.name=Melhoria de Baú de Cobre para Prata -item.ironchest:SILVERGOLD.name=Melhoria de Baú de Prata para Ouro -item.ironchest:COPPERIRON.name=Melhoria de Baú de Cobre para Ferro -item.ironchest:DIAMONDCRYSTAL.name=Melhoria de Baú de Diamante para Cristal -item.ironchest:WOODIRON.name=Melhoria de Baú de Madeira para Ferro -item.ironchest:WOODCOPPER.name=Melhoria de Baú de Madeira para Cobre -item.ironchest:DIAMONDOBSIDIAN.name=Melhoria de Baú de Diamante para Obsidiana +tile.ironchest.chest.iron.name=Baú de Ferro +tile.ironchest.chest.gold.name=Baú de Ouro +tile.ironchest.chest.diamond.name=Baú de Diamante +tile.ironchest.chest.copper.name=Baú de Cobre +tile.ironchest.chest.silver.name=Baú de Prata +tile.ironchest.chest.crystal.name=Baú de Cristal +tile.ironchest.chest.obsidian.name=Baú de Obsidiana + +item.ironchest.chest.iron_gold.name=Melhoria de Baú de Ferro para Ouro +item.ironchest.chest.gold_diamond.name=Melhoria de Baú de Ouro para Diamante +item.ironchest.chest.copper_silver.name=Melhoria de Baú de Cobre para Prata +item.ironchest.chest.silver_gold.name=Melhoria de Baú de Prata para Ouro +item.ironchest.chest.copper_iron.name=Melhoria de Baú de Cobre para Ferro +item.ironchest.chest.diamond_crystal.name=Melhoria de Baú de Diamante para Cristal +item.ironchest.chest.wood_iron.name=Melhoria de Baú de Madeira para Ferro +item.ironchest.chest.wood_copper.name=Melhoria de Baú de Madeira para Cobre +item.ironchest.chest.diamond_obsidian.name=Melhoria de Baú de Diamante para Obsidiana diff --git a/src/main/resources/assets/ironchest/lang/ru_RU.lang b/src/main/resources/assets/ironchest/lang/ru_RU.lang index 114eee76..709ddcfe 100755 --- a/src/main/resources/assets/ironchest/lang/ru_RU.lang +++ b/src/main/resources/assets/ironchest/lang/ru_RU.lang @@ -1,17 +1,21 @@ -tile.ironchest:IRON.name=Железный сундук -tile.ironchest:GOLD.name=Золотой сундук -tile.ironchest:DIAMOND.name=Алмазный сундук -tile.ironchest:COPPER.name=Медный сундук -tile.ironchest:SILVER.name=Серебряный сундук -tile.ironchest:CRYSTAL.name=Кристальный сундук -tile.ironchest:OBSIDIAN.name=Обсидиановый сундук +################ +# Chests # +################ -item.ironchest:IRONGOLD.name=Улучшение из железного в золотой сундук -item.ironchest:GOLDDIAMOND.name=Улучшение из золотого в алмазный сундук -item.ironchest:COPPERSILVER.name=Улучшение из медного в серебряный сундук -item.ironchest:SILVERGOLD.name=Улучшение из серебряного в золотой сундук -item.ironchest:COPPERIRON.name=Улучшение из медного в железный сундук -item.ironchest:DIAMONDCRYSTAL.name=Улучшение из алмазного в кристальный сундук -item.ironchest:WOODIRON.name=Улучшение из деревянного в железный сундук -item.ironchest:WOODCOPPER.name=Улучшение из деревянного в медный сундук -item.ironchest:DIAMONDOBSIDIAN.name=Улучшение из алмазного в обсидиановый сундук +tile.ironchest.chest.iron.name=Железный сундук +tile.ironchest.chest.gold.name=Золотой сундук +tile.ironchest.chest.diamond.name=Алмазный сундук +tile.ironchest.chest.copper.name=Медный сундук +tile.ironchest.chest.silver.name=Серебряный сундук +tile.ironchest.chest.crystal.name=Кристальный сундук +tile.ironchest.chest.obsidian.name=Обсидиановый сундук + +item.ironchest.chest.iron_gold.name=Улучшение из железного в золотой сундук +item.ironchest.chest.gold_diamond.name=Улучшение из золотого в алмазный сундук +item.ironchest.chest.copper_silver.name=Улучшение из медного в серебряный сундук +item.ironchest.chest.silver_gold.name=Улучшение из серебряного в золотой сундук +item.ironchest.chest.copper_iron.name=Улучшение из медного в железный сундук +item.ironchest.chest.diamond_crystal.name=Улучшение из алмазного в кристальный сундук +item.ironchest.chest.wood_iron.name=Улучшение из деревянного в железный сундук +item.ironchest.chest.wood_copper.name=Улучшение из деревянного в медный сундук +item.ironchest.chest.diamond_obsidian.name=Улучшение из алмазного в обсидиановый сундук diff --git a/src/main/resources/assets/ironchest/lang/sv_SE.lang b/src/main/resources/assets/ironchest/lang/sv_SE.lang index 2bbeacf7..1f25185f 100755 --- a/src/main/resources/assets/ironchest/lang/sv_SE.lang +++ b/src/main/resources/assets/ironchest/lang/sv_SE.lang @@ -1,17 +1,21 @@ -tile.ironchest:IRON.name=Järnkista -tile.ironchest:GOLD.name=Guldkista -tile.ironchest:DIAMOND.name=Diamantkista -tile.ironchest:COPPER.name=Kopparkista -tile.ironchest:SILVER.name=Silverkista -tile.ironchest:CRYSTAL.name=Kristallkista -tile.ironchest:OBSIDIAN.name=Obsidiankista +################ +# Chests # +################ -item.ironchest:IRONGOLD.name=Järn till Guld Kistuppgradering -item.ironchest:GOLDDIAMOND.name=Guld till Diamant Kistuppgradering -item.ironchest:COPPERSILVER.name=Koppar till Silver Kistuppgradering -item.ironchest:SILVERGOLD.name=Silver till Guld Kistuppgradering -item.ironchest:COPPERIRON.name=Koppar till Järn Kistuppgradering -item.ironchest:DIAMONDCRYSTAL.name=Diamant till Kristal Kistuppgradering -item.ironchest:WOODIRON.name=Trä till Järn Kistuppgradering -item.ironchest:WOODCOPPER.name=Trä till Koppar Kistuppgradering -item.ironchest:DIAMONDOBSIDIAN.name=Diamant till Obsidian Kistuppgradering +tile.ironchest.chest.iron.name=Järnkista +tile.ironchest.chest.gold.name=Guldkista +tile.ironchest.chest.diamond.name=Diamantkista +tile.ironchest.chest.copper.name=Kopparkista +tile.ironchest.chest.silver.name=Silverkista +tile.ironchest.chest.crystal.name=Kristallkista +tile.ironchest.chest.obsidian.name=Obsidiankista + +item.ironchest.chest.iron_gold.name=Järn till Guld Kistuppgradering +item.ironchest.chest.gold_diamond.name=Guld till Diamant Kistuppgradering +item.ironchest.chest.copper_silver.name=Koppar till Silver Kistuppgradering +item.ironchest.chest.silver_gold.name=Silver till Guld Kistuppgradering +item.ironchest.chest.copper_iron.name=Koppar till Järn Kistuppgradering +item.ironchest.chest.diamond_crystal.name=Diamant till Kristal Kistuppgradering +item.ironchest.chest.wood_iron.name=Trä till Järn Kistuppgradering +item.ironchest.chest.wood_copper.name=Trä till Koppar Kistuppgradering +item.ironchest.chest.diamond_obsidian.name=Diamant till Obsidian Kistuppgradering diff --git a/src/main/resources/assets/ironchest/lang/tr_TR.lang b/src/main/resources/assets/ironchest/lang/tr_TR.lang index 9c86204a..43436515 100755 --- a/src/main/resources/assets/ironchest/lang/tr_TR.lang +++ b/src/main/resources/assets/ironchest/lang/tr_TR.lang @@ -1,25 +1,29 @@ -tile.ironchest:IRON.name=Demir Sandık -tile.ironchest:GOLD.name=Altın Sandık -tile.ironchest:DIAMOND.name=Elmas Sandık -tile.ironchest:COPPER.name=Bakır Sandık -tile.ironchest:SILVER.name=Gümüş Sandık -tile.ironchest:CRYSTAL.name=Kristal Sandık -tile.ironchest:OBSIDIAN.name=Obsidyen Sandık -tile.ironchest:DIRTCHEST9000.name=Toprak Sandık-9000! +################ +# Chests # +################ -item.ironchest:IRONGOLD.name=Demir Sandığı Altın Sandığa Yükselt -item.ironchest:GOLDDIAMOND.name=Altın Sandığı Elmas Sandığa Yükselt -item.ironchest:COPPERSILVER.name=Bakır Sandığı Gümüş Sandığa Yükselt -item.ironchest:SILVERGOLD.name=Gümüş Sandığı Altın Sandığa Yükselt -item.ironchest:COPPERIRON.name=Bakır Sandığı Demir Sandığa Yükselt -item.ironchest:DIAMONDCRYSTAL.name=Elmas Sandığı Kristal Sandığa Yükselt -item.ironchest:WOODIRON.name=Tahta Sandığı Demir Sandığa Yükselt -item.ironchest:WOODCOPPER.name=Tahta Sandığı Bakır Sandığa Yükselt -item.ironchest:DIAMONDOBSIDIAN.name=Elmas Sandığı Obsidyen Sandığa Yükselt +tile.ironchest.chest.iron.name=Demir Sandık +tile.ironchest.chest.gold.name=Altın Sandık +tile.ironchest.chest.diamond.name=Elmas Sandık +tile.ironchest.chest.copper.name=Bakır Sandık +tile.ironchest.chest.silver.name=Gümüş Sandık +tile.ironchest.chest.crystal.name=Kristal Sandık +tile.ironchest.chest.obsidian.name=Obsidyen Sandık +tile.ironchest.chest.dirtchest9000.name=Toprak Sandık-9000! -book.ironchest:dirtchest9000.title=Toprak Sandık-9000 Kullanım Kılavuzu -book.ironchest:dirtchest9000.page1=Yeni sandık olan Toprak Sandık-9000 yaptığınız için teşekkürler.Bu sandık ile topraklarınızı depolayabilirsiniz. -book.ironchest:dirtchest9000.page2=Kullanımı: 64 adet toprak alarak içine koyunuz. Böylece sadece toprak depolanır. -book.ironchest:dirtchest9000.page3=Biz bu kılavuzu gözden keyif aldık umuyoruz, ve gelecekte ürünlerimizi kullanmayı düşünün umuyoruz! Saygılarımızla, dahil DirtChest 9000 manuel yazar. -book.ironchest:dirtchest9000.page4=Garanti: Bu ürün herhangi bir garanti vardır. Sizin kir depolanabilir değil, yavaş yavaş çevreye sülük olabilir, ya da alternatif olarak, hiç bir şey yapamazsınız. -book.ironchest:dirtchest9000.page5=Toprak Sandık-9000 çevreye türüdür. Sorumlu bu rehber kitap imha edin ve ne olursa olsun sadece bazı lav içine ayna yok yok. Bizim için çok üzücü olacaktır. +item.ironchest.chest.iron_gold.name=Demir Sandığı Altın Sandığa Yükselt +item.ironchest.chest.gold_diamond.name=Altın Sandığı Elmas Sandığa Yükselt +item.ironchest.chest.copper_silver.name=Bakır Sandığı Gümüş Sandığa Yükselt +item.ironchest.chest.silver_gold.name=Gümüş Sandığı Altın Sandığa Yükselt +item.ironchest.chest.copper_iron.name=Bakır Sandığı Demir Sandığa Yükselt +item.ironchest.chest.diamond_crystal.name=Elmas Sandığı Kristal Sandığa Yükselt +item.ironchest.chest.wood_iron.name=Tahta Sandığı Demir Sandığa Yükselt +item.ironchest.chest.wood_copper.name=Tahta Sandığı Bakır Sandığa Yükselt +item.ironchest.chest.diamond_obsidian.name=Elmas Sandığı Obsidyen Sandığa Yükselt + +book.ironchest.dirtchest9000.title=Toprak Sandık-9000 Kullanım Kılavuzu +book.ironchest.dirtchest9000.page1=Yeni sandık olan Toprak Sandık-9000 yaptığınız için teşekkürler.Bu sandık ile topraklarınızı depolayabilirsiniz. +book.ironchest.dirtchest9000.page2=Kullanımı: 64 adet toprak alarak içine koyunuz. Böylece sadece toprak depolanır. +book.ironchest.dirtchest9000.page3=Biz bu kılavuzu gözden keyif aldık umuyoruz, ve gelecekte ürünlerimizi kullanmayı düşünün umuyoruz! Saygılarımızla, dahil DirtChest 9000 manuel yazar. +book.ironchest.dirtchest9000.page4=Garanti: Bu ürün herhangi bir garanti vardır. Sizin kir depolanabilir değil, yavaş yavaş çevreye sülük olabilir, ya da alternatif olarak, hiç bir şey yapamazsınız. +book.ironchest.dirtchest9000.page5=Toprak Sandık-9000 çevreye türüdür. Sorumlu bu rehber kitap imha edin ve ne olursa olsun sadece bazı lav içine ayna yok yok. Bizim için çok üzücü olacaktır. diff --git a/src/main/resources/assets/ironchest/lang/zh_CN.lang b/src/main/resources/assets/ironchest/lang/zh_CN.lang index 974ada4f..991d877e 100755 --- a/src/main/resources/assets/ironchest/lang/zh_CN.lang +++ b/src/main/resources/assets/ironchest/lang/zh_CN.lang @@ -1,25 +1,29 @@ -tile.ironchest:IRON.name=铁箱子 -tile.ironchest:GOLD.name=金箱子 -tile.ironchest:DIAMOND.name=钻石箱子 -tile.ironchest:COPPER.name=铜箱子 -tile.ironchest:SILVER.name=银箱子 -tile.ironchest:CRYSTAL.name=水晶箱子 -tile.ironchest:OBSIDIAN.name=黑曜石箱子 -tile.ironchest:DIRTCHEST9000.name=泥箱子9000! +################ +# Chests # +################ -item.ironchest:IRONGOLD.name=升级:铁>金 -item.ironchest:GOLDDIAMOND.name=升级:金>钻石 -item.ironchest:COPPERSILVER.name=升级:铜>银 -item.ironchest:SILVERGOLD.name=升级:银>金 -item.ironchest:COPPERIRON.name=升级:铜>铁 -item.ironchest:DIAMONDCRYSTAL.name=升级:钻石>水晶 -item.ironchest:WOODIRON.name=升级:木>铁 -item.ironchest:WOODCOPPER.name=升级:木>铜 -item.ironchest:DIAMONDOBSIDIAN.name=升级:钻石>黑曜石 +tile.ironchest.chest.iron.name=铁箱子 +tile.ironchest.chest.gold.name=金箱子 +tile.ironchest.chest.diamond.name=钻石箱子 +tile.ironchest.chest.copper.name=铜箱子 +tile.ironchest.chest.silver.name=银箱子 +tile.ironchest.chest.crystal.name=水晶箱子 +tile.ironchest.chest.obsidian.name=黑曜石箱子 +tile.ironchest.chest.dirtchest9000.name=泥箱子9000! -book.ironchest:dirtchest9000.title=傻瓜也一定会用的泥箱子9000! -book.ironchest:dirtchest9000.page1=欢迎使用这台全新的泥箱子9000!希望你能愉快地常年使用我们的设备来储存(大量)泥土(大雾)。 -book.ironchest:dirtchest9000.page2=使用方法: 把一组泥土丢进去就行了。每次您经过的时候都可以打开它(很方便地)取出来用。 -book.ironchest:dirtchest9000.page3=希望您阅读本手册愉快,并选择使用我们的产品。作为泥箱子9000手册作者我谨向您致以诚挚问候。 -book.ironchest:dirtchest9000.page4=质量保障: 恕本产品不提供任何质量保障。您的泥土或者能安全存储其内,或者会逐渐流失到环境中,或者什么也不会发生。(读者:我了个去!) -book.ironchest:dirtchest9000.page5=泥箱子9000十分环保。请小心收藏好本手册,如果您随手丢进岩浆的话,我们可会伤心的。 +item.ironchest.chest.iron_gold.name=升级:铁>金 +item.ironchest.chest.gold_diamond.name=升级:金>钻石 +item.ironchest.chest.copper_silver.name=升级:铜>银 +item.ironchest.chest.silver_gold.name=升级:银>金 +item.ironchest.chest.copper_iron.name=升级:铜>铁 +item.ironchest.chest.diamond_crystal.name=升级:钻石>水晶 +item.ironchest.chest.wood_iron.name=升级:木>铁 +item.ironchest.chest.wood_copper.name=升级:木>铜 +item.ironchest.chest.diamond_obsidian.name=升级:钻石>黑曜石 + +book.ironchest.dirtchest9000.title=傻瓜也一定会用的泥箱子9000! +book.ironchest.dirtchest9000.page1=欢迎使用这台全新的泥箱子9000!希望你能愉快地常年使用我们的设备来储存(大量)泥土(大雾)。 +book.ironchest.dirtchest9000.page2=使用方法: 把一组泥土丢进去就行了。每次您经过的时候都可以打开它(很方便地)取出来用。 +book.ironchest.dirtchest9000.page3=希望您阅读本手册愉快,并选择使用我们的产品。作为泥箱子9000手册作者我谨向您致以诚挚问候。 +book.ironchest.dirtchest9000.page4=质量保障: 恕本产品不提供任何质量保障。您的泥土或者能安全存储其内,或者会逐渐流失到环境中,或者什么也不会发生。(读者:我了个去!) +book.ironchest.dirtchest9000.page5=泥箱子9000十分环保。请小心收藏好本手册,如果您随手丢进岩浆的话,我们可会伤心的。 diff --git a/src/main/resources/assets/ironchest/lang/zh_TW.lang b/src/main/resources/assets/ironchest/lang/zh_TW.lang index d4755f69..69c7cdc0 100755 --- a/src/main/resources/assets/ironchest/lang/zh_TW.lang +++ b/src/main/resources/assets/ironchest/lang/zh_TW.lang @@ -1,25 +1,29 @@ -tile.ironchest:IRON.name=鐵箱 -tile.ironchest:GOLD.name=黃金箱 -tile.ironchest:DIAMOND.name=鑽石箱 -tile.ironchest:COPPER.name=銅箱 -tile.ironchest:SILVER.name=銀箱 -tile.ironchest:CRYSTAL.name=水晶箱 -tile.ironchest:OBSIDIAN.name=黑曜石箱 -tile.ironchest:DIRTCHEST9000.name=泥土箱9000! +################ +# Chests # +################ -item.ironchest:IRONGOLD.name=鐵箱升級成金箱 -item.ironchest:GOLDDIAMOND.name=金箱升級成鑽石箱 -item.ironchest:COPPERSILVER.name=銅箱升級成銀箱 -item.ironchest:SILVERGOLD.name=銀箱升級成金箱 -item.ironchest:COPPERIRON.name=銅箱升級成鐵箱 -item.ironchest:DIAMONDCRYSTAL.name=鑽石箱升級成水晶箱 -item.ironchest:WOODIRON.name=木箱升級成鐵箱 -item.ironchest:WOODCOPPER.name=木箱升級成銅箱 -item.ironchest:DIAMONDOBSIDIAN.name=鑽石箱升級成黑曜石箱 +tile.ironchest.chest.iron.name=鐵箱 +tile.ironchest.chest.gold.name=黃金箱 +tile.ironchest.chest.diamond.name=鑽石箱 +tile.ironchest.chest.copper.name=銅箱 +tile.ironchest.chest.silver.name=銀箱 +tile.ironchest.chest.crystal.name=水晶箱 +tile.ironchest.chest.obsidian.name=黑曜石箱 +tile.ironchest.chest.dirtchest9000.name=泥土箱9000! -book.ironchest:dirtchest9000.title=笨蛋也一定會用的泥土箱9000! -book.ironchest:dirtchest9000.page1=歡迎使用這台全新的泥土箱9000!希望你能愉快地常年使用我們的設備來儲存泥土。 -book.ironchest:dirtchest9000.page2=使用方法:把一組泥土丟進去就行了。每次您經過的時候都可以打開它很方便地取出來用。 -book.ironchest:dirtchest9000.page3=希望您閱讀本手冊愉快,並選擇使用我們的產品。作為泥土箱9000手冊作者我謹向您致以誠摯問候。 -book.ironchest:dirtchest9000.page4=質量保障:恕本產品不提供任何質量保障。您的泥土或許能安全存儲其內,或許會逐漸流失到環境中,或者什麼也不會發生。 -book.ironchest:dirtchest9000.page5=泥土箱9000十分環保。請小心收藏好本手冊,如果您隨手丟進岩漿的話,我們可會傷心的。 \ No newline at end of file +item.ironchest.chest.iron_gold.name=鐵箱升級成金箱 +item.ironchest.chest.gold_diamond.name=金箱升級成鑽石箱 +item.ironchest.chest.copper_silver.name=銅箱升級成銀箱 +item.ironchest.chest.silver_gold.name=銀箱升級成金箱 +item.ironchest.chest.copper_iron.name=銅箱升級成鐵箱 +item.ironchest.chest.diamond_crystal.name=鑽石箱升級成水晶箱 +item.ironchest.chest.wood_iron.name=木箱升級成鐵箱 +item.ironchest.chest.wood_copper.name=木箱升級成銅箱 +item.ironchest.chest.diamond_obsidian.name=鑽石箱升級成黑曜石箱 + +book.ironchest.dirtchest9000.title=笨蛋也一定會用的泥土箱9000! +book.ironchest.dirtchest9000.page1=歡迎使用這台全新的泥土箱9000!希望你能愉快地常年使用我們的設備來儲存泥土。 +book.ironchest.dirtchest9000.page2=使用方法:把一組泥土丟進去就行了。每次您經過的時候都可以打開它很方便地取出來用。 +book.ironchest.dirtchest9000.page3=希望您閱讀本手冊愉快,並選擇使用我們的產品。作為泥土箱9000手冊作者我謹向您致以誠摯問候。 +book.ironchest.dirtchest9000.page4=質量保障:恕本產品不提供任何質量保障。您的泥土或許能安全存儲其內,或許會逐漸流失到環境中,或者什麼也不會發生。 +book.ironchest.dirtchest9000.page5=泥土箱9000十分環保。請小心收藏好本手冊,如果您隨手丟進岩漿的話,我們可會傷心的。 \ No newline at end of file diff --git a/src/main/resources/assets/ironchest/models/block/iron_chest.json b/src/main/resources/assets/ironchest/models/block/iron_chest.json index 9f41512f..16c0ca9a 100644 --- a/src/main/resources/assets/ironchest/models/block/iron_chest.json +++ b/src/main/resources/assets/ironchest/models/block/iron_chest.json @@ -1,7 +1,7 @@ { "parent": "block/block", "textures": { - "texture": "ironchest:model/copper_chest" + "texture": "ironchest:model/chest/copper_chest" }, "elements": [ { "from": [ 1, 0, 1 ], diff --git a/src/main/resources/assets/ironchest/models/block/iron_shulker_box.json b/src/main/resources/assets/ironchest/models/block/iron_shulker_box.json new file mode 100644 index 00000000..3886143c --- /dev/null +++ b/src/main/resources/assets/ironchest/models/block/iron_shulker_box.json @@ -0,0 +1,152 @@ +{ + "parent": "block/block", + "textures": { + "texture": "ironchest:model/shulker/purple/shulker_purple_copper" + }, + "elements": [ + { "from": [ 1, 0, 0 ], + "to": [ 15, 4, 1 ], + "faces": { + "north": { "uv": [ 0.25, 12, 3.75, 13 ], "texture": "#texture" } + } + }, + { "from": [ 4, 4, 0 ], + "to": [ 12, 8, 1 ], + "faces": { + "north": { "uv": [ 1, 11, 3, 12 ], "texture": "#texture" } + } + }, + { "from": [ 1, 4, 0 ], + "to": [ 4, 8, 1 ], + "faces": { + "north": { "uv": [ 3, 6, 3.75, 7 ], "texture": "#texture" } + } + }, + { "from": [ 12, 4, 0 ], + "to": [ 15, 8, 1 ], + "faces": { + "north": { "uv": [ 0.25, 6, 1, 7 ], "texture": "#texture" } + } + }, + { "from": [ 1, 8, 0 ], + "to": [ 15, 16, 1 ], + "faces": { + "north": { "uv": [ 0.25, 4, 3.75, 6 ], "texture": "#texture" } + } + }, + { "from": [ 15, 0, 0 ], + "to": [ 16, 4, 16 ], + "faces": { + "north": { "uv": [ 0, 12, 0.25, 13 ], "texture": "#texture" }, + "east": { "uv": [ 4, 12, 8, 13 ], "texture": "#texture" }, + "south": { "uv": [ 11.75, 12, 12, 13 ], "texture": "#texture" } + } + }, + { "from": [ 15, 4, 4 ], + "to": [ 16, 8, 12 ], + "faces": { + "east": { "uv": [ 5, 11, 7, 12 ], "texture": "#texture" } + } + }, + { "from": [ 15, 4, 0 ], + "to": [ 16, 8, 4 ], + "faces": { + "north": { "uv": [ 0, 6, 0.25, 7 ], "texture": "#texture" }, + "east": { "uv": [ 7, 6, 8, 7 ], "texture": "#texture" } + } + }, + { "from": [ 15, 4, 12 ], + "to": [ 16, 8, 16 ], + "faces": { + "east": { "uv": [ 4, 6, 5, 7 ], "texture": "#texture" }, + "south": { "uv": [ 11.75, 6, 12, 7 ], "texture": "#texture" } + } + }, + { "from": [ 15, 8, 0 ], + "to": [ 16, 16, 16 ], + "faces": { + "north": { "uv": [ 0, 4, 0.25, 6 ], "texture": "#texture" }, + "east": { "uv": [ 4, 4, 8, 6 ], "texture": "#texture" }, + "south": { "uv": [ 11.75, 4, 12, 6 ], "texture": "#texture" } + } + }, + { "from": [ 1, 0, 15 ], + "to": [ 15, 4, 16 ], + "faces": { + "south": { "uv": [ 8.25, 12, 11.75, 13 ], "texture": "#texture" } + } + }, + { "from": [ 4, 4, 15 ], + "to": [ 12, 8, 16 ], + "faces": { + "south": { "uv": [ 9, 11, 11, 12 ], "texture": "#texture" } + } + }, + { "from": [ 12, 4, 15 ], + "to": [ 15, 8, 16 ], + "faces": { + "south": { "uv": [ 11, 6, 11.75, 7 ], "texture": "#texture" } + } + }, + { "from": [ 1, 4, 15 ], + "to": [ 4, 8, 16 ], + "faces": { + "south": { "uv": [ 8.25, 6, 9, 7 ], "texture": "#texture" } + } + }, + { "from": [ 1, 8, 15 ], + "to": [ 15, 16, 16 ], + "faces": { + "south": { "uv": [ 8.25, 4, 11.75, 6 ], "texture": "#texture" } + } + }, + { "from": [ 0, 0, 0 ], + "to": [ 1, 4, 16 ], + "faces": { + "north": { "uv": [ 3.75, 12, 4, 13 ], "texture": "#texture" }, + "south": { "uv": [ 8, 12, 8.25, 13 ], "texture": "#texture" }, + "west": { "uv": [ 12, 12, 16, 13 ], "texture": "#texture" } + } + }, + { "from": [ 0, 4, 4 ], + "to": [ 1, 8, 12 ], + "faces": { + "west": { "uv": [ 13, 11, 15, 12 ], "texture": "#texture" } + } + }, + { "from": [ 0, 4, 12 ], + "to": [ 1, 8, 16 ], + "faces": { + "south": { "uv": [ 8, 6, 8.25, 7 ], "texture": "#texture" }, + "west": { "uv": [ 15, 6, 16, 7 ], "texture": "#texture" } + } + }, + { "from": [ 0, 4, 0 ], + "to": [ 1, 8, 4 ], + "faces": { + "north": { "uv": [ 3.75, 6, 4, 7 ], "texture": "#texture" }, + "west": { "uv": [ 12, 6, 13, 7 ], "texture": "#texture" } + } + }, + { "from": [ 0, 8, 0 ], + "to": [ 1, 16, 16 ], + "faces": { + "north": { "uv": [ 3.75, 4, 4, 6 ], "texture": "#texture" }, + "south": { "uv": [ 8, 4, 8.25, 6 ], "texture": "#texture" }, + "west": { "uv": [ 12, 4, 16, 6 ], "texture": "#texture" } + } + }, + { "from": [ 0, 16, 0 ], + "to": [ 16, 16, 16 ], + "faces": { + "up": { "uv": [ 4, 0, 8, 4 ], "texture": "#texture" } + } + }, + { "from": [ 0, 0, 0 ], + "to": [ 16, 0, 16 ], + "faces": { + "down": { "uv": [ 8, 7, 12, 11 ], "texture": "#texture" } + } + } + ] +} diff --git a/src/main/resources/assets/ironchest/textures/items/copper_iron_upgrade.png b/src/main/resources/assets/ironchest/textures/items/chest/copper_iron_upgrade.png similarity index 100% rename from src/main/resources/assets/ironchest/textures/items/copper_iron_upgrade.png rename to src/main/resources/assets/ironchest/textures/items/chest/copper_iron_upgrade.png diff --git a/src/main/resources/assets/ironchest/textures/items/copper_silver_upgrade.png b/src/main/resources/assets/ironchest/textures/items/chest/copper_silver_upgrade.png similarity index 100% rename from src/main/resources/assets/ironchest/textures/items/copper_silver_upgrade.png rename to src/main/resources/assets/ironchest/textures/items/chest/copper_silver_upgrade.png diff --git a/src/main/resources/assets/ironchest/textures/items/diamond_crystal_upgrade.png b/src/main/resources/assets/ironchest/textures/items/chest/diamond_crystal_upgrade.png similarity index 100% rename from src/main/resources/assets/ironchest/textures/items/diamond_crystal_upgrade.png rename to src/main/resources/assets/ironchest/textures/items/chest/diamond_crystal_upgrade.png diff --git a/src/main/resources/assets/ironchest/textures/items/diamond_obsidian_upgrade.png b/src/main/resources/assets/ironchest/textures/items/chest/diamond_obsidian_upgrade.png similarity index 100% rename from src/main/resources/assets/ironchest/textures/items/diamond_obsidian_upgrade.png rename to src/main/resources/assets/ironchest/textures/items/chest/diamond_obsidian_upgrade.png diff --git a/src/main/resources/assets/ironchest/textures/items/gold_diamond_upgrade.png b/src/main/resources/assets/ironchest/textures/items/chest/gold_diamond_upgrade.png similarity index 100% rename from src/main/resources/assets/ironchest/textures/items/gold_diamond_upgrade.png rename to src/main/resources/assets/ironchest/textures/items/chest/gold_diamond_upgrade.png diff --git a/src/main/resources/assets/ironchest/textures/items/iron_gold_upgrade.png b/src/main/resources/assets/ironchest/textures/items/chest/iron_gold_upgrade.png similarity index 100% rename from src/main/resources/assets/ironchest/textures/items/iron_gold_upgrade.png rename to src/main/resources/assets/ironchest/textures/items/chest/iron_gold_upgrade.png diff --git a/src/main/resources/assets/ironchest/textures/items/silver_gold_upgrade.png b/src/main/resources/assets/ironchest/textures/items/chest/silver_gold_upgrade.png similarity index 100% rename from src/main/resources/assets/ironchest/textures/items/silver_gold_upgrade.png rename to src/main/resources/assets/ironchest/textures/items/chest/silver_gold_upgrade.png diff --git a/src/main/resources/assets/ironchest/textures/items/wood_copper_upgrade.png b/src/main/resources/assets/ironchest/textures/items/chest/wood_copper_upgrade.png similarity index 100% rename from src/main/resources/assets/ironchest/textures/items/wood_copper_upgrade.png rename to src/main/resources/assets/ironchest/textures/items/chest/wood_copper_upgrade.png diff --git a/src/main/resources/assets/ironchest/textures/items/wood_iron_upgrade.png b/src/main/resources/assets/ironchest/textures/items/chest/wood_iron_upgrade.png similarity index 100% rename from src/main/resources/assets/ironchest/textures/items/wood_iron_upgrade.png rename to src/main/resources/assets/ironchest/textures/items/chest/wood_iron_upgrade.png diff --git a/src/main/resources/assets/ironchest/textures/items/shulker/copper_iron_upgrade.png b/src/main/resources/assets/ironchest/textures/items/shulker/copper_iron_upgrade.png new file mode 100644 index 0000000000000000000000000000000000000000..0af1e53f4e8cccb5915daa7c5a80d4e07f3d675a GIT binary patch literal 363 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbL!WQl7;NpOBzNqJ&XDuZK6ep0G} zXKrG8YEWuoN@d~6R2!h8gaDrq*S-Y{_mhl-pA3j=t z@X(nVx$`$}nh|e!;nCxRm#^$Nb$Zg0r88EoUXPzFleh2O zdh>Q$t$(L8_olkwMsNA;Cr|zV|G%O2UMA2kg_0n@U?3MCV2Fv4ehXAv>gnPbQgJKf zd^q1>1p$VO3uj1e|1$6QeWM3V-)h!eaAwloFErb7uG|}jY+dOCTh|tgEZAvo$#r1u z>q|Zg%i_M=ud8!jaYyj|UoNB40}`9tC6XD}er^9~6&CR7tic>HkMCY~C$Gjov1}=r kSuR-Qs}peggLneN{dfFNEw=V(03E>K>FVdQ&MBb@01VW#?f?J) literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/ironchest/textures/items/shulker/copper_silver_upgrade.png b/src/main/resources/assets/ironchest/textures/items/shulker/copper_silver_upgrade.png new file mode 100644 index 0000000000000000000000000000000000000000..1adaafbf8809b9248107494cb412e213c990a51c GIT binary patch literal 363 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbL!WQl7;NpOBzNqJ&XDuZK6ep0G} zXKrG8YEWuoN@d~6R2!h8gaDrq*O_x>?k%@JGdcCzqVlcv!I!UHzIFH3nHjm8wr*Or zcGa%EyB<7#uz13XvBPK1pP3PFxUJUz>5Hd_I-{>#ztZR}zd6_R^tscE z@|-)Jx#!HEvuNp}O?APCjvo5||9?t;G9%C~g_0n@U?3MCV2Fv4ehXAv>gnPbQgJKf zd^q1>1p$VO3unBVc5m|U`$i9#zSXR`;LN1EUud@FT)#IB63WsCO6D4hEZAvc$#tMs z=CY5%vUxoB6YHE;+-Vj##AQ@^z;ZkL`&!1eU#EV%8y4`&`Tl+}kMCY`C$GjoxfxYG kyIioyS0~`~2k``krxW;}{=I3o66gR1Pgg&ebxsLQ02v#zS^xk5 literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/ironchest/textures/items/shulker/diamond_crystal_upgrade.png b/src/main/resources/assets/ironchest/textures/items/shulker/diamond_crystal_upgrade.png new file mode 100644 index 0000000000000000000000000000000000000000..6af17cf5209bf936e0dc8b83d5c94a919a092460 GIT binary patch literal 281 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbL!WQl7;NpOBzNqJ&XDuZK6ep0G} zXKrG8YEWuoN@d~6R2!fovjCqE*M!S&l@C2z|MJ_NufIF)eJs53{?hA@)msmRtlGQu z{+pSXA4u-FQ*!hDj*HhB`ZldNcs%LK+yDRn*9JIc0!R|^XZ+gLZ+AZJzo8Eo7>gWHNKmOZ3 z{rK^-y6fAYbAJ5K|N1}l%YVIVk2EgaIk}WU{rv5q&;LK4SHFIfcjvGF&kswtfB(O( zk3sk9!_qK@`3(%mPcr0u{SO4*A2XAHb}5tu`2~accmP98jPzTe+EPy!$B>F!A?L&S z4l4*STwFNg)wFw)f8RHH!1S$V%>`#B-TgwdE$6O#!;q~jePHX_Vvz+q%`LeOY=3>p zM`2mqm*sVJ&MWS;OFZT>Dm_rWpFP=!aqZXUhn67$uMSzriFJ{~a+dFJ?YCXIeP$iky%X|o z=~+MC+Wr6Gae14-$EOx&)^eU$#!@?d?%B0m1rw(%J97HZXXkq-6mIO7*mM2f{Syjr zZX4X(FY*8X|Ep*2x&hszQxfDC4CE3E7>-}#>;dYl_H=O!skjw#K9r9|QGns1ll%3% zci-3VZxx)evY)R~Wx_M@MaHWy_sLCADYtUi8GFWyDS?0I+4gA+A5I#X%XX~dJ-TDX zeSuTukN4JXQHW)pcRy49Tc(slcI~sG7}tQTlPPss2kvVBJS1K}Q91d{)_ble%q}{d eIUL`>$Z)AvjQ7qlLt~&b7(8A5T-G@yGywoN!`d?d literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/ironchest/textures/items/shulker/silver_gold_upgrade.png b/src/main/resources/assets/ironchest/textures/items/shulker/silver_gold_upgrade.png new file mode 100644 index 0000000000000000000000000000000000000000..4cf4ebf2382dd522c45d2d832755fd8be9a95bca GIT binary patch literal 414 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbL!WQl7;NpOBzNqJ&XDuZK6ep0G} zXKrG8YEWuoN@d~6R2!h8x&WUL*Qv9o99_h)V*T>%`?jy$vi8#xi#K-+o?g=U^V#Ln zHo=nW;!jV^zrV3dOi%dp+4;v?yOYaVx+iws*eCJ*js4C25;yisGII*1N-U)>h%YdZ(_qXBMk_wV0ChEZx;TbZ+zL7WlCQ}?!0qDCT^l%*w6yXR9vu6< zUm>?q^N#%FFDi4FT`4Y@{AcGuE&*3bv4)ax`CtQw{latqm`F543(UxDh>31VwRoqH zX}x&0oH55`w&jmDv}MZ}?~q-8{(AEi-FH8WnI?55?zZtWHyLmk ZFen;{+>pM%QwQi422WQ%mvv4FO#r9D&FcUF literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/ironchest/textures/items/shulker/vanilla_copper_upgrade.png b/src/main/resources/assets/ironchest/textures/items/shulker/vanilla_copper_upgrade.png new file mode 100644 index 0000000000000000000000000000000000000000..c675fdc32d7fc119a4bcdfc789c38fdc4d9e5913 GIT binary patch literal 566 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbL!WQl7;NpOBzNqJ&XDuZK6ep0G} zXKrG8YEWuoN@d~6R2!h8O94J1u9s^=UL9Cn8C+Q&SY8ue^Zvr2TN85Mp4?F#TK#Zo zM_FLm-C0!?K^2qICf(>vZi;NG4y%59YS;4}i=M2X+7RAQ6;joc*wdTTd$lR5JgB@o zzI#gAl-|VNiK!D?Vp?j#Y9^&ldcJ)@e@g$ftZ7p-r`Ctm*GAM%OP}`f>WP-fmMQ5| zu6HC&NS*NN;94&wuPVQ)sTot7Bbuv1s~)eJbfrFgV%o&+gzozA`sV27MAJkkS*ON` z#=hjfzNEgXX;ZsmyOK?k%RI^^r%f*ODRfhC`~Uy{>$N;TfxdGq3GxdDaw!K4nbTY@ z08L!s>EaktaVzBfRiQ%xJS-QU-rE(tz=O5Cy!^-i_$Hxc%)d8Gw&Xv_a$e=f%kx(b z$~%a-{$Y4h5;biiL(t(685M?**zb4qA6SN6>Ecg$CV5Md$L!uM8OP92rfIz1lM}dO zukYW$BlY$JljkIkQx|)Sli6423x04u`SGtdS1W6yn!)07DP_Lc$fw#{tG?fvbMK|N w>g@ZozZrgdBiXo^lPx$x`}kCeI3^y3%iij%f;#_90=k*O)78&qol`;+0QWi``v3p{ literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/ironchest/textures/items/shulker/vanilla_iron_upgrade.png b/src/main/resources/assets/ironchest/textures/items/shulker/vanilla_iron_upgrade.png new file mode 100644 index 0000000000000000000000000000000000000000..6569f1cf4d3b560379d50d5a5a504e296c09e04b GIT binary patch literal 566 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 literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/ironchest/textures/model/shulker/black/shulker_black_crystal.png b/src/main/resources/assets/ironchest/textures/model/shulker/black/shulker_black_crystal.png new file mode 100644 index 0000000000000000000000000000000000000000..bf1a0dfa177629b38f20e8fa576e30bef05a00ce GIT binary patch literal 19000 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 D(Idj9 literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/ironchest/textures/model/shulker/black/shulker_black_diamond.png b/src/main/resources/assets/ironchest/textures/model/shulker/black/shulker_black_diamond.png new file mode 100644 index 0000000000000000000000000000000000000000..a62e14206ff8407e1cc64449c382b4b44337665a GIT binary patch literal 19636 zcmeI4cTf{s^!OL?0a8^&Ku|+KMKmOVP!dD$O{7TxMM4rnq$H3iO^~8g0TC1gK~S;K zR1_3x0To09L?6A0h^PpNhykVig55k{=FR-R-+#W7ok@1jJ@=fm_jAuZyPKI!%&whA zLj3Fa0RRv(G1j+c?zNXbd_2tWJd#g8bGL$G>_7zo0nw!o7m$8N0s#0eNqTy_cDa*j zWU4!v0y5Fl15td*ZX{0v0Qh%j+7NARUa!?)^ncJbiw;dOBU_8{fvk1oLf0g1R*+e- z(llBor%TMLW|e`#a;XQ|(cB3Mp~u9mwhPAcck;fFIhPP|K05Z{=fR-!9_=x$i`ETaBi-QWvF?J#~h3b2yz2403bFUtkYgrL#e zz;xa!fXn}>03SfN$e_cdqZUQp=$_ug6?%k=PD@fZ;|pB_Xa^?fUIeraxk5A3HroK% z%K?{0oa+#<3j(-oIsEb|5Slr2I*1E!N|6!c%1#16qJ(IDzuEIAON$9KDrfH9t5~Nkd^fZj+_S87{0ehPi`w(IikQM zb-EZ`CWkZ#bK-;e@Y>reZjf&_5#P2(6}t?ZuB})ba9UC+3?cGt>Jb2BCy6mfJ2mg$ zEL_ywteQ|NybtoGnr9L0>N>PA+>%dWPTU|Zq;+9C^v1f-9Xz343+FbCFL!qq$UeY` zb1N3nE&;M%ciT@XX(@|kC~k3N{^O1GR?am2OvWunpCErG?k^-sa~OkB$_3TuX}R{JFAryrYA$_2;h zp4fVS)00K~^MUQ3xitq=fNT3Txq^})m-phhKbmb>iJ{S-GXUUyIl1Ok*@ixw?<&jMfHfT z+`U@emAd@+P-$P6tp(w_@{vu~)+@L`|JGiQpj){|CR2nJYwd0eYfwZ!VfnIZ*$&$F z;OL9Y7k6JMzmR$%^WKR+(^cE&!i>#xdFzM!O(lm{4kLzn2x&?>cIVTr`!46$u2M;K z)Gf>@wZ3WN<2#p*(GV zeR-Tl-jy7rp0cU3{SE7>6gMs2p){YFGqjy6M&vK0PKCtwubJ5Te5=$&gn1d9u*W0s zRO%^AzHz=)zR_rj@-q4hnJR(gByYU|}^Qt?)nP;=iW;2U7 z7USvG7G)Q=Uff~6!@R!fQPa7m_R}gE8t@LKk&Kayj*Nj@E{^_=+e8b|&x4&uS;$y*63ePweMQ@#MmApJP;dIKLG4EMr#GJ&*9yM>;nZs= z5!14=rBivRRJ3vHJyNDk##1ArII)ZxF%=ybV;0`1n5wCmAywD+pz?(&ZQ5t=VBnMK z%#0fuwPTliu8ymYlg6WZ&ptw&-J0c~OnrR!f!;H#;Z`kyvnOF50|g)uRsRf6_mt-=9H* zTOzMQOjQ&#^Az`^yVdR>?r7C1x;Z>*!(?JiJk6w$iV8)l-kwzhb7NCc&oiG33q&7*g!r@Yfysc?Diu}$wq{Wc}=2h^^wC4!-?s;$wT zdV3T$?0j#mU=euYZBm6wfZToM-0j0{E+EDmMpOc!W9EJPfZX;qn+2u;U*-8a&$DF}Bwd19ccE!G4O& zl+qN7i7i^wBc3XDxKqB@e^@Gt{IL3TZ_3Rp`S;53EpAWTUcc;zWH||+%1eEjD(o%P z)qPWFVE4_j>5m3I(9|aRp7MxNy|VMw=-U;9OAXCUJG5*s*nY76WUD&4`@3!Z6AfGI#P)5YM#A+Qs}?dR{2)TALU!?I>YmF|^aEbJW~>-sY!E_qA3PRR zFv$CKF?7GGi=g7JGnaDv3#W2+Ww|LaL%Y_qsSQq+9AMn%C>>j{W|<< zGVy)OvCNa1!6AyXy)HfHN`ppl%>(;I$P;%~(gvRxEXIxOsMyiG=lyNk`{JHqQTyBW z=~q$vyx!2>pcj&#TGp4JDNipd+v8C-9#~lta{m8I6)_n|Uia_wS!TNYBIuW~Ao z%(%~(9$4EK;=5(Oxv{*mjTk&f zBU%=crV~Z<{z^QZ*cd4kIhv)ei9|lv@|}M@cS)}W-?BMNeBsZ|I|vS9|Je>o!z1_$$MmKkWWIR^!*}w|?UMfQaRbL!iU*i|(`6 zr)?fz`kXA8oV>W4J8fzXrwr)<0F)}p7DK~Wn4@rHFGVb#>`GAd_o6UwL;(P;g2m0eF7EdOQO(7WN*-tU#u(n z08Il7UJCSM`!+5w%8x+a)NkyV6ruiD3KXsggZ_(=g#~*vFRwpZQfUSUnP>8CWPc1u zwGE&Upw5rg~r4cljY#}fN1g>riS4Sx!PzYvf zs-a-8Uz~jH$>PI;nf-Vy4f|ib{MMJ%4;fE#3;0i7e)jy`hlK^o#G6XPdgBNt`kKtK zE0Rcf6oLR(RU){mL6AzWa0mj4$3oO$cr}PC9IpgdM_^&9Du^$G{N4N?uJy^d152sI zbp3VdhJ_#z2m%C$a3$c~++1<4YAW9Y{o?E& zfh>JV%*urI{H4#*Sn$kXcsCVS6*pHr1gDC1g)p5XA?oS~I5Pws;i|5p0>>j%zlZpP zn}38dCQ+IB6!1%)F|+MU?Xe;F{NDOq;Ys>ZLnv5ZDq(49YJk75%^yYQM@?C>`Le`O zSlm+e(Znq!FaeK-{?_{Qw0>BAGb8HpQ$mtOzwgi3a! z`C)wtIz(oM{I|9F)$i|ytO3x_rF!j2`d^p|D)!+2-$eYkb@hK_B7SBv&K>JbB;Yln z-;?-z!+)E*uQU4l>iWK7|G65`cpS=&?CXW4X_CCKL;{rJO+-U~HvWu>{#l3g$ev_h z3o@Rdsf>pHsripq%-`R3ef{}OlWJ|G3o@L%2h((e~POP4wnv*Iwb zANyscGj0CS#@ZjVR5?5keCe;I1Y>Sc_|o?`(_huBrVi{)e^s-Z{5tPdW`x4)rNWNNYG>sjkSrj_b!q@!4soTVqPz(OLb3`d4>66!>ahBp~Jr!{-XG1 z_%)q=xxxEVDZaKcZy%X=uFxO1uKy?^KdSBjM7A*%C3lR1q2N!!jELsjO79i|J4lee5ShO5mEI` zIk?#KVbOAMu>fH&a&WQd!=mNjVgbTl#7UgY3n&xb|J!NmfEy~x4Eo)3$bgNp?Sdy#{SJs%b=2Nw$v z_96!tdp;~$4lWiT>_xV?_qFTa)10$Q~%g{#<=mMdmq3%P8rEin;`aAFx*IFvPk~T>b}{>T=YV%Iq85b zZs0-+uxnIwmEn1-SAGj0kXhBQp0`hgEC+{Eg@JePT4mFXCMFlEWEG;+N1CM%?-o^$ z`Z#AGz8|KYeh~;w9$X1zE9jgNjCyuVC;CLM3yeM`zV}&I2N23Dva!?+>^9RdRPWtZ za&>!XN64abZ?n>6git!etN3b)ZZ5jF|FC#C^^jiUw#QCQx%}E5LYp?NK26VXdvtr{ zGElh6MMs#7$!dW9?gMR8w?1ul8DAV%&B^_e9(=-%9_s3_I=V!SqrKA%_@!3Y?wU_^ zyEC;-W2~}dTd3+DgRWCFAetUs(-;ZY%^HyyMq1}my5ciOJ@s8q8Zq32N1mPG#x2JQ z-c%jA69o+xco87HX;X?dMeN2T{Jum4Rk*J68rd#))-IUt=nz^``ZDcidvCz`UN=}2hd`9NZ! z)3%ND=BK>oJX=-5Y@P1$>YJLn7gq1kr0>uMV0Mp(=EF5-8O5%L_%Z(EgP%oZ* z7pR=D%P~4Kq8;Vl;TU&L{y0Ha9cY)C38mON591ya58Pr52rV`i7pS_~5{~*T4kRvc zp+B#?r8zs@CVVt__ZD@Lkvoj>DrmBj<%43u_OkcECs)*M_0IU9x-+WfepvPN>~-$Y zjSI7>uckjq#2X&Bb|n&}`n*K~veZ6Sz8nao@@^Oy`v_YXpPj-#RMNgu_hwzoxelIz z(P^K+z*vutB5Y8QhoaU7XvJDTRMeoSrlfFANmh@@>|BOcW=u=5ASqoje&3OW_C?|2 zBgiKRgX#ezt2Kr1Tono}R>SHj>4aU@k>E()7T-M!!RdL=c$r+jD7wbh&ZatWODtJU%UG^Q1Ox>eRCgE}>x{A8`o!#Bb?7}e8 zH?Ga7%Yr3vHAr3qc)19E4nKRup0Vr$uApSPw>rI^*T`Z9VHY;&=!x}`ho>a0eo$;R z#>dYE971es zbFF~PeqBU++Z*09Q)M%OA=ZvIr=$Lc$kxUAi#T}Xl}QRtV?3js z=j6j>r;jzg=St?X_1s(V5PZ_QWY+c287GW~%n?3}lb2GVdD!&TGui9gUH?~ zlWkhnl+0%Ad6CDCL*tb}W`mVaKi%&uHyb=@Eg$QO{iL(k;BHlVo7-%t$rv;o8VkmB zDa~|VhlF394J{RX)E$xkOxz@%*h=0;muPv8scKq2zmSc;89OX~pYbWeSH$w!P;qzh zhaUOtj?q*Rv8>&dQfE952fW97Cxk54M09VM_KT}z3^+$Of84TI!>l21gFjCW4+u5m zu6Y@jmAiO>FwLW>XN0eI2ToMS_sQuvuQ}c}pz6gqzhk)bGvjJ0urA-6h|zPBsZ2T1 z=@1m+;OV?3zPe;vOr^QmZ9XnoK|r~D(>_VA2LeUXS1W<`s_h}IFBc#3Ygb(`6P?W4 zztDS#u9P!@E-*h)Ry}d^uL|>~tMS00-M2osW*(&s%uO~b682-HNW(9i zGUEL$2PACLH2|sC_0XYD@lvlgY_uF~i<)5mixz93d`KHU3~TosFRrUdma+Pcn0W3zoBA;nvwVePJirsd2Zh8{PI z89IO7?GVE~)>(9Z=OvrF9aSRoS|kW>P!v30tAufmk(HD-1NPUd0;MDOiH4kTmijd4 z914%DkgrS4A%560`hGHq9N74LerBeaAbCjY)6Ja&W6p*_!vbI_F3;uHR?!WCUk)lx e#6Orn47e>!t*b5OZd&^D2NQ#x`bD}f;r|a3+ZUPu literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/ironchest/textures/model/shulker/black/shulker_black_gold.png b/src/main/resources/assets/ironchest/textures/model/shulker/black/shulker_black_gold.png new file mode 100644 index 0000000000000000000000000000000000000000..69fe3d18813b4ddf506460e24107970f9c55dc51 GIT binary patch literal 19619 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 G?EeA8BmKYt literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/ironchest/textures/model/shulker/black/shulker_black_iron.png b/src/main/resources/assets/ironchest/textures/model/shulker/black/shulker_black_iron.png new file mode 100644 index 0000000000000000000000000000000000000000..b143affb864186d34ca14145caf83866492ed521 GIT binary patch literal 19628 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 M^mgm!>o^?wfAMb+EC2ui literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/ironchest/textures/model/shulker/black/shulker_black_obsidian.png b/src/main/resources/assets/ironchest/textures/model/shulker/black/shulker_black_obsidian.png new file mode 100644 index 0000000000000000000000000000000000000000..79bc61f251697c906fdfb54a387ffff0a67349c2 GIT binary patch literal 20770 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