From 8ab1a6d59c3da0c89c05ea382de6367ad0594d28 Mon Sep 17 00:00:00 2001 From: LordGrimmauld Date: Sat, 20 Jun 2020 13:18:21 +0200 Subject: [PATCH] fix piston head not dropping --- src/generated/resources/.cache/cache | 2 +- .../blocks/mechanical_piston_head.json | 2 +- .../java/com/simibubi/create/AllBlocks.java | 17 +++++++++-------- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/generated/resources/.cache/cache b/src/generated/resources/.cache/cache index f4f3cea87..26efba9c7 100644 --- a/src/generated/resources/.cache/cache +++ b/src/generated/resources/.cache/cache @@ -1883,7 +1883,7 @@ dee1e06d953c0ca4e37799aee9073fdd43a3dc76 data\create\loot_tables\blocks\mechanic 95fa2d3e9cf4aacc42617b1f5ddbf25eeb025770 data\create\loot_tables\blocks\mechanical_harvester.json b12efeeef5682966016ce6ea2d171eecd33d9667 data\create\loot_tables\blocks\mechanical_mixer.json 2599be757a55464af338ef0a01e3772690d7eaf8 data\create\loot_tables\blocks\mechanical_piston.json -205f5899101262f31f5c1a88bb7d954918d08d04 data\create\loot_tables\blocks\mechanical_piston_head.json +1087b6c6d88dc7c71ed81e1d3e180fe065e6d098 data\create\loot_tables\blocks\mechanical_piston_head.json d9e217fcc668a04ee495968f8ccf9966271b6cea data\create\loot_tables\blocks\mechanical_plough.json 0e0742d066bda87ba5cc835a4028efb99e70b2f2 data\create\loot_tables\blocks\mechanical_press.json e94a78187bcf7f235244b2c656732ba9a5821dd0 data\create\loot_tables\blocks\mechanical_pump.json diff --git a/src/generated/resources/data/create/loot_tables/blocks/mechanical_piston_head.json b/src/generated/resources/data/create/loot_tables/blocks/mechanical_piston_head.json index 78793172c..7f5453a57 100644 --- a/src/generated/resources/data/create/loot_tables/blocks/mechanical_piston_head.json +++ b/src/generated/resources/data/create/loot_tables/blocks/mechanical_piston_head.json @@ -6,7 +6,7 @@ "entries": [ { "type": "minecraft:item", - "name": "minecraft:air" + "name": "create:piston_extension_pole" } ], "conditions": [ diff --git a/src/main/java/com/simibubi/create/AllBlocks.java b/src/main/java/com/simibubi/create/AllBlocks.java index 7ec9d31b0..bd4727493 100644 --- a/src/main/java/com/simibubi/create/AllBlocks.java +++ b/src/main/java/com/simibubi/create/AllBlocks.java @@ -431,14 +431,6 @@ public class AllBlocks { .transform(BuilderTransformers.mechanicalPiston(PistonType.STICKY)) .register(); - public static final BlockEntry MECHANICAL_PISTON_HEAD = - REGISTRATE.block("mechanical_piston_head", MechanicalPistonHeadBlock::new) - .initialProperties(() -> Blocks.PISTON_HEAD) - .blockstate((c, p) -> BlockStateGen.directionalBlockIgnoresWaterlogged(c, p, state -> p.models() - .getExistingFile(p.modLoc("block/mechanical_piston/" + state.get(MechanicalPistonHeadBlock.TYPE) - .getName() + "/head")))) - .register(); - public static final BlockEntry PISTON_EXTENSION_POLE = REGISTRATE.block("piston_extension_pole", PistonExtensionPoleBlock::new) .initialProperties(() -> Blocks.PISTON_HEAD) @@ -446,6 +438,15 @@ public class AllBlocks { .simpleItem() .register(); + public static final BlockEntry MECHANICAL_PISTON_HEAD = + REGISTRATE.block("mechanical_piston_head", MechanicalPistonHeadBlock::new) + .initialProperties(() -> Blocks.PISTON_HEAD) + .loot((p, b) -> p.registerDropping(b, PISTON_EXTENSION_POLE.get())) + .blockstate((c, p) -> BlockStateGen.directionalBlockIgnoresWaterlogged(c, p, state -> p.models() + .getExistingFile(p.modLoc("block/mechanical_piston/" + state.get(MechanicalPistonHeadBlock.TYPE) + .getName() + "/head")))) + .register(); + public static final BlockEntry MECHANICAL_BEARING = REGISTRATE.block("mechanical_bearing", MechanicalBearingBlock::new) .transform(BuilderTransformers.bearing("mechanical", "gearbox"))