From 658225e318f6a4b9fe4dbfc303c1737b5d2ebeb3 Mon Sep 17 00:00:00 2001 From: IThundxr Date: Mon, 17 Feb 2025 14:47:47 -0500 Subject: [PATCH] Fortuneful Crushers - Fix Crushing Wheels not applying fortune like they should - Remove extra FIXME --- changelog.md | 3 +- .../ChainConveyorBlockEntity.java | 20 +- .../crusher/CrushingWheelBlockEntity.java | 7 +- .../advancement/AllAdvancements.java | 1014 ++++++++--------- .../mixin/LootingEnchantFunctionMixin.java | 44 + src/main/resources/create.mixins.json | 1 + 6 files changed, 570 insertions(+), 519 deletions(-) create mode 100644 src/main/java/com/simibubi/create/foundation/mixin/LootingEnchantFunctionMixin.java diff --git a/changelog.md b/changelog.md index 3ef38cdf24..77d30a46a8 100644 --- a/changelog.md +++ b/changelog.md @@ -128,7 +128,8 @@ _Now using Flywheel 1.0_ - Fixed stations voiding schedules when disassembling the train - Fixed lighting on signal block indicators - Fixed vaults and tanks rotated in place not updating their multiblock correctly -- Hose pulley now deletes lilypads and other surface foliage +- Hose pulley now deletes lilypads and other surface foliage +- Fixed crushing wheels not applying looting to killed entities #### API Changes diff --git a/src/main/java/com/simibubi/create/content/kinetics/chainConveyor/ChainConveyorBlockEntity.java b/src/main/java/com/simibubi/create/content/kinetics/chainConveyor/ChainConveyorBlockEntity.java index 39841b9a0e..d68fbbb01d 100644 --- a/src/main/java/com/simibubi/create/content/kinetics/chainConveyor/ChainConveyorBlockEntity.java +++ b/src/main/java/com/simibubi/create/content/kinetics/chainConveyor/ChainConveyorBlockEntity.java @@ -106,7 +106,7 @@ public class ChainConveyorBlockEntity extends KineticBlockEntity implements Tran return false; if (connection != null && (!(level.getBlockEntity(worldPosition.offset(connection)) instanceof ChainConveyorBlockEntity otherClbe) - || !otherClbe.canAcceptMorePackages())) + || !otherClbe.canAcceptMorePackages())) return false; return true; } @@ -174,7 +174,7 @@ public class ChainConveyorBlockEntity extends KineticBlockEntity implements Tran if (!(level.getBlockEntity(worldPosition.offset(offset)) instanceof ChainConveyorBlockEntity otherLift)) continue; for (Iterator iterator = entry.getValue() - .iterator(); iterator.hasNext();) { + .iterator(); iterator.hasNext(); ) { ChainConveyorPackage box = iterator.next(); if (box.justFlipped) continue; @@ -195,8 +195,9 @@ public class ChainConveyorBlockEntity extends KineticBlockEntity implements Tran if (stats == null) continue; - Travelling: for (Iterator iterator = entry.getValue() - .iterator(); iterator.hasNext();) { + Travelling: + for (Iterator iterator = entry.getValue() + .iterator(); iterator.hasNext(); ) { ChainConveyorPackage box = iterator.next(); box.justFlipped = false; @@ -251,7 +252,8 @@ public class ChainConveyorBlockEntity extends KineticBlockEntity implements Tran } } - Looping: for (Iterator iterator = loopingPackages.iterator(); iterator.hasNext();) { + Looping: + for (Iterator iterator = loopingPackages.iterator(); iterator.hasNext(); ) { ChainConveyorPackage box = iterator.next(); box.justFlipped = false; @@ -313,7 +315,7 @@ public class ChainConveyorBlockEntity extends KineticBlockEntity implements Tran public void removeInvalidConnections() { boolean changed = false; - for (Iterator iterator = connections.iterator(); iterator.hasNext();) { + for (Iterator iterator = connections.iterator(); iterator.hasNext(); ) { BlockPos next = iterator.next(); BlockPos target = worldPosition.offset(next); if (!level.isLoaded(target)) @@ -584,7 +586,7 @@ public class ChainConveyorBlockEntity extends KineticBlockEntity implements Tran private void spawnDestroyParticles(BlockPos blockPos) { forPointsAlongChains(blockPos, (int) Math.round(Vec3.atLowerCornerOf(blockPos) - .length() * 8), + .length() * 8), vec -> level.addParticle(new BlockParticleOption(ParticleTypes.BLOCK, Blocks.CHAIN.defaultBlockState()), vec.x, vec.y, vec.z, 0, 0, 0)); } @@ -652,7 +654,7 @@ public class ChainConveyorBlockEntity extends KineticBlockEntity implements Tran @Override public float propagateRotationTo(KineticBlockEntity target, BlockState stateFrom, BlockState stateTo, BlockPos diff, - boolean connectedViaAxes, boolean connectedViaCogs) { + boolean connectedViaAxes, boolean connectedViaCogs) { if (connections.contains(target.getBlockPos() .subtract(worldPosition))) { if (!(target instanceof ChainConveyorBlockEntity)) @@ -774,7 +776,7 @@ public class ChainConveyorBlockEntity extends KineticBlockEntity implements Tran @Override public ItemRequirement getRequiredItems(BlockState state) { - // Uncomment when Schematicannon is able to print these with chains + // TODO: Uncomment when Schematicannon is able to print these with chains // int totalCost = 0; // for (BlockPos pos : connections) // totalCost += getChainCost(pos); diff --git a/src/main/java/com/simibubi/create/content/kinetics/crusher/CrushingWheelBlockEntity.java b/src/main/java/com/simibubi/create/content/kinetics/crusher/CrushingWheelBlockEntity.java index 72a3434dc7..c384b06185 100644 --- a/src/main/java/com/simibubi/create/content/kinetics/crusher/CrushingWheelBlockEntity.java +++ b/src/main/java/com/simibubi/create/content/kinetics/crusher/CrushingWheelBlockEntity.java @@ -16,6 +16,7 @@ import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.phys.AABB; import net.minecraft.world.phys.Vec3; + import net.minecraftforge.event.entity.living.LivingDropsEvent; import net.minecraftforge.event.entity.living.LootingLevelEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; @@ -43,7 +44,7 @@ public class CrushingWheelBlockEntity extends KineticBlockEntity { public void fixControllers() { for (Direction d : Iterate.directions) ((CrushingWheelBlock) getBlockState().getBlock()).updateControllers(getBlockState(), getLevel(), getBlockPos(), - d); + d); } @Override @@ -57,12 +58,14 @@ public class CrushingWheelBlockEntity extends KineticBlockEntity { fixControllers(); } + // This increases the drops when dropCustomDeathLoot is called, and LootingEnchantFunctionMixin increases the drops + // defined in the entity loot table @SubscribeEvent public static void crushingIsFortunate(LootingLevelEvent event) { DamageSource damageSource = event.getDamageSource(); if (damageSource == null || !damageSource.is(AllDamageTypes.CRUSH)) return; - event.setLootingLevel(2); //This does not currently increase mob drops. It seems like this only works for damage done by an entity. + event.setLootingLevel(2); } @SubscribeEvent diff --git a/src/main/java/com/simibubi/create/foundation/advancement/AllAdvancements.java b/src/main/java/com/simibubi/create/foundation/advancement/AllAdvancements.java index 755e97d87d..d6203485dd 100644 --- a/src/main/java/com/simibubi/create/foundation/advancement/AllAdvancements.java +++ b/src/main/java/com/simibubi/create/foundation/advancement/AllAdvancements.java @@ -39,627 +39,626 @@ public class AllAdvancements implements DataProvider { public static final List ENTRIES = new ArrayList<>(); public static final CreateAdvancement START = null, - /* - * Some ids have trailing 0's to modify their vertical position on the tree - * (Advancement ordering seems to be deterministic but hash based) - */ + /* + * Some ids have trailing 0's to modify their vertical position on the tree + * (Advancement ordering seems to be deterministic but hash based) + */ - ROOT = create("root", b -> b.icon(AllItems.BRASS_HAND) - .title("Welcome to Create") - .description("Here Be Contraptions") - .awardedForFree() - .special(SILENT)), + ROOT = create("root", b -> b.icon(AllItems.BRASS_HAND) + .title("Welcome to Create") + .description("Here Be Contraptions") + .awardedForFree() + .special(SILENT)), - // Andesite - Central Branch + // Andesite - Central Branch - ANDESITE = create("andesite_alloy", b -> b.icon(AllItems.ANDESITE_ALLOY) - .title("Sturdier Rocks") - .description("Obtain some Andesite Alloy, Create's most important resource") - .after(ROOT) - .whenIconCollected()), + ANDESITE = create("andesite_alloy", b -> b.icon(AllItems.ANDESITE_ALLOY) + .title("Sturdier Rocks") + .description("Obtain some Andesite Alloy, Create's most important resource") + .after(ROOT) + .whenIconCollected()), - ANDESITE_CASING = create("andesite_casing", b -> b.icon(AllBlocks.ANDESITE_CASING) - .title("The Andesite Age") - .description("Apply Andesite Alloy to stripped wood, creating a basic casing for your machines") - .after(ANDESITE) - .special(NOISY)), + ANDESITE_CASING = create("andesite_casing", b -> b.icon(AllBlocks.ANDESITE_CASING) + .title("The Andesite Age") + .description("Apply Andesite Alloy to stripped wood, creating a basic casing for your machines") + .after(ANDESITE) + .special(NOISY)), - PRESS = create("mechanical_press", b -> b.icon(AllBlocks.MECHANICAL_PRESS) - .title("Bonk!") - .description("Create some sheets in a Mechanical Press") - .after(ANDESITE_CASING) - .special(NOISY)), + PRESS = create("mechanical_press", b -> b.icon(AllBlocks.MECHANICAL_PRESS) + .title("Bonk!") + .description("Create some sheets in a Mechanical Press") + .after(ANDESITE_CASING) + .special(NOISY)), - ENCASED_FAN = create("encased_fan", b -> b.icon(AllBlocks.ENCASED_FAN) - .title("Wind Maker") - .description("Place and power an Encased Fan") - .after(PRESS)), + ENCASED_FAN = create("encased_fan", b -> b.icon(AllBlocks.ENCASED_FAN) + .title("Wind Maker") + .description("Place and power an Encased Fan") + .after(PRESS)), - FAN_PROCESSING = create("fan_processing", b -> b.icon(AllItems.PROPELLER) - .title("Processing by Particle") - .description("Use an Encased Fan to process materials") - .after(ENCASED_FAN)), + FAN_PROCESSING = create("fan_processing", b -> b.icon(AllItems.PROPELLER) + .title("Processing by Particle") + .description("Use an Encased Fan to process materials") + .after(ENCASED_FAN)), - SAW_PROCESSING = create("saw_processing", b -> b.icon(AllBlocks.MECHANICAL_SAW) - .title("Workshop's Most Feared") - .description("Use an upright Mechanical Saw to process materials") - .after(FAN_PROCESSING)), + SAW_PROCESSING = create("saw_processing", b -> b.icon(AllBlocks.MECHANICAL_SAW) + .title("Workshop's Most Feared") + .description("Use an upright Mechanical Saw to process materials") + .after(FAN_PROCESSING)), - COMPACTING = create("compacting", b -> b.icon(Blocks.IRON_BLOCK) - .title("Compactification") - .description("Use a Mechanical Press and a Basin to create fewer items from more") - .after(SAW_PROCESSING)), + COMPACTING = create("compacting", b -> b.icon(Blocks.IRON_BLOCK) + .title("Compactification") + .description("Use a Mechanical Press and a Basin to create fewer items from more") + .after(SAW_PROCESSING)), - BELT = create("belt", b -> b.icon(AllItems.BELT_CONNECTOR) - .title("Kelp Drive") - .description("Connect two Shafts with a Mechanical Belt") - .after(COMPACTING)), + BELT = create("belt", b -> b.icon(AllItems.BELT_CONNECTOR) + .title("Kelp Drive") + .description("Connect two Shafts with a Mechanical Belt") + .after(COMPACTING)), - FUNNEL = create("funnel", b -> b.icon(AllBlocks.ANDESITE_FUNNEL) - .title("Airport Aesthetic") - .description("Extract or insert items into a container using a Funnel") - .after(BELT)), + FUNNEL = create("funnel", b -> b.icon(AllBlocks.ANDESITE_FUNNEL) + .title("Airport Aesthetic") + .description("Extract or insert items into a container using a Funnel") + .after(BELT)), - CHUTE = create("chute", b -> b.icon(AllBlocks.CHUTE) - .title("Vertical Logistics") - .description("Transport some items by Chute") - .after(FUNNEL)), + CHUTE = create("chute", b -> b.icon(AllBlocks.CHUTE) + .title("Vertical Logistics") + .description("Transport some items by Chute") + .after(FUNNEL)), - MIXER = create("mechanical_mixer", b -> b.icon(AllBlocks.MECHANICAL_MIXER) - .title("Mixing It Up") - .description("Combine ingredients in a Mechanical Mixer") - .after(CHUTE)), + MIXER = create("mechanical_mixer", b -> b.icon(AllBlocks.MECHANICAL_MIXER) + .title("Mixing It Up") + .description("Combine ingredients in a Mechanical Mixer") + .after(CHUTE)), - BLAZE_BURNER = create("burner", b -> b.icon(AllBlocks.BLAZE_BURNER) - .title("Sentient Fireplace") - .description("Obtain a Blaze Burner") - .whenIconCollected() - .after(MIXER)), + BLAZE_BURNER = create("burner", b -> b.icon(AllBlocks.BLAZE_BURNER) + .title("Sentient Fireplace") + .description("Obtain a Blaze Burner") + .whenIconCollected() + .after(MIXER)), - // Andesite - Top Branch + // Andesite - Top Branch - WATER_WHEEL = create("water_wheel", b -> b.icon(AllBlocks.WATER_WHEEL) - .title("Harnessed Hydraulics") - .description("Place a Water Wheel and use it to generate torque") - .after(ANDESITE)), + WATER_WHEEL = create("water_wheel", b -> b.icon(AllBlocks.WATER_WHEEL) + .title("Harnessed Hydraulics") + .description("Place a Water Wheel and use it to generate torque") + .after(ANDESITE)), - WINDMILL = create("windmill", b -> b.icon(AllBlocks.SAIL_FRAME) - .title("A mild Breeze") - .description("Assemble a windmill and use it to generate torque") - .after(WATER_WHEEL)), + WINDMILL = create("windmill", b -> b.icon(AllBlocks.SAIL_FRAME) + .title("A mild Breeze") + .description("Assemble a windmill and use it to generate torque") + .after(WATER_WHEEL)), - COGS = create("shifting_gears", b -> b.icon(AllBlocks.COGWHEEL) - .title("Shifting Gears") - .description( - "Connect a Large Cogwheel to a Small Cogwheel, allowing you to change the speed of your Contraption") - .after(WINDMILL)), + COGS = create("shifting_gears", b -> b.icon(AllBlocks.COGWHEEL) + .title("Shifting Gears") + .description( + "Connect a Large Cogwheel to a Small Cogwheel, allowing you to change the speed of your Contraption") + .after(WINDMILL)), - MILLSTONE = create("millstone", b -> b.icon(AllBlocks.MILLSTONE) - .title("Embrace the Grind") - .description("Use a Millstone to pulverise materials") - .after(COGS)), + MILLSTONE = create("millstone", b -> b.icon(AllBlocks.MILLSTONE) + .title("Embrace the Grind") + .description("Use a Millstone to pulverise materials") + .after(COGS)), - SUPER_GLUE = create("super_glue", b -> b.icon(AllItems.SUPER_GLUE) - .title("Area of Connect") - .description("Super Glue some blocks into a group") - .after(MILLSTONE)), + SUPER_GLUE = create("super_glue", b -> b.icon(AllItems.SUPER_GLUE) + .title("Area of Connect") + .description("Super Glue some blocks into a group") + .after(MILLSTONE)), - CONTRAPTION_ACTORS = create("contraption_actors", b -> b.icon(AllBlocks.MECHANICAL_HARVESTER) - .title("Moving with Purpose") - .description("Create a Contraption with drills, saws, or harvesters on board") - .after(SUPER_GLUE)), + CONTRAPTION_ACTORS = create("contraption_actors", b -> b.icon(AllBlocks.MECHANICAL_HARVESTER) + .title("Moving with Purpose") + .description("Create a Contraption with drills, saws, or harvesters on board") + .after(SUPER_GLUE)), - PSI = create("portable_storage_interface", b -> b.icon(AllBlocks.PORTABLE_STORAGE_INTERFACE) - .title("Drive-by Exchange") - .description("Use a Portable Storage Interface to take or insert items into a Contraption") - .after(CONTRAPTION_ACTORS)), + PSI = create("portable_storage_interface", b -> b.icon(AllBlocks.PORTABLE_STORAGE_INTERFACE) + .title("Drive-by Exchange") + .description("Use a Portable Storage Interface to take or insert items into a Contraption") + .after(CONTRAPTION_ACTORS)), - WRENCH_GOGGLES = create("wrench_goggles", b -> b.icon(AllItems.WRENCH) - .title("Kitted Out") - .description("Equip Engineer's Goggles and a Wrench") - .whenIconCollected() - .whenItemCollected(AllItems.GOGGLES) - .after(PSI)), + WRENCH_GOGGLES = create("wrench_goggles", b -> b.icon(AllItems.WRENCH) + .title("Kitted Out") + .description("Equip Engineer's Goggles and a Wrench") + .whenIconCollected() + .whenItemCollected(AllItems.GOGGLES) + .after(PSI)), - STRESSOMETER = create("stressometer", b -> b.icon(AllBlocks.STRESSOMETER) - .title("Stress for Nerds") - .description("Get an exact readout with the help of Engineer's Goggles and a Stressometer") - .after(WRENCH_GOGGLES)), + STRESSOMETER = create("stressometer", b -> b.icon(AllBlocks.STRESSOMETER) + .title("Stress for Nerds") + .description("Get an exact readout with the help of Engineer's Goggles and a Stressometer") + .after(WRENCH_GOGGLES)), - CUCKOO_CLOCK = create("cuckoo_clock", b -> b.icon(AllBlocks.CUCKOO_CLOCK) - .title("Is it Time?") - .description("Witness your Cuckoo Clock announce bedtime") - .after(STRESSOMETER) - .special(NOISY)), + CUCKOO_CLOCK = create("cuckoo_clock", b -> b.icon(AllBlocks.CUCKOO_CLOCK) + .title("Is it Time?") + .description("Witness your Cuckoo Clock announce bedtime") + .after(STRESSOMETER) + .special(NOISY)), - // Andesite - Expert Branch + // Andesite - Expert Branch - WINDMILL_MAXED = create("windmill_maxed", b -> b.icon(AllBlocks.SAIL) - .title("A strong Breeze") - .description("Assemble a windmill of maximum strength") - .after(ANDESITE) - .special(EXPERT)), + WINDMILL_MAXED = create("windmill_maxed", b -> b.icon(AllBlocks.SAIL) + .title("A strong Breeze") + .description("Assemble a windmill of maximum strength") + .after(ANDESITE) + .special(EXPERT)), - EJECTOR_MAXED = create("ejector_maxed", b -> b.icon(AllBlocks.WEIGHTED_EJECTOR) - .title("Springboard Champion") - .description("Get launched more than 30 blocks by a Weighted Ejector") - .after(WINDMILL_MAXED) - .special(EXPERT)), + EJECTOR_MAXED = create("ejector_maxed", b -> b.icon(AllBlocks.WEIGHTED_EJECTOR) + .title("Springboard Champion") + .description("Get launched more than 30 blocks by a Weighted Ejector") + .after(WINDMILL_MAXED) + .special(EXPERT)), - PULLEY_MAXED = create("pulley_maxed", b -> b.icon(AllBlocks.ROPE_PULLEY) - .title("Rope to Nowhere") - .description("Extend a Rope Pulley over 200 blocks deep") - .after(EJECTOR_MAXED) - .special(EXPERT)), + PULLEY_MAXED = create("pulley_maxed", b -> b.icon(AllBlocks.ROPE_PULLEY) + .title("Rope to Nowhere") + .description("Extend a Rope Pulley over 200 blocks deep") + .after(EJECTOR_MAXED) + .special(EXPERT)), - CART_PICKUP = create("cart_pickup", b -> b.icon(AllItems.CHEST_MINECART_CONTRAPTION) - .title("Strong Arms") - .description("Pick up a Minecart Contraption with at least 200 attached blocks") - .after(PULLEY_MAXED) - .special(EXPERT)), + CART_PICKUP = create("cart_pickup", b -> b.icon(AllItems.CHEST_MINECART_CONTRAPTION) + .title("Strong Arms") + .description("Pick up a Minecart Contraption with at least 200 attached blocks") + .after(PULLEY_MAXED) + .special(EXPERT)), - ANVIL_PLOUGH = create("anvil_plough", b -> b.icon(Blocks.CHIPPED_ANVIL) - .title("Blacksmith Artillery") - .description("Launch an Anvil with Mechanical Ploughs") - .after(CART_PICKUP) - .special(EXPERT)), + ANVIL_PLOUGH = create("anvil_plough", b -> b.icon(Blocks.CHIPPED_ANVIL) + .title("Blacksmith Artillery") + .description("Launch an Anvil with Mechanical Ploughs") + .after(CART_PICKUP) + .special(EXPERT)), - // Andesite - Hidden + // Andesite - Hidden - LAVA_WHEEL = create("lava_wheel_00000", b -> b.icon(AllBlocks.WATER_WHEEL) - .title("Magma Wheel") - .description("This shouldn't have worked") - .after(MIXER) - .special(SECRET)), + LAVA_WHEEL = create("lava_wheel_00000", b -> b.icon(AllBlocks.WATER_WHEEL) + .title("Magma Wheel") + .description("This shouldn't have worked") + .after(MIXER) + .special(SECRET)), - HAND_CRANK = create("hand_crank_000", b -> b.icon(AllBlocks.HAND_CRANK) - .title("Workout Session") - .description("Use a Hand Crank until fully exhausted") - .after(MIXER) - .special(SECRET)), + HAND_CRANK = create("hand_crank_000", b -> b.icon(AllBlocks.HAND_CRANK) + .title("Workout Session") + .description("Use a Hand Crank until fully exhausted") + .after(MIXER) + .special(SECRET)), - FUNNEL_KISS = create("belt_funnel_kiss", b -> b.icon(AllBlocks.BRASS_FUNNEL) - .title("The Parrots and the Flaps") - .description("Make two Belt-mounted Funnels kiss") - .after(MIXER) - .special(SECRET)), + FUNNEL_KISS = create("belt_funnel_kiss", b -> b.icon(AllBlocks.BRASS_FUNNEL) + .title("The Parrots and the Flaps") + .description("Make two Belt-mounted Funnels kiss") + .after(MIXER) + .special(SECRET)), - STRESSOMETER_MAXED = create("stressometer_maxed", b -> b.icon(AllBlocks.STRESSOMETER) - .title("Perfectly Stressed") - .description("Get a 100% readout from a Stressometer") - .after(MIXER) - .special(SECRET)), + STRESSOMETER_MAXED = create("stressometer_maxed", b -> b.icon(AllBlocks.STRESSOMETER) + .title("Perfectly Stressed") + .description("Get a 100% readout from a Stressometer") + .after(MIXER) + .special(SECRET)), - // Logistics - - CARDBOARD = create("cardboard", b -> b.icon(AllItems.CARDBOARD) - .title("Part and Parcel") - .description("Produce or obtain your first Cardboard") - .whenIconCollected() - .after(MIXER)), - - PACKAGER = create("packager", b -> b.icon(AllBlocks.PACKAGER) - .title("Post Production") - .description("Package items from an inventory using the Packager") - .after(CARDBOARD)), - - STOCK_TICKER = create("stock_ticker", b -> b.icon(AllBlocks.STOCK_TICKER) - .title("Order Up!") - .description("Employ a mob at your stock ticker and make your first requests") - .special(NOISY) - .after(PACKAGER)), - - FROGPORT = create("frogport", b -> b.icon(AllBlocks.PACKAGE_FROGPORT) - .title("Hungry hoppers") - .description("Catch packages from your Chain Conveyor using a Frogport") - .special(NOISY) - .after(STOCK_TICKER)), - - TABLE_CLOTH_SHOP = create("table_cloth_shop", b -> b.icon(AllBlocks.TABLE_CLOTHS.get(DyeColor.RED)) - .title("Open for business") - .description("Put items up for sale using a Table Cloth") - .special(NOISY) - .after(FROGPORT)), - - FACTORY_GAUGE = create("factory_gauge", b -> b.icon(AllBlocks.FACTORY_GAUGE) - .title("High Logistics") - .description("Trigger an automatic package request using Factory Gauges") - .special(NOISY) - .after(TABLE_CLOTH_SHOP)), - - CARDBOARD_ARMOR = create("cardboard_armor", b -> b.icon(AllItems.CARDBOARD_CHESTPLATE) - .title("Full Stealth") - .description("Sneak around in full Cardboard Armor") - .after(FACTORY_GAUGE)), - - // Logistics - Secret + // Logistics - PACKAGE_CHUTE_THROW = create("package_chute_throw", b -> b.icon(PackageStyles.getDefaultBox()) - .title("Nothing but net") - .description("Land your cardboard package throw in an item chute") + CARDBOARD = create("cardboard", b -> b.icon(AllItems.CARDBOARD) + .title("Part and Parcel") + .description("Produce or obtain your first Cardboard") + .whenIconCollected() + .after(MIXER)), + + PACKAGER = create("packager", b -> b.icon(AllBlocks.PACKAGER) + .title("Post Production") + .description("Package items from an inventory using the Packager") + .after(CARDBOARD)), + + STOCK_TICKER = create("stock_ticker", b -> b.icon(AllBlocks.STOCK_TICKER) + .title("Order Up!") + .description("Employ a mob at your stock ticker and make your first requests") + .special(NOISY) + .after(PACKAGER)), + + FROGPORT = create("frogport", b -> b.icon(AllBlocks.PACKAGE_FROGPORT) + .title("Hungry hoppers") + .description("Catch packages from your Chain Conveyor using a Frogport") + .special(NOISY) + .after(STOCK_TICKER)), + + TABLE_CLOTH_SHOP = create("table_cloth_shop", b -> b.icon(AllBlocks.TABLE_CLOTHS.get(DyeColor.RED)) + .title("Open for business") + .description("Put items up for sale using a Table Cloth") + .special(NOISY) + .after(FROGPORT)), + + FACTORY_GAUGE = create("factory_gauge", b -> b.icon(AllBlocks.FACTORY_GAUGE) + .title("High Logistics") + .description("Trigger an automatic package request using Factory Gauges") + .special(NOISY) + .after(TABLE_CLOTH_SHOP)), + + CARDBOARD_ARMOR = create("cardboard_armor", b -> b.icon(AllItems.CARDBOARD_CHESTPLATE) + .title("Full Stealth") + .description("Sneak around in full Cardboard Armor") + .after(FACTORY_GAUGE)), + + // Logistics - Secret + + PACKAGE_CHUTE_THROW = create("package_chute_throw", b -> b.icon(PackageStyles.getDefaultBox()) + .title("Nothing but net") + .description("Land your cardboard package throw in an item chute") + .after(CARDBOARD_ARMOR) + .special(SECRET)), + + CARDBOARD_ARMOR_TRIM = create("cardboard_armor_trim", + b -> b.icon(createArmorTrimmedCardboardChestplate()) + .title("Arts and Crafts") + .description("Decorate your cardboard equipment with armor trims") .after(CARDBOARD_ARMOR) .special(SECRET)), - // TODO: award using AllAdvancements.CARDBOARD_ARMOR_TRIM.awardTo() on server - CARDBOARD_ARMOR_TRIM = create("cardboard_armor_trim", - b -> b.icon(createArmorTrimmedCardboardChestplate()) - .title("Arts and Crafts") - .description("Decorate your cardboard equipment with armor trims") - .after(CARDBOARD_ARMOR) - .special(SECRET)), + // Copper - Central Branch - // Copper - Central Branch + COPPER = create("copper", b -> b.icon(Items.COPPER_INGOT) + .title("Cuprum Bokum") + .description("Amass some Copper Ingots for your exploits in fluid manipulation") + .whenIconCollected() + .after(BLAZE_BURNER) + .special(SILENT)), - COPPER = create("copper", b -> b.icon(Items.COPPER_INGOT) - .title("Cuprum Bokum") - .description("Amass some Copper Ingots for your exploits in fluid manipulation") - .whenIconCollected() - .after(BLAZE_BURNER) - .special(SILENT)), + COPPER_CASING = create("copper_casing", b -> b.icon(AllBlocks.COPPER_CASING) + .title("The Copper Age") + .description("Apply Copper Ingots to stripped wood, creating a waterproof casing for your machines") + .after(COPPER)), - COPPER_CASING = create("copper_casing", b -> b.icon(AllBlocks.COPPER_CASING) - .title("The Copper Age") - .description("Apply Copper Ingots to stripped wood, creating a waterproof casing for your machines") - .after(COPPER)), + SPOUT = create("spout", b -> b.icon(AllBlocks.SPOUT) + .title("Sploosh") + .description("Watch a fluid-containing item be filled by a Spout") + .after(COPPER_CASING)), - SPOUT = create("spout", b -> b.icon(AllBlocks.SPOUT) - .title("Sploosh") - .description("Watch a fluid-containing item be filled by a Spout") - .after(COPPER_CASING)), + DRAIN = create("drain", b -> b.icon(AllBlocks.ITEM_DRAIN) + .title("Tumble Draining") + .description("Watch a fluid-containing item be emptied by an Item Drain") + .after(SPOUT)), - DRAIN = create("drain", b -> b.icon(AllBlocks.ITEM_DRAIN) - .title("Tumble Draining") - .description("Watch a fluid-containing item be emptied by an Item Drain") - .after(SPOUT)), + STEAM_ENGINE = create("steam_engine", b -> b.icon(AllBlocks.STEAM_ENGINE) + .title("The Powerhouse") + .description("Use a Steam Engine to generate torque") + .after(DRAIN)), - STEAM_ENGINE = create("steam_engine", b -> b.icon(AllBlocks.STEAM_ENGINE) - .title("The Powerhouse") - .description("Use a Steam Engine to generate torque") - .after(DRAIN)), + STEAM_WHISTLE = create("steam_whistle", b -> b.icon(AllBlocks.STEAM_WHISTLE) + .title("Voice of an Angel") + .description("Activate a Steam Whistle") + .after(STEAM_ENGINE)), - STEAM_WHISTLE = create("steam_whistle", b -> b.icon(AllBlocks.STEAM_WHISTLE) - .title("Voice of an Angel") - .description("Activate a Steam Whistle") - .after(STEAM_ENGINE)), + BACKTANK = create("backtank", b -> b.icon(AllItems.COPPER_BACKTANK) + .title("Pressure to Go") + .description("Create a Copper Backtank and make it accumulate air pressure") + .after(STEAM_WHISTLE)), - BACKTANK = create("backtank", b -> b.icon(AllItems.COPPER_BACKTANK) - .title("Pressure to Go") - .description("Create a Copper Backtank and make it accumulate air pressure") - .after(STEAM_WHISTLE)), + DIVING_SUIT = create("diving_suit", b -> b.icon(AllItems.COPPER_DIVING_HELMET) + .title("Ready for the Depths") + .description("Equip a Diving Helmet and a Copper Backtank, then jump into water") + .after(BACKTANK)), - DIVING_SUIT = create("diving_suit", b -> b.icon(AllItems.COPPER_DIVING_HELMET) - .title("Ready for the Depths") - .description("Equip a Diving Helmet and a Copper Backtank, then jump into water") - .after(BACKTANK)), + // Copper - Top Branch - // Copper - Top Branch + PUMP = create("mechanical_pump_0", b -> b.icon(AllBlocks.MECHANICAL_PUMP) + .title("Under Pressure") + .description("Place and power a Mechanical Pump") + .after(COPPER)), - PUMP = create("mechanical_pump_0", b -> b.icon(AllBlocks.MECHANICAL_PUMP) - .title("Under Pressure") - .description("Place and power a Mechanical Pump") - .after(COPPER)), + GLASS_PIPE = create("glass_pipe", b -> b.icon(AllBlocks.FLUID_PIPE) + .title("Flow Discovery") + .description("Use your Wrench on a pipe that contains a fluid") + .after(PUMP)), - GLASS_PIPE = create("glass_pipe", b -> b.icon(AllBlocks.FLUID_PIPE) - .title("Flow Discovery") - .description("Use your Wrench on a pipe that contains a fluid") - .after(PUMP)), + WATER_SUPPLY = create("water_supply", b -> b.icon(Items.WATER_BUCKET) + .title("Puddle Collector") + .description("Use the pulling end of a Fluid Pipe or Mechanical Pump to collect water") + .after(GLASS_PIPE)), - WATER_SUPPLY = create("water_supply", b -> b.icon(Items.WATER_BUCKET) - .title("Puddle Collector") - .description("Use the pulling end of a Fluid Pipe or Mechanical Pump to collect water") - .after(GLASS_PIPE)), + HOSE_PULLEY = create("hose_pulley", b -> b.icon(AllBlocks.HOSE_PULLEY) + .title("Industrial Spillage") + .description("Lower a Hose Pulley and watch it drain or fill a body of fluid") + .after(WATER_SUPPLY)), - HOSE_PULLEY = create("hose_pulley", b -> b.icon(AllBlocks.HOSE_PULLEY) - .title("Industrial Spillage") - .description("Lower a Hose Pulley and watch it drain or fill a body of fluid") - .after(WATER_SUPPLY)), - - CHOCOLATE_BUCKET = create("chocolate_bucket", b -> b.icon(AllFluids.CHOCOLATE.get() + CHOCOLATE_BUCKET = create("chocolate_bucket", b -> b.icon(AllFluids.CHOCOLATE.get() .getBucket()) - .title("A World of Imagination") - .description("Obtain a bucket of molten chocolate") - .whenIconCollected() - .after(HOSE_PULLEY)), + .title("A World of Imagination") + .description("Obtain a bucket of molten chocolate") + .whenIconCollected() + .after(HOSE_PULLEY)), - HONEY_DRAIN = create("honey_drain", b -> b.icon(Items.BEEHIVE) - .title("Autonomous Bee-Keeping") - .description("Use pipes to pull honey from a Bee Nest or Beehive") - .after(CHOCOLATE_BUCKET)), + HONEY_DRAIN = create("honey_drain", b -> b.icon(Items.BEEHIVE) + .title("Autonomous Bee-Keeping") + .description("Use pipes to pull honey from a Bee Nest or Beehive") + .after(CHOCOLATE_BUCKET)), - // Copper - Expert Branch + // Copper - Expert Branch - HOSE_PULLEY_LAVA = create("hose_pulley_lava", b -> b.icon(AllBlocks.HOSE_PULLEY) - .title("Tapping the Mantle") - .description("Pump from a body of lava large enough to be considered infinite") - .after(COPPER) - .special(EXPERT)), + HOSE_PULLEY_LAVA = create("hose_pulley_lava", b -> b.icon(AllBlocks.HOSE_PULLEY) + .title("Tapping the Mantle") + .description("Pump from a body of lava large enough to be considered infinite") + .after(COPPER) + .special(EXPERT)), - STEAM_ENGINE_MAXED = create("steam_engine_maxed", b -> b.icon(AllBlocks.STEAM_ENGINE) - .title("Full Steam") - .description("Run a boiler at the maximum level of power") - .after(HOSE_PULLEY_LAVA) - .special(EXPERT)), + STEAM_ENGINE_MAXED = create("steam_engine_maxed", b -> b.icon(AllBlocks.STEAM_ENGINE) + .title("Full Steam") + .description("Run a boiler at the maximum level of power") + .after(HOSE_PULLEY_LAVA) + .special(EXPERT)), - FOODS = create("foods", b -> b.icon(AllItems.CHOCOLATE_BERRIES) - .title("Balanced Diet") - .description("Create Chocolate Glazed Berries, a Honeyed Apple, and a Sweet Roll all from the same Spout") - .after(STEAM_ENGINE_MAXED) - .special(EXPERT)), + FOODS = create("foods", b -> b.icon(AllItems.CHOCOLATE_BERRIES) + .title("Balanced Diet") + .description("Create Chocolate Glazed Berries, a Honeyed Apple, and a Sweet Roll all from the same Spout") + .after(STEAM_ENGINE_MAXED) + .special(EXPERT)), - DIVING_SUIT_LAVA = create("diving_suit_lava", b -> b.icon(AllItems.NETHERITE_DIVING_HELMET) - .title("Swimming with the Striders") - .description("Attempt to take a dive in lava with your netherite diving gear") - .after(FOODS) - .special(EXPERT)), + DIVING_SUIT_LAVA = create("diving_suit_lava", b -> b.icon(AllItems.NETHERITE_DIVING_HELMET) + .title("Swimming with the Striders") + .description("Attempt to take a dive in lava with your netherite diving gear") + .after(FOODS) + .special(EXPERT)), - // Copper - Hidden + // Copper - Hidden - CHAINED_DRAIN = create("chained_drain", b -> b.icon(AllBlocks.ITEM_DRAIN) - .title("On a Roll") - .description("Watch an item move across a row of Item Drains") - .after(BACKTANK) - .special(SECRET)), + CHAINED_DRAIN = create("chained_drain", b -> b.icon(AllBlocks.ITEM_DRAIN) + .title("On a Roll") + .description("Watch an item move across a row of Item Drains") + .after(BACKTANK) + .special(SECRET)), - CROSS_STREAMS = create("cross_streams", b -> b.icon(Blocks.COBBLESTONE) - .title("Don't Cross the Streams!") - .description("Watch two fluids meet in your pipe network") - .after(BACKTANK) - .special(SECRET)), + CROSS_STREAMS = create("cross_streams", b -> b.icon(Blocks.COBBLESTONE) + .title("Don't Cross the Streams!") + .description("Watch two fluids meet in your pipe network") + .after(BACKTANK) + .special(SECRET)), - PIPE_ORGAN = create("pipe_organ", b -> b.icon(AllBlocks.STEAM_WHISTLE) - .title("The Pipe Organ") - .description("Attach 12 uniquely pitched Steam Whistles to a single Fluid Tank") - .after(BACKTANK) - .special(SECRET)), + PIPE_ORGAN = create("pipe_organ", b -> b.icon(AllBlocks.STEAM_WHISTLE) + .title("The Pipe Organ") + .description("Attach 12 uniquely pitched Steam Whistles to a single Fluid Tank") + .after(BACKTANK) + .special(SECRET)), - // Brass - Central Branch + // Brass - Central Branch - BRASS = create("brass", b -> b.icon(AllItems.BRASS_INGOT) - .title("Real Alloys") - .description("Create Brass Ingots by alloying Copper and Zinc Ingots in your Blaze-heated Mechanical Mixer") - .whenIconCollected() - .after(DIVING_SUIT)), + BRASS = create("brass", b -> b.icon(AllItems.BRASS_INGOT) + .title("Real Alloys") + .description("Create Brass Ingots by alloying Copper and Zinc Ingots in your Blaze-heated Mechanical Mixer") + .whenIconCollected() + .after(DIVING_SUIT)), - BRASS_CASING = create("brass_casing", b -> b.icon(AllBlocks.BRASS_CASING) - .title("The Brass Age") - .description("Apply Brass Ingots to stripped wood, creating a casing for more sophisticated machines") - .after(BRASS) - .special(NOISY)), + BRASS_CASING = create("brass_casing", b -> b.icon(AllBlocks.BRASS_CASING) + .title("The Brass Age") + .description("Apply Brass Ingots to stripped wood, creating a casing for more sophisticated machines") + .after(BRASS) + .special(NOISY)), - ROSE_QUARTZ = create("rose_quartz", b -> b.icon(AllItems.POLISHED_ROSE_QUARTZ) - .title("Supercharged") - .description("Polish some Rose Quartz") - .whenIconCollected() - .after(BRASS_CASING)), + ROSE_QUARTZ = create("rose_quartz", b -> b.icon(AllItems.POLISHED_ROSE_QUARTZ) + .title("Supercharged") + .description("Polish some Rose Quartz") + .whenIconCollected() + .after(BRASS_CASING)), - DEPLOYER = create("deployer", b -> b.icon(AllBlocks.DEPLOYER) - .title("Artificial Intelligence") - .description("Place and power a Deployer, the perfect reflection of yourself") - .after(ROSE_QUARTZ)), + DEPLOYER = create("deployer", b -> b.icon(AllBlocks.DEPLOYER) + .title("Artificial Intelligence") + .description("Place and power a Deployer, the perfect reflection of yourself") + .after(ROSE_QUARTZ)), - MECHANISM = create("precision_mechanism", b -> b.icon(AllItems.PRECISION_MECHANISM) - .title("Complex Curiosities") - .description("Assemble a Precision Mechanism") - .whenIconCollected() - .after(DEPLOYER) - .special(NOISY)), + MECHANISM = create("precision_mechanism", b -> b.icon(AllItems.PRECISION_MECHANISM) + .title("Complex Curiosities") + .description("Assemble a Precision Mechanism") + .whenIconCollected() + .after(DEPLOYER) + .special(NOISY)), - SPEED_CONTROLLER = create("speed_controller", b -> b.icon(AllBlocks.ROTATION_SPEED_CONTROLLER) - .title("Engineers hate this simple trick!") - .description("Fine-tune your Contraption with a Rotation Speed Controller") - .after(MECHANISM)), + SPEED_CONTROLLER = create("speed_controller", b -> b.icon(AllBlocks.ROTATION_SPEED_CONTROLLER) + .title("Engineers hate this simple trick!") + .description("Fine-tune your Contraption with a Rotation Speed Controller") + .after(MECHANISM)), - MECHANICAL_ARM = create("mechanical_arm", b -> b.icon(AllBlocks.MECHANICAL_ARM) - .title("Busy Hands") - .description("Watch your Mechanical Arm transport its first item") - .after(SPEED_CONTROLLER) - .special(NOISY)), + MECHANICAL_ARM = create("mechanical_arm", b -> b.icon(AllBlocks.MECHANICAL_ARM) + .title("Busy Hands") + .description("Watch your Mechanical Arm transport its first item") + .after(SPEED_CONTROLLER) + .special(NOISY)), - CRAFTER = create("mechanical_crafter", b -> b.icon(AllBlocks.MECHANICAL_CRAFTER) - .title("Automated Assembly") - .description("Place and power some Mechanical Crafters") - .after(MECHANICAL_ARM)), + CRAFTER = create("mechanical_crafter", b -> b.icon(AllBlocks.MECHANICAL_CRAFTER) + .title("Automated Assembly") + .description("Place and power some Mechanical Crafters") + .after(MECHANICAL_ARM)), - CRUSHING_WHEEL = create("crushing_wheel", b -> b.icon(AllBlocks.CRUSHING_WHEEL) - .title("Wheels of Destruction") - .description("Place and power a set of Crushing Wheels") - .after(CRAFTER) - .special(NOISY)), + CRUSHING_WHEEL = create("crushing_wheel", b -> b.icon(AllBlocks.CRUSHING_WHEEL) + .title("Wheels of Destruction") + .description("Place and power a set of Crushing Wheels") + .after(CRAFTER) + .special(NOISY)), - // Brass - Top Branch + // Brass - Top Branch - HAUNTED_BELL = create("haunted_bell", b -> b.icon(AllBlocks.HAUNTED_BELL) - .title("Shadow Sense") - .description("Toll a Haunted Bell") - .after(BRASS) - .special(NOISY)), + HAUNTED_BELL = create("haunted_bell", b -> b.icon(AllBlocks.HAUNTED_BELL) + .title("Shadow Sense") + .description("Toll a Haunted Bell") + .after(BRASS) + .special(NOISY)), - CLOCKWORK_BEARING = create("clockwork_bearing", b -> b.icon(AllBlocks.CLOCKWORK_BEARING) - .title("Contraption o'Clock") - .description("Assemble a structure mounted on a Clockwork Bearing") - .after(HAUNTED_BELL) - .special(NOISY)), + CLOCKWORK_BEARING = create("clockwork_bearing", b -> b.icon(AllBlocks.CLOCKWORK_BEARING) + .title("Contraption o'Clock") + .description("Assemble a structure mounted on a Clockwork Bearing") + .after(HAUNTED_BELL) + .special(NOISY)), - DISPLAY_LINK = create("display_link", b -> b.icon(AllBlocks.DISPLAY_LINK) - .title("Big Data") - .description("Use a Display Link to visualise information") - .after(CLOCKWORK_BEARING)), + DISPLAY_LINK = create("display_link", b -> b.icon(AllBlocks.DISPLAY_LINK) + .title("Big Data") + .description("Use a Display Link to visualise information") + .after(CLOCKWORK_BEARING)), - POTATO_CANNON = create("potato_cannon", b -> b.icon(AllItems.POTATO_CANNON) - .title("Fwoomp!") - .description("Defeat an enemy with your Potato Cannon") - .after(DISPLAY_LINK) - .special(NOISY)), + POTATO_CANNON = create("potato_cannon", b -> b.icon(AllItems.POTATO_CANNON) + .title("Fwoomp!") + .description("Defeat an enemy with your Potato Cannon") + .after(DISPLAY_LINK) + .special(NOISY)), - EXTENDO_GRIP = create("extendo_grip", b -> b.icon(AllItems.EXTENDO_GRIP) - .title("Boioioing!") - .description("Get hold of an Extendo Grip") - .after(POTATO_CANNON)), + EXTENDO_GRIP = create("extendo_grip", b -> b.icon(AllItems.EXTENDO_GRIP) + .title("Boioioing!") + .description("Get hold of an Extendo Grip") + .after(POTATO_CANNON)), - LINKED_CONTROLLER = create("linked_controller", b -> b.icon(AllItems.LINKED_CONTROLLER) - .title("Remote Activation") - .description("Activate a Redstone Link using a Linked Controller") - .after(EXTENDO_GRIP)), + LINKED_CONTROLLER = create("linked_controller", b -> b.icon(AllItems.LINKED_CONTROLLER) + .title("Remote Activation") + .description("Activate a Redstone Link using a Linked Controller") + .after(EXTENDO_GRIP)), - ARM_BLAZE_BURNER = create("arm_blaze_burner", b -> b.icon(AllBlocks.BLAZE_BURNER) - .title("Combust-o-Tron") - .description("Instruct a Mechanical Arm to feed your Blaze Burner") - .after(LINKED_CONTROLLER)), + ARM_BLAZE_BURNER = create("arm_blaze_burner", b -> b.icon(AllBlocks.BLAZE_BURNER) + .title("Combust-o-Tron") + .description("Instruct a Mechanical Arm to feed your Blaze Burner") + .after(LINKED_CONTROLLER)), - // Brass - Expert Branch + // Brass - Expert Branch - CRUSHER_MAXED = create("crusher_maxed_0000", b -> b.icon(AllBlocks.CRUSHING_WHEEL) - .title("Crushing It") - .description("Operate a pair of Crushing Wheels at maximum speed") - .after(BRASS) - .special(EXPERT)), + CRUSHER_MAXED = create("crusher_maxed_0000", b -> b.icon(AllBlocks.CRUSHING_WHEEL) + .title("Crushing It") + .description("Operate a pair of Crushing Wheels at maximum speed") + .after(BRASS) + .special(EXPERT)), - ARM_MANY_TARGETS = create("arm_many_targets", b -> b.icon(AllBlocks.MECHANICAL_ARM) - .title("Organize-o-Tron") - .description("Program a Mechanical Arm with 10 or more output locations") - .after(CRUSHER_MAXED) - .special(EXPERT)), + ARM_MANY_TARGETS = create("arm_many_targets", b -> b.icon(AllBlocks.MECHANICAL_ARM) + .title("Organize-o-Tron") + .description("Program a Mechanical Arm with 10 or more output locations") + .after(CRUSHER_MAXED) + .special(EXPERT)), - POTATO_CANNON_COLLIDE = create("potato_cannon_collide", b -> b.icon(Items.CARROT) - .title("Veggie Fireworks") - .description("Cause Potato Cannon projectiles of different types to collide with each other") - .after(ARM_MANY_TARGETS) - .special(EXPERT)), + POTATO_CANNON_COLLIDE = create("potato_cannon_collide", b -> b.icon(Items.CARROT) + .title("Veggie Fireworks") + .description("Cause Potato Cannon projectiles of different types to collide with each other") + .after(ARM_MANY_TARGETS) + .special(EXPERT)), - SELF_DEPLOYING = create("self_deploying", b -> b.icon(Items.RAIL) - .title("Self-Driving Cart") - .description("Create a Minecart Contraption that places tracks in front of itself") - .after(POTATO_CANNON_COLLIDE) - .special(EXPERT)), + SELF_DEPLOYING = create("self_deploying", b -> b.icon(Items.RAIL) + .title("Self-Driving Cart") + .description("Create a Minecart Contraption that places tracks in front of itself") + .after(POTATO_CANNON_COLLIDE) + .special(EXPERT)), - // Brass - Hidden + // Brass - Hidden - FIST_BUMP = create("fist_bump", b -> b.icon(AllBlocks.DEPLOYER) - .title("Pound It, Bro!") - .description("Make two Deployers fist-bump") - .after(CRAFTER) - .special(SECRET)), + FIST_BUMP = create("fist_bump", b -> b.icon(AllBlocks.DEPLOYER) + .title("Pound It, Bro!") + .description("Make two Deployers fist-bump") + .after(CRAFTER) + .special(SECRET)), - CRAFTER_LAZY = create("crafter_lazy_000", b -> b.icon(AllBlocks.MECHANICAL_CRAFTER) - .title("Desperate Measures") - .description("Drastically slow down a Mechanical Crafter to procrastinate on proper infrastructure") - .after(CRAFTER) - .special(SECRET)), + CRAFTER_LAZY = create("crafter_lazy_000", b -> b.icon(AllBlocks.MECHANICAL_CRAFTER) + .title("Desperate Measures") + .description("Drastically slow down a Mechanical Crafter to procrastinate on proper infrastructure") + .after(CRAFTER) + .special(SECRET)), - EXTENDO_GRIP_DUAL = create("extendo_grip_dual", b -> b.icon(AllItems.EXTENDO_GRIP) - .title("To Full Extent") - .description("Dual-wield Extendo Grips for superhuman reach") - .after(CRAFTER) - .special(SECRET)), + EXTENDO_GRIP_DUAL = create("extendo_grip_dual", b -> b.icon(AllItems.EXTENDO_GRIP) + .title("To Full Extent") + .description("Dual-wield Extendo Grips for superhuman reach") + .after(CRAFTER) + .special(SECRET)), - MUSICAL_ARM = create("musical_arm", b -> b.icon(Blocks.JUKEBOX) - .title("DJ Mechanico") - .description("Watch a Mechanical Arm operate your Jukebox") - .after(CRAFTER) - .special(SECRET)), + MUSICAL_ARM = create("musical_arm", b -> b.icon(Blocks.JUKEBOX) + .title("DJ Mechanico") + .description("Watch a Mechanical Arm operate your Jukebox") + .after(CRAFTER) + .special(SECRET)), - // Trains - Central Branch + // Trains - Central Branch - STURDY_SHEET = create("sturdy_sheet", b -> b.icon(AllItems.STURDY_SHEET) - .title("The Sturdiest Rocks") - .description("Assemble a Sturdy Sheet by refining Powdered Obsidian") - .whenIconCollected() - .after(CRUSHING_WHEEL)), + STURDY_SHEET = create("sturdy_sheet", b -> b.icon(AllItems.STURDY_SHEET) + .title("The Sturdiest Rocks") + .description("Assemble a Sturdy Sheet by refining Powdered Obsidian") + .whenIconCollected() + .after(CRUSHING_WHEEL)), - TRAIN_CASING = create("train_casing_00", b -> b.icon(AllBlocks.RAILWAY_CASING) - .title("The Locomotive Age") - .description("Use Sturdy Sheets to create a casing for railway components") - .after(STURDY_SHEET)), + TRAIN_CASING = create("train_casing_00", b -> b.icon(AllBlocks.RAILWAY_CASING) + .title("The Locomotive Age") + .description("Use Sturdy Sheets to create a casing for railway components") + .after(STURDY_SHEET)), - TRAIN = create("train", b -> b.icon(AllBlocks.TRACK_STATION) - .title("All Aboard!") - .description("Assemble your first Train") - .after(TRAIN_CASING) - .special(NOISY)), + TRAIN = create("train", b -> b.icon(AllBlocks.TRACK_STATION) + .title("All Aboard!") + .description("Assemble your first Train") + .after(TRAIN_CASING) + .special(NOISY)), - CONDUCTOR = create("conductor", b -> b.icon(AllItems.SCHEDULE) - .title("Conductor Instructor") - .description("Instruct a Train driver with a Train Schedule") - .after(TRAIN)), + CONDUCTOR = create("conductor", b -> b.icon(AllItems.SCHEDULE) + .title("Conductor Instructor") + .description("Instruct a Train driver with a Train Schedule") + .after(TRAIN)), - SIGNAL = create("track_signal", b -> b.icon(AllBlocks.TRACK_SIGNAL) - .title("Traffic Control") - .description("Place a Train Signal") - .after(CONDUCTOR)), + SIGNAL = create("track_signal", b -> b.icon(AllBlocks.TRACK_SIGNAL) + .title("Traffic Control") + .description("Place a Train Signal") + .after(CONDUCTOR)), - DISPLAY_BOARD = create("display_board_0", b -> b.icon(AllBlocks.DISPLAY_BOARD) - .title("Dynamic Timetables") - .description("Forecast a Train's arrival on your Display Board with the help of Display Links") - .after(SIGNAL) - .special(NOISY)), + DISPLAY_BOARD = create("display_board_0", b -> b.icon(AllBlocks.DISPLAY_BOARD) + .title("Dynamic Timetables") + .description("Forecast a Train's arrival on your Display Board with the help of Display Links") + .after(SIGNAL) + .special(NOISY)), - // Trains - Top Branch + // Trains - Top Branch - TRAIN_TRACK = create("track_0", b -> b.icon(AllBlocks.TRACK) - .title("A New Gauge") - .description("Obtain some Train Tracks") - .whenItemCollected(AllItemTags.TRACKS.tag) - .after(STURDY_SHEET)), + TRAIN_TRACK = create("track_0", b -> b.icon(AllBlocks.TRACK) + .title("A New Gauge") + .description("Obtain some Train Tracks") + .whenItemCollected(AllItemTags.TRACKS.tag) + .after(STURDY_SHEET)), - TRAIN_WHISTLE = create("train_whistle", b -> b.icon(AllBlocks.STEAM_WHISTLE) - .title("Choo Choo!") - .description("Assemble a Steam Whistle to your Train and activate it while driving") - .after(TRAIN_TRACK)), + TRAIN_WHISTLE = create("train_whistle", b -> b.icon(AllBlocks.STEAM_WHISTLE) + .title("Choo Choo!") + .description("Assemble a Steam Whistle to your Train and activate it while driving") + .after(TRAIN_TRACK)), - TRAIN_PORTAL = create("train_portal", b -> b.icon(Blocks.AMETHYST_BLOCK) - .title("Dimensional Commuter") - .description("Ride a Train through a portal") - .after(TRAIN_WHISTLE) - .special(NOISY)), + TRAIN_PORTAL = create("train_portal", b -> b.icon(Blocks.AMETHYST_BLOCK) + .title("Dimensional Commuter") + .description("Ride a Train through a portal") + .after(TRAIN_WHISTLE) + .special(NOISY)), - // Trains - Expert Branch + // Trains - Expert Branch - TRACK_CRAFTING = create("track_crafting_factory", b -> b.icon(AllBlocks.MECHANICAL_PRESS) - .title("Track Factory") - .description("Produce more than 1000 Train Tracks with the same Mechanical Press") - .after(STURDY_SHEET) - .special(EXPERT)), + TRACK_CRAFTING = create("track_crafting_factory", b -> b.icon(AllBlocks.MECHANICAL_PRESS) + .title("Track Factory") + .description("Produce more than 1000 Train Tracks with the same Mechanical Press") + .after(STURDY_SHEET) + .special(EXPERT)), - LONG_TRAIN = create("long_train", b -> b.icon(Items.MINECART) - .title("Ambitious Endeavours") - .description("Create a Train with at least 6 carriages") - .after(TRACK_CRAFTING) - .special(EXPERT)), + LONG_TRAIN = create("long_train", b -> b.icon(Items.MINECART) + .title("Ambitious Endeavours") + .description("Create a Train with at least 6 carriages") + .after(TRACK_CRAFTING) + .special(EXPERT)), - LONG_TRAVEL = create("long_travel", b -> b.icon(AllBlocks.SEATS.get(DyeColor.GREEN)) - .title("Field Trip") - .description("Leave a Train Seat over 5000 blocks away from where you started travelling") - .after(LONG_TRAIN) - .special(EXPERT)), + LONG_TRAVEL = create("long_travel", b -> b.icon(AllBlocks.SEATS.get(DyeColor.GREEN)) + .title("Field Trip") + .description("Leave a Train Seat over 5000 blocks away from where you started travelling") + .after(LONG_TRAIN) + .special(EXPERT)), - // Trains - Hidden + // Trains - Hidden - TRAIN_ROADKILL = create("train_roadkill", b -> b.icon(Items.DIAMOND_SWORD) - .title("Road Kill") - .description("Run over an enemy with your Train") - .after(SIGNAL) - .special(SECRET)), + TRAIN_ROADKILL = create("train_roadkill", b -> b.icon(Items.DIAMOND_SWORD) + .title("Road Kill") + .description("Run over an enemy with your Train") + .after(SIGNAL) + .special(SECRET)), - RED_SIGNAL = create("red_signal", b -> b.icon(AllBlocks.TRACK_SIGNAL) - .title("Expert Driver") - .description("Run a red Train Signal") - .after(SIGNAL) - .special(SECRET)), + RED_SIGNAL = create("red_signal", b -> b.icon(AllBlocks.TRACK_SIGNAL) + .title("Expert Driver") + .description("Run a red Train Signal") + .after(SIGNAL) + .special(SECRET)), - TRAIN_CRASH = create("train_crash", b -> b.icon(AllItems.INCOMPLETE_TRACK) - .title("Terrible Service") - .description("Witness a Train crash as a passenger") - .after(SIGNAL) - .special(SECRET)), + TRAIN_CRASH = create("train_crash", b -> b.icon(AllItems.INCOMPLETE_TRACK) + .title("Terrible Service") + .description("Witness a Train crash as a passenger") + .after(SIGNAL) + .special(SECRET)), - TRAIN_CRASH_BACKWARDS = create("train_crash_backwards", b -> b.icon(AllItems.INCOMPLETE_TRACK) - .title("Blind Spot") - .description("Crash into another Train while driving backwards") - .after(SIGNAL) - .special(SECRET)), + TRAIN_CRASH_BACKWARDS = create("train_crash_backwards", b -> b.icon(AllItems.INCOMPLETE_TRACK) + .title("Blind Spot") + .description("Crash into another Train while driving backwards") + .after(SIGNAL) + .special(SECRET)), - // - END = null; + // + END = null; private static ItemStack createArmorTrimmedCardboardChestplate() { ItemStack asStack = AllItems.CARDBOARD_CHESTPLATE.asStack(); @@ -715,6 +714,7 @@ public class AllAdvancements implements DataProvider { advancement.provideLang(consumer); } - public static void register() {} + public static void register() { + } } diff --git a/src/main/java/com/simibubi/create/foundation/mixin/LootingEnchantFunctionMixin.java b/src/main/java/com/simibubi/create/foundation/mixin/LootingEnchantFunctionMixin.java new file mode 100644 index 0000000000..9b2dc47b16 --- /dev/null +++ b/src/main/java/com/simibubi/create/foundation/mixin/LootingEnchantFunctionMixin.java @@ -0,0 +1,44 @@ +package com.simibubi.create.foundation.mixin; + +import org.spongepowered.asm.mixin.Final; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +import com.simibubi.create.AllDamageTypes; + +import net.minecraft.world.damagesource.DamageSource; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.storage.loot.LootContext; +import net.minecraft.world.level.storage.loot.functions.LootingEnchantFunction; +import net.minecraft.world.level.storage.loot.parameters.LootContextParams; +import net.minecraft.world.level.storage.loot.providers.number.NumberProvider; + +@Mixin(LootingEnchantFunction.class) +public abstract class LootingEnchantFunctionMixin { + @Shadow + @Final + NumberProvider value; + + @Shadow + @Final + int limit; + + @Shadow + abstract boolean hasLimit(); + + @Inject(method = "run", at = @At("TAIL")) + private void create$crushingWheelsHaveLooting(ItemStack stack, LootContext context, CallbackInfoReturnable cir) { + DamageSource damageSource = context.getParamOrNull(LootContextParams.DAMAGE_SOURCE); + if (damageSource != null && damageSource.is(AllDamageTypes.CRUSH)) { + int lootingLevel = 2; + + float f = (float) lootingLevel * this.value.getFloat(context); + stack.grow(Math.round(f)); + if (this.hasLimit() && stack.getCount() > this.limit) + stack.setCount(this.limit); + } + } +} diff --git a/src/main/resources/create.mixins.json b/src/main/resources/create.mixins.json index e00095e18c..1370268535 100644 --- a/src/main/resources/create.mixins.json +++ b/src/main/resources/create.mixins.json @@ -13,6 +13,7 @@ "CustomItemUseEffectsMixin", "EntityMixin", "LavaSwimmingMixin", + "LootingEnchantFunctionMixin", "MapItemSavedDataMixin", "ProjectileUtilMixin", "ShulkerBoxBlockMixin",