From 120721564ef9731e5d24e2f1b19e69c789d9e80c Mon Sep 17 00:00:00 2001 From: Flanks255 <32142731+Flanks255@users.noreply.github.com> Date: Wed, 19 Oct 2022 09:57:56 -0500 Subject: [PATCH] Crushers and furnaces keep energy. Fixed crusher crash. --- src/generated/resources/.cache/cache | 6 +++--- .../loot_tables/blocks/crusher.json | 13 +++++++++++++ .../loot_tables/blocks/crusher_double.json | 13 +++++++++++++ .../loot_tables/blocks/powered_furnace.json | 13 +++++++++++++ .../actuallyadditions/data/LootTableGenerator.java | 6 +++--- .../mod/blocks/ActuallyBlocks.java | 6 +++--- .../actuallyadditions/mod/blocks/BlockCrusher.java | 2 +- .../assets/actuallyadditions/lang/en_us.json | 4 ++-- 8 files changed, 51 insertions(+), 12 deletions(-) diff --git a/src/generated/resources/.cache/cache b/src/generated/resources/.cache/cache index bc67f7f74..7ce86fe5f 100644 --- a/src/generated/resources/.cache/cache +++ b/src/generated/resources/.cache/cache @@ -480,8 +480,8 @@ f3df22f203e8c00ee7ee004bb9b4edfd522f069a data/actuallyadditions/loot_tables/bloc bf7743c27757cf5b0dbab9b3e15d1d5ca1ece818 data/actuallyadditions/loot_tables/blocks/coal_generator.json 66ee33930c8392b29710ce2bc117f99907e336df data/actuallyadditions/loot_tables/blocks/coffee.json 3285202e3f840d091b8d85dc2c721199fcc96240 data/actuallyadditions/loot_tables/blocks/coffee_machine.json -98c2198bf7df995a8c43f08101eb2021a62e1dec data/actuallyadditions/loot_tables/blocks/crusher.json -93c16ed7d46e44ceafdc32c2a440f98b8c805723 data/actuallyadditions/loot_tables/blocks/crusher_double.json +317d0377327250f2fe15ff549a1ffa1b7bdade14 data/actuallyadditions/loot_tables/blocks/crusher.json +b087c6f44cf0236f52471ec54c026ee30ba0d273 data/actuallyadditions/loot_tables/blocks/crusher_double.json 6336ca572b8d81f6e06b43bb925b48bb915b6574 data/actuallyadditions/loot_tables/blocks/diamatine_crystal_block.json b9ed4007fec7a382a02b08b231f072df6aa40049 data/actuallyadditions/loot_tables/blocks/diamatine_crystal_cluster.json 7476dbc0cbb3c1a8ce5a3c1562f73fcfb4adcd10 data/actuallyadditions/loot_tables/blocks/display_stand.json @@ -559,7 +559,7 @@ d6c0f113ea7c3cc0e8c3a11860792966d516211b data/actuallyadditions/loot_tables/bloc a365f2f0d80e070d281a7b839c961d36f115abeb data/actuallyadditions/loot_tables/blocks/phantom_redstoneface.json 13f0d4587dac4822a26fd063a22f6f46c83e9af6 data/actuallyadditions/loot_tables/blocks/placer.json 6d9a73f94513ed92c1697d25c5d89145b016ab5d data/actuallyadditions/loot_tables/blocks/player_interface.json -25a194a62fcad1b0b86540efbe6ca81757a3408a data/actuallyadditions/loot_tables/blocks/powered_furnace.json +bb5b9781aa9c64a1330eff6d7bb3e6c2c7f3a645 data/actuallyadditions/loot_tables/blocks/powered_furnace.json a92f9584164335ecbcf769bc668289d76cea5d6c data/actuallyadditions/loot_tables/blocks/ranged_collector.json d497fdb4936e1f3fdaa556da79e39f6fcbb405ed data/actuallyadditions/loot_tables/blocks/restonia_crystal_block.json 7d025b370ad83e847619627002ca835901faf235 data/actuallyadditions/loot_tables/blocks/restonia_crystal_cluster.json diff --git a/src/generated/resources/data/actuallyadditions/loot_tables/blocks/crusher.json b/src/generated/resources/data/actuallyadditions/loot_tables/blocks/crusher.json index 1906da531..d3cc6a7ff 100644 --- a/src/generated/resources/data/actuallyadditions/loot_tables/blocks/crusher.json +++ b/src/generated/resources/data/actuallyadditions/loot_tables/blocks/crusher.json @@ -13,6 +13,19 @@ { "condition": "minecraft:survives_explosion" } + ], + "functions": [ + { + "function": "minecraft:copy_nbt", + "source": "block_entity", + "ops": [ + { + "source": "Energy", + "target": "BlockEntityTag.Energy", + "op": "replace" + } + ] + } ] } ] diff --git a/src/generated/resources/data/actuallyadditions/loot_tables/blocks/crusher_double.json b/src/generated/resources/data/actuallyadditions/loot_tables/blocks/crusher_double.json index 7270b7dd8..6d67d9a3f 100644 --- a/src/generated/resources/data/actuallyadditions/loot_tables/blocks/crusher_double.json +++ b/src/generated/resources/data/actuallyadditions/loot_tables/blocks/crusher_double.json @@ -13,6 +13,19 @@ { "condition": "minecraft:survives_explosion" } + ], + "functions": [ + { + "function": "minecraft:copy_nbt", + "source": "block_entity", + "ops": [ + { + "source": "Energy", + "target": "BlockEntityTag.Energy", + "op": "replace" + } + ] + } ] } ] diff --git a/src/generated/resources/data/actuallyadditions/loot_tables/blocks/powered_furnace.json b/src/generated/resources/data/actuallyadditions/loot_tables/blocks/powered_furnace.json index 33d71a09e..da1571118 100644 --- a/src/generated/resources/data/actuallyadditions/loot_tables/blocks/powered_furnace.json +++ b/src/generated/resources/data/actuallyadditions/loot_tables/blocks/powered_furnace.json @@ -13,6 +13,19 @@ { "condition": "minecraft:survives_explosion" } + ], + "functions": [ + { + "function": "minecraft:copy_nbt", + "source": "block_entity", + "ops": [ + { + "source": "Energy", + "target": "BlockEntityTag.Energy", + "op": "replace" + } + ] + } ] } ] diff --git a/src/main/java/de/ellpeck/actuallyadditions/data/LootTableGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/data/LootTableGenerator.java index 74aeff35e..ab4469e69 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/data/LootTableGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/data/LootTableGenerator.java @@ -57,6 +57,9 @@ public class LootTableGenerator extends LootTableProvider { dropKeepEnergy(ActuallyBlocks.DISPLAY_STAND); dropKeepEnergy(ActuallyBlocks.COAL_GENERATOR); dropKeepEnergy(ActuallyBlocks.OIL_GENERATOR); + dropKeepEnergy(ActuallyBlocks.CRUSHER); + dropKeepEnergy(ActuallyBlocks.CRUSHER_DOUBLE); + dropKeepEnergy(ActuallyBlocks.POWERED_FURNACE); this.dropSelf(ActuallyBlocks.BATTERY_BOX.get()); this.dropSelf(ActuallyBlocks.ITEM_INTERFACE_HOPPING.get()); @@ -81,9 +84,6 @@ public class LootTableGenerator extends LootTableProvider { this.dropSelf(ActuallyBlocks.PHANTOM_BREAKER.get()); this.dropSelf(ActuallyBlocks.FERMENTING_BARREL.get()); this.dropSelf(ActuallyBlocks.FEEDER.get()); - this.dropSelf(ActuallyBlocks.CRUSHER.get()); - this.dropSelf(ActuallyBlocks.CRUSHER_DOUBLE.get()); - this.dropSelf(ActuallyBlocks.POWERED_FURNACE.get()); this.dropSelf(ActuallyBlocks.HEAT_COLLECTOR.get()); this.dropSelf(ActuallyBlocks.GREENHOUSE_GLASS.get()); this.dropSelf(ActuallyBlocks.BREAKER.get()); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/ActuallyBlocks.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/ActuallyBlocks.java index 322676e5d..e0e44440e 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/ActuallyBlocks.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/ActuallyBlocks.java @@ -46,9 +46,9 @@ public final class ActuallyBlocks { // Machines public static final AABlockReg FEEDER = new AABlockReg<>("feeder", BlockFeeder::new, (b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityFeeder::new); public static final AABlockReg CRUSHER = new AABlockReg<>("crusher", () -> new BlockCrusher(false), - (b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityCrusher::new); + (b) -> new AABlockItem.BlockEntityEnergyItem(b, defaultBlockItemProperties), TileEntityCrusher::new); public static final AABlockReg CRUSHER_DOUBLE = new AABlockReg<>("crusher_double", () -> new BlockCrusher(false), - (b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityCrusherDouble::new); + (b) -> new AABlockItem.BlockEntityEnergyItem(b, defaultBlockItemProperties), TileEntityCrusherDouble::new); public static final AABlockReg ENERGIZER = new AABlockReg<>("energizer", () -> new BlockEnergizer(true), (b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityEnergizer::new); @@ -108,7 +108,7 @@ public final class ActuallyBlocks { public static final AABlockReg COFFEE_MACHINE = new AABlockReg<>("coffee_machine", BlockCoffeeMachine::new, (b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityCoffeeMachine::new); public static final AABlockReg POWERED_FURNACE = new AABlockReg<>("powered_furnace", BlockPoweredFurnace::new, - (b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityPoweredFurnace::new); + (b) -> new AABlockItem.BlockEntityEnergyItem(b, defaultBlockItemProperties), TileEntityPoweredFurnace::new); // Crystal Blocks diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCrusher.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCrusher.java index a68f9fb69..26a237e59 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCrusher.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCrusher.java @@ -83,7 +83,7 @@ public class BlockCrusher extends BlockContainerBase { @Override public BlockState getStateForPlacement(BlockItemUseContext context) { - return defaultBlockState().setValue(HORIZONTAL_FACING, context.getNearestLookingDirection().getOpposite()).setValue(LIT, false); + return defaultBlockState().setValue(HORIZONTAL_FACING, context.getHorizontalDirection().getOpposite()).setValue(LIT, false); } @Override diff --git a/src/main/resources/assets/actuallyadditions/lang/en_us.json b/src/main/resources/assets/actuallyadditions/lang/en_us.json index f1d79c6e7..99051f90f 100644 --- a/src/main/resources/assets/actuallyadditions/lang/en_us.json +++ b/src/main/resources/assets/actuallyadditions/lang/en_us.json @@ -105,7 +105,7 @@ "block.actuallyadditions.giant_chest_medium": "Medium Storage Crate", "block.actuallyadditions.giant_chest_large": "Large Storage Crate", "block.actuallyadditions.crusher": "Crusher", - "block.actuallyadditions.double_crusher": "Double Crusher", + "block.actuallyadditions.crusher_double": "Double Crusher", "block.actuallyadditions.powered_furnace": "Powered Furnace", "block.actuallyadditions.fishing_net": "Fishing Net", "block.actuallyadditions.furnace_solar": "Solar Panel", @@ -591,7 +591,7 @@ "container.actuallyadditions.inputter": "ESD", "container.actuallyadditions.inputterAdvanced": "Advanced ESD", "container.actuallyadditions.crusher": "Crusher", - "container.actuallyadditions.double_crusher": "Double Crusher", + "container.actuallyadditions.crusher_double": "Double Crusher", "container.actuallyadditions.powered_furnace": "Powered Furnace", "container.actuallyadditions.feeder": "Feeder", "container.actuallyadditions.giantChest": "Small Storage Crate",