From ff1ff5ae2c8bf796d358070da8c9693507b79243 Mon Sep 17 00:00:00 2001 From: mezz Date: Wed, 18 May 2016 23:44:03 -0700 Subject: [PATCH] Put Facing on blockstate not Tile. Use one block per type for BlockBase --- lang | 2 +- .../forestry/apiculture/PluginApiculture.java | 26 +-- .../apiculture/blocks/BlockApiculture.java | 4 +- .../blocks/BlockRegistryApiculture.java | 20 +- .../blocks/BlockTypeApiculture.java | 8 +- .../blocks/BlockTypeApicultureTesr.java | 8 +- .../entities/EntityMinecartApiary.java | 3 +- .../entities/EntityMinecartBeehouse.java | 3 +- .../worldgen/VillageApiaristHouse.java | 77 +++---- .../arboriculture/PluginArboriculture.java | 7 +- .../blocks/BlockArboriculture.java | 4 +- .../blocks/BlockRegistryArboriculture.java | 6 +- .../blocks/BlockTypeArboricultureTesr.java | 8 +- src/main/java/forestry/core/PluginCore.java | 8 +- .../java/forestry/core/blocks/BlockBase.java | 216 ++++++------------ .../java/forestry/core/blocks/BlockCore.java | 4 +- .../core/blocks/BlockRegistryCore.java | 10 +- .../core/blocks/BlockTypeCoreTesr.java | 9 +- .../core/blocks/IMachineProperties.java | 15 +- .../core/blocks/MachineProperties.java | 47 +--- .../core/blocks/MachinePropertiesTesr.java | 10 +- .../core/items/ItemBlockForestry.java | 16 +- .../forestry/core/recipes/RecipeUtil.java | 5 + .../core/render/MachineParticleCallback.java | 12 +- .../core/render/MachineStateMapper.java | 24 +- .../forestry/core/render/RenderAnalyzer.java | 12 +- .../core/render/RenderEscritoire.java | 12 +- .../forestry/core/render/RenderMachine.java | 12 +- .../core/render/RenderNaturalistChest.java | 12 +- .../forestry/core/tiles/IRenderableTile.java | 5 - .../java/forestry/core/tiles/TileBase.java | 12 +- .../java/forestry/core/tiles/TileEngine.java | 48 +--- .../forestry/core/tiles/TileForestry.java | 57 +---- .../core/worldgen/BlockTypeTileForestry.java | 59 ----- .../java/forestry/energy/PluginEnergy.java | 23 +- .../forestry/energy/blocks/BlockEngine.java | 75 ++++-- .../energy/blocks/BlockRegistryEnergy.java | 14 +- .../energy/blocks/BlockTypeEngine.java | 18 +- .../blocks/MachinePropertiesEngine.java | 18 +- .../java/forestry/energy/gui/GuiEngine.java | 2 +- .../forestry/energy/render/RenderEngine.java | 12 +- .../java/forestry/factory/PluginFactory.java | 53 ++--- .../factory/blocks/BlockFactoryPlain.java | 4 +- .../factory/blocks/BlockFactoryTESR.java | 4 +- .../factory/blocks/BlockRegistryFactory.java | 49 +++- .../factory/blocks/BlockTypeFactoryPlain.java | 10 +- .../factory/blocks/BlockTypeFactoryTesr.java | 24 +- .../factory/recipes/jei/FactoryJeiPlugin.java | 22 +- .../jei/bottler/BottlerRecipeCategory.java | 2 +- .../carpenter/CarpenterRecipeCategory.java | 2 +- .../centrifuge/CentrifugeRecipeCategory.java | 2 +- .../fabricator/FabricatorRecipeCategory.java | 2 +- .../fermenter/FermenterRecipeCategory.java | 2 +- .../moistener/MoistenerRecipeCategory.java | 2 +- .../rainmaker/RainmakerRecipeCategory.java | 2 +- .../jei/squeezer/SqueezerRecipeCategory.java | 2 +- .../jei/still/StillRecipeCategory.java | 2 +- .../PluginLepidopterology.java | 8 +- .../blocks/BlockLepidopterology.java | 4 +- .../blocks/BlockRegistryLepidopterology.java | 6 +- .../blocks/BlockTypeLepidopterologyTesr.java | 8 +- src/main/java/forestry/mail/PluginMail.java | 12 +- .../java/forestry/mail/blocks/BlockMail.java | 4 +- .../mail/blocks/BlockRegistryMail.java | 14 +- .../forestry/mail/blocks/BlockTypeMail.java | 10 +- .../plugins/compat/BlockRegistryIC2.java | 19 ++ .../forestry/plugins/compat/PluginIC2.java | 11 + .../java/forestry/storage/PluginStorage.java | 5 +- .../assets/forestry/blockstates/apiary.json | 8 + .../blockstates/apiculture_apiary.json | 8 - .../blockstates/apiculture_bee_house.json | 8 - .../forestry/blockstates/bee_house.json | 8 + .../forestry/blockstates/fabricator.json | 8 + .../blockstates/factory2_fabricator.json | 8 - .../blockstates/factory2_raintank.json | 8 - .../blockstates/factory2_worktable.json | 8 - .../forestry/blockstates/mail_mailbox.json | 8 - .../blockstates/mail_philatelist.json | 8 - .../blockstates/mail_stamp_collector.json | 8 - .../blockstates/mail_trade_station.json | 8 - .../assets/forestry/blockstates/mailbox.json | 8 + .../assets/forestry/blockstates/raintank.json | 8 + .../forestry/blockstates/stamp_collector.json | 8 + .../forestry/blockstates/trade_station.json | 8 + .../forestry/blockstates/worktable.json | 8 + .../{apiculture_apiary.json => apiary.json} | 0 ...iculture_bee_house.json => bee_house.json} | 0 ...ctory2_fabricator.json => fabricator.json} | 0 .../block/{mail_mailbox.json => mailbox.json} | 0 .../{factory2_raintank.json => raintank.json} | 0 ...mp_collector.json => stamp_collector.json} | 0 ..._trade_station.json => trade_station.json} | 0 ...factory2_worktable.json => worktable.json} | 0 .../{core_analyzer.json => analyzer.json} | 0 .../item/{mail_mailbox.json => apiary.json} | 2 +- .../models/item/apiculture_bee_house.json | 10 - ...ureChest_api_chest.json => bee_chest.json} | 0 ...{apiculture_apiary.json => bee_house.json} | 2 +- .../{core_escritoire.json => bottler.json} | 0 ...re_arb_chest.json => butterfly_chest.json} | 0 .../{factory_bottler.json => carpenter.json} | 0 ...factory_carpenter.json => centrifuge.json} | 0 ...actory_centrifuge.json => escritoire.json} | 0 ...factory2_raintank.json => fabricator.json} | 2 +- .../models/item/factory2_fabricator.json | 10 - ...{factory_fermenter.json => fermenter.json} | 0 .../models/item/mail_stamp_collector.json | 10 - .../models/item/mail_trade_station.json | 10 - .../{factory2_worktable.json => mailbox.json} | 2 +- ...{factory_moistener.json => moistener.json} | 0 ...{factory_rainmaker.json => rainmaker.json} | 0 .../assets/forestry/models/item/raintank.json | 10 + .../{factory_squeezer.json => squeezer.json} | 0 .../forestry/models/item/stamp_collector.json | 10 + .../item/{factory_still.json => still.json} | 0 .../forestry/models/item/trade_station.json | 10 + ...rology_lepi_chest.json => tree_chest.json} | 0 .../forestry/models/item/worktable.json | 10 + 118 files changed, 636 insertions(+), 816 deletions(-) delete mode 100644 src/main/java/forestry/core/worldgen/BlockTypeTileForestry.java create mode 100644 src/main/java/forestry/plugins/compat/BlockRegistryIC2.java create mode 100644 src/main/resources/assets/forestry/blockstates/apiary.json delete mode 100644 src/main/resources/assets/forestry/blockstates/apiculture_apiary.json delete mode 100644 src/main/resources/assets/forestry/blockstates/apiculture_bee_house.json create mode 100644 src/main/resources/assets/forestry/blockstates/bee_house.json create mode 100644 src/main/resources/assets/forestry/blockstates/fabricator.json delete mode 100644 src/main/resources/assets/forestry/blockstates/factory2_fabricator.json delete mode 100644 src/main/resources/assets/forestry/blockstates/factory2_raintank.json delete mode 100644 src/main/resources/assets/forestry/blockstates/factory2_worktable.json delete mode 100644 src/main/resources/assets/forestry/blockstates/mail_mailbox.json delete mode 100644 src/main/resources/assets/forestry/blockstates/mail_philatelist.json delete mode 100644 src/main/resources/assets/forestry/blockstates/mail_stamp_collector.json delete mode 100644 src/main/resources/assets/forestry/blockstates/mail_trade_station.json create mode 100644 src/main/resources/assets/forestry/blockstates/mailbox.json create mode 100644 src/main/resources/assets/forestry/blockstates/raintank.json create mode 100644 src/main/resources/assets/forestry/blockstates/stamp_collector.json create mode 100644 src/main/resources/assets/forestry/blockstates/trade_station.json create mode 100644 src/main/resources/assets/forestry/blockstates/worktable.json rename src/main/resources/assets/forestry/models/block/{apiculture_apiary.json => apiary.json} (100%) rename src/main/resources/assets/forestry/models/block/{apiculture_bee_house.json => bee_house.json} (100%) rename src/main/resources/assets/forestry/models/block/{factory2_fabricator.json => fabricator.json} (100%) rename src/main/resources/assets/forestry/models/block/{mail_mailbox.json => mailbox.json} (100%) rename src/main/resources/assets/forestry/models/block/{factory2_raintank.json => raintank.json} (100%) rename src/main/resources/assets/forestry/models/block/{mail_stamp_collector.json => stamp_collector.json} (100%) rename src/main/resources/assets/forestry/models/block/{mail_trade_station.json => trade_station.json} (100%) rename src/main/resources/assets/forestry/models/block/{factory2_worktable.json => worktable.json} (100%) rename src/main/resources/assets/forestry/models/item/{core_analyzer.json => analyzer.json} (100%) rename src/main/resources/assets/forestry/models/item/{mail_mailbox.json => apiary.json} (81%) delete mode 100644 src/main/resources/assets/forestry/models/item/apiculture_bee_house.json rename src/main/resources/assets/forestry/models/item/{apicultureChest_api_chest.json => bee_chest.json} (100%) rename src/main/resources/assets/forestry/models/item/{apiculture_apiary.json => bee_house.json} (79%) rename src/main/resources/assets/forestry/models/item/{core_escritoire.json => bottler.json} (100%) rename src/main/resources/assets/forestry/models/item/{arboriculture_arb_chest.json => butterfly_chest.json} (100%) rename src/main/resources/assets/forestry/models/item/{factory_bottler.json => carpenter.json} (100%) rename src/main/resources/assets/forestry/models/item/{factory_carpenter.json => centrifuge.json} (100%) rename src/main/resources/assets/forestry/models/item/{factory_centrifuge.json => escritoire.json} (100%) rename src/main/resources/assets/forestry/models/item/{factory2_raintank.json => fabricator.json} (79%) delete mode 100644 src/main/resources/assets/forestry/models/item/factory2_fabricator.json rename src/main/resources/assets/forestry/models/item/{factory_fermenter.json => fermenter.json} (100%) delete mode 100644 src/main/resources/assets/forestry/models/item/mail_stamp_collector.json delete mode 100644 src/main/resources/assets/forestry/models/item/mail_trade_station.json rename src/main/resources/assets/forestry/models/item/{factory2_worktable.json => mailbox.json} (79%) rename src/main/resources/assets/forestry/models/item/{factory_moistener.json => moistener.json} (100%) rename src/main/resources/assets/forestry/models/item/{factory_rainmaker.json => rainmaker.json} (100%) create mode 100644 src/main/resources/assets/forestry/models/item/raintank.json rename src/main/resources/assets/forestry/models/item/{factory_squeezer.json => squeezer.json} (100%) create mode 100644 src/main/resources/assets/forestry/models/item/stamp_collector.json rename src/main/resources/assets/forestry/models/item/{factory_still.json => still.json} (100%) create mode 100644 src/main/resources/assets/forestry/models/item/trade_station.json rename src/main/resources/assets/forestry/models/item/{lepidopterology_lepi_chest.json => tree_chest.json} (100%) create mode 100644 src/main/resources/assets/forestry/models/item/worktable.json diff --git a/lang b/lang index 8063f9d26..2d10d35c0 160000 --- a/lang +++ b/lang @@ -1 +1 @@ -Subproject commit 8063f9d26b5a20acfa521f80fc1fb503edac4a56 +Subproject commit 2d10d35c0873a16a1884b5013223fd7d7aee3c2b diff --git a/src/main/java/forestry/apiculture/PluginApiculture.java b/src/main/java/forestry/apiculture/PluginApiculture.java index 16b758fb6..e551a5e19 100644 --- a/src/main/java/forestry/apiculture/PluginApiculture.java +++ b/src/main/java/forestry/apiculture/PluginApiculture.java @@ -67,8 +67,6 @@ import forestry.api.storage.StorageManager; import forestry.apiculture.blocks.BlockAlvearyType; import forestry.apiculture.blocks.BlockCandle; import forestry.apiculture.blocks.BlockRegistryApiculture; -import forestry.apiculture.blocks.BlockTypeApiculture; -import forestry.apiculture.blocks.BlockTypeApicultureTesr; import forestry.apiculture.commands.CommandBee; import forestry.apiculture.entities.EntityMinecartApiary; import forestry.apiculture.entities.EntityMinecartBeehouse; @@ -191,9 +189,6 @@ public class PluginApiculture extends BlankForestryPlugin { MinecraftForge.EVENT_BUS.register(this); - blocks.apiculture.addDefinitions(BlockTypeApiculture.VALUES); - blocks.apicultureChest.addDefinitions(BlockTypeApicultureTesr.APIARIST_CHEST); - if (Config.enableVillagers) { // Register village components with the Structure registry. VillageCreationApiculture.registerVillageComponents(); @@ -313,9 +308,9 @@ public class PluginApiculture extends BlankForestryPlugin { villagerApiarist = new VillagerRegistry.VillagerProfession(Constants.ID_VILLAGER_APIARIST, Constants.TEXTURE_SKIN_BEEKPEEPER); villagerRegistry.register(villagerApiarist); - ItemStack wildcardPrincess = new ItemStack(PluginApiculture.items.beePrincessGE, 1); - ItemStack apiary = PluginApiculture.blocks.apiculture.get(BlockTypeApiculture.APIARY); - ItemStack provenFrames = PluginApiculture.items.frameProven.getItemStack(); + ItemStack wildcardPrincess = new ItemStack(items.beePrincessGE, 1); + ItemStack apiary = new ItemStack(blocks.apiary); + ItemStack provenFrames = items.frameProven.getItemStack(); ItemStack monasticDrone = BeeDefinition.MONASTIC.getMemberStack(EnumBeeType.DRONE); VillagerRegistry.VillagerCareer apiaristCareer = new VillagerRegistry.VillagerCareer(villagerApiarist, "apiarist"); @@ -339,8 +334,9 @@ public class PluginApiculture extends BlankForestryPlugin { proxy.initializeRendering(); - blocks.apiculture.init(); - blocks.apicultureChest.init(); + blocks.apiary.init(); + blocks.beeHouse.init(); + blocks.beeChest.init(); } @Override @@ -500,12 +496,12 @@ public class PluginApiculture extends BlankForestryPlugin { RecipeUtil.addRecipe(items.minecartBeehouse.getBeeHouseMinecart(), "B", "C", - 'B', blocks.apiculture.get(BlockTypeApiculture.BEE_HOUSE), + 'B', new ItemStack(blocks.beeHouse), 'C', Items.MINECART); RecipeUtil.addRecipe(items.minecartBeehouse.getApiaryMinecart(), "B", "C", - 'B', blocks.apiculture.get(BlockTypeApiculture.APIARY), + 'B', new ItemStack(blocks.apiary), 'C', Items.MINECART); // FOOD STUFF @@ -750,7 +746,7 @@ public class PluginApiculture extends BlankForestryPlugin { RecipeManagers.fermenterManager.addRecipe(items.honeydew.getItemStack(), 500, 1.0f, Fluids.SHORT_MEAD.getFluid(1), Fluids.FOR_HONEY.getFluid(1)); } - RecipeUtil.addRecipe(blocks.apiculture.get(BlockTypeApiculture.APIARY), + RecipeUtil.addRecipe(blocks.apiary, "XXX", "#C#", "###", @@ -758,7 +754,7 @@ public class PluginApiculture extends BlankForestryPlugin { '#', "plankWood", 'C', PluginCore.items.impregnatedCasing); - RecipeUtil.addRecipe(new ItemStack(blocks.apicultureChest), + RecipeUtil.addRecipe(blocks.beeChest, " # ", "XYX", "XXX", @@ -766,7 +762,7 @@ public class PluginApiculture extends BlankForestryPlugin { 'X', "beeComb", 'Y', "chestWood"); - RecipeUtil.addRecipe(blocks.apiculture.get(BlockTypeApiculture.BEE_HOUSE), + RecipeUtil.addRecipe(blocks.beeHouse, "XXX", "#C#", "###", diff --git a/src/main/java/forestry/apiculture/blocks/BlockApiculture.java b/src/main/java/forestry/apiculture/blocks/BlockApiculture.java index ad7599234..e2e2dc9b6 100644 --- a/src/main/java/forestry/apiculture/blocks/BlockApiculture.java +++ b/src/main/java/forestry/apiculture/blocks/BlockApiculture.java @@ -14,8 +14,8 @@ import forestry.api.core.Tabs; import forestry.core.blocks.BlockBase; public class BlockApiculture extends BlockBase { - public BlockApiculture() { - super(BlockTypeApiculture.class); + public BlockApiculture(BlockTypeApiculture type) { + super(type); setCreativeTab(Tabs.tabApiculture); setHarvestLevel("axe", 0); } diff --git a/src/main/java/forestry/apiculture/blocks/BlockRegistryApiculture.java b/src/main/java/forestry/apiculture/blocks/BlockRegistryApiculture.java index a540f0869..bbd44fd2f 100644 --- a/src/main/java/forestry/apiculture/blocks/BlockRegistryApiculture.java +++ b/src/main/java/forestry/apiculture/blocks/BlockRegistryApiculture.java @@ -21,21 +21,25 @@ import forestry.core.blocks.BlockRegistry; import forestry.core.items.ItemBlockForestry; public class BlockRegistryApiculture extends BlockRegistry { - public final BlockApiculture apiculture; - public final BlockBase apicultureChest; + public final BlockApiculture apiary; + public final BlockApiculture beeHouse; + public final BlockBase beeChest; public final BlockBeeHives beehives; public final BlockCandle candle; public final BlockStump stump; private final Map alvearyBlockMap; public BlockRegistryApiculture() { - apiculture = new BlockApiculture(); - registerBlock(apiculture, new ItemBlockForestry(apiculture), "apiculture"); + apiary = new BlockApiculture(BlockTypeApiculture.APIARY); + registerBlock(apiary, new ItemBlockForestry(apiary), "apiary"); - apicultureChest = new BlockBase<>(BlockTypeApicultureTesr.class); - registerBlock(apicultureChest, new ItemBlockForestry(apicultureChest), "apicultureChest"); - apicultureChest.setCreativeTab(Tabs.tabApiculture); - apicultureChest.setHarvestLevel("axe", 0); + beeHouse = new BlockApiculture(BlockTypeApiculture.BEE_HOUSE); + registerBlock(beeHouse, new ItemBlockForestry(beeHouse), "bee_house"); + + beeChest = new BlockBase<>(BlockTypeApicultureTesr.APIARIST_CHEST); + registerBlock(beeChest, new ItemBlockForestry(beeChest), "bee_chest"); + beeChest.setCreativeTab(Tabs.tabApiculture); + beeChest.setHarvestLevel("axe", 0); beehives = new BlockBeeHives(); registerBlock(beehives, new ItemBlockForestry(beehives), "beehives"); diff --git a/src/main/java/forestry/apiculture/blocks/BlockTypeApiculture.java b/src/main/java/forestry/apiculture/blocks/BlockTypeApiculture.java index 527dc290f..c816df00a 100644 --- a/src/main/java/forestry/apiculture/blocks/BlockTypeApiculture.java +++ b/src/main/java/forestry/apiculture/blocks/BlockTypeApiculture.java @@ -20,16 +20,16 @@ import forestry.core.blocks.MachineProperties; import forestry.core.tiles.TileForestry; public enum BlockTypeApiculture implements IBlockType { - APIARY(0, TileApiary.class, "apiary"), - BEE_HOUSE(1, TileBeeHouse.class, "bee_house"); + APIARY(TileApiary.class, "apiary"), + BEE_HOUSE(TileBeeHouse.class, "bee_house"); public static final BlockTypeApiculture[] VALUES = values(); @Nonnull private final IMachineProperties machineProperties; - BlockTypeApiculture(int meta, @Nonnull Class teClass, @Nonnull String name) { - this.machineProperties = new MachineProperties<>(meta, teClass, name); + BlockTypeApiculture(@Nonnull Class teClass, @Nonnull String name) { + this.machineProperties = new MachineProperties<>(teClass, name); } @Nonnull diff --git a/src/main/java/forestry/apiculture/blocks/BlockTypeApicultureTesr.java b/src/main/java/forestry/apiculture/blocks/BlockTypeApicultureTesr.java index b9e40a2b7..4bbd95517 100644 --- a/src/main/java/forestry/apiculture/blocks/BlockTypeApicultureTesr.java +++ b/src/main/java/forestry/apiculture/blocks/BlockTypeApicultureTesr.java @@ -26,18 +26,18 @@ import forestry.core.tiles.TileForestry; import forestry.core.tiles.TileNaturalistChest; public enum BlockTypeApicultureTesr implements IBlockTypeTesr { - APIARIST_CHEST(0, TileApiaristChest.class, "api_chest", Proxies.render.getRenderChest("apiaristchest"), TileNaturalistChest.chestBoundingBox); + APIARIST_CHEST(TileApiaristChest.class, "api_chest", Proxies.render.getRenderChest("apiaristchest"), TileNaturalistChest.chestBoundingBox); public static final BlockTypeApicultureTesr[] VALUES = values(); @Nonnull private final IMachinePropertiesTesr machineProperties; - BlockTypeApicultureTesr(int meta, @Nonnull Class teClass, @Nonnull String name, @Nullable TileEntitySpecialRenderer renderer, @Nullable AxisAlignedBB boundingBox) { + BlockTypeApicultureTesr(@Nonnull Class teClass, @Nonnull String name, @Nullable TileEntitySpecialRenderer renderer, @Nullable AxisAlignedBB boundingBox) { if (boundingBox != null) { - this.machineProperties = new MachinePropertiesTesr<>(meta, teClass, name, renderer, boundingBox, Constants.RESOURCE_ID + ":blocks/" + name + ".0"); + this.machineProperties = new MachinePropertiesTesr<>(teClass, name, renderer, boundingBox, Constants.RESOURCE_ID + ":blocks/" + name + ".0"); } else { - this.machineProperties = new MachinePropertiesTesr<>(meta, teClass, name, renderer, Constants.RESOURCE_ID + ":blocks/" + name + ".0"); + this.machineProperties = new MachinePropertiesTesr<>(teClass, name, renderer, Constants.RESOURCE_ID + ":blocks/" + name + ".0"); } } diff --git a/src/main/java/forestry/apiculture/entities/EntityMinecartApiary.java b/src/main/java/forestry/apiculture/entities/EntityMinecartApiary.java index 295311b20..b3732af60 100644 --- a/src/main/java/forestry/apiculture/entities/EntityMinecartApiary.java +++ b/src/main/java/forestry/apiculture/entities/EntityMinecartApiary.java @@ -28,7 +28,6 @@ import forestry.apiculture.ApiaryBeeListener; import forestry.apiculture.ApiaryBeeModifier; import forestry.apiculture.IApiary; import forestry.apiculture.PluginApiculture; -import forestry.apiculture.blocks.BlockTypeApiculture; import forestry.apiculture.gui.ContainerMinecartBeehouse; import forestry.apiculture.gui.GuiBeeHousing; import forestry.apiculture.inventory.IApiaryInventory; @@ -72,7 +71,7 @@ public class EntityMinecartApiary extends EntityMinecartBeeHousingBase implement @Override public IBlockState getDisplayTile() { - return PluginApiculture.blocks.apiculture.getStateFromMeta(BlockTypeApiculture.APIARY.ordinal()); + return PluginApiculture.blocks.apiary.getDefaultState(); } @Override diff --git a/src/main/java/forestry/apiculture/entities/EntityMinecartBeehouse.java b/src/main/java/forestry/apiculture/entities/EntityMinecartBeehouse.java index b5924611c..693f78a02 100644 --- a/src/main/java/forestry/apiculture/entities/EntityMinecartBeehouse.java +++ b/src/main/java/forestry/apiculture/entities/EntityMinecartBeehouse.java @@ -25,7 +25,6 @@ import forestry.api.apiculture.IBeeModifier; import forestry.apiculture.BeehouseBeeModifier; import forestry.apiculture.InventoryBeeHousing; import forestry.apiculture.PluginApiculture; -import forestry.apiculture.blocks.BlockTypeApiculture; import forestry.apiculture.gui.ContainerMinecartBeehouse; import forestry.apiculture.gui.GuiBeeHousing; import forestry.core.config.Config; @@ -54,7 +53,7 @@ public class EntityMinecartBeehouse extends EntityMinecartBeeHousingBase { @Override public IBlockState getDisplayTile() { - return PluginApiculture.blocks.apiculture.getStateFromMeta(BlockTypeApiculture.BEE_HOUSE.ordinal()); + return PluginApiculture.blocks.beeHouse.getDefaultState(); } @Override diff --git a/src/main/java/forestry/apiculture/worldgen/VillageApiaristHouse.java b/src/main/java/forestry/apiculture/worldgen/VillageApiaristHouse.java index 1880be390..7bd08d807 100644 --- a/src/main/java/forestry/apiculture/worldgen/VillageApiaristHouse.java +++ b/src/main/java/forestry/apiculture/worldgen/VillageApiaristHouse.java @@ -18,6 +18,8 @@ import java.util.Random; import net.minecraft.block.Block; import net.minecraft.block.BlockDoor; +import net.minecraft.block.BlockFenceGate; +import net.minecraft.block.BlockLog; import net.minecraft.block.BlockNewLog; import net.minecraft.block.BlockOldLog; import net.minecraft.block.BlockPlanks; @@ -52,11 +54,9 @@ import forestry.api.core.EnumTemperature; import forestry.api.core.ForestryAPI; import forestry.api.genetics.AlleleManager; import forestry.apiculture.PluginApiculture; -import forestry.apiculture.blocks.BlockTypeApiculture; import forestry.apiculture.flowers.Flower; import forestry.apiculture.flowers.FlowerRegistry; -import forestry.apiculture.inventory.InventoryApiary; -import forestry.apiculture.tiles.TileApiary; +import forestry.apiculture.tiles.TileBeeHouse; import forestry.arboriculture.PluginArboriculture; import forestry.core.PluginCore; import forestry.core.blocks.BlockCore; @@ -98,7 +98,7 @@ public class VillageApiaristHouse extends StructureVillagePieces.House1 { EnumWoodType woodType = EnumWoodType.getRandom(random); IWoodAccess woodAccess = TreeManager.woodAccess; - this.logs = woodAccess.getLogBlock(woodType, fireproof); + this.logs = woodAccess.getLogBlock(woodType, fireproof).withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.X); this.planks = woodAccess.getPlanksBlock(woodType, fireproof); this.stairs = woodAccess.getStairsBlock(woodType, fireproof); this.fence = woodAccess.getFenceBlock(woodType, fireproof); @@ -166,7 +166,9 @@ public class VillageApiaristHouse extends StructureVillagePieces.House1 { fillWithBlocks(world, structBoundingBox, 8, 1, 6, 8, 1, 10, fence, fence, false); fillWithBlocks(world, structBoundingBox, 2, 1, 10, 7, 1, 10, fence, fence, false); - placeBlockAtCurrentPosition(world, fenceGate, 8, 1, 8, structBoundingBox); + setBlockState(world, fenceGate, 8, 1, 8, structBoundingBox); + setBlockState(world, fenceGate, 1, 1, 8, structBoundingBox); + setBlockState(world, fenceGate.withProperty(BlockFenceGate.FACING, EnumFacing.NORTH), 4, 1, 10, structBoundingBox); // Flowers plantFlowerGarden(world, structBoundingBox, 2, 1, 5, 7, 1, 9); @@ -189,17 +191,17 @@ public class VillageApiaristHouse extends StructureVillagePieces.House1 { fillWithBlocks(world, structBoundingBox, 0, 4, 4, 8, 4, 4, planks, planks, false); fillWithBlocks(world, structBoundingBox, 0, 5, 2, 8, 5, 3, planks, planks, false); - placeBlockAtCurrentPosition(world, planks, 0, 4, 2, structBoundingBox); - placeBlockAtCurrentPosition(world, planks, 0, 4, 3, structBoundingBox); - placeBlockAtCurrentPosition(world, planks, 8, 4, 2, structBoundingBox); - placeBlockAtCurrentPosition(world, planks, 8, 4, 3, structBoundingBox); + setBlockState(world, planks, 0, 4, 2, structBoundingBox); + setBlockState(world, planks, 0, 4, 3, structBoundingBox); + setBlockState(world, planks, 8, 4, 2, structBoundingBox); + setBlockState(world, planks, 8, 4, 3, structBoundingBox); buildRoof(world, structBoundingBox); - placeBlockAtCurrentPosition(world, logs, 0, 2, 1, structBoundingBox); - placeBlockAtCurrentPosition(world, logs, 0, 2, 4, structBoundingBox); - placeBlockAtCurrentPosition(world, logs, 8, 2, 1, structBoundingBox); - placeBlockAtCurrentPosition(world, logs, 8, 2, 4, structBoundingBox); + setBlockState(world, logs, 0, 2, 1, structBoundingBox); + setBlockState(world, logs, 0, 2, 4, structBoundingBox); + setBlockState(world, logs, 8, 2, 1, structBoundingBox); + setBlockState(world, logs, 8, 2, 4, structBoundingBox); IBlockState glassPaneState = Blocks.GLASS_PANE.getDefaultState(); setBlockState(world, glassPaneState, 0, 2, 2, structBoundingBox); @@ -218,8 +220,8 @@ public class VillageApiaristHouse extends StructureVillagePieces.House1 { // Escritoire if (random.nextInt(2) == 0) { - IBlockState escritoireBlock = PluginCore.blocks.escritoire.getDefaultState().withProperty(BlockCore.FACING, EnumFacing.WEST); - placeBlockAtCurrentPosition(world, escritoireBlock, 1, 1, 3, structBoundingBox); + IBlockState escritoireBlock = PluginCore.blocks.escritoire.getDefaultState().withProperty(BlockCore.FACING, EnumFacing.EAST); + setBlockState(world, escritoireBlock, 1, 1, 3, structBoundingBox); } IBlockState airState = Blocks.AIR.getDefaultState(); @@ -227,6 +229,8 @@ public class VillageApiaristHouse extends StructureVillagePieces.House1 { this.setBlockState(world, this.door.withProperty(BlockDoor.FACING, EnumFacing.NORTH), 2, 1, 0, structBoundingBox); this.setBlockState(world, this.door.withProperty(BlockDoor.FACING, EnumFacing.NORTH).withProperty(BlockDoor.HALF, BlockDoor.EnumDoorHalf.UPPER), 2, 2, 0, structBoundingBox); + this.setBlockState(world, Blocks.TORCH.getDefaultState().withProperty(BlockTorch.FACING, EnumFacing.NORTH), 2, 3, 1, structBoundingBox); + if (isAirBlockAtCurrentPosition(world, new BlockPos(2, 0, -1), structBoundingBox) && !isAirBlockAtCurrentPosition(world, new BlockPos(2, -1, -1), structBoundingBox)) { setBlockState(world, Blocks.STONE_STAIRS.getDefaultState().withProperty(BlockStairs.FACING, EnumFacing.NORTH), 2, 0, -1, structBoundingBox); } @@ -234,8 +238,7 @@ public class VillageApiaristHouse extends StructureVillagePieces.House1 { setBlockState(world, airState, 6, 1, 5, structBoundingBox); setBlockState(world, airState, 6, 2, 5, structBoundingBox); - // Candles / Lighting - this.setBlockState(world, Blocks.TORCH.getDefaultState().withProperty(BlockTorch.FACING, EnumFacing.NORTH), 2, 3, 1, structBoundingBox); + this.setBlockState(world, Blocks.TORCH.getDefaultState().withProperty(BlockTorch.FACING, EnumFacing.SOUTH), 6, 3, 4, structBoundingBox); this.setBlockState(world, this.door.withProperty(BlockDoor.FACING, EnumFacing.SOUTH), 6, 1, 5, structBoundingBox); this.setBlockState(world, this.door.withProperty(BlockDoor.FACING, EnumFacing.SOUTH).withProperty(BlockDoor.HALF, BlockDoor.EnumDoorHalf.UPPER), 6, 2, 5, structBoundingBox); @@ -258,10 +261,10 @@ public class VillageApiaristHouse extends StructureVillagePieces.House1 { for (int i = -1; i <= 2; ++i) { for (int j = 0; j <= 8; ++j) { IBlockState northStairs = stairs.withProperty(BlockStairs.FACING, EnumFacing.NORTH); - placeBlockAtCurrentPosition(world, northStairs, j, 4 + i, i, structBoundingBox); + setBlockState(world, northStairs, j, 4 + i, i, structBoundingBox); IBlockState southStairs = stairs.withProperty(BlockStairs.FACING, EnumFacing.SOUTH); - placeBlockAtCurrentPosition(world, southStairs, j, 4 + i, 5 - i, structBoundingBox); + setBlockState(world, southStairs, j, 4 + i, 5 - i, structBoundingBox); } } } @@ -326,41 +329,23 @@ public class VillageApiaristHouse extends StructureVillagePieces.House1 { } IBlockState blockState = world.getBlockState(posNew); - if (PluginApiculture.blocks.apiculture == blockState.getBlock() || !world.isBlockLoaded(posNew.down())) { + if (PluginApiculture.blocks.beeHouse == blockState.getBlock() || !world.isBlockLoaded(posNew.down())) { return; } - world.setBlockState(posNew, PluginApiculture.blocks.apiculture.getStateFromMeta(BlockTypeApiculture.APIARY.ordinal()), Constants.FLAG_BLOCK_SYNCH); - PluginApiculture.blocks.apiculture.onBlockAdded(world, posNew, PluginApiculture.blocks.apiculture.getStateFromMeta(BlockTypeApiculture.APIARY.ordinal())); + IBlockState beeHouseDefaultState = PluginApiculture.blocks.beeHouse.getDefaultState(); + world.setBlockState(posNew, beeHouseDefaultState, Constants.FLAG_BLOCK_SYNCH); - TileApiary apiary = TileUtil.getTile(world, posNew, TileApiary.class); - if (apiary == null) { + TileBeeHouse beeHouse = TileUtil.getTile(world, posNew, TileBeeHouse.class); + if (beeHouse == null) { return; } ItemStack randomVillagePrincess = getRandomVillageBeeStack(world, posNew, EnumBeeType.PRINCESS); - apiary.getBeeInventory().setQueen(randomVillagePrincess); + beeHouse.getBeeInventory().setQueen(randomVillagePrincess); ItemStack randomVillageDrone = getRandomVillageBeeStack(world, posNew, EnumBeeType.DRONE); - apiary.getBeeInventory().setDrone(randomVillageDrone); - - for (int i = InventoryApiary.SLOT_FRAMES_1; i < InventoryApiary.SLOT_FRAMES_1 + InventoryApiary.SLOT_FRAMES_COUNT; i++) { - ItemStack randomFrame = getRandomFrame(world.rand); - apiary.setInventorySlotContents(i, randomFrame); - } - } - - private static ItemStack getRandomFrame(Random random) { - float roll = random.nextFloat(); - if (roll < 0.2f) { - return PluginApiculture.items.frameUntreated.getItemStack(); - } else if (roll < 0.4f) { - return PluginApiculture.items.frameImpregnated.getItemStack(); - } else if (roll < 0.6) { - return PluginApiculture.items.frameProven.getItemStack(); - } else { - return null; - } + beeHouse.getBeeInventory().setDrone(randomVillageDrone); } private static ItemStack getRandomVillageBeeStack(World world, BlockPos pos, EnumBeeType beeType) { @@ -408,10 +393,6 @@ public class VillageApiaristHouse extends StructureVillagePieces.House1 { species.getHumidity(), genome.getToleranceHumid()); } - private void placeBlockAtCurrentPosition(World world, IBlockState block, int x, int y, int z, StructureBoundingBox boundingboxIn) { - setBlockState(world, block, x, y, z, boundingboxIn); - } - @Override protected int chooseProfession(int villagerCount, int currentVillagerProfession) { FMLControlledNamespacedRegistry registry = (FMLControlledNamespacedRegistry) VillagerRegistry.instance().getRegistry(); diff --git a/src/main/java/forestry/arboriculture/PluginArboriculture.java b/src/main/java/forestry/arboriculture/PluginArboriculture.java index b83339923..2d43bc8ef 100644 --- a/src/main/java/forestry/arboriculture/PluginArboriculture.java +++ b/src/main/java/forestry/arboriculture/PluginArboriculture.java @@ -46,7 +46,6 @@ import forestry.api.storage.StorageManager; import forestry.arboriculture.blocks.BlockArbLog; import forestry.arboriculture.blocks.BlockArbSlab; import forestry.arboriculture.blocks.BlockRegistryArboriculture; -import forestry.arboriculture.blocks.BlockTypeArboricultureTesr; import forestry.arboriculture.commands.CommandTree; import forestry.arboriculture.genetics.TreeBranchDefinition; import forestry.arboriculture.genetics.TreeDefinition; @@ -140,8 +139,6 @@ public class PluginArboriculture extends BlankForestryPlugin { WoodAccess.registerFenceGates(blocks.fenceGatesFireproof); WoodAccess.registerStairs(blocks.stairsFireproof); - blocks.arboriculture.addDefinitions(BlockTypeArboricultureTesr.ARB_CHEST); - // Init rendering proxy.initializeModels(); @@ -168,7 +165,7 @@ public class PluginArboriculture extends BlankForestryPlugin { GameRegistry.registerTileEntity(TileLeaves.class, "forestry.Leaves"); GameRegistry.registerTileEntity(TileFruitPod.class, "forestry.Pods"); - blocks.arboriculture.init(); + blocks.treeChest.init(); if (Config.enableVillagers) { villagerArborist = new VillagerRegistry.VillagerProfession(Constants.ID_VILLAGER_ARBORIST, Constants.TEXTURE_SKIN_LUMBERJACK); @@ -360,7 +357,7 @@ public class PluginArboriculture extends BlankForestryPlugin { 'B', "ingotBronze", '#', "stickWood"); - RecipeUtil.addRecipe(blocks.arboriculture.get(BlockTypeArboricultureTesr.ARB_CHEST), + RecipeUtil.addRecipe(blocks.treeChest, " # ", "XYX", "XXX", diff --git a/src/main/java/forestry/arboriculture/blocks/BlockArboriculture.java b/src/main/java/forestry/arboriculture/blocks/BlockArboriculture.java index f8d1f0ecc..c3fb06102 100644 --- a/src/main/java/forestry/arboriculture/blocks/BlockArboriculture.java +++ b/src/main/java/forestry/arboriculture/blocks/BlockArboriculture.java @@ -14,8 +14,8 @@ import forestry.api.core.Tabs; import forestry.core.blocks.BlockBase; public class BlockArboriculture extends BlockBase { - public BlockArboriculture() { - super(BlockTypeArboricultureTesr.class); + public BlockArboriculture(BlockTypeArboricultureTesr type) { + super(type); setCreativeTab(Tabs.tabArboriculture); } } diff --git a/src/main/java/forestry/arboriculture/blocks/BlockRegistryArboriculture.java b/src/main/java/forestry/arboriculture/blocks/BlockRegistryArboriculture.java index 0654c3fd2..5cf0c6d7b 100644 --- a/src/main/java/forestry/arboriculture/blocks/BlockRegistryArboriculture.java +++ b/src/main/java/forestry/arboriculture/blocks/BlockRegistryArboriculture.java @@ -53,7 +53,7 @@ public class BlockRegistryArboriculture extends BlockRegistry { private final Map speciesToLeavesDecorative; public final Map podsMap; - public final BlockArboriculture arboriculture; + public final BlockArboriculture treeChest; public BlockRegistryArboriculture() { // Wood blocks @@ -196,8 +196,8 @@ public class BlockRegistryArboriculture extends BlockRegistry { } // Machines - arboriculture = new BlockArboriculture(); - registerBlock(arboriculture, new ItemBlockForestry(arboriculture), "arboriculture"); + treeChest = new BlockArboriculture(BlockTypeArboricultureTesr.ARB_CHEST); + registerBlock(treeChest, new ItemBlockForestry(treeChest), "tree_chest"); } public ItemStack getDecorativeLeaves(String speciesUid) { diff --git a/src/main/java/forestry/arboriculture/blocks/BlockTypeArboricultureTesr.java b/src/main/java/forestry/arboriculture/blocks/BlockTypeArboricultureTesr.java index c2f80c147..b41c5e633 100644 --- a/src/main/java/forestry/arboriculture/blocks/BlockTypeArboricultureTesr.java +++ b/src/main/java/forestry/arboriculture/blocks/BlockTypeArboricultureTesr.java @@ -26,18 +26,18 @@ import forestry.core.tiles.TileForestry; import forestry.core.tiles.TileNaturalistChest; public enum BlockTypeArboricultureTesr implements IBlockTypeTesr { - ARB_CHEST(0, TileArboristChest.class, "arb_chest", Proxies.render.getRenderChest("arbchest"), TileNaturalistChest.chestBoundingBox); + ARB_CHEST(TileArboristChest.class, "arb_chest", Proxies.render.getRenderChest("arbchest"), TileNaturalistChest.chestBoundingBox); public static final BlockTypeArboricultureTesr[] VALUES = values(); @Nonnull private final IMachinePropertiesTesr machineProperties; - BlockTypeArboricultureTesr(int meta, @Nonnull Class teClass, @Nonnull String name, @Nullable TileEntitySpecialRenderer renderer, @Nullable AxisAlignedBB boundingBox) { + BlockTypeArboricultureTesr(@Nonnull Class teClass, @Nonnull String name, @Nullable TileEntitySpecialRenderer renderer, @Nullable AxisAlignedBB boundingBox) { if (boundingBox != null) { - this.machineProperties = new MachinePropertiesTesr<>(meta, teClass, name, renderer, boundingBox, Constants.RESOURCE_ID + ":blocks/" + name + ".0"); + this.machineProperties = new MachinePropertiesTesr<>(teClass, name, renderer, boundingBox, Constants.RESOURCE_ID + ":blocks/" + name + ".0"); } else { - this.machineProperties = new MachinePropertiesTesr<>(meta, teClass, name, renderer, Constants.RESOURCE_ID + ":blocks/" + name + ".0"); + this.machineProperties = new MachinePropertiesTesr<>(teClass, name, renderer, Constants.RESOURCE_ID + ":blocks/" + name + ".0"); } } diff --git a/src/main/java/forestry/core/PluginCore.java b/src/main/java/forestry/core/PluginCore.java index 4d8fd380d..618b127c3 100644 --- a/src/main/java/forestry/core/PluginCore.java +++ b/src/main/java/forestry/core/PluginCore.java @@ -41,7 +41,6 @@ import forestry.api.storage.ICrateRegistry; import forestry.api.storage.StorageManager; import forestry.core.blocks.BlockRegistryCore; import forestry.core.blocks.BlockSoil; -import forestry.core.blocks.BlockTypeCoreTesr; import forestry.core.blocks.EnumResourceType; import forestry.core.circuits.CircuitRegistry; import forestry.core.circuits.SolderManager; @@ -119,15 +118,14 @@ public class PluginCore extends BlankForestryPlugin { MinecraftForge.EVENT_BUS.register(this); rootCommand.addChildCommand(new CommandPlugins()); - - blocks.core.addDefinitions(BlockTypeCoreTesr.VALUES); } @Override public void doInit() { super.doInit(); - blocks.core.init(); + blocks.analyzer.init(); + blocks.escritoire.init(); ForestryModEnvWarningCallable.register(); @@ -279,7 +277,7 @@ public class PluginCore extends BlankForestryPlugin { } // ANALYZER - RecipeUtil.addRecipe(PluginCore.blocks.core.get(BlockTypeCoreTesr.ANALYZER), + RecipeUtil.addRecipe(PluginCore.blocks.analyzer, "XTX", " Y ", "X X", diff --git a/src/main/java/forestry/core/blocks/BlockBase.java b/src/main/java/forestry/core/blocks/BlockBase.java index 67fb52e74..e5fbcebed 100644 --- a/src/main/java/forestry/core/blocks/BlockBase.java +++ b/src/main/java/forestry/core/blocks/BlockBase.java @@ -10,17 +10,15 @@ ******************************************************************************/ package forestry.core.blocks; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import javax.annotation.Nonnull; +import net.minecraft.block.BlockHorizontal; 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.client.renderer.texture.TextureMap; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; import net.minecraft.inventory.IInventory; @@ -31,13 +29,15 @@ import net.minecraft.util.EnumBlockRenderType; import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumHand; import net.minecraft.util.IStringSerializable; +import net.minecraft.util.Mirror; import net.minecraft.util.ResourceLocation; +import net.minecraft.util.Rotation; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.RayTraceResult; import net.minecraft.util.math.Vec3d; import net.minecraft.util.text.TextComponentTranslation; -import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.fluids.IFluidHandler; @@ -62,59 +62,36 @@ import forestry.core.tiles.TileUtil; import forestry.core.utils.InventoryUtil; import forestry.core.utils.PlayerUtil; -import jline.internal.Log; +public class BlockBase

& IBlockType & IStringSerializable> extends BlockForestry implements IItemModelRegister, ISpriteRegister, IStateMapperRegister { + /** use this instead of {@link BlockHorizontal#FACING} so the blocks rotate in a circle instead of NSWE order. */ + public static final PropertyEnum FACING = PropertyEnum.create("facing", EnumFacing.class, EnumFacing.NORTH, EnumFacing.EAST, EnumFacing.SOUTH, EnumFacing.WEST); -public class BlockBase

& IBlockType & IStringSerializable> extends BlockForestry implements IItemModelRegister, ISpriteRegister, IStateMapperRegister, IBlockWithMeta { - private final Map properties = new HashMap<>(); private final boolean hasTESR; private final boolean hasCustom; - private final Class

machinePropertiesClass; - + @Nonnull + public final P blockType; + /* PROPERTIES */ - private final PropertyEnum

TYPE; - private final PropertyEnum FACE; - + private final ParticleHelper.Callback particleCallback; protected final BlockStateContainer blockState; - - private boolean canCreateProps = false; - public BlockBase(Class

machinePropertiesClass) { + public BlockBase(@Nonnull P blockType) { super(Material.IRON); - this.hasTESR = IBlockTypeTesr.class.isAssignableFrom(machinePropertiesClass); - this.hasCustom = IBlockTypeCustom.class.isAssignableFrom(machinePropertiesClass); + this.blockType = blockType; + blockType.getMachineProperties().setBlock(this); + + this.hasTESR = blockType instanceof IBlockTypeTesr; + this.hasCustom = blockType instanceof IBlockTypeCustom; this.lightOpacity = (!hasTESR && !hasCustom) ? 255 : 0; - this.machinePropertiesClass = machinePropertiesClass; - - canCreateProps = true; - - TYPE = PropertyEnum.create("type", machinePropertiesClass); - FACE = PropertyEnum.create("face", EnumFacing.class); - + this.blockState = this.createBlockState(); - IBlockState state = this.blockState.getBaseState().withProperty(FACE, EnumFacing.NORTH); + IBlockState state = this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH); this.setDefaultState(state); - particleCallback = new MachineParticleCallback<>(this, TYPE); - } - - public PropertyEnum

getTypeProperty() { - return TYPE; - } - - @SafeVarargs - public final void addDefinitions(P... blockTypes) { - for (P blockType : blockTypes) { - IMachineProperties machineProperties = blockType.getMachineProperties(); - if (machineProperties != null) { - machineProperties.setBlock(this); - this.properties.put(blockType, machineProperties); - } else { - Log.error("Null Definition found {}", Arrays.toString(blockTypes)); - } - } + particleCallback = new MachineParticleCallback<>(this, blockType); } @Override @@ -136,59 +113,30 @@ public class BlockBase

& IBlockType & IStringSerializable> ext } } - private IMachineProperties getDefinition(IBlockAccess world, BlockPos pos) { - IBlockState state = world.getBlockState(pos); - if (!(state.getBlock() instanceof BlockBase)) { - return null; - } - return state.getValue(TYPE).getMachineProperties(); + @Nonnull + private IMachineProperties getDefinition() { + return blockType.getMachineProperties(); } @Override public AxisAlignedBB getCollisionBoundingBox(IBlockState blockState, World worldIn, BlockPos pos) { - IMachineProperties definition = getDefinition(worldIn, pos); - if (definition == null) { - return super.getCollisionBoundingBox(blockState, worldIn, pos); - } + IMachineProperties definition = getDefinition(); return definition.getBoundingBox(pos, blockState); } @Override public RayTraceResult collisionRayTrace(IBlockState blockState, World worldIn, BlockPos pos, Vec3d start, Vec3d end) { - IMachineProperties definition = getDefinition(worldIn, pos); - if (definition == null) { - return super.collisionRayTrace(blockState, worldIn, pos, start, end); - } else { - return definition.collisionRayTrace(worldIn, pos, start, end); - } - } - - /* CREATIVE INVENTORY */ - @SideOnly(Side.CLIENT) - @Override - public void getSubBlocks(Item item, CreativeTabs tab, List list) { - for (IMachineProperties definition : properties.values()) { - definition.getSubBlocks(item, tab, list); - } + IMachineProperties definition = getDefinition(); + return definition.collisionRayTrace(worldIn, pos, start, end); } /* TILE ENTITY CREATION */ @Override public TileEntity createNewTileEntity(World world, int meta) { - IMachineProperties definition = getStateFromMeta(meta).getValue(TYPE).getMachineProperties(); - if (definition == null) { - return null; - } - return definition.createTileEntity(); + return getDefinition().createTileEntity(); } /* INTERACTION */ - @Override - public boolean isSideSolid(IBlockState base_state, IBlockAccess world, BlockPos pos, EnumFacing side) { - IMachineProperties definition = getDefinition(world, pos); - return definition != null && definition.isSolidOnSide(world, pos, side); - } - @Override public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) { if (playerIn.isSneaking()) { @@ -224,13 +172,23 @@ public class BlockBase

& IBlockType & IStringSerializable> ext return true; } - @Override - public boolean rotateBlock(World world, BlockPos pos, EnumFacing axis) { - IMachineProperties definition = getDefinition(world, pos); - if (definition == null) { - return super.rotateBlock(world, pos, axis); + public void rotateAfterPlacement(EntityPlayer player, World world, BlockPos pos, EnumFacing side) { + IBlockState state = world.getBlockState(pos); + + int l = MathHelper.floor_double(player.rotationYaw * 4F / 360F + 0.5D) & 3; + if (l == 0) { + state = state.withProperty(FACING, EnumFacing.NORTH); } - return definition.rotateBlock(world, pos, axis); + if (l == 1) { + state = state.withProperty(FACING, EnumFacing.EAST); + } + if (l == 2) { + state = state.withProperty(FACING, EnumFacing.SOUTH); + } + if (l == 3) { + state = state.withProperty(FACING, EnumFacing.WEST); + } + world.setBlockState(pos, state, 2); } @Override @@ -260,69 +218,36 @@ public class BlockBase

& IBlockType & IStringSerializable> ext } public void init() { - for (IMachineProperties def : properties.values()) { - def.registerTileEntity(); - } + blockType.getMachineProperties().registerTileEntity(); } /* ITEM MODELS */ @SideOnly(Side.CLIENT) @Override public void registerModel(Item item, IModelManager manager) { - for (IMachineProperties def : properties.values()) { - def.registerModel(item, manager); - } + blockType.getMachineProperties().registerModel(item, manager); } /* STATES */ @Override @SideOnly(Side.CLIENT) public void registerStateMapper() { - Proxies.render.registerStateMapper(this, new MachineStateMapper<>(machinePropertiesClass, TYPE, FACE)); + Proxies.render.registerStateMapper(this, new MachineStateMapper<>(blockType)); } @Override protected BlockStateContainer createBlockState() { - if (!canCreateProps) { - return super.createBlockState(); - } - return new BlockStateContainer(this, TYPE, FACE); - } - - @Override - public int getMetaFromState(IBlockState state) { - IBlockType blockType = (IBlockType) state.getProperties().get(this.TYPE); - IMachineProperties machineProperties = blockType.getMachineProperties(); - return machineProperties.getMeta(); + return new BlockStateContainer(this, FACING); } @Override public IBlockState getStateFromMeta(int meta) { - for (Map.Entry entry : properties.entrySet()) { - IMachineProperties machineProperties = entry.getValue(); - if (machineProperties.getMeta() == meta) { - P blockType = entry.getKey(); - return getDefaultState().withProperty(this.TYPE, blockType); - } - } - return getDefaultState(); + return this.getDefaultState().withProperty(FACING, EnumFacing.getHorizontal(meta)); } @Override - public String getNameFromMeta(int meta) { - IBlockState state = getStateFromMeta(meta); - IBlockType blockType = (IBlockType) state.getProperties().get(TYPE); - IMachineProperties machineProperties = blockType.getMachineProperties(); - return machineProperties.getName(); - } - - @Override - public IBlockState getActualState(IBlockState state, IBlockAccess world, BlockPos pos) { - TileForestry tile = TileUtil.getTile(world, pos, TileForestry.class); - if (tile != null) { - state = state.withProperty(FACE, tile.getOrientation()); - } - return super.getActualState(state, world, pos); + public int getMetaFromState(IBlockState state) { + return state.getValue(FACING).getHorizontalIndex(); } @Override @@ -330,6 +255,17 @@ public class BlockBase

& IBlockType & IStringSerializable> ext return this.blockState; } + @Override + public IBlockState withMirror(IBlockState state, Mirror mirrorIn) { + return super.withMirror(state, mirrorIn); + } + + @Override + public IBlockState withRotation(IBlockState state, Rotation rot) { + EnumFacing facing = state.getValue(FACING); + return state.withProperty(FACING, rot.rotate(facing)); + } + @Override public boolean getUseNeighborBrightness(IBlockState state) { return hasTESR; @@ -339,8 +275,7 @@ public class BlockBase

& IBlockType & IStringSerializable> ext @SideOnly(Side.CLIENT) @Override public boolean addHitEffects(IBlockState state, World worldObj, RayTraceResult target, EffectRenderer effectRenderer) { - P property = state.getValue(TYPE); - if(property.getMachineProperties() instanceof IMachinePropertiesTesr){ + if (blockType.getMachineProperties() instanceof IMachinePropertiesTesr) { return ParticleHelper.addBlockHitEffects(worldObj, target.getBlockPos(), target.sideHit, effectRenderer, particleCallback); } return false; @@ -349,28 +284,21 @@ public class BlockBase

& IBlockType & IStringSerializable> ext @SideOnly(Side.CLIENT) @Override public boolean addDestroyEffects(World world, BlockPos pos, EffectRenderer effectRenderer) { - IBlockState state = world.getBlockState(pos); - - P property = state.getValue(TYPE); - if(property.getMachineProperties() instanceof IMachinePropertiesTesr){ - return ParticleHelper.addDestroyEffects(world, this, world.getBlockState(pos), pos, effectRenderer, particleCallback); + if (blockType.getMachineProperties() instanceof IMachinePropertiesTesr) { + IBlockState blockState = world.getBlockState(pos); + return ParticleHelper.addDestroyEffects(world, this, blockState, pos, effectRenderer, particleCallback); } return false; } - - - - public final ItemStack get(P type) { - return new ItemStack(this, 1, type.getMachineProperties().getMeta()); - } @SideOnly(Side.CLIENT) @Override public void registerSprites(ITextureManager manager) { - for(P property : properties.keySet()){ - if(property.getMachineProperties() instanceof IMachinePropertiesTesr){ - Proxies.common.getClientInstance().getTextureMapBlocks().registerSprite(new ResourceLocation(((IMachinePropertiesTesr)property.getMachineProperties()).getParticleTextureLocation())); - } + IMachineProperties machineProperties = blockType.getMachineProperties(); + if (machineProperties instanceof IMachinePropertiesTesr) { + TextureMap textureMapBlocks = Proxies.common.getClientInstance().getTextureMapBlocks(); + String particleTextureLocation = ((IMachinePropertiesTesr) machineProperties).getParticleTextureLocation(); + textureMapBlocks.registerSprite(new ResourceLocation(particleTextureLocation)); } } } diff --git a/src/main/java/forestry/core/blocks/BlockCore.java b/src/main/java/forestry/core/blocks/BlockCore.java index 570487db3..30bdaddac 100644 --- a/src/main/java/forestry/core/blocks/BlockCore.java +++ b/src/main/java/forestry/core/blocks/BlockCore.java @@ -11,7 +11,7 @@ package forestry.core.blocks; public class BlockCore extends BlockBase { - public BlockCore() { - super(BlockTypeCoreTesr.class); + public BlockCore(BlockTypeCoreTesr blockType) { + super(blockType); } } diff --git a/src/main/java/forestry/core/blocks/BlockRegistryCore.java b/src/main/java/forestry/core/blocks/BlockRegistryCore.java index 74b39dde4..79db24988 100644 --- a/src/main/java/forestry/core/blocks/BlockRegistryCore.java +++ b/src/main/java/forestry/core/blocks/BlockRegistryCore.java @@ -17,14 +17,18 @@ import net.minecraftforge.oredict.OreDictionary; import forestry.core.items.ItemBlockForestry; public class BlockRegistryCore extends BlockRegistry { - public final BlockCore core; + public final BlockCore analyzer; + public final BlockCore escritoire; public final BlockSoil soil; public final BlockResourceOre resources; public final BlockResourceStorage resourceStorage; public BlockRegistryCore() { - core = new BlockCore(); - registerBlock(core, new ItemBlockForestry(core), "core"); + analyzer = new BlockCore(BlockTypeCoreTesr.ANALYZER); + registerBlock(analyzer, new ItemBlockForestry(analyzer), "analyzer"); + + escritoire = new BlockCore(BlockTypeCoreTesr.ESCRITOIRE); + registerBlock(escritoire, new ItemBlockForestry<>(escritoire), "escritoire"); soil = new BlockSoil(); registerBlock(soil, new ItemBlockForestry(soil), "soil"); diff --git a/src/main/java/forestry/core/blocks/BlockTypeCoreTesr.java b/src/main/java/forestry/core/blocks/BlockTypeCoreTesr.java index 660ac4c83..36442bb48 100644 --- a/src/main/java/forestry/core/blocks/BlockTypeCoreTesr.java +++ b/src/main/java/forestry/core/blocks/BlockTypeCoreTesr.java @@ -14,6 +14,7 @@ import javax.annotation.Nonnull; import javax.annotation.Nullable; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; + import forestry.core.config.Constants; import forestry.core.proxy.Proxies; import forestry.core.tiles.TileAnalyzer; @@ -21,16 +22,16 @@ import forestry.core.tiles.TileEscritoire; import forestry.core.tiles.TileForestry; public enum BlockTypeCoreTesr implements IBlockTypeTesr { - ANALYZER(0, TileAnalyzer.class, "analyzer", Proxies.render.getRendererAnalyzer()), - ESCRITOIRE(1, TileEscritoire.class, "escritoire", Proxies.render.getRenderEscritoire()); + ANALYZER(TileAnalyzer.class, "analyzer", Proxies.render.getRendererAnalyzer()), + ESCRITOIRE(TileEscritoire.class, "escritoire", Proxies.render.getRenderEscritoire()); public static final BlockTypeCoreTesr[] VALUES = values(); @Nonnull private final IMachinePropertiesTesr machineProperties; - BlockTypeCoreTesr(int meta, @Nonnull Class teClass, @Nonnull String name, @Nullable TileEntitySpecialRenderer renderer) { - this.machineProperties = new MachinePropertiesTesr<>(meta, teClass, name, renderer, Constants.RESOURCE_ID + ":blocks/" + name + ".0"); + BlockTypeCoreTesr(@Nonnull Class teClass, @Nonnull String name, @Nullable TileEntitySpecialRenderer renderer) { + this.machineProperties = new MachinePropertiesTesr<>(teClass, name, renderer, Constants.RESOURCE_ID + ":blocks/" + name + ".0"); } @Nonnull diff --git a/src/main/java/forestry/core/blocks/IMachineProperties.java b/src/main/java/forestry/core/blocks/IMachineProperties.java index b0a86f98e..46198ed8b 100644 --- a/src/main/java/forestry/core/blocks/IMachineProperties.java +++ b/src/main/java/forestry/core/blocks/IMachineProperties.java @@ -11,29 +11,22 @@ package forestry.core.blocks; import javax.annotation.Nonnull; -import java.util.List; import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; -import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IStringSerializable; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.IStringSerializable; import net.minecraft.util.math.RayTraceResult; import net.minecraft.util.math.Vec3d; -import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import forestry.api.core.IModelManager; import forestry.core.tiles.TileForestry; public interface IMachineProperties extends IStringSerializable { - int getMeta(); - @Nonnull String getTeIdent(); @@ -54,15 +47,9 @@ public interface IMachineProperties extends IStringSeria Block getBlock(); - void getSubBlocks(@Nonnull Item item, @Nonnull CreativeTabs tab, @Nonnull List list); - @Nonnull AxisAlignedBB getBoundingBox(@Nonnull BlockPos pos, @Nonnull IBlockState state); @Nonnull RayTraceResult collisionRayTrace(@Nonnull World world, @Nonnull BlockPos pos, @Nonnull Vec3d startVec, @Nonnull Vec3d endVec); - - boolean isSolidOnSide(@Nonnull IBlockAccess world, @Nonnull BlockPos pos, @Nonnull EnumFacing side); - - boolean rotateBlock(@Nonnull World world, @Nonnull BlockPos pos, @Nonnull EnumFacing axis); } diff --git a/src/main/java/forestry/core/blocks/MachineProperties.java b/src/main/java/forestry/core/blocks/MachineProperties.java index 96fdc2e60..2fb1d87df 100644 --- a/src/main/java/forestry/core/blocks/MachineProperties.java +++ b/src/main/java/forestry/core/blocks/MachineProperties.java @@ -2,33 +2,25 @@ package forestry.core.blocks; import javax.annotation.Nonnull; import javax.annotation.Nullable; -import java.util.List; import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; -import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.EnumFacing; import net.minecraft.util.math.RayTraceResult; import net.minecraft.util.math.Vec3d; -import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.fml.common.registry.GameRegistry; import forestry.api.core.IModelManager; import forestry.core.tiles.TileForestry; -import forestry.core.tiles.TileUtil; import forestry.core.utils.BlockUtil; import forestry.core.utils.ItemStackUtil; public class MachineProperties implements IMachineProperties { - - private final int meta; @Nonnull private final String name; @Nonnull @@ -40,16 +32,15 @@ public class MachineProperties implements IMachineProper @Nullable private Block block; - public MachineProperties(int meta, @Nonnull Class teClass, @Nonnull String name) { - this(meta, "forestry." + name, teClass, name, new AxisAlignedBB(0, 0, 0, 1, 1, 1)); + public MachineProperties(@Nonnull Class teClass, @Nonnull String name) { + this("forestry." + name, teClass, name, new AxisAlignedBB(0, 0, 0, 1, 1, 1)); } - public MachineProperties(int meta, @Nonnull Class teClass, @Nonnull String name, @Nonnull AxisAlignedBB boundingBox) { - this(meta, "forestry." + name, teClass, name, boundingBox); + public MachineProperties(@Nonnull Class teClass, @Nonnull String name, @Nonnull AxisAlignedBB boundingBox) { + this("forestry." + name, teClass, name, boundingBox); } - private MachineProperties(int meta, @Nonnull String teIdent, @Nonnull Class teClass, @Nonnull String name, @Nonnull AxisAlignedBB boundingBox) { - this.meta = meta; + private MachineProperties(@Nonnull String teIdent, @Nonnull Class teClass, @Nonnull String name, @Nonnull AxisAlignedBB boundingBox) { this.teIdent = teIdent; this.teClass = teClass; this.name = name; @@ -67,11 +58,6 @@ public class MachineProperties implements IMachineProper return block; } - @Override - public void getSubBlocks(@Nonnull Item item, @Nonnull CreativeTabs tab, @Nonnull List list) { - list.add(new ItemStack(item, 1, meta)); - } - @Nonnull @Override public AxisAlignedBB getBoundingBox(@Nonnull BlockPos pos, @Nonnull IBlockState state) { @@ -84,20 +70,6 @@ public class MachineProperties implements IMachineProper return BlockUtil.collisionRayTrace(pos, startVec, endVec, boundingBox); } - @Override - public boolean isSolidOnSide(@Nonnull IBlockAccess world, @Nonnull BlockPos pos, @Nonnull EnumFacing side) { - return true; - } - - @Override - public boolean rotateBlock(@Nonnull World world, @Nonnull BlockPos pos, @Nonnull EnumFacing axis) { - T tile = TileUtil.getTile(world, pos, teClass); - if (tile == null) { - return false; - } - return tile.rotate(axis); - } - @Override public void registerTileEntity() { GameRegistry.registerTileEntity(teClass, teIdent); @@ -105,8 +77,8 @@ public class MachineProperties implements IMachineProper @Override public void registerModel(@Nonnull Item item, @Nonnull IModelManager manager) { - String identifier = ItemStackUtil.getItemNameFromRegistry(item).getResourcePath() + "_" + name; - manager.registerItemModel(item, meta, identifier); + String identifier = ItemStackUtil.getItemNameFromRegistry(item).getResourcePath(); + manager.registerItemModel(item, 0, identifier); } @Nonnull @@ -119,11 +91,6 @@ public class MachineProperties implements IMachineProper } } - @Override - public int getMeta() { - return meta; - } - @Nonnull @Override public String getTeIdent() { diff --git a/src/main/java/forestry/core/blocks/MachinePropertiesTesr.java b/src/main/java/forestry/core/blocks/MachinePropertiesTesr.java index 1026cde6b..b3ab933b3 100644 --- a/src/main/java/forestry/core/blocks/MachinePropertiesTesr.java +++ b/src/main/java/forestry/core/blocks/MachinePropertiesTesr.java @@ -20,14 +20,14 @@ public class MachinePropertiesTesr extends MachineProper @Nonnull private final String particleTextureLocation; - public MachinePropertiesTesr(int meta, @Nonnull Class teClass, @Nonnull String name, @Nullable TileEntitySpecialRenderer renderer, @Nonnull String particleTextureLocation) { - super(meta, teClass, name); + public MachinePropertiesTesr(@Nonnull Class teClass, @Nonnull String name, @Nullable TileEntitySpecialRenderer renderer, @Nonnull String particleTextureLocation) { + super(teClass, name); this.renderer = renderer; this.particleTextureLocation = particleTextureLocation; } - public MachinePropertiesTesr(int meta, @Nonnull Class teClass, @Nonnull String name, @Nullable TileEntitySpecialRenderer renderer, @Nonnull AxisAlignedBB boundingBox, @Nonnull String particleTextureLocation) { - super(meta, teClass, name, boundingBox); + public MachinePropertiesTesr(@Nonnull Class teClass, @Nonnull String name, @Nullable TileEntitySpecialRenderer renderer, @Nonnull AxisAlignedBB boundingBox, @Nonnull String particleTextureLocation) { + super(teClass, name, boundingBox); this.renderer = renderer; this.particleTextureLocation = particleTextureLocation; } @@ -45,7 +45,7 @@ public class MachinePropertiesTesr extends MachineProper ClientRegistry.bindTileEntitySpecialRenderer(getTeClass(), renderer); Item item = Item.getItemFromBlock(getBlock()); if (item != null) { - ForgeHooksClient.registerTESRItemStack(item, getMeta(), getTeClass()); + ForgeHooksClient.registerTESRItemStack(item, 0, getTeClass()); } } } diff --git a/src/main/java/forestry/core/items/ItemBlockForestry.java b/src/main/java/forestry/core/items/ItemBlockForestry.java index a11c7bc9a..42e3b7745 100644 --- a/src/main/java/forestry/core/items/ItemBlockForestry.java +++ b/src/main/java/forestry/core/items/ItemBlockForestry.java @@ -15,10 +15,11 @@ import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; -import net.minecraft.util.math.BlockPos; import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; +import forestry.core.blocks.BlockBase; import forestry.core.blocks.IBlockWithMeta; import forestry.core.tiles.TileForestry; import forestry.core.tiles.TileUtil; @@ -58,18 +59,19 @@ public class ItemBlockForestry extends ItemBlock { boolean placed = super.placeBlockAt(stack, player, world, pos, side, hitX, hitY, hitZ, newState); if (block.hasTileEntity(newState)) { - TileForestry tile = TileUtil.getTile(world, pos, TileForestry.class); - - if (tile != null) { - if (stack.getItem() instanceof ItemBlockNBT && stack.hasTagCompound()) { + if (stack.getItem() instanceof ItemBlockNBT && stack.hasTagCompound()) { + TileForestry tile = TileUtil.getTile(world, pos, TileForestry.class); + if (tile != null) { tile.readFromNBT(stack.getTagCompound()); tile.setPos(pos); } - - tile.rotateAfterPlacement(player, side); } } + if (block instanceof BlockBase) { + ((BlockBase) block).rotateAfterPlacement(player, world, pos, side); + } + return placed; } } diff --git a/src/main/java/forestry/core/recipes/RecipeUtil.java b/src/main/java/forestry/core/recipes/RecipeUtil.java index 1a286cd9f..2a0cb1e66 100644 --- a/src/main/java/forestry/core/recipes/RecipeUtil.java +++ b/src/main/java/forestry/core/recipes/RecipeUtil.java @@ -15,6 +15,7 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; +import net.minecraft.block.Block; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.InventoryCrafting; import net.minecraft.item.Item; @@ -208,6 +209,10 @@ public abstract class RecipeUtil { return null; } + public static void addRecipe(Block block, Object... obj) { + addRecipe(new ItemStack(block), obj); + } + public static void addRecipe(Item item, Object... obj) { addRecipe(new ItemStack(item), obj); } diff --git a/src/main/java/forestry/core/render/MachineParticleCallback.java b/src/main/java/forestry/core/render/MachineParticleCallback.java index 43053fc3b..e8efe3bf6 100644 --- a/src/main/java/forestry/core/render/MachineParticleCallback.java +++ b/src/main/java/forestry/core/render/MachineParticleCallback.java @@ -10,14 +10,13 @@ ******************************************************************************/ package forestry.core.render; -import net.minecraft.block.properties.PropertyEnum; import net.minecraft.block.state.IBlockState; import net.minecraft.client.Minecraft; import net.minecraft.client.particle.EntityDiggingFX; import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.util.math.BlockPos; import net.minecraft.util.IStringSerializable; +import net.minecraft.util.math.BlockPos; import forestry.core.blocks.BlockBase; import forestry.core.blocks.IBlockType; @@ -27,17 +26,16 @@ import forestry.core.proxy.Proxies; public class MachineParticleCallback

& IBlockType & IStringSerializable> extends ParticleHelper.DefaultCallback { - private final PropertyEnum

TYPE; + private final P blockType; - public MachineParticleCallback(BlockBase block, PropertyEnum

TYPE) { + public MachineParticleCallback(BlockBase block, P blockType) { super(block); - this.TYPE = TYPE; + this.blockType = blockType; } @Override protected void setTexture(EntityDiggingFX fx, BlockPos pos, IBlockState state) { - P property = state.getValue(TYPE); - IMachineProperties machineProperties = property.getMachineProperties(); + IMachineProperties machineProperties = blockType.getMachineProperties(); if(machineProperties instanceof IMachinePropertiesTesr){ Minecraft minecraft = Proxies.common.getClientInstance(); TextureMap textureMapBlocks = minecraft.getTextureMapBlocks(); diff --git a/src/main/java/forestry/core/render/MachineStateMapper.java b/src/main/java/forestry/core/render/MachineStateMapper.java index 8c16579f8..a6728e511 100644 --- a/src/main/java/forestry/core/render/MachineStateMapper.java +++ b/src/main/java/forestry/core/render/MachineStateMapper.java @@ -7,7 +7,6 @@ import java.util.Map; import net.minecraft.block.Block; import net.minecraft.block.properties.IProperty; -import net.minecraft.block.properties.PropertyEnum; import net.minecraft.block.state.IBlockState; import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.util.EnumFacing; @@ -17,39 +16,34 @@ import net.minecraft.util.ResourceLocation; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; +import forestry.core.blocks.BlockBase; import forestry.core.blocks.IBlockType; import forestry.core.blocks.IMachinePropertiesTesr; @SideOnly(Side.CLIENT) public class MachineStateMapper & IBlockType & IStringSerializable> extends ForestryStateMapper { - private final Class machinePropertiesClass; - private final PropertyEnum META; - private final PropertyEnum FACE; - - public MachineStateMapper(Class machinePropertiesClass, PropertyEnum META, PropertyEnum FACE) { - this.machinePropertiesClass = machinePropertiesClass; - this.META = META; - this.FACE = FACE; + private final T type; + + public MachineStateMapper(T type) { + this.type = type; } @Override public Map putStateModelLocations(Block block) { - for (T type : machinePropertiesClass.getEnumConstants()) { - if (type.getMachineProperties() instanceof IMachinePropertiesTesr) { - continue; - } + if (!(type.getMachineProperties() instanceof IMachinePropertiesTesr)) { for (EnumFacing facing : EnumFacing.values()) { if (facing == EnumFacing.DOWN || facing == EnumFacing.UP) { continue; } - IBlockState state = block.getDefaultState().withProperty(META, type).withProperty(FACE, facing); + IBlockState state = block.getDefaultState().withProperty(BlockBase.FACING, facing); LinkedHashMap, Comparable> linkedhashmap = Maps.newLinkedHashMap(state.getProperties()); ResourceLocation blockLocation = Block.REGISTRY.getNameForObject(block); - String s = String.format("%s:%s", blockLocation.getResourceDomain(), blockLocation.getResourcePath() + "_" + META.getName((T) linkedhashmap.remove(META))); + String s = String.format("%s:%s", blockLocation.getResourceDomain(), blockLocation.getResourcePath()); mapStateModelLocations.put(state, new ModelResourceLocation(s, getPropertyString(linkedhashmap))); } } + return this.mapStateModelLocations; } diff --git a/src/main/java/forestry/core/render/RenderAnalyzer.java b/src/main/java/forestry/core/render/RenderAnalyzer.java index 268695378..f556dd6da 100755 --- a/src/main/java/forestry/core/render/RenderAnalyzer.java +++ b/src/main/java/forestry/core/render/RenderAnalyzer.java @@ -10,6 +10,7 @@ ******************************************************************************/ package forestry.core.render; +import net.minecraft.block.state.IBlockState; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; @@ -19,6 +20,7 @@ import net.minecraft.util.EnumFacing; import net.minecraft.world.World; import forestry.apiculture.render.ModelAnalyzer; +import forestry.core.blocks.BlockBase; import forestry.core.proxy.Proxies; import forestry.core.tiles.TileAnalyzer; @@ -38,10 +40,14 @@ public class RenderAnalyzer extends TileEntitySpecialRenderer { @Override public void renderTileEntityAt(TileAnalyzer analyzer, double x, double y, double z, float partialTicks, int destroyStage) { if (analyzer != null) { - render(analyzer.getIndividualOnDisplay(), analyzer.getWorld(), analyzer.getOrientation(), x, y, z); - } else { - render(null, null, EnumFacing.WEST, x, y, z); + IBlockState blockState = analyzer.getWorldObj().getBlockState(analyzer.getPos()); + if (blockState != null && blockState.getBlock() instanceof BlockBase) { + EnumFacing facing = blockState.getValue(BlockBase.FACING); + render(analyzer.getIndividualOnDisplay(), analyzer.getWorld(), facing, x, y, z); + return; + } } + render(null, null, EnumFacing.WEST, x, y, z); } private void render(ItemStack itemstack, World world, EnumFacing orientation, double x, double y, double z) { diff --git a/src/main/java/forestry/core/render/RenderEscritoire.java b/src/main/java/forestry/core/render/RenderEscritoire.java index dc9af2054..6bc5e40ea 100755 --- a/src/main/java/forestry/core/render/RenderEscritoire.java +++ b/src/main/java/forestry/core/render/RenderEscritoire.java @@ -10,12 +10,14 @@ ******************************************************************************/ package forestry.core.render; +import net.minecraft.block.state.IBlockState; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumFacing; import net.minecraft.util.ResourceLocation; +import forestry.core.blocks.BlockBase; import forestry.core.config.Constants; import forestry.core.inventory.InventoryEscritoire; import forestry.core.models.ModelEscritoire; @@ -38,10 +40,14 @@ public class RenderEscritoire extends TileEntitySpecialRenderer @Override public void renderTileEntityAt(TileEscritoire escritoire, double x, double y, double z, float partialTicks, int destroyStage) { if (escritoire != null) { - render(escritoire.getStackInSlot(InventoryEscritoire.SLOT_ANALYZE), escritoire.getOrientation(), x, y, z); - } else { - render(null, EnumFacing.SOUTH, x, y, z); + IBlockState blockState = escritoire.getWorldObj().getBlockState(escritoire.getPos()); + if (blockState != null && blockState.getBlock() instanceof BlockBase) { + EnumFacing facing = blockState.getValue(BlockBase.FACING); + render(escritoire.getStackInSlot(InventoryEscritoire.SLOT_ANALYZE), facing, x, y, z); + return; + } } + render(null, EnumFacing.SOUTH, x, y, z); } private void render(ItemStack itemstack, EnumFacing orientation, double x, double y, double z) { diff --git a/src/main/java/forestry/core/render/RenderMachine.java b/src/main/java/forestry/core/render/RenderMachine.java index 8815ff040..4d3782d6e 100755 --- a/src/main/java/forestry/core/render/RenderMachine.java +++ b/src/main/java/forestry/core/render/RenderMachine.java @@ -14,6 +14,7 @@ import java.awt.Color; import java.util.EnumMap; import java.util.Locale; +import net.minecraft.block.state.IBlockState; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; import net.minecraft.client.renderer.GlStateManager; @@ -21,6 +22,7 @@ import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.util.EnumFacing; import net.minecraft.util.ResourceLocation; +import forestry.core.blocks.BlockBase; import forestry.core.proxy.Proxies; import forestry.core.tiles.IRenderableTile; import forestry.core.tiles.TileBase; @@ -89,10 +91,14 @@ public class RenderMachine extends TileEntitySpecialRenderer { public void renderTileEntityAt(TileBase tile, double x, double y, double z, float partialTicks, int destroyStage) { if (tile != null) { IRenderableTile generator = (IRenderableTile) tile; - render(generator.getResourceTankInfo(), generator.getProductTankInfo(), generator.getOrientation(), x, y, z, destroyStage); - } else { - render(TankRenderInfo.EMPTY, TankRenderInfo.EMPTY, EnumFacing.SOUTH, x, y, z, -1); + IBlockState blockState = tile.getWorldObj().getBlockState(tile.getPos()); + if (blockState != null && blockState.getBlock() instanceof BlockBase) { + EnumFacing facing = blockState.getValue(BlockBase.FACING); + render(generator.getResourceTankInfo(), generator.getProductTankInfo(), facing, x, y, z, destroyStage); + return; + } } + render(TankRenderInfo.EMPTY, TankRenderInfo.EMPTY, EnumFacing.SOUTH, x, y, z, -1); } private void render(TankRenderInfo resourceTankInfo, TankRenderInfo productTankInfo, EnumFacing orientation, double x, double y, double z, int destroyStage) { diff --git a/src/main/java/forestry/core/render/RenderNaturalistChest.java b/src/main/java/forestry/core/render/RenderNaturalistChest.java index 79e07cc73..3be1c35b5 100644 --- a/src/main/java/forestry/core/render/RenderNaturalistChest.java +++ b/src/main/java/forestry/core/render/RenderNaturalistChest.java @@ -10,12 +10,14 @@ ******************************************************************************/ package forestry.core.render; +import net.minecraft.block.state.IBlockState; import net.minecraft.client.model.ModelChest; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.util.EnumFacing; import net.minecraft.util.ResourceLocation; +import forestry.core.blocks.BlockBase; import forestry.core.config.Constants; import forestry.core.tiles.TileNaturalistChest; @@ -34,10 +36,14 @@ public class RenderNaturalistChest extends TileEntitySpecialRenderer 0.25 && stagePiston == 1) { stagePiston = 2; @@ -144,8 +138,8 @@ public abstract class TileEngine extends TileBase implements IEnergyConnection, progress = 0; stagePiston = 0; } - } else if (enabledRedstone && BlockUtil.isEnergyReceiverOrEngine(getOrientation().getOpposite(), tile)) { - if (energyManager.canSendEnergy(getOrientation(), tile)) { + } else if (enabledRedstone && BlockUtil.isEnergyReceiverOrEngine(facing.getOpposite(), tile)) { + if (energyManager.canSendEnergy(facing, tile)) { stagePiston = 1; // If we can transfer energy, start running setActive(true); cantSendEnergyCountdown = CANT_SEND_ENERGY_TIME; @@ -188,30 +182,6 @@ public abstract class TileEngine extends TileBase implements IEnergyConnection, } } - /* INTERACTION */ - @Override - public boolean rotate(EnumFacing axis) { - rotate(); - - // it would be irritating if the wrench opened the engine gui when it failed to rotate, so always return true - return true; - } - - private void rotate() { - for (int i = getOrientation().ordinal() + 1; i <= getOrientation().ordinal() + 6; ++i) { - EnumFacing orientation = EnumFacing.values()[i % 6]; - if (isOrientedAtEnergyReciever(orientation)) { - setOrientation(orientation); - return; - } - } - } - - private boolean isOrientedAtEnergyReciever(EnumFacing orientation) { - TileEntity tile = worldObj.getTileEntity(getPos().offset(orientation)); - return BlockUtil.isEnergyReceiverOrEngine(getOrientation().getOpposite(), tile); - } - // STATE INFORMATION protected double getHeatLevel() { return (double) heat / (double) maxHeat; diff --git a/src/main/java/forestry/core/tiles/TileForestry.java b/src/main/java/forestry/core/tiles/TileForestry.java index 1c03d51c2..15181a79d 100644 --- a/src/main/java/forestry/core/tiles/TileForestry.java +++ b/src/main/java/forestry/core/tiles/TileForestry.java @@ -24,7 +24,6 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumFacing; import net.minecraft.util.ITickable; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.MathHelper; import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.TextComponentTranslation; import net.minecraft.world.World; @@ -62,7 +61,6 @@ public abstract class TileForestry extends TileEntity implements IStreamable, IE private int tickCount = rand.nextInt(256); private boolean needsNetworkUpdate = false; - private EnumFacing orientation = EnumFacing.WEST; protected AdjacentTileCache getTileCache() { return tileCache; @@ -84,31 +82,6 @@ public abstract class TileForestry extends TileEntity implements IStreamable, IE super.validate(); } - public void rotateAfterPlacement(EntityPlayer player, EnumFacing side) { - int l = MathHelper.floor_double(player.rotationYaw * 4F / 360F + 0.5D) & 3; - if (l == 0) { - setOrientation(EnumFacing.NORTH); - } - if (l == 1) { - setOrientation(EnumFacing.EAST); - } - if (l == 2) { - setOrientation(EnumFacing.SOUTH); - } - if (l == 3) { - setOrientation(EnumFacing.WEST); - } - } - - public boolean rotate(EnumFacing axis) { - if (axis == EnumFacing.DOWN || axis == EnumFacing.UP) { - EnumFacing orientation = getOrientation().rotateAround(axis.getAxis()); - setOrientation(orientation); - return true; - } - return false; - } - // / UPDATING @Override public final void update() { @@ -143,12 +116,6 @@ public abstract class TileForestry extends TileEntity implements IStreamable, IE inventory.readFromNBT(data); accessHandler.readFromNBT(data); - - if (data.hasKey("Orientation")) { - orientation = EnumFacing.values()[data.getInteger("Orientation")]; - } else { - orientation = EnumFacing.WEST; - } } @Override @@ -156,7 +123,6 @@ public abstract class TileForestry extends TileEntity implements IStreamable, IE super.writeToNBT(data); inventory.writeToNBT(data); accessHandler.writeToNBT(data); - data.setInteger("Orientation", orientation.ordinal()); } @Override @@ -174,12 +140,12 @@ public abstract class TileForestry extends TileEntity implements IStreamable, IE /* IStreamable */ @Override public void writeData(DataOutputStreamForestry data) throws IOException { - data.writeEnum(orientation, forgeDirections); + } @Override public void readData(DataInputStreamForestry data) throws IOException { - orientation = data.readEnum(forgeDirections); + } public void onRemoval() { @@ -209,25 +175,6 @@ public abstract class TileForestry extends TileEntity implements IStreamable, IE return worldObj.isBlockIndirectlyGettingPowered(getPos()) > 0; } - // / ORIENTATION - public EnumFacing getOrientation() { - return this.orientation; - } - - public void setOrientation(EnumFacing orientation) { - if (orientation == null) { - throw new NullPointerException("Orientation cannot be null"); - } - if (this.orientation == orientation) { - return; - } - this.orientation = orientation; - this.setNeedsNetworkUpdate(); - BlockPos pos = getPos(); - worldObj.notifyBlockOfStateChange(pos, worldObj.getBlockState(pos).getBlock()); - worldObj.markBlockRangeForRenderUpdate(pos, pos); - } - protected final void setNeedsNetworkUpdate() { needsNetworkUpdate = true; } diff --git a/src/main/java/forestry/core/worldgen/BlockTypeTileForestry.java b/src/main/java/forestry/core/worldgen/BlockTypeTileForestry.java deleted file mode 100644 index 434e19941..000000000 --- a/src/main/java/forestry/core/worldgen/BlockTypeTileForestry.java +++ /dev/null @@ -1,59 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2011-2014 SirSengir. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the GNU Lesser Public License v3 - * which accompanies this distribution, and is available at - * http://www.gnu.org/licenses/lgpl-3.0.txt - * - * Various Contributors including, but not limited to: - * SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges - ******************************************************************************/ -package forestry.core.worldgen; - -import net.minecraft.block.Block; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.EnumFacing; -import net.minecraft.world.World; - -import forestry.core.config.Constants; -import forestry.core.tiles.TileForestry; - -public class BlockTypeTileForestry implements IBlockType { - private final Block block; - private final int meta; - private EnumFacing direction; - - public BlockTypeTileForestry(Block block, int meta) { - this.block = block; - this.meta = meta; - } - - @Override - public void setDirection(EnumFacing facing) { - this.direction = facing; - } - - @Override - public void setBlock(World world, BlockPos pos) { - boolean placed = world.setBlockState(pos, block.getStateFromMeta(meta), Constants.FLAG_BLOCK_SYNCH_AND_UPDATE); - if (!placed) { - return; - } - - Block worldBlock = world.getBlockState(pos).getBlock(); - if (!Block.isEqualTo(block, worldBlock)) { - return; - } - - TileEntity tile = world.getTileEntity(pos); - if (!(tile instanceof TileForestry)) { - world.setBlockToAir(pos); - return; - } - - TileForestry tileForestry = (TileForestry) tile; - - tileForestry.setOrientation(direction); - } -} diff --git a/src/main/java/forestry/energy/PluginEnergy.java b/src/main/java/forestry/energy/PluginEnergy.java index 5cc1e52b1..c22e87575 100644 --- a/src/main/java/forestry/energy/PluginEnergy.java +++ b/src/main/java/forestry/energy/PluginEnergy.java @@ -12,6 +12,7 @@ package forestry.energy; import net.minecraft.init.Blocks; import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; import net.minecraftforge.fml.common.SidedProxy; @@ -19,7 +20,6 @@ import forestry.api.core.ForestryAPI; import forestry.core.config.Constants; import forestry.core.recipes.RecipeUtil; import forestry.energy.blocks.BlockRegistryEnergy; -import forestry.energy.blocks.BlockTypeEngine; import forestry.energy.proxy.ProxyEnergy; import forestry.plugins.BlankForestryPlugin; import forestry.plugins.ForestryPlugin; @@ -39,27 +39,20 @@ public class PluginEnergy extends BlankForestryPlugin { } @Override - public void preInit() { - blocks.engine.addDefinitions( - BlockTypeEngine.PEAT, - BlockTypeEngine.BIOGAS - ); + public void doInit() { + blocks.peatEngine.init(); + blocks.biogasEngine.init(); if (ForestryAPI.activeMode.getBooleanSetting("energy.engine.clockwork")) { - blocks.engine.addDefinitions(BlockTypeEngine.CLOCKWORK); + blocks.clockworkEngine.init(); } } - @Override - public void doInit() { - blocks.engine.init(); - } - @Override public void registerRecipes() { super.registerRecipes(); - RecipeUtil.addRecipe(blocks.engine.get(BlockTypeEngine.PEAT), + RecipeUtil.addRecipe(new ItemStack(blocks.peatEngine), "###", " X ", "YVY", @@ -68,7 +61,7 @@ public class PluginEnergy extends BlankForestryPlugin { 'Y', "gearCopper", 'V', Blocks.PISTON); - RecipeUtil.addRecipe(blocks.engine.get(BlockTypeEngine.BIOGAS), + RecipeUtil.addRecipe(new ItemStack(blocks.biogasEngine), "###", " X ", "YVY", @@ -78,7 +71,7 @@ public class PluginEnergy extends BlankForestryPlugin { 'V', Blocks.PISTON); if (ForestryAPI.activeMode.getBooleanSetting("energy.engine.clockwork")) { - RecipeUtil.addRecipe(blocks.engine.get(BlockTypeEngine.CLOCKWORK), + RecipeUtil.addRecipe(new ItemStack(blocks.clockworkEngine), "###", " X ", "ZVY", diff --git a/src/main/java/forestry/energy/blocks/BlockEngine.java b/src/main/java/forestry/energy/blocks/BlockEngine.java index 079d5a271..bc6c8f638 100644 --- a/src/main/java/forestry/energy/blocks/BlockEngine.java +++ b/src/main/java/forestry/energy/blocks/BlockEngine.java @@ -17,16 +17,18 @@ import java.util.List; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.EnumFacing; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.EnumFacing; import net.minecraft.util.math.RayTraceResult; import net.minecraft.util.math.Vec3d; +import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import forestry.core.blocks.BlockBase; -import forestry.core.tiles.TileEngine; -import forestry.core.tiles.TileUtil; +import forestry.core.utils.BlockUtil; public class BlockEngine extends BlockBase { private static final EnumMap> boundingBoxesForDirections = new EnumMap<>(EnumFacing.class); @@ -52,19 +54,13 @@ public class BlockEngine extends BlockBase { )); } - public BlockEngine() { - super(BlockTypeEngine.class); + public BlockEngine(BlockTypeEngine blockType) { + super(blockType); } @Override public void addCollisionBoxToList(IBlockState state, World worldIn, BlockPos pos, AxisAlignedBB entityBox, List collidingBoxes, Entity entityIn) { - TileEngine tile = TileUtil.getTile(worldIn, pos, TileEngine.class); - if (tile == null) { - super.addCollisionBoxToList(state, worldIn, pos, entityBox, collidingBoxes, entityIn); - return; - } - - EnumFacing orientation = tile.getOrientation(); + EnumFacing orientation = state.getValue(FACING); List boundingBoxes = boundingBoxesForDirections.get(orientation); if (boundingBoxes == null) { return; @@ -80,12 +76,7 @@ public class BlockEngine extends BlockBase { @Override public RayTraceResult collisionRayTrace(IBlockState blockState, World worldIn, BlockPos pos, Vec3d start, Vec3d end) { - TileEngine tile = TileUtil.getTile(worldIn, pos, TileEngine.class); - if (tile == null) { - return super.collisionRayTrace(blockState, worldIn, pos, start, end); - } - - EnumFacing orientation = tile.getOrientation(); + EnumFacing orientation = blockState.getValue(FACING); List boundingBoxes = boundingBoxesForDirections.get(orientation); if (boundingBoxes == null) { return super.collisionRayTrace(blockState, worldIn, pos, start, end); @@ -112,4 +103,52 @@ public class BlockEngine extends BlockBase { return nearestIntersection; } + + @Override + public boolean rotateBlock(World world, BlockPos pos, EnumFacing axis) { + if (rotate(world, pos)) { + return true; + } + + return super.rotateBlock(world, pos, axis); + } + + private static boolean isOrientedAtEnergyReciever(World world, BlockPos pos, EnumFacing orientation) { + TileEntity tile = world.getTileEntity(pos.offset(orientation)); + return BlockUtil.isEnergyReceiverOrEngine(orientation.getOpposite(), tile); + } + + private static boolean rotate(World world, BlockPos pos) { + IBlockState blockState = world.getBlockState(pos); + EnumFacing blockFacing = blockState.getValue(FACING); + for (int i = blockFacing.ordinal() + 1; i <= blockFacing.ordinal() + 6; ++i) { + EnumFacing orientation = EnumFacing.values()[i % 6]; + if (isOrientedAtEnergyReciever(world, pos, orientation)) { + blockState = blockState.withProperty(FACING, orientation); + world.setBlockState(pos, blockState, 2); + return true; + } + } + return false; + } + + @Override + public void rotateAfterPlacement(EntityPlayer player, World world, BlockPos pos, EnumFacing side) { + EnumFacing orientation = side.getOpposite(); + if (isOrientedAtEnergyReciever(world, pos, orientation)) { + IBlockState blockState = world.getBlockState(pos); + blockState = blockState.withProperty(FACING, orientation); + world.setBlockState(pos, blockState, 2); + } else { + super.rotateAfterPlacement(player, world, pos, side); + rotate(world, pos); + } + } + + @Override + public boolean isSideSolid(IBlockState base_state, IBlockAccess world, BlockPos pos, EnumFacing side) { + IBlockState blockState = world.getBlockState(pos); + EnumFacing facing = blockState.getValue(BlockBase.FACING); + return facing.getOpposite() == side; + } } diff --git a/src/main/java/forestry/energy/blocks/BlockRegistryEnergy.java b/src/main/java/forestry/energy/blocks/BlockRegistryEnergy.java index 73b9e4328..464d0152f 100644 --- a/src/main/java/forestry/energy/blocks/BlockRegistryEnergy.java +++ b/src/main/java/forestry/energy/blocks/BlockRegistryEnergy.java @@ -14,10 +14,18 @@ import forestry.core.blocks.BlockRegistry; import forestry.energy.items.ItemEngine; public class BlockRegistryEnergy extends BlockRegistry { - public final BlockEngine engine; + public final BlockEngine peatEngine; + public final BlockEngine biogasEngine; + public final BlockEngine clockworkEngine; public BlockRegistryEnergy() { - engine = new BlockEngine(); - registerBlock(engine, new ItemEngine(engine), "engine"); + peatEngine = new BlockEngine(BlockTypeEngine.PEAT); + registerBlock(peatEngine, new ItemEngine(peatEngine), "engine.peat"); + + biogasEngine = new BlockEngine(BlockTypeEngine.BIOGAS); + registerBlock(biogasEngine, new ItemEngine(biogasEngine), "engine.biogas"); + + clockworkEngine = new BlockEngine(BlockTypeEngine.CLOCKWORK); + registerBlock(clockworkEngine, new ItemEngine(clockworkEngine), "engine.clockwork"); } } diff --git a/src/main/java/forestry/energy/blocks/BlockTypeEngine.java b/src/main/java/forestry/energy/blocks/BlockTypeEngine.java index 398b6afa7..798801024 100644 --- a/src/main/java/forestry/energy/blocks/BlockTypeEngine.java +++ b/src/main/java/forestry/energy/blocks/BlockTypeEngine.java @@ -29,11 +29,11 @@ import forestry.energy.tiles.TileEnginePeat; import forestry.energy.tiles.TileEuGenerator; public enum BlockTypeEngine implements IBlockTypeTesr { - PEAT(createEngineProperties(0, TileEnginePeat.class, "peat", "/engine_copper")), - BIOGAS(createEngineProperties(1, TileEngineBiogas.class, "biogas", "/engine_bronze")), - CLOCKWORK(createEngineProperties(2, TileEngineClockwork.class, "clockwork", "/engine_clock")), - ELECTRICAL(createEngineProperties(3, TileEngineElectric.class, "electrical", "/engine_tin")), - GENERATOR(createMachineProperties(4, TileEuGenerator.class, "generator", "/generator")); + PEAT(createEngineProperties(TileEnginePeat.class, "peat", "/engine_copper")), + BIOGAS(createEngineProperties(TileEngineBiogas.class, "biogas", "/engine_bronze")), + CLOCKWORK(createEngineProperties(TileEngineClockwork.class, "clockwork", "/engine_clock")), + ELECTRICAL(createEngineProperties(TileEngineElectric.class, "electrical", "/engine_tin")), + GENERATOR(createMachineProperties(TileEuGenerator.class, "generator", "/generator")); public static final BlockTypeEngine[] VALUES = values(); @@ -44,14 +44,14 @@ public enum BlockTypeEngine implements IBlockTypeTesr { this.machineProperties = machineProperties; } - protected static IMachinePropertiesTesr createEngineProperties(int meta, @Nonnull Class teClass, @Nonnull String name, @Nonnull String textureName) { + protected static IMachinePropertiesTesr createEngineProperties(@Nonnull Class teClass, @Nonnull String name, @Nonnull String textureName) { TileEntitySpecialRenderer renderer = PluginEnergy.proxy.getRenderDefaultEngine(Constants.TEXTURE_PATH_BLOCKS + textureName + "_"); - return new MachinePropertiesEngine<>(meta, teClass, name, renderer, Constants.RESOURCE_ID + ":blocks" + textureName + ".0"); + return new MachinePropertiesEngine<>(teClass, name, renderer, Constants.RESOURCE_ID + ":blocks" + textureName + ".0"); } - protected static IMachinePropertiesTesr createMachineProperties(int meta, @Nonnull Class teClass, @Nonnull String name, @Nonnull String textureName) { + protected static IMachinePropertiesTesr createMachineProperties(@Nonnull Class teClass, @Nonnull String name, @Nonnull String textureName) { TileEntitySpecialRenderer renderer = Proxies.render.getRenderDefaultMachine(Constants.TEXTURE_PATH_BLOCKS + textureName + "_"); - return new MachinePropertiesTesr<>(meta, teClass, name, renderer, Constants.RESOURCE_ID + ":blocks" + textureName + ".0"); + return new MachinePropertiesTesr<>(teClass, name, renderer, Constants.RESOURCE_ID + ":blocks" + textureName + ".0"); } @Nonnull diff --git a/src/main/java/forestry/energy/blocks/MachinePropertiesEngine.java b/src/main/java/forestry/energy/blocks/MachinePropertiesEngine.java index 262352e79..a18c85710 100644 --- a/src/main/java/forestry/energy/blocks/MachinePropertiesEngine.java +++ b/src/main/java/forestry/energy/blocks/MachinePropertiesEngine.java @@ -4,26 +4,12 @@ import javax.annotation.Nonnull; import javax.annotation.Nullable; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.EnumFacing; -import net.minecraft.world.IBlockAccess; import forestry.core.blocks.MachinePropertiesTesr; import forestry.core.tiles.TileEngine; -import forestry.core.tiles.TileUtil; public class MachinePropertiesEngine extends MachinePropertiesTesr { - public MachinePropertiesEngine(int meta, @Nonnull Class teClass, @Nonnull String name, @Nullable TileEntitySpecialRenderer renderer, String particleTextureLocation) { - super(meta, teClass, name, renderer, particleTextureLocation); - } - - @Override - public boolean isSolidOnSide(@Nonnull IBlockAccess world, @Nonnull BlockPos pos, @Nonnull EnumFacing side) { - TileEngine tile = TileUtil.getTile(world, pos, TileEngine.class); - if (tile == null) { - return false; - } - - return tile.getOrientation().getOpposite() == side; + public MachinePropertiesEngine(@Nonnull Class teClass, @Nonnull String name, @Nullable TileEntitySpecialRenderer renderer, String particleTextureLocation) { + super(teClass, name, renderer, particleTextureLocation); } } diff --git a/src/main/java/forestry/energy/gui/GuiEngine.java b/src/main/java/forestry/energy/gui/GuiEngine.java index f42ffb0b8..5dee2944a 100755 --- a/src/main/java/forestry/energy/gui/GuiEngine.java +++ b/src/main/java/forestry/energy/gui/GuiEngine.java @@ -56,7 +56,7 @@ public abstract class GuiEngine exten drawText(inventory.getCurrentOutput() + " RF/t", x + 22, y + 32); drawSubheader(Translator.translateToLocal("for.gui.stored") + ':', x + 22, y + 44); - drawText(inventory.getEnergyManager().getEnergyStored(inventory.getOrientation()) + " RF", x + 22, y + 56); + drawText(inventory.getEnergyManager().getEnergyStored(null) + " RF", x + 22, y + 56); drawSubheader(Translator.translateToLocal("for.gui.heat") + ':', x + 22, y + 68); drawText((double) inventory.getHeat() / (double) 10 + 20.0 + " C", x + 22, y + 80); diff --git a/src/main/java/forestry/energy/render/RenderEngine.java b/src/main/java/forestry/energy/render/RenderEngine.java index 36ce30387..6e4ac42b2 100755 --- a/src/main/java/forestry/energy/render/RenderEngine.java +++ b/src/main/java/forestry/energy/render/RenderEngine.java @@ -12,6 +12,7 @@ package forestry.energy.render; import javax.annotation.Nullable; +import net.minecraft.block.state.IBlockState; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; import net.minecraft.client.renderer.GlStateManager; @@ -19,6 +20,7 @@ import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.util.EnumFacing; import net.minecraft.util.ResourceLocation; +import forestry.core.blocks.BlockBase; import forestry.core.config.Constants; import forestry.core.proxy.Proxies; import forestry.core.render.ForestryResource; @@ -92,10 +94,14 @@ public class RenderEngine extends TileEntitySpecialRenderer { @Override public void renderTileEntityAt(@Nullable TileEngine engine, double x, double y, double z, float partialTicks, int destroyStage) { if (engine != null) { - render(engine.getTemperatureState(), engine.progress, engine.getOrientation(), x, y, z); - } else { - render(TemperatureState.COOL, 0.25F, EnumFacing.UP, x, y, z); + IBlockState blockState = engine.getWorldObj().getBlockState(engine.getPos()); + if (blockState != null && blockState.getBlock() instanceof BlockBase) { + EnumFacing facing = blockState.getValue(BlockBase.FACING); + render(engine.getTemperatureState(), engine.progress, facing, x, y, z); + return; + } } + render(TemperatureState.COOL, 0.25F, EnumFacing.UP, x, y, z); } private void render(TemperatureState state, float progress, EnumFacing orientation, double x, double y, double z) { diff --git a/src/main/java/forestry/factory/PluginFactory.java b/src/main/java/forestry/factory/PluginFactory.java index 295ea37d2..648780061 100644 --- a/src/main/java/forestry/factory/PluginFactory.java +++ b/src/main/java/forestry/factory/PluginFactory.java @@ -35,7 +35,6 @@ import forestry.apiculture.items.ItemRegistryApiculture; import forestry.core.PluginCore; import forestry.core.PluginFluids; import forestry.core.blocks.BlockSoil; -import forestry.core.blocks.BlockTypeCoreTesr; import forestry.core.circuits.Circuit; import forestry.core.circuits.CircuitLayout; import forestry.core.circuits.EnumCircuitBoardType; @@ -50,8 +49,6 @@ import forestry.core.recipes.RecipeUtil; import forestry.core.utils.datastructures.FluidMap; import forestry.core.utils.datastructures.ItemStackMap; import forestry.factory.blocks.BlockRegistryFactory; -import forestry.factory.blocks.BlockTypeFactoryPlain; -import forestry.factory.blocks.BlockTypeFactoryTesr; import forestry.factory.circuits.CircuitSpeedUpgrade; import forestry.factory.network.PacketRegistryFactory; import forestry.factory.recipes.CarpenterRecipeManager; @@ -171,18 +168,6 @@ public class PluginFactory extends BlankForestryPlugin { FuelManager.rainSubstrate.put(iodineCharge, new RainSubstrate(iodineCharge, Constants.RAINMAKER_RAIN_DURATION_IODINE, 0.01f)); FuelManager.rainSubstrate.put(dissipationCharge, new RainSubstrate(dissipationCharge, 0.075f)); - blocks.factoryTESR.addDefinitions( - BlockTypeFactoryTesr.BOTTLER, - BlockTypeFactoryTesr.CARPENTER, - BlockTypeFactoryTesr.CENTRIFUGE, - BlockTypeFactoryTesr.FERMENTER, - BlockTypeFactoryTesr.MOISTENER, - BlockTypeFactoryTesr.SQUEEZER, - BlockTypeFactoryTesr.STILL, - BlockTypeFactoryTesr.RAINMAKER - ); - blocks.factoryPlain.addDefinitions(BlockTypeFactoryPlain.VALUES); - ICircuitLayout layoutMachineUpgrade = new CircuitLayout("machine.upgrade", CircuitSocketType.MACHINE); ChipsetManager.circuitRegistry.registerLayout(layoutMachineUpgrade); @@ -203,8 +188,18 @@ public class PluginFactory extends BlankForestryPlugin { public void doInit() { super.doInit(); - blocks.factoryTESR.init(); - blocks.factoryPlain.init(); + blocks.bottler.init(); + blocks.carpenter.init(); + blocks.centrifuge.init(); + blocks.fermenter.init(); + blocks.moistener.init(); + blocks.squeezer.init(); + blocks.still.init(); + blocks.rainmaker.init(); + + blocks.fabricator.init(); + blocks.raintank.init(); + blocks.worktable.init(); Circuit.machineSpeedUpgrade1 = new CircuitSpeedUpgrade("machine.speed.boost.1", 0.125f, 0.05f, 4); Circuit.machineSpeedUpgrade2 = new CircuitSpeedUpgrade("machine.speed.boost.2", 0.250f, 0.10f, 4); @@ -315,7 +310,7 @@ public class PluginFactory extends BlankForestryPlugin { "###", '#', "logWood"); RecipeManagers.carpenterManager.addRecipe(50, Fluids.SEED_OIL.getFluid(500), null, - PluginCore.blocks.core.get(BlockTypeCoreTesr.ESCRITOIRE), + new ItemStack(PluginCore.blocks.escritoire), "# ", "###", "# #", @@ -433,7 +428,7 @@ public class PluginFactory extends BlankForestryPlugin { ChipsetManager.solderManager.addRecipe(layout, PluginCore.items.tubes.get(EnumElectronTube.BLAZE, 1), Circuit.machineSpeedUpgrade2); ChipsetManager.solderManager.addRecipe(layout, PluginCore.items.tubes.get(EnumElectronTube.GOLD, 1), Circuit.machineEfficiencyUpgrade1); - RecipeUtil.addRecipe(blocks.factoryTESR.get(BlockTypeFactoryTesr.BOTTLER), + RecipeUtil.addRecipe(blocks.bottler, "X#X", "#Y#", "X#X", @@ -441,7 +436,7 @@ public class PluginFactory extends BlankForestryPlugin { 'X', PluginFluids.items.canEmpty, 'Y', PluginCore.items.sturdyCasing); - RecipeUtil.addRecipe(blocks.factoryTESR.get(BlockTypeFactoryTesr.CARPENTER), + RecipeUtil.addRecipe(blocks.carpenter, "X#X", "XYX", "X#X", @@ -449,7 +444,7 @@ public class PluginFactory extends BlankForestryPlugin { 'X', "ingotBronze", 'Y', PluginCore.items.sturdyCasing); - RecipeUtil.addRecipe(blocks.factoryTESR.get(BlockTypeFactoryTesr.CENTRIFUGE), + RecipeUtil.addRecipe(blocks.centrifuge, "X#X", "XYX", "X#X", @@ -457,7 +452,7 @@ public class PluginFactory extends BlankForestryPlugin { 'X', "ingotCopper", 'Y', PluginCore.items.sturdyCasing); - RecipeUtil.addRecipe(blocks.factoryTESR.get(BlockTypeFactoryTesr.FERMENTER), + RecipeUtil.addRecipe(blocks.fermenter, "X#X", "#Y#", "X#X", @@ -465,7 +460,7 @@ public class PluginFactory extends BlankForestryPlugin { 'X', "gearBronze", 'Y', PluginCore.items.sturdyCasing); - RecipeUtil.addRecipe(blocks.factoryTESR.get(BlockTypeFactoryTesr.MOISTENER), + RecipeUtil.addRecipe(blocks.moistener, "X#X", "#Y#", "X#X", @@ -473,7 +468,7 @@ public class PluginFactory extends BlankForestryPlugin { 'X', "gearCopper", 'Y', PluginCore.items.sturdyCasing); - RecipeUtil.addRecipe(blocks.factoryTESR.get(BlockTypeFactoryTesr.SQUEEZER), + RecipeUtil.addRecipe(blocks.squeezer, "X#X", "XYX", "X#X", @@ -481,7 +476,7 @@ public class PluginFactory extends BlankForestryPlugin { 'X', "ingotTin", 'Y', PluginCore.items.sturdyCasing); - RecipeUtil.addRecipe(blocks.factoryTESR.get(BlockTypeFactoryTesr.STILL), + RecipeUtil.addRecipe(blocks.still, "X#X", "#Y#", "X#X", @@ -489,7 +484,7 @@ public class PluginFactory extends BlankForestryPlugin { 'X', "dustRedstone", 'Y', PluginCore.items.sturdyCasing); - RecipeUtil.addRecipe(blocks.factoryTESR.get(BlockTypeFactoryTesr.RAINMAKER), + RecipeUtil.addRecipe(blocks.rainmaker, "X#X", "#Y#", "X#X", @@ -497,7 +492,7 @@ public class PluginFactory extends BlankForestryPlugin { 'X', "gearTin", 'Y', PluginCore.items.hardenedCasing); - RecipeUtil.addRecipe(blocks.factoryPlain.get(BlockTypeFactoryPlain.FABRICATOR), + RecipeUtil.addRecipe(blocks.fabricator, "X#X", "#Y#", "XZX", @@ -506,7 +501,7 @@ public class PluginFactory extends BlankForestryPlugin { 'Y', PluginCore.items.sturdyCasing, 'Z', "chestWood"); - RecipeUtil.addRecipe(blocks.factoryPlain.get(BlockTypeFactoryPlain.RAINTANK), + RecipeUtil.addRecipe(blocks.raintank, "X#X", "XYX", "X#X", @@ -514,7 +509,7 @@ public class PluginFactory extends BlankForestryPlugin { 'X', "ingotIron", 'Y', PluginCore.items.sturdyCasing); - RecipeUtil.addRecipe(blocks.factoryPlain.get(BlockTypeFactoryPlain.WORKTABLE), + RecipeUtil.addRecipe(blocks.worktable, "B", "W", "C", diff --git a/src/main/java/forestry/factory/blocks/BlockFactoryPlain.java b/src/main/java/forestry/factory/blocks/BlockFactoryPlain.java index a74c39a97..827de9561 100644 --- a/src/main/java/forestry/factory/blocks/BlockFactoryPlain.java +++ b/src/main/java/forestry/factory/blocks/BlockFactoryPlain.java @@ -13,7 +13,7 @@ package forestry.factory.blocks; import forestry.core.blocks.BlockBase; public class BlockFactoryPlain extends BlockBase { - public BlockFactoryPlain() { - super(BlockTypeFactoryPlain.class); + public BlockFactoryPlain(BlockTypeFactoryPlain type) { + super(type); } } diff --git a/src/main/java/forestry/factory/blocks/BlockFactoryTESR.java b/src/main/java/forestry/factory/blocks/BlockFactoryTESR.java index f44dee3c0..ffc16a982 100644 --- a/src/main/java/forestry/factory/blocks/BlockFactoryTESR.java +++ b/src/main/java/forestry/factory/blocks/BlockFactoryTESR.java @@ -13,7 +13,7 @@ package forestry.factory.blocks; import forestry.core.blocks.BlockBase; public class BlockFactoryTESR extends BlockBase { - public BlockFactoryTESR() { - super(BlockTypeFactoryTesr.class); + public BlockFactoryTESR(BlockTypeFactoryTesr type) { + super(type); } } diff --git a/src/main/java/forestry/factory/blocks/BlockRegistryFactory.java b/src/main/java/forestry/factory/blocks/BlockRegistryFactory.java index c18ce7b61..da7626de6 100644 --- a/src/main/java/forestry/factory/blocks/BlockRegistryFactory.java +++ b/src/main/java/forestry/factory/blocks/BlockRegistryFactory.java @@ -15,14 +15,51 @@ import forestry.core.items.ItemBlockForestry; import forestry.core.items.ItemBlockNBT; public class BlockRegistryFactory extends BlockRegistry { - public final BlockFactoryTESR factoryTESR; - public final BlockFactoryPlain factoryPlain; + public final BlockFactoryTESR bottler; + public final BlockFactoryTESR carpenter; + public final BlockFactoryTESR centrifuge; + public final BlockFactoryTESR fermenter; + public final BlockFactoryTESR moistener; + public final BlockFactoryTESR squeezer; + public final BlockFactoryTESR still; + public final BlockFactoryTESR rainmaker; + + public final BlockFactoryPlain fabricator; + public final BlockFactoryPlain raintank; + public final BlockFactoryPlain worktable; public BlockRegistryFactory() { - factoryTESR = new BlockFactoryTESR(); - registerBlock(factoryTESR, new ItemBlockForestry(factoryTESR), "factory"); + bottler = new BlockFactoryTESR(BlockTypeFactoryTesr.BOTTLER); + registerBlock(bottler, new ItemBlockForestry(bottler), "bottler"); - factoryPlain = new BlockFactoryPlain(); - registerBlock(factoryPlain, new ItemBlockNBT(factoryPlain), "factory2"); + carpenter = new BlockFactoryTESR(BlockTypeFactoryTesr.CARPENTER); + registerBlock(carpenter, new ItemBlockForestry(carpenter), "carpenter"); + + centrifuge = new BlockFactoryTESR(BlockTypeFactoryTesr.CENTRIFUGE); + registerBlock(centrifuge, new ItemBlockForestry(centrifuge), "centrifuge"); + + fermenter = new BlockFactoryTESR(BlockTypeFactoryTesr.FERMENTER); + registerBlock(fermenter, new ItemBlockForestry(fermenter), "fermenter"); + + moistener = new BlockFactoryTESR(BlockTypeFactoryTesr.MOISTENER); + registerBlock(moistener, new ItemBlockForestry(moistener), "moistener"); + + squeezer = new BlockFactoryTESR(BlockTypeFactoryTesr.SQUEEZER); + registerBlock(squeezer, new ItemBlockForestry(squeezer), "squeezer"); + + still = new BlockFactoryTESR(BlockTypeFactoryTesr.STILL); + registerBlock(still, new ItemBlockForestry(still), "still"); + + rainmaker = new BlockFactoryTESR(BlockTypeFactoryTesr.RAINMAKER); + registerBlock(rainmaker, new ItemBlockForestry(rainmaker), "rainmaker"); + + fabricator = new BlockFactoryPlain(BlockTypeFactoryPlain.FABRICATOR); + registerBlock(fabricator, new ItemBlockNBT(fabricator), "fabricator"); + + raintank = new BlockFactoryPlain(BlockTypeFactoryPlain.RAINTANK); + registerBlock(raintank, new ItemBlockNBT(raintank), "raintank"); + + worktable = new BlockFactoryPlain(BlockTypeFactoryPlain.WORKTABLE); + registerBlock(worktable, new ItemBlockNBT(worktable), "worktable"); } } diff --git a/src/main/java/forestry/factory/blocks/BlockTypeFactoryPlain.java b/src/main/java/forestry/factory/blocks/BlockTypeFactoryPlain.java index 49b5d3b05..7e896dd60 100644 --- a/src/main/java/forestry/factory/blocks/BlockTypeFactoryPlain.java +++ b/src/main/java/forestry/factory/blocks/BlockTypeFactoryPlain.java @@ -21,17 +21,17 @@ import forestry.factory.tiles.TileRaintank; import forestry.factory.tiles.TileWorktable; public enum BlockTypeFactoryPlain implements IBlockType { - FABRICATOR(0, TileFabricator.class, "fabricator"), - RAINTANK(1, TileRaintank.class, "raintank"), - WORKTABLE(2, TileWorktable.class, "worktable"); + FABRICATOR(TileFabricator.class, "fabricator"), + RAINTANK(TileRaintank.class, "raintank"), + WORKTABLE(TileWorktable.class, "worktable"); public static final BlockTypeFactoryPlain[] VALUES = values(); @Nonnull private final IMachineProperties machineProperties; - BlockTypeFactoryPlain(int meta, @Nonnull Class teClass, @Nonnull String name) { - this.machineProperties = new MachineProperties<>(meta, teClass, name); + BlockTypeFactoryPlain(@Nonnull Class teClass, @Nonnull String name) { + this.machineProperties = new MachineProperties<>(teClass, name); } @Nonnull diff --git a/src/main/java/forestry/factory/blocks/BlockTypeFactoryTesr.java b/src/main/java/forestry/factory/blocks/BlockTypeFactoryTesr.java index a9898d092..09b5e9291 100644 --- a/src/main/java/forestry/factory/blocks/BlockTypeFactoryTesr.java +++ b/src/main/java/forestry/factory/blocks/BlockTypeFactoryTesr.java @@ -31,27 +31,27 @@ import forestry.factory.tiles.TileSqueezer; import forestry.factory.tiles.TileStill; public enum BlockTypeFactoryTesr implements IBlockTypeTesr { - BOTTLER(0, TileBottler.class, "bottler"), - CARPENTER(1, TileCarpenter.class, "carpenter"), - CENTRIFUGE(2, TileCentrifuge.class, "centrifuge"), - FERMENTER(3, TileFermenter.class, "fermenter"), - MOISTENER(4, TileMoistener.class, "moistener"), - SQUEEZER(5, TileSqueezer.class, "squeezer"), - STILL(6, TileStill.class, "still"), - RAINMAKER(7, TileMillRainmaker.class, "rainmaker", Proxies.render.getRenderMill(Constants.TEXTURE_PATH_BLOCKS + "/rainmaker_")); + BOTTLER(TileBottler.class, "bottler"), + CARPENTER(TileCarpenter.class, "carpenter"), + CENTRIFUGE(TileCentrifuge.class, "centrifuge"), + FERMENTER(TileFermenter.class, "fermenter"), + MOISTENER(TileMoistener.class, "moistener"), + SQUEEZER(TileSqueezer.class, "squeezer"), + STILL(TileStill.class, "still"), + RAINMAKER(TileMillRainmaker.class, "rainmaker", Proxies.render.getRenderMill(Constants.TEXTURE_PATH_BLOCKS + "/rainmaker_")); public static final BlockTypeFactoryTesr[] VALUES = values(); @Nonnull private final IMachinePropertiesTesr machineProperties; - BlockTypeFactoryTesr(int meta, @Nonnull Class teClass, @Nonnull String name) { + BlockTypeFactoryTesr(@Nonnull Class teClass, @Nonnull String name) { TileEntitySpecialRenderer renderer = Proxies.render.getRenderDefaultMachine(Constants.TEXTURE_PATH_BLOCKS + "/" + name + "_"); - this.machineProperties = new MachinePropertiesTesr<>(meta, teClass, name, renderer, Constants.RESOURCE_ID + ":blocks/" + name + ".0"); + this.machineProperties = new MachinePropertiesTesr<>(teClass, name, renderer, Constants.RESOURCE_ID + ":blocks/" + name + ".0"); } - BlockTypeFactoryTesr(int meta, @Nonnull Class teClass, @Nonnull String name, @Nullable TileEntitySpecialRenderer renderer) { - this.machineProperties = new MachinePropertiesTesr<>(meta, teClass, name, renderer, Constants.RESOURCE_ID + ":blocks/" + name + ".0"); + BlockTypeFactoryTesr(@Nonnull Class teClass, @Nonnull String name, @Nullable TileEntitySpecialRenderer renderer) { + this.machineProperties = new MachinePropertiesTesr<>(teClass, name, renderer, Constants.RESOURCE_ID + ":blocks/" + name + ".0"); } @Nonnull diff --git a/src/main/java/forestry/factory/recipes/jei/FactoryJeiPlugin.java b/src/main/java/forestry/factory/recipes/jei/FactoryJeiPlugin.java index afdde1a2a..74262a07f 100644 --- a/src/main/java/forestry/factory/recipes/jei/FactoryJeiPlugin.java +++ b/src/main/java/forestry/factory/recipes/jei/FactoryJeiPlugin.java @@ -5,11 +5,11 @@ import javax.annotation.Nullable; import java.awt.Rectangle; import java.util.List; +import net.minecraft.item.ItemStack; + import forestry.core.gui.GuiForestry; import forestry.core.recipes.jei.ForestryRecipeCategoryUid; import forestry.factory.PluginFactory; -import forestry.factory.blocks.BlockTypeFactoryPlain; -import forestry.factory.blocks.BlockTypeFactoryTesr; import forestry.factory.gui.GuiBottler; import forestry.factory.gui.GuiCarpenter; import forestry.factory.gui.GuiCentrifuge; @@ -108,15 +108,15 @@ public class FactoryJeiPlugin extends BlankModPlugin { registry.addRecipeClickArea(GuiSqueezer.class, 76, 41, 43, 16, ForestryRecipeCategoryUid.SQUEEZER); registry.addRecipeClickArea(GuiStill.class, 73, 17, 33, 57, ForestryRecipeCategoryUid.STILL); - registry.addRecipeCategoryCraftingItem(PluginFactory.blocks.factoryTESR.get(BlockTypeFactoryTesr.BOTTLER), ForestryRecipeCategoryUid.BOTTLER); - registry.addRecipeCategoryCraftingItem(PluginFactory.blocks.factoryTESR.get(BlockTypeFactoryTesr.CARPENTER), ForestryRecipeCategoryUid.CARPENTER); - registry.addRecipeCategoryCraftingItem(PluginFactory.blocks.factoryTESR.get(BlockTypeFactoryTesr.CENTRIFUGE), ForestryRecipeCategoryUid.CENTRIFUGE); - registry.addRecipeCategoryCraftingItem(PluginFactory.blocks.factoryPlain.get(BlockTypeFactoryPlain.FABRICATOR), ForestryRecipeCategoryUid.FABRICATOR); - registry.addRecipeCategoryCraftingItem(PluginFactory.blocks.factoryTESR.get(BlockTypeFactoryTesr.FERMENTER), ForestryRecipeCategoryUid.FERMENTER); - registry.addRecipeCategoryCraftingItem(PluginFactory.blocks.factoryTESR.get(BlockTypeFactoryTesr.MOISTENER), ForestryRecipeCategoryUid.MOISTENER); - registry.addRecipeCategoryCraftingItem(PluginFactory.blocks.factoryTESR.get(BlockTypeFactoryTesr.RAINMAKER), ForestryRecipeCategoryUid.RAINMAKER); - registry.addRecipeCategoryCraftingItem(PluginFactory.blocks.factoryTESR.get(BlockTypeFactoryTesr.SQUEEZER), ForestryRecipeCategoryUid.SQUEEZER); - registry.addRecipeCategoryCraftingItem(PluginFactory.blocks.factoryTESR.get(BlockTypeFactoryTesr.STILL), ForestryRecipeCategoryUid.STILL); + registry.addRecipeCategoryCraftingItem(new ItemStack(PluginFactory.blocks.bottler), ForestryRecipeCategoryUid.BOTTLER); + registry.addRecipeCategoryCraftingItem(new ItemStack(PluginFactory.blocks.carpenter), ForestryRecipeCategoryUid.CARPENTER); + registry.addRecipeCategoryCraftingItem(new ItemStack(PluginFactory.blocks.centrifuge), ForestryRecipeCategoryUid.CENTRIFUGE); + registry.addRecipeCategoryCraftingItem(new ItemStack(PluginFactory.blocks.fabricator), ForestryRecipeCategoryUid.FABRICATOR); + registry.addRecipeCategoryCraftingItem(new ItemStack(PluginFactory.blocks.fermenter), ForestryRecipeCategoryUid.FERMENTER); + registry.addRecipeCategoryCraftingItem(new ItemStack(PluginFactory.blocks.moistener), ForestryRecipeCategoryUid.MOISTENER); + registry.addRecipeCategoryCraftingItem(new ItemStack(PluginFactory.blocks.rainmaker), ForestryRecipeCategoryUid.RAINMAKER); + registry.addRecipeCategoryCraftingItem(new ItemStack(PluginFactory.blocks.squeezer), ForestryRecipeCategoryUid.SQUEEZER); + registry.addRecipeCategoryCraftingItem(new ItemStack(PluginFactory.blocks.still), ForestryRecipeCategoryUid.STILL); IRecipeTransferRegistry transferRegistry = registry.getRecipeTransferRegistry(); transferRegistry.addRecipeTransferHandler(new WorktableRecipeTransferHandler()); diff --git a/src/main/java/forestry/factory/recipes/jei/bottler/BottlerRecipeCategory.java b/src/main/java/forestry/factory/recipes/jei/bottler/BottlerRecipeCategory.java index 8b011ffdb..9b6307bf2 100644 --- a/src/main/java/forestry/factory/recipes/jei/bottler/BottlerRecipeCategory.java +++ b/src/main/java/forestry/factory/recipes/jei/bottler/BottlerRecipeCategory.java @@ -31,7 +31,7 @@ public class BottlerRecipeCategory extends ForestryRecipeCategory { private final IDrawable tankOverlay; public BottlerRecipeCategory(IGuiHelper guiHelper) { - super(guiHelper.createDrawable(guiTexture, 52, 16, 81, 60), "tile.for.factory.bottler.name"); + super(guiHelper.createDrawable(guiTexture, 52, 16, 81, 60), "tile.for.bottler.name"); IDrawableStatic arrowDrawable = guiHelper.createDrawable(guiTexture, 176, 74, 24, 17); this.arrow = guiHelper.createAnimatedDrawable(arrowDrawable, 200, IDrawableAnimated.StartDirection.LEFT, false); diff --git a/src/main/java/forestry/factory/recipes/jei/carpenter/CarpenterRecipeCategory.java b/src/main/java/forestry/factory/recipes/jei/carpenter/CarpenterRecipeCategory.java index 9e16dc450..53977ad43 100644 --- a/src/main/java/forestry/factory/recipes/jei/carpenter/CarpenterRecipeCategory.java +++ b/src/main/java/forestry/factory/recipes/jei/carpenter/CarpenterRecipeCategory.java @@ -39,7 +39,7 @@ public class CarpenterRecipeCategory extends ForestryRecipeCategory { private final IDrawable tankOverlay; public CarpenterRecipeCategory(IGuiHelper guiHelper) { - super(guiHelper.createDrawable(guiTexture, 9, 16, 158, 61), "tile.for.factory.carpenter.name"); + super(guiHelper.createDrawable(guiTexture, 9, 16, 158, 61), "tile.for.carpenter.name"); craftingGridHelper = guiHelper.createCraftingGridHelper(craftInputSlot, craftOutputSlot); IDrawableStatic arrowDrawable = guiHelper.createDrawable(guiTexture, 176, 59, 4, 17); diff --git a/src/main/java/forestry/factory/recipes/jei/centrifuge/CentrifugeRecipeCategory.java b/src/main/java/forestry/factory/recipes/jei/centrifuge/CentrifugeRecipeCategory.java index 00d153daf..243ea6da7 100644 --- a/src/main/java/forestry/factory/recipes/jei/centrifuge/CentrifugeRecipeCategory.java +++ b/src/main/java/forestry/factory/recipes/jei/centrifuge/CentrifugeRecipeCategory.java @@ -44,7 +44,7 @@ public class CentrifugeRecipeCategory extends ForestryRecipeCategory { private final ForestryTooltipCallback tooltip = new ForestryTooltipCallback(); public CentrifugeRecipeCategory(IGuiHelper guiHelper) { - super(guiHelper.createDrawable(guiTexture, 25, 18, 126, 54), "tile.for.factory.centrifuge.name"); + super(guiHelper.createDrawable(guiTexture, 25, 18, 126, 54), "tile.for.centrifuge.name"); IDrawableStatic arrowDrawable = guiHelper.createDrawable(guiTexture, 176, 0, 4, 17); this.arrow = guiHelper.createAnimatedDrawable(arrowDrawable, 80, IDrawableAnimated.StartDirection.BOTTOM, false); diff --git a/src/main/java/forestry/factory/recipes/jei/fabricator/FabricatorRecipeCategory.java b/src/main/java/forestry/factory/recipes/jei/fabricator/FabricatorRecipeCategory.java index 7c53505ce..dbebeae6a 100644 --- a/src/main/java/forestry/factory/recipes/jei/fabricator/FabricatorRecipeCategory.java +++ b/src/main/java/forestry/factory/recipes/jei/fabricator/FabricatorRecipeCategory.java @@ -39,7 +39,7 @@ public class FabricatorRecipeCategory extends ForestryRecipeCategory { private final ICraftingGridHelper craftingGridHelper; public FabricatorRecipeCategory(IGuiHelper guiHelper) { - super(guiHelper.createDrawable(guiTexture, 20, 16, 136, 54), "tile.for.factory2.fabricator.name"); + super(guiHelper.createDrawable(guiTexture, 20, 16, 136, 54), "tile.for.fabricator.name"); craftingGridHelper = guiHelper.createCraftingGridHelper(craftInputSlot, craftOutputSlot); } diff --git a/src/main/java/forestry/factory/recipes/jei/fermenter/FermenterRecipeCategory.java b/src/main/java/forestry/factory/recipes/jei/fermenter/FermenterRecipeCategory.java index 09469ec07..12dad96e9 100644 --- a/src/main/java/forestry/factory/recipes/jei/fermenter/FermenterRecipeCategory.java +++ b/src/main/java/forestry/factory/recipes/jei/fermenter/FermenterRecipeCategory.java @@ -40,7 +40,7 @@ public class FermenterRecipeCategory extends ForestryRecipeCategory { private final IDrawable tankOverlay; public FermenterRecipeCategory(IGuiHelper guiHelper) { - super(guiHelper.createDrawable(guiTexture, 34, 18, 108, 60), "tile.for.factory.fermenter.name"); + super(guiHelper.createDrawable(guiTexture, 34, 18, 108, 60), "tile.for.fermenter.name"); IDrawableStatic progressBarDrawable0 = guiHelper.createDrawable(guiTexture, 176, 60, 4, 18); this.progressBar0 = guiHelper.createAnimatedDrawable(progressBarDrawable0, 40, IDrawableAnimated.StartDirection.BOTTOM, false); diff --git a/src/main/java/forestry/factory/recipes/jei/moistener/MoistenerRecipeCategory.java b/src/main/java/forestry/factory/recipes/jei/moistener/MoistenerRecipeCategory.java index a015309c5..6469c8435 100644 --- a/src/main/java/forestry/factory/recipes/jei/moistener/MoistenerRecipeCategory.java +++ b/src/main/java/forestry/factory/recipes/jei/moistener/MoistenerRecipeCategory.java @@ -38,7 +38,7 @@ public class MoistenerRecipeCategory extends ForestryRecipeCategory { private final IDrawable tankOverlay; public MoistenerRecipeCategory(IGuiHelper guiHelper) { - super(guiHelper.createDrawable(guiTexture, 15, 15, 145, 60), "tile.for.factory.moistener.name"); + super(guiHelper.createDrawable(guiTexture, 15, 15, 145, 60), "tile.for.moistener.name"); IDrawableStatic arrowDrawable = guiHelper.createDrawable(guiTexture, 176, 91, 29, 55); this.arrow = guiHelper.createAnimatedDrawable(arrowDrawable, 80, IDrawableAnimated.StartDirection.BOTTOM, false); diff --git a/src/main/java/forestry/factory/recipes/jei/rainmaker/RainmakerRecipeCategory.java b/src/main/java/forestry/factory/recipes/jei/rainmaker/RainmakerRecipeCategory.java index 3abe24609..f55ec7e30 100644 --- a/src/main/java/forestry/factory/recipes/jei/rainmaker/RainmakerRecipeCategory.java +++ b/src/main/java/forestry/factory/recipes/jei/rainmaker/RainmakerRecipeCategory.java @@ -20,7 +20,7 @@ public class RainmakerRecipeCategory extends ForestryRecipeCategory { private final IDrawable slot; public RainmakerRecipeCategory(@Nonnull IGuiHelper guiHelper) { - super(guiHelper.createBlankDrawable(150, 30), "tile.for.factory.rainmaker.name"); + super(guiHelper.createBlankDrawable(150, 30), "tile.for.rainmaker.name"); this.slot = guiHelper.getSlotDrawable(); } diff --git a/src/main/java/forestry/factory/recipes/jei/squeezer/SqueezerRecipeCategory.java b/src/main/java/forestry/factory/recipes/jei/squeezer/SqueezerRecipeCategory.java index 3a5eada82..75c726888 100644 --- a/src/main/java/forestry/factory/recipes/jei/squeezer/SqueezerRecipeCategory.java +++ b/src/main/java/forestry/factory/recipes/jei/squeezer/SqueezerRecipeCategory.java @@ -38,7 +38,7 @@ public class SqueezerRecipeCategory extends ForestryRecipeCategory { private final ForestryTooltipCallback tooltip = new ForestryTooltipCallback(); public SqueezerRecipeCategory(@Nonnull IGuiHelper guiHelper) { - super(guiHelper.createDrawable(guiTexture, 9, 16, 158, 62), "tile.for.factory.squeezer.name"); + super(guiHelper.createDrawable(guiTexture, 9, 16, 158, 62), "tile.for.squeezer.name"); IDrawableStatic arrowDrawable = guiHelper.createDrawable(guiTexture, 176, 60, 43, 18); this.arrow = guiHelper.createAnimatedDrawable(arrowDrawable, 200, IDrawableAnimated.StartDirection.LEFT, false); diff --git a/src/main/java/forestry/factory/recipes/jei/still/StillRecipeCategory.java b/src/main/java/forestry/factory/recipes/jei/still/StillRecipeCategory.java index 916ffbede..8166f6f43 100644 --- a/src/main/java/forestry/factory/recipes/jei/still/StillRecipeCategory.java +++ b/src/main/java/forestry/factory/recipes/jei/still/StillRecipeCategory.java @@ -30,7 +30,7 @@ public class StillRecipeCategory extends ForestryRecipeCategory { private final IDrawableAnimated progressBar; public StillRecipeCategory(IGuiHelper guiHelper) { - super(guiHelper.createDrawable(guiTexture, 34, 14, 108, 60), "tile.for.factory.still.name"); + super(guiHelper.createDrawable(guiTexture, 34, 14, 108, 60), "tile.for.still.name"); this.tankOverlay = guiHelper.createDrawable(guiTexture, 176, 0, 16, 58); IDrawableStatic progressBarDrawable0 = guiHelper.createDrawable(guiTexture, 176, 74, 4, 18); diff --git a/src/main/java/forestry/lepidopterology/PluginLepidopterology.java b/src/main/java/forestry/lepidopterology/PluginLepidopterology.java index bfe9cd502..7b186d47c 100644 --- a/src/main/java/forestry/lepidopterology/PluginLepidopterology.java +++ b/src/main/java/forestry/lepidopterology/PluginLepidopterology.java @@ -28,6 +28,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.CraftingManager; import net.minecraft.world.World; import net.minecraft.world.chunk.IChunkGenerator; + import net.minecraftforge.common.config.Property; import net.minecraftforge.fml.common.SidedProxy; import net.minecraftforge.fml.common.registry.GameRegistry; @@ -50,7 +51,6 @@ import forestry.core.utils.ItemStackUtil; import forestry.core.utils.Log; import forestry.core.utils.Translator; import forestry.lepidopterology.blocks.BlockRegistryLepidopterology; -import forestry.lepidopterology.blocks.BlockTypeLepidopterologyTesr; import forestry.lepidopterology.commands.CommandButterfly; import forestry.lepidopterology.entities.EntityButterfly; import forestry.lepidopterology.genetics.ButterflyBranchDefinition; @@ -111,8 +111,6 @@ public class PluginLepidopterology extends BlankForestryPlugin { GameRegistry.registerTileEntity(TileCocoon.class, "forestry.Cocoon"); proxy.preInitializeRendering(); - - blocks.lepidopterology.addDefinitions(BlockTypeLepidopterologyTesr.VALUES); } @Nonnull @@ -133,7 +131,7 @@ public class PluginLepidopterology extends BlankForestryPlugin { ButterflyDefinition.initButterflies(); AlleleButterflyCocoon.createLoot(); - blocks.lepidopterology.init(); + blocks.butterflyChest.init(); if(spawnButterflysFromLeaves){ TreeManager.treeRoot.registerLeafTickHandler(new ButterflySpawner()); @@ -261,7 +259,7 @@ public class PluginLepidopterology extends BlankForestryPlugin { public void registerRecipes() { CraftingManager.getInstance().getRecipeList().add(new MatingRecipe()); - RecipeUtil.addRecipe(blocks.lepidopterology.get(BlockTypeLepidopterologyTesr.LEPICHEST), + RecipeUtil.addRecipe(blocks.butterflyChest, " # ", "XYX", "XXX", diff --git a/src/main/java/forestry/lepidopterology/blocks/BlockLepidopterology.java b/src/main/java/forestry/lepidopterology/blocks/BlockLepidopterology.java index eb47ae1db..fe3b6fb91 100644 --- a/src/main/java/forestry/lepidopterology/blocks/BlockLepidopterology.java +++ b/src/main/java/forestry/lepidopterology/blocks/BlockLepidopterology.java @@ -14,8 +14,8 @@ import forestry.api.core.Tabs; import forestry.core.blocks.BlockBase; public class BlockLepidopterology extends BlockBase { - public BlockLepidopterology() { - super(BlockTypeLepidopterologyTesr.class); + public BlockLepidopterology(BlockTypeLepidopterologyTesr type) { + super(type); setCreativeTab(Tabs.tabLepidopterology); } } diff --git a/src/main/java/forestry/lepidopterology/blocks/BlockRegistryLepidopterology.java b/src/main/java/forestry/lepidopterology/blocks/BlockRegistryLepidopterology.java index 88d472382..4493fc023 100644 --- a/src/main/java/forestry/lepidopterology/blocks/BlockRegistryLepidopterology.java +++ b/src/main/java/forestry/lepidopterology/blocks/BlockRegistryLepidopterology.java @@ -15,13 +15,13 @@ import forestry.core.items.ItemBlockForestry; import forestry.lepidopterology.genetics.alleles.AlleleButterflyCocoon; public class BlockRegistryLepidopterology extends BlockRegistry { - public final BlockLepidopterology lepidopterology; + public final BlockLepidopterology butterflyChest; public final BlockCocoon cocoon; public final BlockSolidCocoon solidCocoon; public BlockRegistryLepidopterology() { - lepidopterology = new BlockLepidopterology(); - registerBlock(lepidopterology, new ItemBlockForestry(lepidopterology), "lepidopterology"); + butterflyChest = new BlockLepidopterology(BlockTypeLepidopterologyTesr.LEPICHEST); + registerBlock(butterflyChest, new ItemBlockForestry(butterflyChest), "butterfly_chest"); AlleleButterflyCocoon.createAlleles(); cocoon = new BlockCocoon(); diff --git a/src/main/java/forestry/lepidopterology/blocks/BlockTypeLepidopterologyTesr.java b/src/main/java/forestry/lepidopterology/blocks/BlockTypeLepidopterologyTesr.java index 71ef70856..91dffdb1a 100644 --- a/src/main/java/forestry/lepidopterology/blocks/BlockTypeLepidopterologyTesr.java +++ b/src/main/java/forestry/lepidopterology/blocks/BlockTypeLepidopterologyTesr.java @@ -26,18 +26,18 @@ import forestry.core.tiles.TileNaturalistChest; import forestry.lepidopterology.tiles.TileLepidopteristChest; public enum BlockTypeLepidopterologyTesr implements IBlockTypeTesr { - LEPICHEST(0, TileLepidopteristChest.class, "lepi_chest", Proxies.render.getRenderChest("lepichest"), TileNaturalistChest.chestBoundingBox); + LEPICHEST(TileLepidopteristChest.class, "lepi_chest", Proxies.render.getRenderChest("lepichest"), TileNaturalistChest.chestBoundingBox); public static final BlockTypeLepidopterologyTesr[] VALUES = values(); @Nonnull private final IMachinePropertiesTesr machineProperties; - BlockTypeLepidopterologyTesr(int meta, @Nonnull Class teClass, @Nonnull String name, @Nullable TileEntitySpecialRenderer renderer, @Nullable AxisAlignedBB boundingBox) { + BlockTypeLepidopterologyTesr(@Nonnull Class teClass, @Nonnull String name, @Nullable TileEntitySpecialRenderer renderer, @Nullable AxisAlignedBB boundingBox) { if (boundingBox != null) { - this.machineProperties = new MachinePropertiesTesr<>(meta, teClass, name, renderer, boundingBox, Constants.RESOURCE_ID + ":blocks/" + name + ".0"); + this.machineProperties = new MachinePropertiesTesr<>(teClass, name, renderer, boundingBox, Constants.RESOURCE_ID + ":blocks/" + name + ".0"); } else { - this.machineProperties = new MachinePropertiesTesr<>(meta, teClass, name, renderer, Constants.RESOURCE_ID + ":blocks/" + name + ".0"); + this.machineProperties = new MachinePropertiesTesr<>(teClass, name, renderer, Constants.RESOURCE_ID + ":blocks/" + name + ".0"); } } diff --git a/src/main/java/forestry/mail/PluginMail.java b/src/main/java/forestry/mail/PluginMail.java index bebe1f87f..f242e9fc6 100644 --- a/src/main/java/forestry/mail/PluginMail.java +++ b/src/main/java/forestry/mail/PluginMail.java @@ -14,6 +14,7 @@ import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraftforge.common.MinecraftForge; + import forestry.api.circuits.ICircuit; import forestry.api.mail.EnumAddressee; import forestry.api.mail.PostManager; @@ -31,7 +32,6 @@ import forestry.core.items.EnumElectronTube; import forestry.core.network.IPacketRegistry; import forestry.core.recipes.RecipeUtil; import forestry.mail.blocks.BlockRegistryMail; -import forestry.mail.blocks.BlockTypeMail; import forestry.mail.commands.CommandMail; import forestry.mail.items.EnumStampDefinition; import forestry.mail.items.ItemRegistryMail; @@ -67,8 +67,6 @@ public class PluginMail extends BlankForestryPlugin { if (Config.mailAlertEnabled) { MinecraftForge.EVENT_BUS.register(new EventHandlerMailAlert()); } - - blocks.mail.addDefinitions(BlockTypeMail.VALUES); } // TODO: Buildcraft for 1.9 @@ -81,7 +79,9 @@ public class PluginMail extends BlankForestryPlugin { public void doInit() { super.doInit(); - blocks.mail.init(); + blocks.mailbox.init(); + blocks.tradeStation.init(); + blocks.stampCollector.init(); } @Override @@ -136,7 +136,7 @@ public class PluginMail extends BlankForestryPlugin { RecipeUtil.addShapelessRecipe(items.catalogue.getItemStack(), items.stamps.getWildcard(), new ItemStack(Items.BOOK)); - RecipeUtil.addRecipe(blocks.mail.get(BlockTypeMail.MAILBOX), + RecipeUtil.addRecipe(new ItemStack(blocks.mailbox), " # ", "#Y#", "XXX", @@ -144,7 +144,7 @@ public class PluginMail extends BlankForestryPlugin { 'X', "chestWood", 'Y', PluginCore.items.sturdyCasing); - RecipeUtil.addRecipe(blocks.mail.get(BlockTypeMail.TRADE_STATION), + RecipeUtil.addRecipe(new ItemStack(blocks.tradeStation), "Z#Z", "#Y#", "XWX", diff --git a/src/main/java/forestry/mail/blocks/BlockMail.java b/src/main/java/forestry/mail/blocks/BlockMail.java index 6bfd613a8..5e71a4c32 100644 --- a/src/main/java/forestry/mail/blocks/BlockMail.java +++ b/src/main/java/forestry/mail/blocks/BlockMail.java @@ -13,7 +13,7 @@ package forestry.mail.blocks; import forestry.core.blocks.BlockBase; public class BlockMail extends BlockBase { - public BlockMail() { - super(BlockTypeMail.class); + public BlockMail(BlockTypeMail blockType) { + super(blockType); } } diff --git a/src/main/java/forestry/mail/blocks/BlockRegistryMail.java b/src/main/java/forestry/mail/blocks/BlockRegistryMail.java index fc3f7e54e..80e7eef3a 100644 --- a/src/main/java/forestry/mail/blocks/BlockRegistryMail.java +++ b/src/main/java/forestry/mail/blocks/BlockRegistryMail.java @@ -14,10 +14,18 @@ import forestry.core.blocks.BlockRegistry; import forestry.core.items.ItemBlockForestry; public class BlockRegistryMail extends BlockRegistry { - public final BlockMail mail; + public final BlockMail mailbox; + public final BlockMail tradeStation; + public final BlockMail stampCollector; public BlockRegistryMail() { - mail = new BlockMail(); - registerBlock(mail, new ItemBlockForestry(mail), "mail"); + mailbox = new BlockMail(BlockTypeMail.MAILBOX); + registerBlock(mailbox, new ItemBlockForestry(mailbox), "mailbox"); + + tradeStation = new BlockMail(BlockTypeMail.TRADE_STATION); + registerBlock(tradeStation, new ItemBlockForestry(tradeStation), "trade_station"); + + stampCollector = new BlockMail(BlockTypeMail.PHILATELIST); + registerBlock(stampCollector, new ItemBlockForestry(stampCollector), "stamp_collector"); } } diff --git a/src/main/java/forestry/mail/blocks/BlockTypeMail.java b/src/main/java/forestry/mail/blocks/BlockTypeMail.java index c13297af2..8576170ea 100644 --- a/src/main/java/forestry/mail/blocks/BlockTypeMail.java +++ b/src/main/java/forestry/mail/blocks/BlockTypeMail.java @@ -21,17 +21,17 @@ import forestry.mail.tiles.TileStampCollector; import forestry.mail.tiles.TileTrader; public enum BlockTypeMail implements IBlockType { - MAILBOX(0, TileMailbox.class, "mailbox"), - TRADE_STATION(1, TileTrader.class, "trade_station"), - PHILATELIST(2, TileStampCollector.class, "stamp_collector"); + MAILBOX(TileMailbox.class, "mailbox"), + TRADE_STATION(TileTrader.class, "trade_station"), + PHILATELIST(TileStampCollector.class, "stamp_collector"); public static final BlockTypeMail[] VALUES = values(); @Nonnull private final IMachineProperties machineProperties; - BlockTypeMail(int meta, @Nonnull Class teClass, @Nonnull String name) { - this.machineProperties = new MachineProperties<>(meta, teClass, name); + BlockTypeMail(@Nonnull Class teClass, @Nonnull String name) { + this.machineProperties = new MachineProperties<>(teClass, name); } @Nonnull diff --git a/src/main/java/forestry/plugins/compat/BlockRegistryIC2.java b/src/main/java/forestry/plugins/compat/BlockRegistryIC2.java new file mode 100644 index 000000000..0230afdbb --- /dev/null +++ b/src/main/java/forestry/plugins/compat/BlockRegistryIC2.java @@ -0,0 +1,19 @@ +package forestry.plugins.compat; + +import forestry.core.blocks.BlockRegistry; +import forestry.energy.blocks.BlockEngine; +import forestry.energy.blocks.BlockTypeEngine; +import forestry.energy.items.ItemEngine; + +public class BlockRegistryIC2 extends BlockRegistry { + public final BlockEngine electricalEngine; + public final BlockEngine generator; + + public BlockRegistryIC2() { + electricalEngine = new BlockEngine(BlockTypeEngine.ELECTRICAL); + registerBlock(electricalEngine, new ItemEngine(electricalEngine), "electricalEngine"); + + generator = new BlockEngine(BlockTypeEngine.GENERATOR); + registerBlock(generator, new ItemEngine(generator), "generator"); + } +} diff --git a/src/main/java/forestry/plugins/compat/PluginIC2.java b/src/main/java/forestry/plugins/compat/PluginIC2.java index a91acf5fd..366afbc99 100644 --- a/src/main/java/forestry/plugins/compat/PluginIC2.java +++ b/src/main/java/forestry/plugins/compat/PluginIC2.java @@ -32,6 +32,8 @@ public class PluginIC2 extends BlankForestryPlugin { public static ItemStack rubberWood; public static ItemStack resin; + public BlockRegistryIC2 blocks; + public PluginIC2() { if (PluginIC2.instance == null) { PluginIC2.instance = this; @@ -100,6 +102,9 @@ public class PluginIC2 extends BlankForestryPlugin { // Circuit.energyElectricEfficiency1 = new CircuitElectricEfficiency("electric.efficiency.1"); // Circuit.energyElectricBoost1 = new CircuitElectricBoost("electric.boost.1", 2, 7, 20); // Circuit.energyElectricBoost2 = new CircuitElectricBoost("electric.boost.2", 2, 15, 40); + // + // blocks.electricalEngine.init(); + // blocks.generator.init(); // } // // @Override @@ -266,5 +271,11 @@ public class PluginIC2 extends BlankForestryPlugin { // 'Y', "gearTin", // 'V', Blocks.PISTON); // } + // } + // + // @Override + // public void registerItemsAndBlocks() { + // super.registerItemsAndBlocks(); + // blocks = new BlockRegistryIC2(); // } } diff --git a/src/main/java/forestry/storage/PluginStorage.java b/src/main/java/forestry/storage/PluginStorage.java index e02c2827b..47ea2ddce 100644 --- a/src/main/java/forestry/storage/PluginStorage.java +++ b/src/main/java/forestry/storage/PluginStorage.java @@ -62,7 +62,6 @@ import forestry.core.utils.Log; import forestry.core.utils.Translator; import forestry.lepidopterology.PluginLepidopterology; import forestry.lepidopterology.blocks.BlockRegistryLepidopterology; -import forestry.lepidopterology.blocks.BlockTypeLepidopterologyTesr; import forestry.plugins.BlankForestryPlugin; import forestry.plugins.ForestryPlugin; import forestry.plugins.ForestryPluginUids; @@ -448,12 +447,12 @@ public class PluginStorage extends BlankForestryPlugin { public void registerRecipes() { BlockRegistryApiculture beeBlocks = PluginApiculture.blocks; if (items.apiaristBackpack != null && beeBlocks != null) { - addBackpackRecipe(items.apiaristBackpack, "stickWood", beeBlocks.apicultureChest); + addBackpackRecipe(items.apiaristBackpack, "stickWood", beeBlocks.beeChest); } BlockRegistryLepidopterology butterflyBlocks = PluginLepidopterology.blocks; if (items.lepidopteristBackpack != null && butterflyBlocks != null) { - ItemStack chest = butterflyBlocks.lepidopterology.get(BlockTypeLepidopterologyTesr.LEPICHEST); + ItemStack chest = new ItemStack(butterflyBlocks.butterflyChest); addBackpackRecipe(items.lepidopteristBackpack, "stickWood", chest); } diff --git a/src/main/resources/assets/forestry/blockstates/apiary.json b/src/main/resources/assets/forestry/blockstates/apiary.json new file mode 100644 index 000000000..e83728659 --- /dev/null +++ b/src/main/resources/assets/forestry/blockstates/apiary.json @@ -0,0 +1,8 @@ +{ + "variants": { + "facing=north": { "model": "forestry:apiary" }, + "facing=east": { "model": "forestry:apiary", "y": 90 }, + "facing=south": { "model": "forestry:apiary", "y": 180 }, + "facing=west": { "model": "forestry:apiary", "y": -90 } + } +} diff --git a/src/main/resources/assets/forestry/blockstates/apiculture_apiary.json b/src/main/resources/assets/forestry/blockstates/apiculture_apiary.json deleted file mode 100644 index 58a3beb28..000000000 --- a/src/main/resources/assets/forestry/blockstates/apiculture_apiary.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "variants": { - "face=north": { "model": "forestry:apiculture_apiary" }, - "face=east": { "model": "forestry:apiculture_apiary", "y": 90 }, - "face=south": { "model": "forestry:apiculture_apiary", "y": 180 }, - "face=west": { "model": "forestry:apiculture_apiary", "y": -90 } - } -} diff --git a/src/main/resources/assets/forestry/blockstates/apiculture_bee_house.json b/src/main/resources/assets/forestry/blockstates/apiculture_bee_house.json deleted file mode 100644 index 26cc3d59c..000000000 --- a/src/main/resources/assets/forestry/blockstates/apiculture_bee_house.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "variants": { - "face=north": { "model": "forestry:apiculture_bee_house" }, - "face=east": { "model": "forestry:apiculture_bee_house", "y": 90 }, - "face=south": { "model": "forestry:apiculture_bee_house", "y": 180 }, - "face=west": { "model": "forestry:apiculture_bee_house", "y": -90 } - } -} diff --git a/src/main/resources/assets/forestry/blockstates/bee_house.json b/src/main/resources/assets/forestry/blockstates/bee_house.json new file mode 100644 index 000000000..6c3f600d8 --- /dev/null +++ b/src/main/resources/assets/forestry/blockstates/bee_house.json @@ -0,0 +1,8 @@ +{ + "variants": { + "facing=north": { "model": "forestry:bee_house" }, + "facing=east": { "model": "forestry:bee_house", "y": 90 }, + "facing=south": { "model": "forestry:bee_house", "y": 180 }, + "facing=west": { "model": "forestry:bee_house", "y": -90 } + } +} diff --git a/src/main/resources/assets/forestry/blockstates/fabricator.json b/src/main/resources/assets/forestry/blockstates/fabricator.json new file mode 100644 index 000000000..84e2a5e1b --- /dev/null +++ b/src/main/resources/assets/forestry/blockstates/fabricator.json @@ -0,0 +1,8 @@ +{ + "variants": { + "facing=north": { "model": "forestry:fabricator" }, + "facing=east": { "model": "forestry:fabricator", "y": 90 }, + "facing=south": { "model": "forestry:fabricator", "y": 180 }, + "facing=west": { "model": "forestry:fabricator", "y": -90 } + } +} diff --git a/src/main/resources/assets/forestry/blockstates/factory2_fabricator.json b/src/main/resources/assets/forestry/blockstates/factory2_fabricator.json deleted file mode 100644 index 8ed939bce..000000000 --- a/src/main/resources/assets/forestry/blockstates/factory2_fabricator.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "variants": { - "face=north": { "model": "forestry:factory2_fabricator" }, - "face=east": { "model": "forestry:factory2_fabricator", "y": 90 }, - "face=south": { "model": "forestry:factory2_fabricator", "y": 180 }, - "face=west": { "model": "forestry:factory2_fabricator", "y": -90 } - } -} diff --git a/src/main/resources/assets/forestry/blockstates/factory2_raintank.json b/src/main/resources/assets/forestry/blockstates/factory2_raintank.json deleted file mode 100644 index c358171a2..000000000 --- a/src/main/resources/assets/forestry/blockstates/factory2_raintank.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "variants": { - "face=north": { "model": "forestry:factory2_raintank" }, - "face=east": { "model": "forestry:factory2_raintank", "y": 90 }, - "face=south": { "model": "forestry:factory2_raintank", "y": 180 }, - "face=west": { "model": "forestry:factory2_raintank", "y": -90 } - } -} diff --git a/src/main/resources/assets/forestry/blockstates/factory2_worktable.json b/src/main/resources/assets/forestry/blockstates/factory2_worktable.json deleted file mode 100644 index 1474f5998..000000000 --- a/src/main/resources/assets/forestry/blockstates/factory2_worktable.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "variants": { - "face=north": { "model": "forestry:factory2_worktable" }, - "face=east": { "model": "forestry:factory2_worktable", "y": 90 }, - "face=south": { "model": "forestry:factory2_worktable", "y": 180 }, - "face=west": { "model": "forestry:factory2_worktable", "y": -90 } - } -} diff --git a/src/main/resources/assets/forestry/blockstates/mail_mailbox.json b/src/main/resources/assets/forestry/blockstates/mail_mailbox.json deleted file mode 100644 index c8354cf9c..000000000 --- a/src/main/resources/assets/forestry/blockstates/mail_mailbox.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "variants": { - "face=north": { "model": "forestry:mail_mailbox" }, - "face=east": { "model": "forestry:mail_mailbox", "y": 90 }, - "face=south": { "model": "forestry:mail_mailbox", "y": 180 }, - "face=west": { "model": "forestry:mail_mailbox", "y": -90 } - } -} diff --git a/src/main/resources/assets/forestry/blockstates/mail_philatelist.json b/src/main/resources/assets/forestry/blockstates/mail_philatelist.json deleted file mode 100644 index 6a8f7dc0e..000000000 --- a/src/main/resources/assets/forestry/blockstates/mail_philatelist.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "variants": { - "face=north": { "model": "forestry:mail_philatelist" }, - "face=east": { "model": "forestry:mail_philatelist", "y": 90 }, - "face=south": { "model": "forestry:mail_philatelist", "y": 180 }, - "face=west": { "model": "forestry:mail_philatelist", "y": -90 } - } -} diff --git a/src/main/resources/assets/forestry/blockstates/mail_stamp_collector.json b/src/main/resources/assets/forestry/blockstates/mail_stamp_collector.json deleted file mode 100644 index bba61e34a..000000000 --- a/src/main/resources/assets/forestry/blockstates/mail_stamp_collector.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "variants": { - "face=north": { "model": "forestry:mail_stamp_collector" }, - "face=east": { "model": "forestry:mail_stamp_collector", "y": 90 }, - "face=south": { "model": "forestry:mail_stamp_collector", "y": 180 }, - "face=west": { "model": "forestry:mail_stamp_collector", "y": -90 } - } -} diff --git a/src/main/resources/assets/forestry/blockstates/mail_trade_station.json b/src/main/resources/assets/forestry/blockstates/mail_trade_station.json deleted file mode 100644 index 54a923be4..000000000 --- a/src/main/resources/assets/forestry/blockstates/mail_trade_station.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "variants": { - "face=north": { "model": "forestry:mail_trade_station" }, - "face=east": { "model": "forestry:mail_trade_station", "y": 90 }, - "face=south": { "model": "forestry:mail_trade_station", "y": 180 }, - "face=west": { "model": "forestry:mail_trade_station", "y": -90 } - } -} diff --git a/src/main/resources/assets/forestry/blockstates/mailbox.json b/src/main/resources/assets/forestry/blockstates/mailbox.json new file mode 100644 index 000000000..2a1311708 --- /dev/null +++ b/src/main/resources/assets/forestry/blockstates/mailbox.json @@ -0,0 +1,8 @@ +{ + "variants": { + "facing=north": { "model": "forestry:mailbox" }, + "facing=east": { "model": "forestry:mailbox", "y": 90 }, + "facing=south": { "model": "forestry:mailbox", "y": 180 }, + "facing=west": { "model": "forestry:mailbox", "y": -90 } + } +} diff --git a/src/main/resources/assets/forestry/blockstates/raintank.json b/src/main/resources/assets/forestry/blockstates/raintank.json new file mode 100644 index 000000000..54784bfd2 --- /dev/null +++ b/src/main/resources/assets/forestry/blockstates/raintank.json @@ -0,0 +1,8 @@ +{ + "variants": { + "facing=north": { "model": "forestry:raintank" }, + "facing=east": { "model": "forestry:raintank", "y": 90 }, + "facing=south": { "model": "forestry:raintank", "y": 180 }, + "facing=west": { "model": "forestry:raintank", "y": -90 } + } +} diff --git a/src/main/resources/assets/forestry/blockstates/stamp_collector.json b/src/main/resources/assets/forestry/blockstates/stamp_collector.json new file mode 100644 index 000000000..00d914c7b --- /dev/null +++ b/src/main/resources/assets/forestry/blockstates/stamp_collector.json @@ -0,0 +1,8 @@ +{ + "variants": { + "facing=north": { "model": "forestry:stamp_collector" }, + "facing=east": { "model": "forestry:stamp_collector", "y": 90 }, + "facing=south": { "model": "forestry:stamp_collector", "y": 180 }, + "facing=west": { "model": "forestry:stamp_collector", "y": -90 } + } +} diff --git a/src/main/resources/assets/forestry/blockstates/trade_station.json b/src/main/resources/assets/forestry/blockstates/trade_station.json new file mode 100644 index 000000000..fc1b3e751 --- /dev/null +++ b/src/main/resources/assets/forestry/blockstates/trade_station.json @@ -0,0 +1,8 @@ +{ + "variants": { + "facing=north": { "model": "forestry:trade_station" }, + "facing=east": { "model": "forestry:trade_station", "y": 90 }, + "facing=south": { "model": "forestry:trade_station", "y": 180 }, + "facing=west": { "model": "forestry:trade_station", "y": -90 } + } +} diff --git a/src/main/resources/assets/forestry/blockstates/worktable.json b/src/main/resources/assets/forestry/blockstates/worktable.json new file mode 100644 index 000000000..5c11b7672 --- /dev/null +++ b/src/main/resources/assets/forestry/blockstates/worktable.json @@ -0,0 +1,8 @@ +{ + "variants": { + "facing=north": { "model": "forestry:worktable" }, + "facing=east": { "model": "forestry:worktable", "y": 90 }, + "facing=south": { "model": "forestry:worktable", "y": 180 }, + "facing=west": { "model": "forestry:worktable", "y": -90 } + } +} diff --git a/src/main/resources/assets/forestry/models/block/apiculture_apiary.json b/src/main/resources/assets/forestry/models/block/apiary.json similarity index 100% rename from src/main/resources/assets/forestry/models/block/apiculture_apiary.json rename to src/main/resources/assets/forestry/models/block/apiary.json diff --git a/src/main/resources/assets/forestry/models/block/apiculture_bee_house.json b/src/main/resources/assets/forestry/models/block/bee_house.json similarity index 100% rename from src/main/resources/assets/forestry/models/block/apiculture_bee_house.json rename to src/main/resources/assets/forestry/models/block/bee_house.json diff --git a/src/main/resources/assets/forestry/models/block/factory2_fabricator.json b/src/main/resources/assets/forestry/models/block/fabricator.json similarity index 100% rename from src/main/resources/assets/forestry/models/block/factory2_fabricator.json rename to src/main/resources/assets/forestry/models/block/fabricator.json diff --git a/src/main/resources/assets/forestry/models/block/mail_mailbox.json b/src/main/resources/assets/forestry/models/block/mailbox.json similarity index 100% rename from src/main/resources/assets/forestry/models/block/mail_mailbox.json rename to src/main/resources/assets/forestry/models/block/mailbox.json diff --git a/src/main/resources/assets/forestry/models/block/factory2_raintank.json b/src/main/resources/assets/forestry/models/block/raintank.json similarity index 100% rename from src/main/resources/assets/forestry/models/block/factory2_raintank.json rename to src/main/resources/assets/forestry/models/block/raintank.json diff --git a/src/main/resources/assets/forestry/models/block/mail_stamp_collector.json b/src/main/resources/assets/forestry/models/block/stamp_collector.json similarity index 100% rename from src/main/resources/assets/forestry/models/block/mail_stamp_collector.json rename to src/main/resources/assets/forestry/models/block/stamp_collector.json diff --git a/src/main/resources/assets/forestry/models/block/mail_trade_station.json b/src/main/resources/assets/forestry/models/block/trade_station.json similarity index 100% rename from src/main/resources/assets/forestry/models/block/mail_trade_station.json rename to src/main/resources/assets/forestry/models/block/trade_station.json diff --git a/src/main/resources/assets/forestry/models/block/factory2_worktable.json b/src/main/resources/assets/forestry/models/block/worktable.json similarity index 100% rename from src/main/resources/assets/forestry/models/block/factory2_worktable.json rename to src/main/resources/assets/forestry/models/block/worktable.json diff --git a/src/main/resources/assets/forestry/models/item/core_analyzer.json b/src/main/resources/assets/forestry/models/item/analyzer.json similarity index 100% rename from src/main/resources/assets/forestry/models/item/core_analyzer.json rename to src/main/resources/assets/forestry/models/item/analyzer.json diff --git a/src/main/resources/assets/forestry/models/item/mail_mailbox.json b/src/main/resources/assets/forestry/models/item/apiary.json similarity index 81% rename from src/main/resources/assets/forestry/models/item/mail_mailbox.json rename to src/main/resources/assets/forestry/models/item/apiary.json index 31d02e3b7..057a62a7c 100644 --- a/src/main/resources/assets/forestry/models/item/mail_mailbox.json +++ b/src/main/resources/assets/forestry/models/item/apiary.json @@ -1,5 +1,5 @@ { - "parent": "forestry:block/mail_mailbox", + "parent": "forestry:block/apiary", "display": { "thirdperson": { "rotation": [ 10, -45, 170 ], diff --git a/src/main/resources/assets/forestry/models/item/apiculture_bee_house.json b/src/main/resources/assets/forestry/models/item/apiculture_bee_house.json deleted file mode 100644 index 8470c9cfd..000000000 --- a/src/main/resources/assets/forestry/models/item/apiculture_bee_house.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "forestry:block/apiculture_bee_house", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} diff --git a/src/main/resources/assets/forestry/models/item/apicultureChest_api_chest.json b/src/main/resources/assets/forestry/models/item/bee_chest.json similarity index 100% rename from src/main/resources/assets/forestry/models/item/apicultureChest_api_chest.json rename to src/main/resources/assets/forestry/models/item/bee_chest.json diff --git a/src/main/resources/assets/forestry/models/item/apiculture_apiary.json b/src/main/resources/assets/forestry/models/item/bee_house.json similarity index 79% rename from src/main/resources/assets/forestry/models/item/apiculture_apiary.json rename to src/main/resources/assets/forestry/models/item/bee_house.json index c665d8509..3eab44cdf 100644 --- a/src/main/resources/assets/forestry/models/item/apiculture_apiary.json +++ b/src/main/resources/assets/forestry/models/item/bee_house.json @@ -1,5 +1,5 @@ { - "parent": "forestry:block/apiculture_apiary", + "parent": "forestry:block/bee_house", "display": { "thirdperson": { "rotation": [ 10, -45, 170 ], diff --git a/src/main/resources/assets/forestry/models/item/core_escritoire.json b/src/main/resources/assets/forestry/models/item/bottler.json similarity index 100% rename from src/main/resources/assets/forestry/models/item/core_escritoire.json rename to src/main/resources/assets/forestry/models/item/bottler.json diff --git a/src/main/resources/assets/forestry/models/item/arboriculture_arb_chest.json b/src/main/resources/assets/forestry/models/item/butterfly_chest.json similarity index 100% rename from src/main/resources/assets/forestry/models/item/arboriculture_arb_chest.json rename to src/main/resources/assets/forestry/models/item/butterfly_chest.json diff --git a/src/main/resources/assets/forestry/models/item/factory_bottler.json b/src/main/resources/assets/forestry/models/item/carpenter.json similarity index 100% rename from src/main/resources/assets/forestry/models/item/factory_bottler.json rename to src/main/resources/assets/forestry/models/item/carpenter.json diff --git a/src/main/resources/assets/forestry/models/item/factory_carpenter.json b/src/main/resources/assets/forestry/models/item/centrifuge.json similarity index 100% rename from src/main/resources/assets/forestry/models/item/factory_carpenter.json rename to src/main/resources/assets/forestry/models/item/centrifuge.json diff --git a/src/main/resources/assets/forestry/models/item/factory_centrifuge.json b/src/main/resources/assets/forestry/models/item/escritoire.json similarity index 100% rename from src/main/resources/assets/forestry/models/item/factory_centrifuge.json rename to src/main/resources/assets/forestry/models/item/escritoire.json diff --git a/src/main/resources/assets/forestry/models/item/factory2_raintank.json b/src/main/resources/assets/forestry/models/item/fabricator.json similarity index 79% rename from src/main/resources/assets/forestry/models/item/factory2_raintank.json rename to src/main/resources/assets/forestry/models/item/fabricator.json index 9f740839d..1de1a69ae 100644 --- a/src/main/resources/assets/forestry/models/item/factory2_raintank.json +++ b/src/main/resources/assets/forestry/models/item/fabricator.json @@ -1,5 +1,5 @@ { - "parent": "forestry:block/factory2_raintank", + "parent": "forestry:block/fabricator", "display": { "thirdperson": { "rotation": [ 10, -45, 170 ], diff --git a/src/main/resources/assets/forestry/models/item/factory2_fabricator.json b/src/main/resources/assets/forestry/models/item/factory2_fabricator.json deleted file mode 100644 index 9c5c5f55a..000000000 --- a/src/main/resources/assets/forestry/models/item/factory2_fabricator.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "forestry:block/factory2_fabricator", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} diff --git a/src/main/resources/assets/forestry/models/item/factory_fermenter.json b/src/main/resources/assets/forestry/models/item/fermenter.json similarity index 100% rename from src/main/resources/assets/forestry/models/item/factory_fermenter.json rename to src/main/resources/assets/forestry/models/item/fermenter.json diff --git a/src/main/resources/assets/forestry/models/item/mail_stamp_collector.json b/src/main/resources/assets/forestry/models/item/mail_stamp_collector.json deleted file mode 100644 index 6b0c63b13..000000000 --- a/src/main/resources/assets/forestry/models/item/mail_stamp_collector.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "forestry:block/mail_stamp_collector", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} diff --git a/src/main/resources/assets/forestry/models/item/mail_trade_station.json b/src/main/resources/assets/forestry/models/item/mail_trade_station.json deleted file mode 100644 index b888aed3e..000000000 --- a/src/main/resources/assets/forestry/models/item/mail_trade_station.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "forestry:block/mail_trade_station", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} diff --git a/src/main/resources/assets/forestry/models/item/factory2_worktable.json b/src/main/resources/assets/forestry/models/item/mailbox.json similarity index 79% rename from src/main/resources/assets/forestry/models/item/factory2_worktable.json rename to src/main/resources/assets/forestry/models/item/mailbox.json index ce0e82a5e..bd0d0c644 100644 --- a/src/main/resources/assets/forestry/models/item/factory2_worktable.json +++ b/src/main/resources/assets/forestry/models/item/mailbox.json @@ -1,5 +1,5 @@ { - "parent": "forestry:block/factory2_worktable", + "parent": "forestry:block/mailbox", "display": { "thirdperson": { "rotation": [ 10, -45, 170 ], diff --git a/src/main/resources/assets/forestry/models/item/factory_moistener.json b/src/main/resources/assets/forestry/models/item/moistener.json similarity index 100% rename from src/main/resources/assets/forestry/models/item/factory_moistener.json rename to src/main/resources/assets/forestry/models/item/moistener.json diff --git a/src/main/resources/assets/forestry/models/item/factory_rainmaker.json b/src/main/resources/assets/forestry/models/item/rainmaker.json similarity index 100% rename from src/main/resources/assets/forestry/models/item/factory_rainmaker.json rename to src/main/resources/assets/forestry/models/item/rainmaker.json diff --git a/src/main/resources/assets/forestry/models/item/raintank.json b/src/main/resources/assets/forestry/models/item/raintank.json new file mode 100644 index 000000000..dce2dcdd9 --- /dev/null +++ b/src/main/resources/assets/forestry/models/item/raintank.json @@ -0,0 +1,10 @@ +{ + "parent": "forestry:block/raintank", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/src/main/resources/assets/forestry/models/item/factory_squeezer.json b/src/main/resources/assets/forestry/models/item/squeezer.json similarity index 100% rename from src/main/resources/assets/forestry/models/item/factory_squeezer.json rename to src/main/resources/assets/forestry/models/item/squeezer.json diff --git a/src/main/resources/assets/forestry/models/item/stamp_collector.json b/src/main/resources/assets/forestry/models/item/stamp_collector.json new file mode 100644 index 000000000..3b4d5be15 --- /dev/null +++ b/src/main/resources/assets/forestry/models/item/stamp_collector.json @@ -0,0 +1,10 @@ +{ + "parent": "forestry:block/stamp_collector", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/src/main/resources/assets/forestry/models/item/factory_still.json b/src/main/resources/assets/forestry/models/item/still.json similarity index 100% rename from src/main/resources/assets/forestry/models/item/factory_still.json rename to src/main/resources/assets/forestry/models/item/still.json diff --git a/src/main/resources/assets/forestry/models/item/trade_station.json b/src/main/resources/assets/forestry/models/item/trade_station.json new file mode 100644 index 000000000..8b31da477 --- /dev/null +++ b/src/main/resources/assets/forestry/models/item/trade_station.json @@ -0,0 +1,10 @@ +{ + "parent": "forestry:block/trade_station", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/src/main/resources/assets/forestry/models/item/lepidopterology_lepi_chest.json b/src/main/resources/assets/forestry/models/item/tree_chest.json similarity index 100% rename from src/main/resources/assets/forestry/models/item/lepidopterology_lepi_chest.json rename to src/main/resources/assets/forestry/models/item/tree_chest.json diff --git a/src/main/resources/assets/forestry/models/item/worktable.json b/src/main/resources/assets/forestry/models/item/worktable.json new file mode 100644 index 000000000..97f84b99e --- /dev/null +++ b/src/main/resources/assets/forestry/models/item/worktable.json @@ -0,0 +1,10 @@ +{ + "parent": "forestry:block/worktable", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +}