diff --git a/src/main/java/thedarkcolour/exdeorum/block/CompressedSieveBlock.java b/src/main/java/thedarkcolour/exdeorum/block/CompressedSieveBlock.java
new file mode 100644
index 00000000..0b6d56d3
--- /dev/null
+++ b/src/main/java/thedarkcolour/exdeorum/block/CompressedSieveBlock.java
@@ -0,0 +1,46 @@
+/*
+ * Ex Deorum
+ * Copyright (c) 2024 thedarkcolour
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package thedarkcolour.exdeorum.block;
+
+import net.minecraft.core.BlockPos;
+import net.minecraft.world.level.BlockGetter;
+import net.minecraft.world.level.block.state.BlockState;
+import net.minecraft.world.phys.shapes.CollisionContext;
+import net.minecraft.world.phys.shapes.Shapes;
+import net.minecraft.world.phys.shapes.VoxelShape;
+import thedarkcolour.exdeorum.registry.EBlockEntities;
+
+public class CompressedSieveBlock extends SieveBlock {
+ public static final VoxelShape SHAPE = Shapes.or(
+ box(0, 8, 0, 16, 14, 16),
+ box(1, 0, 1, 3, 8, 3),
+ box(13, 0, 1, 15, 8, 3),
+ box(1, 0, 13, 3, 8, 15),
+ box(13, 0, 13, 15, 8, 15)
+ );
+
+ public CompressedSieveBlock(Properties properties) {
+ super(properties, EBlockEntities.COMPRESSED_SIEVE);
+ }
+
+ @Override
+ public VoxelShape getShape(BlockState pState, BlockGetter pLevel, BlockPos pPos, CollisionContext pContext) {
+ return SHAPE;
+ }
+}
diff --git a/src/main/java/thedarkcolour/exdeorum/block/SieveBlock.java b/src/main/java/thedarkcolour/exdeorum/block/SieveBlock.java
index b85ca338..e9850992 100644
--- a/src/main/java/thedarkcolour/exdeorum/block/SieveBlock.java
+++ b/src/main/java/thedarkcolour/exdeorum/block/SieveBlock.java
@@ -22,13 +22,18 @@ import net.minecraft.core.BlockPos;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.entity.BlockEntity;
+import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.Shapes;
import net.minecraft.world.phys.shapes.VoxelShape;
+import net.minecraftforge.registries.RegistryObject;
+import thedarkcolour.exdeorum.blockentity.EBlockEntity;
import thedarkcolour.exdeorum.blockentity.SieveBlockEntity;
import thedarkcolour.exdeorum.registry.EBlockEntities;
+import java.util.function.Supplier;
+
public class SieveBlock extends EBlock {
public static final VoxelShape SHAPE = Shapes.or(
box(0, 11, 0, 16, 16, 16),
@@ -42,14 +47,13 @@ public class SieveBlock extends EBlock {
super(properties, EBlockEntities.SIEVE);
}
- @Override
- public VoxelShape getShape(BlockState state, BlockGetter level, BlockPos pos, CollisionContext context) {
- return SHAPE;
+ protected SieveBlock(Properties properties, Supplier extends BlockEntityType>> blockEntityType) {
+ super(properties, blockEntityType);
}
@Override
- public BlockEntity newBlockEntity(BlockPos pos, BlockState state) {
- return new SieveBlockEntity(pos, state);
+ public VoxelShape getShape(BlockState state, BlockGetter level, BlockPos pos, CollisionContext context) {
+ return SHAPE;
}
@Override
diff --git a/src/main/java/thedarkcolour/exdeorum/blockentity/AbstractSieveBlockEntity.java b/src/main/java/thedarkcolour/exdeorum/blockentity/AbstractSieveBlockEntity.java
index eb4bc286..9743a598 100644
--- a/src/main/java/thedarkcolour/exdeorum/blockentity/AbstractSieveBlockEntity.java
+++ b/src/main/java/thedarkcolour/exdeorum/blockentity/AbstractSieveBlockEntity.java
@@ -22,19 +22,29 @@ import net.minecraft.core.BlockPos;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.server.level.ServerLevel;
+import net.minecraft.util.RandomSource;
+import net.minecraft.world.InteractionHand;
+import net.minecraft.world.InteractionResult;
+import net.minecraft.world.entity.item.ItemEntity;
+import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;
+import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraft.world.level.block.state.BlockState;
+import net.minecraftforge.common.util.FakePlayer;
import thedarkcolour.exdeorum.blockentity.logic.SieveLogic;
+import thedarkcolour.exdeorum.config.EConfig;
import java.util.function.Function;
public abstract class AbstractSieveBlockEntity extends EBlockEntity implements SieveLogic.Owner {
protected final SieveLogic logic;
+ private final float sieveInterval;
- public AbstractSieveBlockEntity(BlockEntityType> type, BlockPos pos, BlockState state, Function logic) {
+ public AbstractSieveBlockEntity(BlockEntityType> type, BlockPos pos, BlockState state, float sieveInterval, Function logic) {
super(type, pos, state);
+ this.sieveInterval = sieveInterval;
this.logic = logic.apply(this);
}
@@ -44,6 +54,16 @@ public abstract class AbstractSieveBlockEntity extends EBlockEntity implements S
return copy;
}
+ @Override
+ public boolean handleResultItem(ItemStack result, ServerLevel level, RandomSource rand) {
+ var pos = this.worldPosition;
+ var itemEntity = new ItemEntity(level, pos.getX() + 0.5, pos.getY() + 1.5, pos.getZ() + 0.5, result);
+ itemEntity.setDeltaMovement(rand.nextGaussian() * 0.05, 0.2, rand.nextGaussian() * 0.05);
+ level.addFreshEntity(itemEntity);
+ return true;
+ }
+
+ @SuppressWarnings("DataFlowIssue")
@Override
public ServerLevel getServerLevel() {
return (ServerLevel) this.level;
@@ -81,4 +101,143 @@ public abstract class AbstractSieveBlockEntity extends EBlockEntity implements S
this.logic.setProgress(buffer.readFloat());
this.logic.setContents(buffer.readItem());
}
+
+
+
+ public InteractionResult use(Level level, Player player, InteractionHand hand) {
+ ItemStack playerItem = player.getItemInHand(hand);
+ boolean isClientSide = level.isClientSide;
+
+ // Try insert mesh
+ if (this.logic.getMesh().isEmpty()) {
+ if (this.logic.isValidMesh(playerItem)) {
+ if (!isClientSide) {
+ this.logic.setMesh(singleCopy(playerItem));
+
+ if (!player.getAbilities().instabuild) {
+ playerItem.shrink(1);
+ }
+ return InteractionResult.CONSUME;
+ } else {
+ return InteractionResult.SUCCESS;
+ }
+ }
+ } else if (this.logic.getContents().isEmpty()) {
+ // remove mesh with sneak right click
+ if (player.isShiftKeyDown() && player.getMainHandItem().isEmpty()) {
+ popOutMesh(level, this.worldPosition, this.logic);
+ }
+ }
+
+ if (!isClientSide) {
+ // Insert an item
+ if (this.logic.getContents().isEmpty()) {
+ // If the input has any sieve drops, insert it into the mesh
+ if (this.logic.isValidInput(playerItem)) {
+ playerItem = insertContents(player, hand, this.logic);
+ var realPlayer = !(player instanceof FakePlayer);
+
+ // prevent machines placing in multiple sieves if nerf is off to avoid confusion
+ if ((realPlayer || !EConfig.SERVER.nerfAutomatedSieves.get()) && canUseSimultaneously()) {
+ int range = EConfig.SERVER.simultaneousSieveUsageRange.get();
+ var cursor = this.worldPosition.mutable().move(-range, 0, -range);
+ var selfType = getType();
+
+ // Fill adjacent sieves
+ otherSieves:
+ for (int x = -range; x <= range; x++) {
+ for (int z = -range; z <= range; z++) {
+ if (playerItem.isEmpty()) {
+ break otherSieves;
+ }
+
+ if ((x | z) != 0) {
+ if (level.getBlockEntity(cursor) instanceof AbstractSieveBlockEntity other && other.getType() == selfType) {
+ var otherLogic = other.logic;
+
+ if (otherLogic.getContents().isEmpty()) {
+ if (this.logic.getMesh().getItem() == otherLogic.getMesh().getItem()) {
+ playerItem = insertContents(player, hand, otherLogic);
+ }
+ }
+ }
+ }
+ cursor.move(0, 0, 1);
+ }
+ cursor.move(1, 0, (-2 * range) - 1);
+ }
+ }
+ }
+ } else {
+ var time = level.getGameTime();
+ var realPlayer = !(player instanceof FakePlayer);
+
+ if ((realPlayer || !EConfig.SERVER.nerfAutomatedSieves.get()) && canUseSimultaneously()) {
+ int range = EConfig.SERVER.simultaneousSieveUsageRange.get();
+ var cursor = this.worldPosition.mutable().move(-range, 0, -range);
+ var selfType = getType();
+
+ // Sieve with adjacent sieves
+ for (int x = -range; x <= range; x++) {
+ for (int z = -range; z <= range; z++) {
+ if (level.getBlockEntity(cursor) instanceof AbstractSieveBlockEntity other && other.getType() == selfType) {
+ var otherLogic = other.logic;
+
+ if (!otherLogic.getContents().isEmpty()) {
+ if (this.logic.getMesh().getItem() == otherLogic.getMesh().getItem()) {
+ otherLogic.sift(this.sieveInterval, time);
+ }
+ }
+ }
+ cursor.move(0, 0, 1);
+ }
+ cursor.move(1, 0, (-2 * range) - 1);
+ }
+ } else if (realPlayer || EConfig.SERVER.automatedSieves.get()) {
+ this.logic.sift(this.sieveInterval, time);
+ }
+ }
+ }
+
+ return InteractionResult.sidedSuccess(isClientSide);
+ }
+
+ // Fills the sieve (assumes contents is EMPTY) and returns the remaining item, putting it in the player's hand
+ public static ItemStack insertContents(Player player, InteractionHand hand, SieveLogic logic) {
+ var consume = !player.getAbilities().instabuild;
+ var playerItem = player.getItemInHand(hand);
+
+ if (consume) {
+ if (playerItem.getCount() == 1) {
+ logic.startSifting(playerItem);
+ player.setItemInHand(hand, ItemStack.EMPTY);
+ playerItem = ItemStack.EMPTY;
+ } else {
+ logic.startSifting(singleCopy(playerItem));
+ playerItem.shrink(1);
+ }
+ } else {
+ logic.startSifting(singleCopy(playerItem));
+ }
+
+ return playerItem;
+ }
+
+ // Do not call on client side
+ public static void popOutMesh(Level level, BlockPos sievePos, SieveLogic logic) {
+ if (!level.isClientSide) {
+ // Pop out item
+ var itemEntity = new ItemEntity(level, sievePos.getX() + 0.5, sievePos.getY() + 1.5, sievePos.getZ() + 0.5, logic.getMesh());
+ var rand = level.random;
+ itemEntity.setDeltaMovement(rand.nextGaussian() * 0.05, 0.2, rand.nextGaussian() * 0.05);
+ level.addFreshEntity(itemEntity);
+
+ // Empty contents
+ logic.setMesh(ItemStack.EMPTY);
+ }
+ }
+
+ protected boolean canUseSimultaneously() {
+ return false;
+ }
}
diff --git a/src/main/java/thedarkcolour/exdeorum/blockentity/CompressedSieveBlockEntity.java b/src/main/java/thedarkcolour/exdeorum/blockentity/CompressedSieveBlockEntity.java
new file mode 100644
index 00000000..529cc01f
--- /dev/null
+++ b/src/main/java/thedarkcolour/exdeorum/blockentity/CompressedSieveBlockEntity.java
@@ -0,0 +1,32 @@
+/*
+ * Ex Deorum
+ * Copyright (c) 2024 thedarkcolour
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package thedarkcolour.exdeorum.blockentity;
+
+import net.minecraft.core.BlockPos;
+import net.minecraft.world.level.block.state.BlockState;
+import thedarkcolour.exdeorum.blockentity.logic.CompressedSieveLogic;
+import thedarkcolour.exdeorum.registry.EBlockEntities;
+
+public class CompressedSieveBlockEntity extends AbstractSieveBlockEntity {
+ private static final float COMPRESSED_SIEVE_INTERVAL = 0.075f;
+
+ public CompressedSieveBlockEntity(BlockPos pos, BlockState state) {
+ super(EBlockEntities.COMPRESSED_SIEVE.get(), pos, state, COMPRESSED_SIEVE_INTERVAL, owner -> new CompressedSieveLogic(owner, false));
+ }
+}
diff --git a/src/main/java/thedarkcolour/exdeorum/blockentity/MechanicalSieveBlockEntity.java b/src/main/java/thedarkcolour/exdeorum/blockentity/MechanicalSieveBlockEntity.java
index c19b1999..1591d172 100644
--- a/src/main/java/thedarkcolour/exdeorum/blockentity/MechanicalSieveBlockEntity.java
+++ b/src/main/java/thedarkcolour/exdeorum/blockentity/MechanicalSieveBlockEntity.java
@@ -49,7 +49,7 @@ public class MechanicalSieveBlockEntity extends AbstractMachineBlockEntity new SieveLogic(owner, true, false));
+ super(EBlockEntities.SIEVE.get(), pos, state, SIEVE_INTERVAL, owner -> new SieveLogic(owner, false));
}
@Override
- public boolean handleResultItem(ItemStack result, ServerLevel level, RandomSource rand) {
- var pos = this.worldPosition;
- var itemEntity = new ItemEntity(level, pos.getX() + 0.5, pos.getY() + 1.5, pos.getZ() + 0.5, result);
- itemEntity.setDeltaMovement(rand.nextGaussian() * 0.05, 0.2, rand.nextGaussian() * 0.05);
- level.addFreshEntity(itemEntity);
- return true;
- }
-
- public InteractionResult use(Level level, Player player, InteractionHand hand) {
- ItemStack playerItem = player.getItemInHand(hand);
- boolean isClientSide = level.isClientSide;
-
- // Try insert mesh
- if (this.logic.getMesh().isEmpty()) {
- if (this.logic.isValidMesh(playerItem)) {
- if (!isClientSide) {
- this.logic.setMesh(singleCopy(playerItem));
-
- if (!player.getAbilities().instabuild) {
- playerItem.shrink(1);
- }
- return InteractionResult.CONSUME;
- } else {
- return InteractionResult.SUCCESS;
- }
- }
- } else if (this.logic.getContents().isEmpty()) {
- // remove mesh with sneak right click
- if (player.isShiftKeyDown() && player.getMainHandItem().isEmpty()) {
- popOutMesh(level, this.worldPosition, this.logic);
- }
- }
-
- if (!isClientSide) {
- // Insert an item
- if (this.logic.getContents().isEmpty()) {
- // If the input has any sieve drops, insert it into the mesh
- if (this.logic.isValidInput(playerItem)) {
- playerItem = insertContents(player, hand, this.logic);
-
- if (EConfig.SERVER.simultaneousSieveUsage.get()) {
- int range = EConfig.SERVER.simultaneousSieveUsageRange.get();
- var cursor = this.worldPosition.mutable().move(-range, 0, -range);
-
- // Fill adjacent sieves
- otherSieves:
- for (int x = -range; x <= range; x++) {
- for (int z = -range; z <= range; z++) {
- if (playerItem.isEmpty()) {
- break otherSieves;
- }
-
- if ((x | z) != 0) {
- if (level.getBlockEntity(cursor) instanceof SieveBlockEntity other) {
- if (other.logic.getContents().isEmpty()) {
- if (this.logic.getMesh().getItem() == other.logic.getMesh().getItem()) {
- playerItem = insertContents(player, hand, other.logic);
- }
- }
- }
- }
- cursor.move(0, 0, 1);
- }
- cursor.move(1, 0, (-2 * range) - 1);
- }
- }
- }
- } else {
- var time = level.getGameTime();
- var realPlayer = !(player instanceof FakePlayer);
-
- if ((realPlayer || !EConfig.SERVER.nerfAutomatedSieves.get()) && EConfig.SERVER.simultaneousSieveUsage.get()) {
- int range = EConfig.SERVER.simultaneousSieveUsageRange.get();
- var cursor = this.worldPosition.mutable().move(-range, 0, -range);
-
- // Sieve with adjacent sieves
- for (int x = -range; x <= range; x++) {
- for (int z = -range; z <= range; z++) {
- if (level.getBlockEntity(cursor) instanceof SieveBlockEntity other) {
- if (!other.logic.getContents().isEmpty()) {
- if (this.logic.getMesh().getItem() == other.logic.getMesh().getItem()) {
- other.logic.sift(SIEVE_INTERVAL, time);
- }
- }
- }
- cursor.move(0, 0, 1);
- }
- cursor.move(1, 0, (-2 * range) - 1);
- }
- } else if (realPlayer || EConfig.SERVER.automatedSieves.get()) {
- this.logic.sift(SIEVE_INTERVAL, time);
- }
- }
- }
-
- return InteractionResult.sidedSuccess(isClientSide);
- }
-
- // Fills the sieve (assumes contents is EMPTY) and returns the remaining item, putting it in the player's hand
- public static ItemStack insertContents(Player player, InteractionHand hand, SieveLogic logic) {
- var consume = !player.getAbilities().instabuild;
- var playerItem = player.getItemInHand(hand);
-
- if (consume) {
- if (playerItem.getCount() == 1) {
- logic.startSifting(playerItem);
- player.setItemInHand(hand, ItemStack.EMPTY);
- playerItem = ItemStack.EMPTY;
- } else {
- logic.startSifting(singleCopy(playerItem));
- playerItem.shrink(1);
- }
- } else {
- logic.startSifting(singleCopy(playerItem));
- }
-
- return playerItem;
- }
-
- // Do not call on client side
- public static void popOutMesh(Level level, BlockPos sievePos, SieveLogic logic) {
- if (!level.isClientSide) {
- // Pop out item
- var itemEntity = new ItemEntity(level, sievePos.getX() + 0.5, sievePos.getY() + 1.5, sievePos.getZ() + 0.5, logic.getMesh());
- var rand = level.random;
- itemEntity.setDeltaMovement(rand.nextGaussian() * 0.05, 0.2, rand.nextGaussian() * 0.05);
- level.addFreshEntity(itemEntity);
-
- // Empty contents
- logic.setMesh(ItemStack.EMPTY);
- }
+ protected boolean canUseSimultaneously() {
+ return EConfig.SERVER.simultaneousSieveUsage.get();
}
}
diff --git a/src/main/java/thedarkcolour/exdeorum/blockentity/logic/CompressedSieveLogic.java b/src/main/java/thedarkcolour/exdeorum/blockentity/logic/CompressedSieveLogic.java
new file mode 100644
index 00000000..7758c4b5
--- /dev/null
+++ b/src/main/java/thedarkcolour/exdeorum/blockentity/logic/CompressedSieveLogic.java
@@ -0,0 +1,36 @@
+/*
+ * Ex Deorum
+ * Copyright (c) 2024 thedarkcolour
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package thedarkcolour.exdeorum.blockentity.logic;
+
+import net.minecraft.world.item.ItemStack;
+import thedarkcolour.exdeorum.recipe.RecipeUtil;
+import thedarkcolour.exdeorum.recipe.sieve.SieveRecipe;
+
+import java.util.List;
+
+public class CompressedSieveLogic extends SieveLogic {
+ public CompressedSieveLogic(Owner owner, boolean mechanical) {
+ super(owner, mechanical);
+ }
+
+ @Override
+ protected List extends SieveRecipe> getDropsFor(ItemStack contents) {
+ return RecipeUtil.getCompressedSieveRecipes(this.mesh.getItem(), contents);
+ }
+}
diff --git a/src/main/java/thedarkcolour/exdeorum/blockentity/logic/SieveLogic.java b/src/main/java/thedarkcolour/exdeorum/blockentity/logic/SieveLogic.java
index ac6225f6..947ec667 100644
--- a/src/main/java/thedarkcolour/exdeorum/blockentity/logic/SieveLogic.java
+++ b/src/main/java/thedarkcolour/exdeorum/blockentity/logic/SieveLogic.java
@@ -32,15 +32,16 @@ import thedarkcolour.exdeorum.recipe.RecipeUtil;
import thedarkcolour.exdeorum.recipe.sieve.SieveRecipe;
import thedarkcolour.exdeorum.tag.EItemTags;
+import java.util.List;
+
public class SieveLogic {
private final Owner owner;
- private final boolean saveMesh;
private final boolean mechanical;
// block currently being sifted
private ItemStack contents = ItemStack.EMPTY;
// mesh
- private ItemStack mesh = ItemStack.EMPTY;
+ protected ItemStack mesh = ItemStack.EMPTY;
// from 0.0 to 1.0
private float progress;
private float efficiency;
@@ -48,9 +49,8 @@ public class SieveLogic {
private long lastTime = 0;
private final long minInterval;
- public SieveLogic(Owner owner, boolean saveMesh, boolean mechanical) {
+ public SieveLogic(Owner owner, boolean mechanical) {
this.owner = owner;
- this.saveMesh = saveMesh;
this.mechanical = mechanical;
this.minInterval = EConfig.SERVER.sieveIntervalTicks.get();
}
@@ -60,7 +60,7 @@ public class SieveLogic {
}
public boolean isValidInput(ItemStack stack) {
- return !RecipeUtil.getSieveRecipes(this.mesh.getItem(), stack).isEmpty();
+ return !getDropsFor(stack).isEmpty();
}
public boolean isValidMesh(ItemStack stack) {
@@ -91,7 +91,7 @@ public class SieveLogic {
var handledAnyDrops = false;
var hasDrops = false;
- for (SieveRecipe recipe : RecipeUtil.getSieveRecipes(this.mesh.getItem(), this.contents)) {
+ for (SieveRecipe recipe : getDropsFor(this.contents)) {
var amount = getResultAmount(recipe, context, rand);
// Split overflowing stacks (64+) into multiple stacks
@@ -124,6 +124,10 @@ public class SieveLogic {
this.owner.markUpdated();
}
+ protected List extends SieveRecipe> getDropsFor(ItemStack contents) {
+ return RecipeUtil.getSieveRecipes(this.mesh.getItem(), contents);
+ }
+
protected int getResultAmount(SieveRecipe recipe, LootContext context, RandomSource rand) {
if (recipe.byHandOnly && this.mechanical) return 0;
@@ -160,7 +164,7 @@ public class SieveLogic {
if (!this.contents.isEmpty()) {
nbt.put("contents", this.contents.serializeNBT());
}
- if (this.saveMesh && !this.mesh.isEmpty()) {
+ if (!this.mechanical && !this.mesh.isEmpty()) {
nbt.put("mesh", this.mesh.save(new CompoundTag()));
}
nbt.putFloat("progress", this.progress);
@@ -177,7 +181,7 @@ public class SieveLogic {
} else {
this.progress = nbt.getFloat("progress");
}
- if (this.saveMesh) {
+ if (!this.mechanical) {
if (nbt.contains("mesh")) {
setMesh(ItemStack.of(nbt.getCompound("mesh")), false);
} else {
diff --git a/src/main/java/thedarkcolour/exdeorum/client/ClientHandler.java b/src/main/java/thedarkcolour/exdeorum/client/ClientHandler.java
index 6581ab5e..2f2d8eb8 100644
--- a/src/main/java/thedarkcolour/exdeorum/client/ClientHandler.java
+++ b/src/main/java/thedarkcolour/exdeorum/client/ClientHandler.java
@@ -45,10 +45,7 @@ import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import thedarkcolour.exdeorum.ExDeorum;
import thedarkcolour.exdeorum.client.screen.MechanicalHammerScreen;
import thedarkcolour.exdeorum.client.screen.MechanicalSieveScreen;
-import thedarkcolour.exdeorum.client.ter.BarrelRenderer;
-import thedarkcolour.exdeorum.client.ter.CrucibleRenderer;
-import thedarkcolour.exdeorum.client.ter.InfestedLeavesRenderer;
-import thedarkcolour.exdeorum.client.ter.SieveRenderer;
+import thedarkcolour.exdeorum.client.ter.*;
import thedarkcolour.exdeorum.compat.ModIds;
import thedarkcolour.exdeorum.config.EConfig;
import thedarkcolour.exdeorum.network.ClientMessageHandler;
@@ -136,8 +133,9 @@ public class ClientHandler {
event.registerBlockEntityRenderer(EBlockEntities.BARREL.get(), BarrelRenderer::new);
event.registerBlockEntityRenderer(EBlockEntities.LAVA_CRUCIBLE.get(), ctx -> new CrucibleRenderer());
event.registerBlockEntityRenderer(EBlockEntities.WATER_CRUCIBLE.get(), ctx -> new CrucibleRenderer());
- event.registerBlockEntityRenderer(EBlockEntities.SIEVE.get(), ctx -> new SieveRenderer<>());
- event.registerBlockEntityRenderer(EBlockEntities.MECHANICAL_SIEVE.get(), ctx -> new SieveRenderer<>());
+ event.registerBlockEntityRenderer(EBlockEntities.SIEVE.get(), ctx -> new SieveRenderer<>(0.75f, 15f));
+ event.registerBlockEntityRenderer(EBlockEntities.MECHANICAL_SIEVE.get(), ctx -> new SieveRenderer<>(0.75f, 15f));
+ event.registerBlockEntityRenderer(EBlockEntities.COMPRESSED_SIEVE.get(), ctx -> new CompressedSieveRenderer<>(0.5625f, 16f));
}
private static void registerShaders(RegisterShadersEvent event) {
diff --git a/src/main/java/thedarkcolour/exdeorum/client/RenderFace.java b/src/main/java/thedarkcolour/exdeorum/client/RenderFace.java
index 19b09ee1..1e0dc745 100644
--- a/src/main/java/thedarkcolour/exdeorum/client/RenderFace.java
+++ b/src/main/java/thedarkcolour/exdeorum/client/RenderFace.java
@@ -19,18 +19,17 @@
package thedarkcolour.exdeorum.client;
import com.mojang.blaze3d.vertex.PoseStack;
-import it.unimi.dsi.fastutil.Pair;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
-import java.util.List;
-
public interface RenderFace {
void renderFlatSpriteLerp(MultiBufferSource buffers, PoseStack stack, float percentage, int r, int g, int b, int light, float edge, float yStart, float yEnd);
boolean isMissingTexture();
+ void renderCuboid(MultiBufferSource buffers, PoseStack stack, float minY, float maxY, int r, int g, int b, int light, float edge);
+
record Single(RenderType renderType, TextureAtlasSprite sprite, boolean isMissingTexture) implements RenderFace {
public Single(RenderType renderType, TextureAtlasSprite sprite) {
this(renderType, sprite, RenderUtil.isMissingTexture(sprite));
@@ -40,23 +39,35 @@ public interface RenderFace {
public void renderFlatSpriteLerp(MultiBufferSource buffers, PoseStack stack, float percentage, int r, int g, int b, int light, float edge, float yStart, float yEnd) {
RenderUtil.renderFlatSpriteLerp(buffers.getBuffer(this.renderType), stack, percentage, r, g, b, this.sprite, light, edge, yStart, yEnd);
}
+
+ @Override
+ public void renderCuboid(MultiBufferSource buffers, PoseStack stack, float minY, float maxY, int r, int g, int b, int light, float edge) {
+ RenderUtil.renderCuboid(buffers.getBuffer(this.renderType), stack, minY, maxY, r, g, b, this.sprite, light, edge);
+ }
}
- record Composite(List> layers, boolean isMissingTexture) implements RenderFace {
- public Composite(List> layers) {
+ record Composite(CompositeLayer[] layers, boolean isMissingTexture) implements RenderFace {
+ public Composite(CompositeLayer[] layers) {
this(layers, areAnyMissing(layers));
}
@Override
public void renderFlatSpriteLerp(MultiBufferSource buffers, PoseStack stack, float percentage, int r, int g, int b, int light, float edge, float yStart, float yEnd) {
for (var layer : this.layers) {
- RenderUtil.renderFlatSpriteLerp(buffers.getBuffer(layer.first()), stack, percentage, r, g, b, layer.second(), light, edge, yStart, yEnd);
+ RenderUtil.renderFlatSpriteLerp(buffers.getBuffer(layer.renderType), stack, percentage, r, g, b, layer.sprite, light, edge, yStart, yEnd);
}
}
- private static boolean areAnyMissing(List> layers) {
+ @Override
+ public void renderCuboid(MultiBufferSource buffers, PoseStack stack, float minY, float maxY, int r, int g, int b, int light, float edge) {
+ for (var layer : this.layers) {
+ RenderUtil.renderCuboid(buffers.getBuffer(layer.renderType), stack, minY, maxY, r, g, b, layer.sprite, light, edge);
+ }
+ }
+
+ private static boolean areAnyMissing(CompositeLayer[] layers) {
for (var layer : layers) {
- if (RenderUtil.isMissingTexture(layer.second())) {
+ if (RenderUtil.isMissingTexture(layer.sprite)) {
return true;
}
}
@@ -64,4 +75,6 @@ public interface RenderFace {
return false;
}
}
+
+ record CompositeLayer(RenderType renderType, TextureAtlasSprite sprite) {}
}
diff --git a/src/main/java/thedarkcolour/exdeorum/client/RenderUtil.java b/src/main/java/thedarkcolour/exdeorum/client/RenderUtil.java
index c5386a97..e7fad446 100644
--- a/src/main/java/thedarkcolour/exdeorum/client/RenderUtil.java
+++ b/src/main/java/thedarkcolour/exdeorum/client/RenderUtil.java
@@ -18,25 +18,20 @@
package thedarkcolour.exdeorum.client;
-import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.mojang.blaze3d.vertex.DefaultVertexFormat;
import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer;
import com.mojang.blaze3d.vertex.VertexFormat;
-import it.unimi.dsi.fastutil.Pair;
import net.irisshaders.iris.api.v0.IrisApi;
import net.minecraft.client.Minecraft;
-import net.minecraft.client.renderer.MultiBufferSource;
-import net.minecraft.client.renderer.RenderStateShard;
-import net.minecraft.client.renderer.RenderType;
-import net.minecraft.client.renderer.ShaderInstance;
-import net.minecraft.client.renderer.Sheets;
+import net.minecraft.client.renderer.*;
import net.minecraft.client.renderer.texture.MissingTextureAtlasSprite;
import net.minecraft.client.renderer.texture.TextureAtlas;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.resources.model.BakedModel;
import net.minecraft.core.BlockPos;
+import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.util.Mth;
import net.minecraft.util.RandomSource;
@@ -48,7 +43,6 @@ import net.minecraft.world.level.material.Fluid;
import net.minecraftforge.client.extensions.common.IClientFluidTypeExtensions;
import net.minecraftforge.client.model.CompositeModel;
import net.minecraftforge.client.model.data.ModelData;
-import net.minecraftforge.registries.ForgeRegistries;
import org.joml.Vector3f;
import thedarkcolour.exdeorum.ExDeorum;
import thedarkcolour.exdeorum.client.ter.SieveRenderer;
@@ -117,14 +111,15 @@ public class RenderUtil {
if (model instanceof CompositeModel.Baked composite) {
@SuppressWarnings("unchecked")
ImmutableMap children = (ImmutableMap) COMPOSITE_MODEL_CHILDREN.get(composite);
- var builder = new ImmutableList.Builder>();
+ RenderFace.CompositeLayer[] layers = new RenderFace.CompositeLayer[children.size()];
+ int i = 0;
for (var childModel : children.values()) {
var singleFace = getFaceFromModel(block, rand, childModel);
- builder.add(Pair.of(singleFace.renderType(), singleFace.sprite()));
+ layers[i++] = new RenderFace.CompositeLayer(singleFace.renderType(), singleFace.sprite());
}
- face = new RenderFace.Composite(builder.build());
+ face = new RenderFace.Composite(layers);
} else {
face = getFaceFromModel(block, rand, model);
}
@@ -147,7 +142,7 @@ public class RenderUtil {
}
private static TextureAtlasSprite getTopTexture(Block block, BakedModel model) {
- var registryName = ForgeRegistries.BLOCKS.getKey(block);
+ var registryName = BuiltInRegistries.BLOCK.getKey(block);
var sprite = blockAtlas.getSprite(registryName.withPrefix("block/"));
// for stuff like azalea bush, retry to get the top texture
if (isMissingTexture(sprite)) {
@@ -209,6 +204,10 @@ public class RenderUtil {
//vMin = sprite.getV0();
//vMax = sprite.getV(8);
+ // Adjust UV based on height of cuboid, rendering from the top down to the bottom of the texture
+ float f = sprite.getV1() - sprite.getV0();
+ vMax = sprite.getV0() + f * (maxY - minY);
+
// South face
normal = poseNormal.transform(new Vector3f(0, 0, 1));
builder.vertex(pose, edgeMax, maxY, edgeMax).color(r, g, b, 255).uv(uMax, vMin).overlayCoords(0, 10).uv2(light).normal(normal.x, normal.y, normal.z).endVertex();
@@ -265,6 +264,68 @@ public class RenderUtil {
builder.vertex(pose, edgeMax, y, edgeMin).color(r, g, b, 255).uv(uMax, vMin).overlayCoords(0, 10).uv2(light).normal(normal.x, normal.y, normal.z).endVertex();
}
+ // todo use ambient occlusion
+ // Renders a cuboid using the same side sprite on all six sides
+ @SuppressWarnings("DuplicatedCode")
+ public static void renderCuboid(VertexConsumer builder, PoseStack stack, float minY, float maxY, int r, int g, int b, TextureAtlasSprite sprite, int light, float edge) {
+ var pose = stack.last().pose();
+ var poseNormal = stack.last().normal();
+
+ Vector3f normal;
+ float uMin = sprite.getU0();
+ float uMax = sprite.getU1();
+ float vMin = sprite.getV0();
+ float vMax = sprite.getV1();
+
+ float edgeMin = edge / 16f;
+ float edgeMax = 1f - edge / 16f;
+
+ int lightU = light & '\uffff';
+ int lightV = light >> 16 & '\uffff';
+
+ // Top face
+ normal = poseNormal.transform(new Vector3f(0, 1, 0));
+ builder.vertex(pose, edgeMin, maxY, edgeMin).color(r, g, b, 255).uv(uMin, vMin).overlayCoords(0, 10).uv2(lightU, lightV).normal(normal.x, normal.y, normal.z).endVertex();
+ builder.vertex(pose, edgeMin, maxY, edgeMax).color(r, g, b, 255).uv(uMin, vMax).overlayCoords(0, 10).uv2(lightU, lightV).normal(normal.x, normal.y, normal.z).endVertex();
+ builder.vertex(pose, edgeMax, maxY, edgeMax).color(r, g, b, 255).uv(uMax, vMax).overlayCoords(0, 10).uv2(lightU, lightV).normal(normal.x, normal.y, normal.z).endVertex();
+ builder.vertex(pose, edgeMax, maxY, edgeMin).color(r, g, b, 255).uv(uMax, vMin).overlayCoords(0, 10).uv2(lightU, lightV).normal(normal.x, normal.y, normal.z).endVertex();
+ // Bottom face
+ normal = poseNormal.transform(new Vector3f(0, -1, 0));
+ builder.vertex(pose, edgeMin, minY, edgeMin).color(r, g, b, 255).uv(uMin, vMin).overlayCoords(0, 10).uv2(lightU, lightV).normal(normal.x, normal.y, normal.z).endVertex();
+ builder.vertex(pose, edgeMax, minY, edgeMin).color(r, g, b, 255).uv(uMax, vMin).overlayCoords(0, 10).uv2(lightU, lightV).normal(normal.x, normal.y, normal.z).endVertex();
+ builder.vertex(pose, edgeMax, minY, edgeMax).color(r, g, b, 255).uv(uMax, vMax).overlayCoords(0, 10).uv2(lightU, lightV).normal(normal.x, normal.y, normal.z).endVertex();
+ builder.vertex(pose, edgeMin, minY, edgeMax).color(r, g, b, 255).uv(uMin, vMax).overlayCoords(0, 10).uv2(lightU, lightV).normal(normal.x, normal.y, normal.z).endVertex();
+
+ // Adjust UV based on height of cuboid, rendering from the top down to the bottom of the texture
+ float f = sprite.getV1() - sprite.getV0();
+ vMax = sprite.getV0() + f * (maxY - minY);
+
+ // South face
+ normal = poseNormal.transform(new Vector3f(0, 0, -1));
+ builder.vertex(pose, edgeMax, maxY, edgeMax).color(r, g, b, 255).uv(uMax, vMin).overlayCoords(0, 10).uv2(lightU, lightV).normal(normal.x, normal.y, normal.z).endVertex();
+ builder.vertex(pose, edgeMin, maxY, edgeMax).color(r, g, b, 255).uv(uMin, vMin).overlayCoords(0, 10).uv2(lightU, lightV).normal(normal.x, normal.y, normal.z).endVertex();
+ builder.vertex(pose, edgeMin, minY, edgeMax).color(r, g, b, 255).uv(uMin, vMax).overlayCoords(0, 10).uv2(lightU, lightV).normal(normal.x, normal.y, normal.z).endVertex();
+ builder.vertex(pose, edgeMax, minY, edgeMax).color(r, g, b, 255).uv(uMax, vMax).overlayCoords(0, 10).uv2(lightU, lightV).normal(normal.x, normal.y, normal.z).endVertex();
+ // North face
+ normal = poseNormal.transform(new Vector3f(0, 0, -1));
+ builder.vertex(pose, edgeMin, maxY, edgeMin).color(r, g, b, 255).uv(uMin, vMin).overlayCoords(0, 10).uv2(lightU, lightV).normal(normal.x, normal.y, normal.z).endVertex();
+ builder.vertex(pose, edgeMax, maxY, edgeMin).color(r, g, b, 255).uv(uMax, vMin).overlayCoords(0, 10).uv2(lightU, lightV).normal(normal.x, normal.y, normal.z).endVertex();
+ builder.vertex(pose, edgeMax, minY, edgeMin).color(r, g, b, 255).uv(uMax, vMax).overlayCoords(0, 10).uv2(lightU, lightV).normal(normal.x, normal.y, normal.z).endVertex();
+ builder.vertex(pose, edgeMin, minY, edgeMin).color(r, g, b, 255).uv(uMin, vMax).overlayCoords(0, 10).uv2(lightU, lightV).normal(normal.x, normal.y, normal.z).endVertex();
+ // East face
+ normal = poseNormal.transform(new Vector3f(1, 0, 0));
+ builder.vertex(pose, edgeMax, maxY, edgeMin).color(r, g, b, 255).uv(uMin, vMin).overlayCoords(0, 10).uv2(lightU, lightV).normal(normal.x, normal.y, normal.z).endVertex();
+ builder.vertex(pose, edgeMax, maxY, edgeMax).color(r, g, b, 255).uv(uMax, vMin).overlayCoords(0, 10).uv2(lightU, lightV).normal(normal.x, normal.y, normal.z).endVertex();
+ builder.vertex(pose, edgeMax, minY, edgeMax).color(r, g, b, 255).uv(uMax, vMax).overlayCoords(0, 10).uv2(lightU, lightV).normal(normal.x, normal.y, normal.z).endVertex();
+ builder.vertex(pose, edgeMax, minY, edgeMin).color(r, g, b, 255).uv(uMin, vMax).overlayCoords(0, 10).uv2(lightU, lightV).normal(normal.x, normal.y, normal.z).endVertex();
+ // West face
+ normal = poseNormal.transform(new Vector3f(-1, 0, 0));
+ builder.vertex(pose, edgeMin, maxY, edgeMax).color(r, g, b, 255).uv(uMax, vMin).overlayCoords(0, 10).uv2(lightU, lightV).normal(normal.x, normal.y, normal.z).endVertex();
+ builder.vertex(pose, edgeMin, maxY, edgeMin).color(r, g, b, 255).uv(uMin, vMin).overlayCoords(0, 10).uv2(lightU, lightV).normal(normal.x, normal.y, normal.z).endVertex();
+ builder.vertex(pose, edgeMin, minY, edgeMin).color(r, g, b, 255).uv(uMin, vMax).overlayCoords(0, 10).uv2(lightU, lightV).normal(normal.x, normal.y, normal.z).endVertex();
+ builder.vertex(pose, edgeMin, minY, edgeMax).color(r, g, b, 255).uv(uMax, vMax).overlayCoords(0, 10).uv2(lightU, lightV).normal(normal.x, normal.y, normal.z).endVertex();
+ }
+
public static Color getRainbowColor(long time, float partialTicks) {
return Color.getHSBColor((180 * Mth.sin((time + partialTicks) / 16.0f) - 180) / 360.0f, 0.7f, 0.8f);
}
diff --git a/src/main/java/thedarkcolour/exdeorum/client/ter/CompressedSieveRenderer.java b/src/main/java/thedarkcolour/exdeorum/client/ter/CompressedSieveRenderer.java
new file mode 100644
index 00000000..2178bcfc
--- /dev/null
+++ b/src/main/java/thedarkcolour/exdeorum/client/ter/CompressedSieveRenderer.java
@@ -0,0 +1,34 @@
+/*
+ * Ex Deorum
+ * Copyright (c) 2024 thedarkcolour
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package thedarkcolour.exdeorum.client.ter;
+
+import thedarkcolour.exdeorum.blockentity.EBlockEntity;
+import thedarkcolour.exdeorum.blockentity.logic.SieveLogic;
+
+// mesh y = 10 / 16
+public class CompressedSieveRenderer extends SieveRenderer {
+ public CompressedSieveRenderer(float meshHeight, float contentsMaxY) {
+ super(meshHeight, contentsMaxY);
+ }
+
+ @Override
+ protected boolean shouldContentsRender3d(T sieve) {
+ return true;
+ }
+}
diff --git a/src/main/java/thedarkcolour/exdeorum/client/ter/SieveRenderer.java b/src/main/java/thedarkcolour/exdeorum/client/ter/SieveRenderer.java
index e21c909f..cd0e5f30 100644
--- a/src/main/java/thedarkcolour/exdeorum/client/ter/SieveRenderer.java
+++ b/src/main/java/thedarkcolour/exdeorum/client/ter/SieveRenderer.java
@@ -25,6 +25,7 @@ import net.minecraft.client.renderer.blockentity.BlockEntityRenderer;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.resources.ResourceLocation;
+import net.minecraft.util.Mth;
import net.minecraft.world.item.BlockItem;
import net.minecraft.world.item.Item;
import thedarkcolour.exdeorum.blockentity.EBlockEntity;
@@ -37,6 +38,16 @@ import java.util.Map;
public class SieveRenderer implements BlockEntityRenderer {
public static final Map- MESH_TEXTURES = new HashMap<>();
+ private final float meshHeight;
+ private final float contentsMinY;
+ private final float contentsMaxY;
+
+ public SieveRenderer(float meshHeight, float contentsMaxY) {
+ this.meshHeight = meshHeight;
+ this.contentsMinY = meshHeight * 16f + 1f;
+ this.contentsMaxY = contentsMaxY;
+ }
+
@Override
public void render(T sieve, float partialTicks, PoseStack stack, MultiBufferSource buffers, int light, int overlay) {
var logic = sieve.getLogic();
@@ -46,7 +57,12 @@ public class SieveRenderer implements
var block = blockItem.getBlock();
var percentage = logic.getProgress();
var face = RenderUtil.getTopFace(block);
- face.renderFlatSpriteLerp(buffers, stack, percentage, 0xff, 0xff, 0xff, light, 1.0f, 15f, 13f);
+
+ if (shouldContentsRender3d(sieve)) {
+ face.renderCuboid(buffers, stack, this.contentsMinY / 16f, Mth.lerp(percentage, this.contentsMaxY, this.contentsMinY) / 16f, 0xff, 0xff, 0xff, light, 1.0f);
+ } else {
+ face.renderFlatSpriteLerp(buffers, stack, percentage, 0xff, 0xff, 0xff, light, 1.0f, this.contentsMaxY, this.contentsMinY);
+ }
}
var mesh = logic.getMesh();
@@ -66,11 +82,16 @@ public class SieveRenderer implements
MESH_TEXTURES.put(meshItem, meshSprite);
}
- RenderUtil.renderFlatSprite(builder, stack, 0.75f, 0xff, 0xff, 0xff, meshSprite, light, 1f);
+ RenderUtil.renderFlatSprite(builder, stack, this.meshHeight, 0xff, 0xff, 0xff, meshSprite, light, 1f);
if (mesh.hasFoil()) {
- RenderUtil.renderFlatSprite(buffers.getBuffer(RenderType.glint()), stack, 0.75f, 0xff, 0xff, 0xff, meshSprite, light, 1f);
+ RenderUtil.renderFlatSprite(buffers.getBuffer(RenderType.glint()), stack, this.meshHeight, 0xff, 0xff, 0xff, meshSprite, light, 1f);
}
}
}
+
+ // todo return true for transparent sieves
+ protected boolean shouldContentsRender3d(T sieve) {
+ return false;
+ }
}
diff --git a/src/main/java/thedarkcolour/exdeorum/data/recipe/SieveRecipes.java b/src/main/java/thedarkcolour/exdeorum/data/recipe/SieveRecipes.java
index 375e4260..9de55d42 100644
--- a/src/main/java/thedarkcolour/exdeorum/data/recipe/SieveRecipes.java
+++ b/src/main/java/thedarkcolour/exdeorum/data/recipe/SieveRecipes.java
@@ -18,10 +18,9 @@
package thedarkcolour.exdeorum.data.recipe;
-import com.mojang.datafixers.util.Either;
+import com.google.common.collect.ImmutableMap;
import net.minecraft.data.recipes.FinishedRecipe;
import net.minecraft.resources.ResourceLocation;
-import net.minecraft.tags.TagKey;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.Items;
import net.minecraft.world.item.crafting.Ingredient;
@@ -33,895 +32,922 @@ import net.minecraftforge.registries.RegistryObject;
import thedarkcolour.exdeorum.ExDeorum;
import thedarkcolour.exdeorum.compat.ModIds;
import thedarkcolour.exdeorum.data.ModCompatData;
+import thedarkcolour.exdeorum.recipe.sieve.FinishedCompressedSieveRecipe;
import thedarkcolour.exdeorum.recipe.sieve.FinishedSieveRecipe;
import thedarkcolour.exdeorum.registry.EItems;
import thedarkcolour.exdeorum.tag.EItemTags;
-import thedarkcolour.modkit.data.MKRecipeProvider;
import java.util.List;
-import java.util.function.BiConsumer;
+import java.util.Map;
import java.util.function.Consumer;
-import java.util.function.Supplier;
import static net.minecraft.world.level.storage.loot.providers.number.BinomialDistributionGenerator.binomial;
import static thedarkcolour.modkit.data.MKRecipeProvider.ingredient;
import static thedarkcolour.modkit.data.MKRecipeProvider.path;
class SieveRecipes {
+ // Ingredients do not implement .equals, so we need constants in order to map them to compressed variants
+ private static final Ingredient
+ DIRT = ingredient(Items.DIRT),
+ GRAVEL = ingredient(Items.GRAVEL),
+ SAND = ingredient(Items.SAND),
+ DUST = ingredient(EItems.DUST.get()),
+ RED_SAND = ingredient(Items.RED_SAND),
+ CRUSHED_DEEPSLATE = ingredient(EItems.CRUSHED_DEEPSLATE.get()),
+ CRUSHED_BLACKSTONE = ingredient(EItems.CRUSHED_BLACKSTONE.get()),
+ CRUSHED_NETHERRACK = ingredient(EItems.CRUSHED_NETHERRACK.get()),
+ SOUL_SAND = ingredient(Items.SOUL_SAND),
+ CRUSHED_END_STONE = ingredient(EItems.CRUSHED_END_STONE),
+ MOSS_BLOCK = ingredient(Items.MOSS_BLOCK);
+ // mod condition is null for ex deorum blocks (ex deorum is always last priority)
+ private static final Map COMPRESSED_VARIANTS = ImmutableMap.builder()
+ .put(DIRT, ingredient(EItemTags.COMPRESSED_DIRT))
+ .put(GRAVEL, ingredient(EItemTags.COMPRESSED_GRAVEL))
+ .put(SAND, ingredient(EItemTags.COMPRESSED_SAND))
+ .put(DUST, ingredient(EItemTags.COMPRESSED_DUST))
+ .put(RED_SAND, ingredient(EItemTags.COMPRESSED_RED_SAND))
+ .put(CRUSHED_DEEPSLATE, ingredient(EItemTags.COMPRESSED_CRUSHED_DEEPSLATE))
+ .put(CRUSHED_BLACKSTONE, ingredient(EItemTags.COMPRESSED_CRUSHED_BLACKSTONE))
+ .put(CRUSHED_NETHERRACK, ingredient(EItemTags.COMPRESSED_CRUSHED_NETHERRACK))
+ .put(SOUL_SAND, ingredient(EItemTags.COMPRESSED_SOUL_SAND))
+ .put(CRUSHED_END_STONE, ingredient(EItemTags.COMPRESSED_CRUSHED_END_STONE))
+ .put(MOSS_BLOCK, ingredient(EItemTags.COMPRESSED_MOSS_BLOCK))
+ .build();
+
static void sieveRecipes(Consumer writer) {
var allMeshes = List.of(EItems.STRING_MESH, EItems.FLINT_MESH, EItems.IRON_MESH, EItems.GOLDEN_MESH, EItems.DIAMOND_MESH, EItems.NETHERITE_MESH);
// Dirt -> String mesh
- forMesh(writer, ingredient(Items.DIRT), EItems.STRING_MESH, (addDrop, addTagDrop, addConditionalDrop) -> {
- addDrop.accept(EItems.STONE_PEBBLE.get(), binomial(7, 0.6f));
- addDrop.accept(Items.FLINT, chance(0.25f));
- addDrop.accept(Items.WHEAT_SEEDS, chance(0.125f));
- addDrop.accept(Items.MELON_SEEDS, chance(0.1f));
- addDrop.accept(Items.PUMPKIN_SEEDS, chance(0.1f));
- addDrop.accept(Items.BEETROOT_SEEDS, chance(0.1f));
- addDrop.accept(Items.POTATO, chance(0.1f));
- addDrop.accept(Items.CARROT, chance(0.1f));
- addDrop.accept(EItems.GRASS_SEEDS.get(), chance(0.1f));
- addDrop.accept(EItems.MYCELIUM_SPORES.get(), chance(0.03f));
- addDrop.accept(Items.SUGAR_CANE, chance(0.1f));
- addDrop.accept(Items.POISONOUS_POTATO, chance(0.05f));
- addDrop.accept(Items.BAMBOO, chance(0.04f));
+ forMesh(writer, DIRT, EItems.STRING_MESH, drops -> {
+ drops.add(EItems.STONE_PEBBLE.get(), binomial(7, 0.6f));
+ drops.add(Items.FLINT, chance(0.25f));
+ drops.add(Items.WHEAT_SEEDS, chance(0.125f));
+ drops.add(Items.MELON_SEEDS, chance(0.1f));
+ drops.add(Items.PUMPKIN_SEEDS, chance(0.1f));
+ drops.add(Items.BEETROOT_SEEDS, chance(0.1f));
+ drops.add(Items.POTATO, chance(0.1f));
+ drops.add(Items.CARROT, chance(0.1f));
+ drops.add(EItems.GRASS_SEEDS.get(), chance(0.1f));
+ drops.add(EItems.MYCELIUM_SPORES.get(), chance(0.03f));
+ drops.add(Items.SUGAR_CANE, chance(0.1f));
+ drops.add(Items.POISONOUS_POTATO, chance(0.05f));
+ drops.add(Items.BAMBOO, chance(0.04f));
});
// Flint mesh will be used to get a larger variety of outputs from dirt, just so people don't always
// have the inventory spam that are the -ite pebbles.
// Dirt -> Flint mesh
- forMesh(writer, ingredient(Items.DIRT), EItems.FLINT_MESH, (addDrop, addTagDrop, addConditionalDrop) -> {
- addDrop.accept(EItems.STONE_PEBBLE.get(), binomial(7, 0.6f));
- addDrop.accept(Items.FLINT, chance(0.3f));
- addDrop.accept(EItems.ANDESITE_PEBBLE.get(), binomial(7, 0.4f));
- addDrop.accept(EItems.GRANITE_PEBBLE.get(), binomial(7, 0.4f));
- addDrop.accept(EItems.DIORITE_PEBBLE.get(), binomial(7, 0.4f));
- addDrop.accept(Items.WHEAT_SEEDS, chance(0.15f));
- addDrop.accept(Items.MELON_SEEDS, chance(0.12f));
- addDrop.accept(Items.PUMPKIN_SEEDS, chance(0.12f));
- addDrop.accept(Items.POTATO, chance(0.13f));
- addDrop.accept(Items.CARROT, chance(0.13f));
- addDrop.accept(EItems.GRASS_SEEDS.get(), chance(0.15f));
- addDrop.accept(EItems.MYCELIUM_SPORES.get(), chance(0.05f));
- addDrop.accept(Items.SUGAR_CANE, chance(0.15f));
- addDrop.accept(Items.POISONOUS_POTATO, chance(0.03f));
- addDrop.accept(Items.BAMBOO, chance(0.04f));
- addDrop.accept(Items.PINK_PETALS, chance(0.03f));
- addDrop.accept(Items.SWEET_BERRIES, chance(0.05f));
- addConditionalDrop.accept(ModCompatData.SOURCEBERRY.get(), chance(0.03f), Recipes.modInstalled(ModIds.ARS_NOUVEAU));
+ forMesh(writer, DIRT, EItems.FLINT_MESH, drops -> {
+ drops.add(EItems.STONE_PEBBLE.get(), binomial(7, 0.6f));
+ drops.add(Items.FLINT, chance(0.3f));
+ drops.add(EItems.ANDESITE_PEBBLE.get(), binomial(7, 0.4f));
+ drops.add(EItems.GRANITE_PEBBLE.get(), binomial(7, 0.4f));
+ drops.add(EItems.DIORITE_PEBBLE.get(), binomial(7, 0.4f));
+ drops.add(Items.WHEAT_SEEDS, chance(0.15f));
+ drops.add(Items.MELON_SEEDS, chance(0.12f));
+ drops.add(Items.PUMPKIN_SEEDS, chance(0.12f));
+ drops.add(Items.POTATO, chance(0.13f));
+ drops.add(Items.CARROT, chance(0.13f));
+ drops.add(EItems.GRASS_SEEDS.get(), chance(0.15f));
+ drops.add(EItems.MYCELIUM_SPORES.get(), chance(0.05f));
+ drops.add(Items.SUGAR_CANE, chance(0.15f));
+ drops.add(Items.POISONOUS_POTATO, chance(0.03f));
+ drops.add(Items.BAMBOO, chance(0.04f));
+ drops.add(Items.PINK_PETALS, chance(0.03f));
+ drops.add(Items.SWEET_BERRIES, chance(0.05f));
+ drops.addConditional(ModCompatData.SOURCEBERRY.get(), chance(0.03f), Recipes.modInstalled(ModIds.ARS_NOUVEAU));
});
// Dirt -> Iron mesh
- forMesh(writer, ingredient(Items.DIRT), EItems.IRON_MESH, (addDrop, addTagDrop, addConditionalDrop) -> {
- addDrop.accept(EItems.STONE_PEBBLE.get(), binomial(8, 0.65f));
- addDrop.accept(EItems.DEEPSLATE_PEBBLE.get(), binomial(3, 0.45f));
- addDrop.accept(Items.FLINT, chance(0.3f));
- addDrop.accept(Items.WHEAT_SEEDS, chance(0.175f));
- addDrop.accept(Items.MELON_SEEDS, chance(0.15f));
- addDrop.accept(Items.PUMPKIN_SEEDS, chance(0.15f));
- addDrop.accept(Items.POTATO, chance(0.15f));
- addDrop.accept(Items.CARROT, chance(0.15f));
- addDrop.accept(EItems.GRASS_SEEDS.get(), chance(0.175f));
- addDrop.accept(EItems.MYCELIUM_SPORES.get(), chance(0.1f));
- addDrop.accept(Items.SUGAR_CANE, chance(0.15f));
- addDrop.accept(Items.IRON_NUGGET, chance(0.05f));
- addDrop.accept(Items.BAMBOO, chance(0.06f));
+ forMesh(writer, DIRT, EItems.IRON_MESH, drops -> {
+ drops.add(EItems.STONE_PEBBLE.get(), binomial(8, 0.65f));
+ drops.add(EItems.DEEPSLATE_PEBBLE.get(), binomial(3, 0.45f));
+ drops.add(Items.FLINT, chance(0.3f));
+ drops.add(Items.WHEAT_SEEDS, chance(0.175f));
+ drops.add(Items.MELON_SEEDS, chance(0.15f));
+ drops.add(Items.PUMPKIN_SEEDS, chance(0.15f));
+ drops.add(Items.POTATO, chance(0.15f));
+ drops.add(Items.CARROT, chance(0.15f));
+ drops.add(EItems.GRASS_SEEDS.get(), chance(0.175f));
+ drops.add(EItems.MYCELIUM_SPORES.get(), chance(0.1f));
+ drops.add(Items.SUGAR_CANE, chance(0.15f));
+ drops.add(Items.IRON_NUGGET, chance(0.05f));
+ drops.add(Items.BAMBOO, chance(0.06f));
});
// Gold tends to spread its luster to whatever passes through it...
// Dirt -> Gold mesh
- forMesh(writer, ingredient(Items.DIRT), EItems.GOLDEN_MESH, (addDrop, addTagDrop, addConditionalDrop) -> {
- addDrop.accept(EItems.STONE_PEBBLE.get(), binomial(8, 0.7f));
- addDrop.accept(EItems.DEEPSLATE_PEBBLE.get(), binomial(3, 0.55f));
- addDrop.accept(Items.FLINT, chance(0.2f));
- addDrop.accept(Items.WHEAT_SEEDS, chance(0.2f));
- addDrop.accept(Items.MELON_SEEDS, chance(0.165f));
- addDrop.accept(Items.PUMPKIN_SEEDS, chance(0.165f));
- addDrop.accept(Items.POTATO, chance(0.175f));
- addDrop.accept(Items.CARROT, chance(0.175f));
- addDrop.accept(EItems.GRASS_SEEDS.get(), chance(0.25f));
- addDrop.accept(EItems.MYCELIUM_SPORES.get(), chance(0.13f));
- addDrop.accept(Items.GOLD_NUGGET, chance(0.05f));
- addDrop.accept(Items.IRON_NUGGET, chance(0.05f));
- addDrop.accept(Items.GOLDEN_CARROT, chance(0.02f));
- addDrop.accept(Items.BAMBOO, chance(0.05f));
+ forMesh(writer, DIRT, EItems.GOLDEN_MESH, drops -> {
+ drops.add(EItems.STONE_PEBBLE.get(), binomial(8, 0.7f));
+ drops.add(EItems.DEEPSLATE_PEBBLE.get(), binomial(3, 0.55f));
+ drops.add(Items.FLINT, chance(0.2f));
+ drops.add(Items.WHEAT_SEEDS, chance(0.2f));
+ drops.add(Items.MELON_SEEDS, chance(0.165f));
+ drops.add(Items.PUMPKIN_SEEDS, chance(0.165f));
+ drops.add(Items.POTATO, chance(0.175f));
+ drops.add(Items.CARROT, chance(0.175f));
+ drops.add(EItems.GRASS_SEEDS.get(), chance(0.25f));
+ drops.add(EItems.MYCELIUM_SPORES.get(), chance(0.13f));
+ drops.add(Items.GOLD_NUGGET, chance(0.05f));
+ drops.add(Items.IRON_NUGGET, chance(0.05f));
+ drops.add(Items.GOLDEN_CARROT, chance(0.02f));
+ drops.add(Items.BAMBOO, chance(0.05f));
});
// Diamond tables have less junk items in them. Maybe you want those items? Use other meshes!
// Dirt -> Diamond mesh
- forMesh(writer, ingredient(Items.DIRT), EItems.DIAMOND_MESH, (addDrop, addTagDrop, addConditionalDrop) -> {
- addDrop.accept(EItems.STONE_PEBBLE.get(), binomial(8, 0.7f));
- addDrop.accept(EItems.DEEPSLATE_PEBBLE.get(), binomial(3, 0.60f));
- addDrop.accept(Items.FLINT, binomial(3, 0.3f));
- addDrop.accept(Items.POTATO, chance(0.25f));
- addDrop.accept(Items.CARROT, chance(0.25f));
- addDrop.accept(EItems.GRASS_SEEDS.get(), chance(0.15f));
- addDrop.accept(EItems.MYCELIUM_SPORES.get(), chance(0.1f));
- addDrop.accept(Items.BAMBOO, chance(0.06f));
+ forMesh(writer, DIRT, EItems.DIAMOND_MESH, drops -> {
+ drops.add(EItems.STONE_PEBBLE.get(), binomial(8, 0.7f));
+ drops.add(EItems.DEEPSLATE_PEBBLE.get(), binomial(3, 0.60f));
+ drops.add(Items.FLINT, binomial(3, 0.3f));
+ drops.add(Items.POTATO, chance(0.25f));
+ drops.add(Items.CARROT, chance(0.25f));
+ drops.add(EItems.GRASS_SEEDS.get(), chance(0.15f));
+ drops.add(EItems.MYCELIUM_SPORES.get(), chance(0.1f));
+ drops.add(Items.BAMBOO, chance(0.06f));
});
// Netherite should be the best for all drops (except pebbles)
// Dirt -> Netherite mesh
- forMesh(writer, ingredient(Items.DIRT), EItems.NETHERITE_MESH, (addDrop, addTagDrop, addConditionalDrop) -> {
- addDrop.accept(EItems.STONE_PEBBLE.get(), binomial(5, 0.4f));
- addDrop.accept(EItems.DEEPSLATE_PEBBLE.get(), binomial(4, 0.65f));
- addDrop.accept(Items.FLINT, binomial(3, 0.4f));
- addDrop.accept(Items.POTATO, chance(0.3f));
- addDrop.accept(Items.CARROT, chance(0.3f));
- addDrop.accept(EItems.GRASS_SEEDS.get(), chance(0.2f));
- addDrop.accept(EItems.MYCELIUM_SPORES.get(), chance(0.2f));
- addDrop.accept(Items.GOLDEN_CARROT, chance(0.01f));
- addDrop.accept(Items.GOLDEN_APPLE, chance(0.0025f));
- addDrop.accept(Items.BAMBOO, chance(0.06f));
+ forMesh(writer, DIRT, EItems.NETHERITE_MESH, drops -> {
+ drops.add(EItems.STONE_PEBBLE.get(), binomial(5, 0.4f));
+ drops.add(EItems.DEEPSLATE_PEBBLE.get(), binomial(4, 0.65f));
+ drops.add(Items.FLINT, binomial(3, 0.4f));
+ drops.add(Items.POTATO, chance(0.3f));
+ drops.add(Items.CARROT, chance(0.3f));
+ drops.add(EItems.GRASS_SEEDS.get(), chance(0.2f));
+ drops.add(EItems.MYCELIUM_SPORES.get(), chance(0.2f));
+ drops.add(Items.GOLDEN_CARROT, chance(0.01f));
+ drops.add(Items.GOLDEN_APPLE, chance(0.0025f));
+ drops.add(Items.BAMBOO, chance(0.06f));
});
// Gravel -> String mesh
- forMesh(writer, ingredient(Items.GRAVEL), EItems.STRING_MESH, (addDrop, addTagDrop, addConditionalDrop) -> {
- addDrop.accept(EItems.STONE_PEBBLE.get(), binomial(4, 0.4f));
- addDrop.accept(Items.FLINT, chance(0.2f));
- addDrop.accept(Items.COAL, chance(0.1f));
- addDrop.accept(Items.LAPIS_LAZULI, chance(0.03f));
- addDrop.accept(EItems.COPPER_ORE_CHUNK.get(), chance(0.08f));
- addDrop.accept(EItems.IRON_ORE_CHUNK.get(), chance(0.10f));
- addDrop.accept(EItems.GOLD_ORE_CHUNK.get(), chance(0.03f));
- addDrop.accept(Items.DIAMOND, chance(0.02f));
- addDrop.accept(Items.EMERALD, chance(0.01f));
- addDrop.accept(Items.AMETHYST_SHARD, chance(0.01f));
+ forMesh(writer, GRAVEL, EItems.STRING_MESH, drops -> {
+ drops.add(EItems.STONE_PEBBLE.get(), binomial(4, 0.4f));
+ drops.add(Items.FLINT, chance(0.2f));
+ drops.add(Items.COAL, chance(0.1f));
+ drops.add(Items.LAPIS_LAZULI, chance(0.03f));
+ drops.add(EItems.COPPER_ORE_CHUNK.get(), chance(0.08f));
+ drops.add(EItems.IRON_ORE_CHUNK.get(), chance(0.10f));
+ drops.add(EItems.GOLD_ORE_CHUNK.get(), chance(0.03f));
+ drops.add(Items.DIAMOND, chance(0.02f));
+ drops.add(Items.EMERALD, chance(0.01f));
+ drops.add(Items.AMETHYST_SHARD, chance(0.01f));
- addConditionalDrop.accept(EItems.ALUMINUM_ORE_CHUNK.get(), chance(0.04f), Recipes.tagNotEmpty(EItemTags.ORES_ALUMINUM));
- addConditionalDrop.accept(EItems.SILVER_ORE_CHUNK.get(), chance(0.04f), Recipes.tagNotEmpty(EItemTags.ORES_SILVER));
- addConditionalDrop.accept(EItems.LEAD_ORE_CHUNK.get(), chance(0.04f), Recipes.tagNotEmpty(EItemTags.ORES_LEAD));
- addConditionalDrop.accept(EItems.OSMIUM_ORE_CHUNK.get(), chance(0.03f), Recipes.tagNotEmpty(EItemTags.ORES_OSMIUM));
- addConditionalDrop.accept(EItems.NICKEL_ORE_CHUNK.get(), chance(0.04f), Recipes.tagNotEmpty(EItemTags.ORES_NICKEL));
- addConditionalDrop.accept(EItems.TIN_ORE_CHUNK.get(), chance(0.06f), Recipes.tagNotEmpty(EItemTags.ORES_TIN));
- addConditionalDrop.accept(EItems.ZINC_ORE_CHUNK.get(), chance(0.035f), Recipes.tagNotEmpty(EItemTags.ORES_ZINC));
- addConditionalDrop.accept(EItems.IRIDIUM_ORE_CHUNK.get(), chance(0.03f), Recipes.tagNotEmpty(EItemTags.ORES_IRIDIUM));
- addConditionalDrop.accept(EItems.MAGNESIUM_ORE_CHUNK.get(), chance(0.07f), Recipes.tagNotEmpty(EItemTags.ORES_MAGNESIUM));
- addConditionalDrop.accept(EItems.THORIUM_ORE_CHUNK.get(), chance(0.05f), Recipes.tagNotEmpty(EItemTags.ORES_THORIUM));
- addConditionalDrop.accept(EItems.BORON_ORE_CHUNK.get(), chance(0.03f), Recipes.tagNotEmpty(EItemTags.ORES_BORON));
+ drops.addConditional(EItems.ALUMINUM_ORE_CHUNK.get(), chance(0.04f), Recipes.tagNotEmpty(EItemTags.ORES_ALUMINUM));
+ drops.addConditional(EItems.SILVER_ORE_CHUNK.get(), chance(0.04f), Recipes.tagNotEmpty(EItemTags.ORES_SILVER));
+ drops.addConditional(EItems.LEAD_ORE_CHUNK.get(), chance(0.04f), Recipes.tagNotEmpty(EItemTags.ORES_LEAD));
+ drops.addConditional(EItems.OSMIUM_ORE_CHUNK.get(), chance(0.03f), Recipes.tagNotEmpty(EItemTags.ORES_OSMIUM));
+ drops.addConditional(EItems.NICKEL_ORE_CHUNK.get(), chance(0.04f), Recipes.tagNotEmpty(EItemTags.ORES_NICKEL));
+ drops.addConditional(EItems.TIN_ORE_CHUNK.get(), chance(0.06f), Recipes.tagNotEmpty(EItemTags.ORES_TIN));
+ drops.addConditional(EItems.ZINC_ORE_CHUNK.get(), chance(0.035f), Recipes.tagNotEmpty(EItemTags.ORES_ZINC));
+ drops.addConditional(EItems.IRIDIUM_ORE_CHUNK.get(), chance(0.03f), Recipes.tagNotEmpty(EItemTags.ORES_IRIDIUM));
+ drops.addConditional(EItems.MAGNESIUM_ORE_CHUNK.get(), chance(0.07f), Recipes.tagNotEmpty(EItemTags.ORES_MAGNESIUM));
+ drops.addConditional(EItems.THORIUM_ORE_CHUNK.get(), chance(0.05f), Recipes.tagNotEmpty(EItemTags.ORES_THORIUM));
+ drops.addConditional(EItems.BORON_ORE_CHUNK.get(), chance(0.03f), Recipes.tagNotEmpty(EItemTags.ORES_BORON));
});
// Gravel -> Flint mesh
- forMesh(writer, ingredient(Items.GRAVEL), EItems.FLINT_MESH, (addDrop, addTagDrop, addConditionalDrop) -> {
- addDrop.accept(EItems.STONE_PEBBLE.get(), binomial(4, 0.5f));
- addDrop.accept(EItems.ANDESITE_PEBBLE.get(), binomial(4, 0.4f));
- addDrop.accept(EItems.GRANITE_PEBBLE.get(), binomial(4, 0.4f));
- addDrop.accept(EItems.DIORITE_PEBBLE.get(), binomial(4, 0.4f));
- addDrop.accept(Items.POINTED_DRIPSTONE, chance(0.15f));
- addDrop.accept(Items.FLINT, chance(0.25f));
- addDrop.accept(Items.COAL, chance(0.125f));
- addDrop.accept(Items.LAPIS_LAZULI, chance(0.05f));
- addDrop.accept(EItems.COPPER_ORE_CHUNK.get(), chance(0.1f));
- addDrop.accept(EItems.IRON_ORE_CHUNK.get(), chance(0.12f));
- addDrop.accept(EItems.GOLD_ORE_CHUNK.get(), chance(0.04f));
- addDrop.accept(Items.DIAMOND, chance(0.03f));
- addDrop.accept(Items.EMERALD, chance(0.015f));
- addDrop.accept(Items.AMETHYST_SHARD, chance(0.015f));
+ forMesh(writer, GRAVEL, EItems.FLINT_MESH, drops -> {
+ drops.add(EItems.STONE_PEBBLE.get(), binomial(4, 0.5f));
+ drops.add(EItems.ANDESITE_PEBBLE.get(), binomial(4, 0.4f));
+ drops.add(EItems.GRANITE_PEBBLE.get(), binomial(4, 0.4f));
+ drops.add(EItems.DIORITE_PEBBLE.get(), binomial(4, 0.4f));
+ drops.add(Items.POINTED_DRIPSTONE, chance(0.15f));
+ drops.add(Items.FLINT, chance(0.25f));
+ drops.add(Items.COAL, chance(0.125f));
+ drops.add(Items.LAPIS_LAZULI, chance(0.05f));
+ drops.add(EItems.COPPER_ORE_CHUNK.get(), chance(0.1f));
+ drops.add(EItems.IRON_ORE_CHUNK.get(), chance(0.12f));
+ drops.add(EItems.GOLD_ORE_CHUNK.get(), chance(0.04f));
+ drops.add(Items.DIAMOND, chance(0.03f));
+ drops.add(Items.EMERALD, chance(0.015f));
+ drops.add(Items.AMETHYST_SHARD, chance(0.015f));
- addConditionalDrop.accept(EItems.ALUMINUM_ORE_CHUNK.get(), chance(0.05f), Recipes.tagNotEmpty(EItemTags.ORES_ALUMINUM));
- addConditionalDrop.accept(EItems.SILVER_ORE_CHUNK.get(), chance(0.05f), Recipes.tagNotEmpty(EItemTags.ORES_SILVER));
- addConditionalDrop.accept(EItems.LEAD_ORE_CHUNK.get(), chance(0.05f), Recipes.tagNotEmpty(EItemTags.ORES_LEAD));
- addConditionalDrop.accept(EItems.OSMIUM_ORE_CHUNK.get(), chance(0.04f), Recipes.tagNotEmpty(EItemTags.ORES_OSMIUM));
- addConditionalDrop.accept(EItems.NICKEL_ORE_CHUNK.get(), chance(0.055f), Recipes.tagNotEmpty(EItemTags.ORES_NICKEL));
- addConditionalDrop.accept(EItems.TIN_ORE_CHUNK.get(), chance(0.07f), Recipes.tagNotEmpty(EItemTags.ORES_TIN));
- addConditionalDrop.accept(EItems.ZINC_ORE_CHUNK.get(), chance(0.04f), Recipes.tagNotEmpty(EItemTags.ORES_ZINC));
- addConditionalDrop.accept(EItems.IRIDIUM_ORE_CHUNK.get(), chance(0.03f), Recipes.tagNotEmpty(EItemTags.ORES_IRIDIUM));
- addConditionalDrop.accept(EItems.MAGNESIUM_ORE_CHUNK.get(), chance(0.075f), Recipes.tagNotEmpty(EItemTags.ORES_MAGNESIUM));
- addConditionalDrop.accept(EItems.THORIUM_ORE_CHUNK.get(), chance(0.055f), Recipes.tagNotEmpty(EItemTags.ORES_THORIUM));
- addConditionalDrop.accept(EItems.BORON_ORE_CHUNK.get(), chance(0.0325f), Recipes.tagNotEmpty(EItemTags.ORES_BORON));
+ drops.addConditional(EItems.ALUMINUM_ORE_CHUNK.get(), chance(0.05f), Recipes.tagNotEmpty(EItemTags.ORES_ALUMINUM));
+ drops.addConditional(EItems.SILVER_ORE_CHUNK.get(), chance(0.05f), Recipes.tagNotEmpty(EItemTags.ORES_SILVER));
+ drops.addConditional(EItems.LEAD_ORE_CHUNK.get(), chance(0.05f), Recipes.tagNotEmpty(EItemTags.ORES_LEAD));
+ drops.addConditional(EItems.OSMIUM_ORE_CHUNK.get(), chance(0.04f), Recipes.tagNotEmpty(EItemTags.ORES_OSMIUM));
+ drops.addConditional(EItems.NICKEL_ORE_CHUNK.get(), chance(0.055f), Recipes.tagNotEmpty(EItemTags.ORES_NICKEL));
+ drops.addConditional(EItems.TIN_ORE_CHUNK.get(), chance(0.07f), Recipes.tagNotEmpty(EItemTags.ORES_TIN));
+ drops.addConditional(EItems.ZINC_ORE_CHUNK.get(), chance(0.04f), Recipes.tagNotEmpty(EItemTags.ORES_ZINC));
+ drops.addConditional(EItems.IRIDIUM_ORE_CHUNK.get(), chance(0.03f), Recipes.tagNotEmpty(EItemTags.ORES_IRIDIUM));
+ drops.addConditional(EItems.MAGNESIUM_ORE_CHUNK.get(), chance(0.075f), Recipes.tagNotEmpty(EItemTags.ORES_MAGNESIUM));
+ drops.addConditional(EItems.THORIUM_ORE_CHUNK.get(), chance(0.055f), Recipes.tagNotEmpty(EItemTags.ORES_THORIUM));
+ drops.addConditional(EItems.BORON_ORE_CHUNK.get(), chance(0.0325f), Recipes.tagNotEmpty(EItemTags.ORES_BORON));
});
// Gravel -> Iron mesh
- forMesh(writer, ingredient(Items.GRAVEL), EItems.IRON_MESH, (addDrop, addTagDrop, addConditionalDrop) -> {
- addDrop.accept(EItems.STONE_PEBBLE.get(), binomial(4, 0.5f));
- addDrop.accept(EItems.DEEPSLATE_PEBBLE.get(), binomial(3, 0.55f));
- addDrop.accept(Items.FLINT, chance(0.15f));
- addDrop.accept(Items.COAL, chance(0.15f));
- addDrop.accept(Items.LAPIS_LAZULI, chance(0.08f));
- addDrop.accept(EItems.COPPER_ORE_CHUNK.get(), chance(0.12f));
- addDrop.accept(EItems.IRON_ORE_CHUNK.get(), chance(0.14f));
- addDrop.accept(EItems.GOLD_ORE_CHUNK.get(), chance(0.06f));
- addDrop.accept(Items.DIAMOND, chance(0.05f));
- addDrop.accept(Items.EMERALD, chance(0.04f));
- addDrop.accept(Items.AMETHYST_SHARD, chance(0.04f));
+ forMesh(writer, GRAVEL, EItems.IRON_MESH, drops -> {
+ drops.add(EItems.STONE_PEBBLE.get(), binomial(4, 0.5f));
+ drops.add(EItems.DEEPSLATE_PEBBLE.get(), binomial(3, 0.55f));
+ drops.add(Items.FLINT, chance(0.15f));
+ drops.add(Items.COAL, chance(0.15f));
+ drops.add(Items.LAPIS_LAZULI, chance(0.08f));
+ drops.add(EItems.COPPER_ORE_CHUNK.get(), chance(0.12f));
+ drops.add(EItems.IRON_ORE_CHUNK.get(), chance(0.14f));
+ drops.add(EItems.GOLD_ORE_CHUNK.get(), chance(0.06f));
+ drops.add(Items.DIAMOND, chance(0.05f));
+ drops.add(Items.EMERALD, chance(0.04f));
+ drops.add(Items.AMETHYST_SHARD, chance(0.04f));
- addConditionalDrop.accept(EItems.ALUMINUM_ORE_CHUNK.get(), chance(0.06f), Recipes.tagNotEmpty(EItemTags.ORES_ALUMINUM));
- addConditionalDrop.accept(EItems.SILVER_ORE_CHUNK.get(), chance(0.055f), Recipes.tagNotEmpty(EItemTags.ORES_SILVER));
- addConditionalDrop.accept(EItems.LEAD_ORE_CHUNK.get(), chance(0.06f), Recipes.tagNotEmpty(EItemTags.ORES_LEAD));
- addConditionalDrop.accept(EItems.OSMIUM_ORE_CHUNK.get(), chance(0.045f), Recipes.tagNotEmpty(EItemTags.ORES_OSMIUM));
- addConditionalDrop.accept(EItems.NICKEL_ORE_CHUNK.get(), chance(0.07f), Recipes.tagNotEmpty(EItemTags.ORES_NICKEL));
- addConditionalDrop.accept(EItems.TIN_ORE_CHUNK.get(), chance(0.09f), Recipes.tagNotEmpty(EItemTags.ORES_TIN));
- addConditionalDrop.accept(EItems.ZINC_ORE_CHUNK.get(), chance(0.06f), Recipes.tagNotEmpty(EItemTags.ORES_ZINC));
- addConditionalDrop.accept(EItems.IRIDIUM_ORE_CHUNK.get(), chance(0.04f), Recipes.tagNotEmpty(EItemTags.ORES_IRIDIUM));
- addConditionalDrop.accept(EItems.MAGNESIUM_ORE_CHUNK.get(), chance(0.09f), Recipes.tagNotEmpty(EItemTags.ORES_MAGNESIUM));
- addConditionalDrop.accept(EItems.THORIUM_ORE_CHUNK.get(), chance(0.065f), Recipes.tagNotEmpty(EItemTags.ORES_THORIUM));
- addConditionalDrop.accept(EItems.BORON_ORE_CHUNK.get(), chance(0.045f), Recipes.tagNotEmpty(EItemTags.ORES_BORON));
+ drops.addConditional(EItems.ALUMINUM_ORE_CHUNK.get(), chance(0.06f), Recipes.tagNotEmpty(EItemTags.ORES_ALUMINUM));
+ drops.addConditional(EItems.SILVER_ORE_CHUNK.get(), chance(0.055f), Recipes.tagNotEmpty(EItemTags.ORES_SILVER));
+ drops.addConditional(EItems.LEAD_ORE_CHUNK.get(), chance(0.06f), Recipes.tagNotEmpty(EItemTags.ORES_LEAD));
+ drops.addConditional(EItems.OSMIUM_ORE_CHUNK.get(), chance(0.045f), Recipes.tagNotEmpty(EItemTags.ORES_OSMIUM));
+ drops.addConditional(EItems.NICKEL_ORE_CHUNK.get(), chance(0.07f), Recipes.tagNotEmpty(EItemTags.ORES_NICKEL));
+ drops.addConditional(EItems.TIN_ORE_CHUNK.get(), chance(0.09f), Recipes.tagNotEmpty(EItemTags.ORES_TIN));
+ drops.addConditional(EItems.ZINC_ORE_CHUNK.get(), chance(0.06f), Recipes.tagNotEmpty(EItemTags.ORES_ZINC));
+ drops.addConditional(EItems.IRIDIUM_ORE_CHUNK.get(), chance(0.04f), Recipes.tagNotEmpty(EItemTags.ORES_IRIDIUM));
+ drops.addConditional(EItems.MAGNESIUM_ORE_CHUNK.get(), chance(0.09f), Recipes.tagNotEmpty(EItemTags.ORES_MAGNESIUM));
+ drops.addConditional(EItems.THORIUM_ORE_CHUNK.get(), chance(0.065f), Recipes.tagNotEmpty(EItemTags.ORES_THORIUM));
+ drops.addConditional(EItems.BORON_ORE_CHUNK.get(), chance(0.045f), Recipes.tagNotEmpty(EItemTags.ORES_BORON));
});
// Golden mesh has much higher drops for gold and gems
// Gravel -> Golden mesh
- forMesh(writer, ingredient(Items.GRAVEL), EItems.GOLDEN_MESH, (addDrop, addTagDrop, addConditionalDrop) -> {
- addDrop.accept(EItems.STONE_PEBBLE.get(), binomial(4, 0.5f));
- addDrop.accept(EItems.DEEPSLATE_PEBBLE.get(), binomial(3, 0.55f));
- addDrop.accept(Items.FLINT, chance(0.13f));
- addDrop.accept(Items.COAL, chance(0.2f));
- addDrop.accept(Items.LAPIS_LAZULI, chance(0.1f));
- addDrop.accept(EItems.COPPER_ORE_CHUNK.get(), chance(0.07f));
- addDrop.accept(EItems.IRON_ORE_CHUNK.get(), chance(0.14f));
- addDrop.accept(EItems.GOLD_ORE_CHUNK.get(), chance(0.1f));
- addDrop.accept(Items.DIAMOND, chance(0.09f));
- addDrop.accept(Items.EMERALD, chance(0.09f));
- addDrop.accept(Items.AMETHYST_SHARD, chance(0.08f));
- addDrop.accept(Items.GOLD_NUGGET, chance(0.08f));
- addDrop.accept(Items.RAW_GOLD, chance(0.02f));
+ forMesh(writer, GRAVEL, EItems.GOLDEN_MESH, drops -> {
+ drops.add(EItems.STONE_PEBBLE.get(), binomial(4, 0.5f));
+ drops.add(EItems.DEEPSLATE_PEBBLE.get(), binomial(3, 0.55f));
+ drops.add(Items.FLINT, chance(0.13f));
+ drops.add(Items.COAL, chance(0.2f));
+ drops.add(Items.LAPIS_LAZULI, chance(0.1f));
+ drops.add(EItems.COPPER_ORE_CHUNK.get(), chance(0.07f));
+ drops.add(EItems.IRON_ORE_CHUNK.get(), chance(0.14f));
+ drops.add(EItems.GOLD_ORE_CHUNK.get(), chance(0.1f));
+ drops.add(Items.DIAMOND, chance(0.09f));
+ drops.add(Items.EMERALD, chance(0.09f));
+ drops.add(Items.AMETHYST_SHARD, chance(0.08f));
+ drops.add(Items.GOLD_NUGGET, chance(0.08f));
+ drops.add(Items.RAW_GOLD, chance(0.02f));
- addConditionalDrop.accept(EItems.ALUMINUM_ORE_CHUNK.get(), chance(0.07f), Recipes.tagNotEmpty(EItemTags.ORES_ALUMINUM));
- addConditionalDrop.accept(EItems.SILVER_ORE_CHUNK.get(), chance(0.12f), Recipes.tagNotEmpty(EItemTags.ORES_SILVER));
- addConditionalDrop.accept(EItems.LEAD_ORE_CHUNK.get(), chance(0.07f), Recipes.tagNotEmpty(EItemTags.ORES_LEAD));
- addConditionalDrop.accept(EItems.OSMIUM_ORE_CHUNK.get(), chance(0.05f), Recipes.tagNotEmpty(EItemTags.ORES_OSMIUM));
- addConditionalDrop.accept(EItems.NICKEL_ORE_CHUNK.get(), chance(0.07f), Recipes.tagNotEmpty(EItemTags.ORES_NICKEL));
- addConditionalDrop.accept(EItems.TIN_ORE_CHUNK.get(), chance(0.07f), Recipes.tagNotEmpty(EItemTags.ORES_TIN));
- addConditionalDrop.accept(EItems.ZINC_ORE_CHUNK.get(), chance(0.05f), Recipes.tagNotEmpty(EItemTags.ORES_ZINC));
- addConditionalDrop.accept(EItems.IRIDIUM_ORE_CHUNK.get(), chance(0.05f), Recipes.tagNotEmpty(EItemTags.ORES_IRIDIUM));
- addConditionalDrop.accept(EItems.MAGNESIUM_ORE_CHUNK.get(), chance(0.04f), Recipes.tagNotEmpty(EItemTags.ORES_MAGNESIUM));
- addConditionalDrop.accept(EItems.THORIUM_ORE_CHUNK.get(), chance(0.04f), Recipes.tagNotEmpty(EItemTags.ORES_THORIUM));
- addConditionalDrop.accept(EItems.BORON_ORE_CHUNK.get(), chance(0.04f), Recipes.tagNotEmpty(EItemTags.ORES_BORON));
+ drops.addConditional(EItems.ALUMINUM_ORE_CHUNK.get(), chance(0.07f), Recipes.tagNotEmpty(EItemTags.ORES_ALUMINUM));
+ drops.addConditional(EItems.SILVER_ORE_CHUNK.get(), chance(0.12f), Recipes.tagNotEmpty(EItemTags.ORES_SILVER));
+ drops.addConditional(EItems.LEAD_ORE_CHUNK.get(), chance(0.07f), Recipes.tagNotEmpty(EItemTags.ORES_LEAD));
+ drops.addConditional(EItems.OSMIUM_ORE_CHUNK.get(), chance(0.05f), Recipes.tagNotEmpty(EItemTags.ORES_OSMIUM));
+ drops.addConditional(EItems.NICKEL_ORE_CHUNK.get(), chance(0.07f), Recipes.tagNotEmpty(EItemTags.ORES_NICKEL));
+ drops.addConditional(EItems.TIN_ORE_CHUNK.get(), chance(0.07f), Recipes.tagNotEmpty(EItemTags.ORES_TIN));
+ drops.addConditional(EItems.ZINC_ORE_CHUNK.get(), chance(0.05f), Recipes.tagNotEmpty(EItemTags.ORES_ZINC));
+ drops.addConditional(EItems.IRIDIUM_ORE_CHUNK.get(), chance(0.05f), Recipes.tagNotEmpty(EItemTags.ORES_IRIDIUM));
+ drops.addConditional(EItems.MAGNESIUM_ORE_CHUNK.get(), chance(0.04f), Recipes.tagNotEmpty(EItemTags.ORES_MAGNESIUM));
+ drops.addConditional(EItems.THORIUM_ORE_CHUNK.get(), chance(0.04f), Recipes.tagNotEmpty(EItemTags.ORES_THORIUM));
+ drops.addConditional(EItems.BORON_ORE_CHUNK.get(), chance(0.04f), Recipes.tagNotEmpty(EItemTags.ORES_BORON));
});
// Gravel -> Diamond mesh
- forMesh(writer, ingredient(Items.GRAVEL), EItems.DIAMOND_MESH, (addDrop, addTagDrop, addConditionalDrop) -> {
- addDrop.accept(EItems.DEEPSLATE_PEBBLE.get(), binomial(5, 0.6f));
- addDrop.accept(Items.FLINT, chance(0.05f));
- addDrop.accept(Items.COAL, chance(0.06f));
- addDrop.accept(Items.LAPIS_LAZULI, chance(0.11f));
- addDrop.accept(EItems.COPPER_ORE_CHUNK.get(), chance(0.07f));
- addDrop.accept(EItems.IRON_ORE_CHUNK.get(), chance(0.15f));
- addDrop.accept(EItems.GOLD_ORE_CHUNK.get(), chance(0.08f));
- addDrop.accept(Items.DIAMOND, chance(0.08f));
- addDrop.accept(Items.EMERALD, chance(0.07f));
- addDrop.accept(Items.AMETHYST_SHARD, chance(0.06f));
+ forMesh(writer, GRAVEL, EItems.DIAMOND_MESH, drops -> {
+ drops.add(EItems.DEEPSLATE_PEBBLE.get(), binomial(5, 0.6f));
+ drops.add(Items.FLINT, chance(0.05f));
+ drops.add(Items.COAL, chance(0.06f));
+ drops.add(Items.LAPIS_LAZULI, chance(0.11f));
+ drops.add(EItems.COPPER_ORE_CHUNK.get(), chance(0.07f));
+ drops.add(EItems.IRON_ORE_CHUNK.get(), chance(0.15f));
+ drops.add(EItems.GOLD_ORE_CHUNK.get(), chance(0.08f));
+ drops.add(Items.DIAMOND, chance(0.08f));
+ drops.add(Items.EMERALD, chance(0.07f));
+ drops.add(Items.AMETHYST_SHARD, chance(0.06f));
- addConditionalDrop.accept(EItems.ALUMINUM_ORE_CHUNK.get(), chance(0.08f), Recipes.tagNotEmpty(EItemTags.ORES_ALUMINUM));
- addConditionalDrop.accept(EItems.SILVER_ORE_CHUNK.get(), chance(0.08f), Recipes.tagNotEmpty(EItemTags.ORES_SILVER));
- addConditionalDrop.accept(EItems.LEAD_ORE_CHUNK.get(), chance(0.09f), Recipes.tagNotEmpty(EItemTags.ORES_LEAD));
- addConditionalDrop.accept(EItems.OSMIUM_ORE_CHUNK.get(), chance(0.07f), Recipes.tagNotEmpty(EItemTags.ORES_OSMIUM));
- addConditionalDrop.accept(EItems.NICKEL_ORE_CHUNK.get(), chance(0.09f), Recipes.tagNotEmpty(EItemTags.ORES_NICKEL));
- addConditionalDrop.accept(EItems.TIN_ORE_CHUNK.get(), chance(0.11f), Recipes.tagNotEmpty(EItemTags.ORES_TIN));
- addConditionalDrop.accept(EItems.ZINC_ORE_CHUNK.get(), chance(0.08f), Recipes.tagNotEmpty(EItemTags.ORES_ZINC));
- addConditionalDrop.accept(EItems.IRIDIUM_ORE_CHUNK.get(), chance(0.05f), Recipes.tagNotEmpty(EItemTags.ORES_IRIDIUM));
- addConditionalDrop.accept(EItems.MAGNESIUM_ORE_CHUNK.get(), chance(0.105f), Recipes.tagNotEmpty(EItemTags.ORES_MAGNESIUM));
- addConditionalDrop.accept(EItems.THORIUM_ORE_CHUNK.get(), chance(0.07f), Recipes.tagNotEmpty(EItemTags.ORES_THORIUM));
- addConditionalDrop.accept(EItems.BORON_ORE_CHUNK.get(), chance(0.06f), Recipes.tagNotEmpty(EItemTags.ORES_BORON));
+ drops.addConditional(EItems.ALUMINUM_ORE_CHUNK.get(), chance(0.08f), Recipes.tagNotEmpty(EItemTags.ORES_ALUMINUM));
+ drops.addConditional(EItems.SILVER_ORE_CHUNK.get(), chance(0.08f), Recipes.tagNotEmpty(EItemTags.ORES_SILVER));
+ drops.addConditional(EItems.LEAD_ORE_CHUNK.get(), chance(0.09f), Recipes.tagNotEmpty(EItemTags.ORES_LEAD));
+ drops.addConditional(EItems.OSMIUM_ORE_CHUNK.get(), chance(0.07f), Recipes.tagNotEmpty(EItemTags.ORES_OSMIUM));
+ drops.addConditional(EItems.NICKEL_ORE_CHUNK.get(), chance(0.09f), Recipes.tagNotEmpty(EItemTags.ORES_NICKEL));
+ drops.addConditional(EItems.TIN_ORE_CHUNK.get(), chance(0.11f), Recipes.tagNotEmpty(EItemTags.ORES_TIN));
+ drops.addConditional(EItems.ZINC_ORE_CHUNK.get(), chance(0.08f), Recipes.tagNotEmpty(EItemTags.ORES_ZINC));
+ drops.addConditional(EItems.IRIDIUM_ORE_CHUNK.get(), chance(0.05f), Recipes.tagNotEmpty(EItemTags.ORES_IRIDIUM));
+ drops.addConditional(EItems.MAGNESIUM_ORE_CHUNK.get(), chance(0.105f), Recipes.tagNotEmpty(EItemTags.ORES_MAGNESIUM));
+ drops.addConditional(EItems.THORIUM_ORE_CHUNK.get(), chance(0.07f), Recipes.tagNotEmpty(EItemTags.ORES_THORIUM));
+ drops.addConditional(EItems.BORON_ORE_CHUNK.get(), chance(0.06f), Recipes.tagNotEmpty(EItemTags.ORES_BORON));
});
// Gravel -> Netherite mesh
- forMesh(writer, ingredient(Items.GRAVEL), EItems.NETHERITE_MESH, (addDrop, addTagDrop, addConditionalDrop) -> {
- addDrop.accept(EItems.DEEPSLATE_PEBBLE.get(), binomial(6, 0.625f));
- addDrop.accept(Items.COAL, chance(0.06f));
- addDrop.accept(Items.LAPIS_LAZULI, chance(0.11f));
- addDrop.accept(EItems.COPPER_ORE_CHUNK.get(), chance(0.1f));
- addDrop.accept(EItems.IRON_ORE_CHUNK.get(), chance(0.17f));
- addDrop.accept(EItems.GOLD_ORE_CHUNK.get(), chance(0.09f));
- addDrop.accept(Items.DIAMOND, chance(0.1f));
- addDrop.accept(Items.EMERALD, chance(0.09f));
- addDrop.accept(Items.AMETHYST_SHARD, chance(0.08f));
- addDrop.accept(Items.GOLD_NUGGET, chance(0.04f));
- addDrop.accept(Items.RAW_GOLD, chance(0.01f));
+ forMesh(writer, GRAVEL, EItems.NETHERITE_MESH, drops -> {
+ drops.add(EItems.DEEPSLATE_PEBBLE.get(), binomial(6, 0.625f));
+ drops.add(Items.COAL, chance(0.06f));
+ drops.add(Items.LAPIS_LAZULI, chance(0.11f));
+ drops.add(EItems.COPPER_ORE_CHUNK.get(), chance(0.1f));
+ drops.add(EItems.IRON_ORE_CHUNK.get(), chance(0.17f));
+ drops.add(EItems.GOLD_ORE_CHUNK.get(), chance(0.09f));
+ drops.add(Items.DIAMOND, chance(0.1f));
+ drops.add(Items.EMERALD, chance(0.09f));
+ drops.add(Items.AMETHYST_SHARD, chance(0.08f));
+ drops.add(Items.GOLD_NUGGET, chance(0.04f));
+ drops.add(Items.RAW_GOLD, chance(0.01f));
- addConditionalDrop.accept(EItems.ALUMINUM_ORE_CHUNK.get(), chance(0.09f), Recipes.tagNotEmpty(EItemTags.ORES_ALUMINUM));
- addConditionalDrop.accept(EItems.SILVER_ORE_CHUNK.get(), chance(0.11f), Recipes.tagNotEmpty(EItemTags.ORES_SILVER));
- addConditionalDrop.accept(EItems.LEAD_ORE_CHUNK.get(), chance(0.11f), Recipes.tagNotEmpty(EItemTags.ORES_LEAD));
- addConditionalDrop.accept(EItems.OSMIUM_ORE_CHUNK.get(), chance(0.09f), Recipes.tagNotEmpty(EItemTags.ORES_OSMIUM));
- addConditionalDrop.accept(EItems.NICKEL_ORE_CHUNK.get(), chance(0.10f), Recipes.tagNotEmpty(EItemTags.ORES_NICKEL));
- addConditionalDrop.accept(EItems.TIN_ORE_CHUNK.get(), chance(0.12f), Recipes.tagNotEmpty(EItemTags.ORES_TIN));
- addConditionalDrop.accept(EItems.ZINC_ORE_CHUNK.get(), chance(0.08f), Recipes.tagNotEmpty(EItemTags.ORES_ZINC));
- addConditionalDrop.accept(EItems.IRIDIUM_ORE_CHUNK.get(), chance(0.055f), Recipes.tagNotEmpty(EItemTags.ORES_IRIDIUM));
- addConditionalDrop.accept(EItems.MAGNESIUM_ORE_CHUNK.get(), chance(0.12f), Recipes.tagNotEmpty(EItemTags.ORES_MAGNESIUM));
- addConditionalDrop.accept(EItems.THORIUM_ORE_CHUNK.get(), chance(0.075f), Recipes.tagNotEmpty(EItemTags.ORES_THORIUM));
- addConditionalDrop.accept(EItems.BORON_ORE_CHUNK.get(), chance(0.065f), Recipes.tagNotEmpty(EItemTags.ORES_BORON));
+ drops.addConditional(EItems.ALUMINUM_ORE_CHUNK.get(), chance(0.09f), Recipes.tagNotEmpty(EItemTags.ORES_ALUMINUM));
+ drops.addConditional(EItems.SILVER_ORE_CHUNK.get(), chance(0.11f), Recipes.tagNotEmpty(EItemTags.ORES_SILVER));
+ drops.addConditional(EItems.LEAD_ORE_CHUNK.get(), chance(0.11f), Recipes.tagNotEmpty(EItemTags.ORES_LEAD));
+ drops.addConditional(EItems.OSMIUM_ORE_CHUNK.get(), chance(0.09f), Recipes.tagNotEmpty(EItemTags.ORES_OSMIUM));
+ drops.addConditional(EItems.NICKEL_ORE_CHUNK.get(), chance(0.10f), Recipes.tagNotEmpty(EItemTags.ORES_NICKEL));
+ drops.addConditional(EItems.TIN_ORE_CHUNK.get(), chance(0.12f), Recipes.tagNotEmpty(EItemTags.ORES_TIN));
+ drops.addConditional(EItems.ZINC_ORE_CHUNK.get(), chance(0.08f), Recipes.tagNotEmpty(EItemTags.ORES_ZINC));
+ drops.addConditional(EItems.IRIDIUM_ORE_CHUNK.get(), chance(0.055f), Recipes.tagNotEmpty(EItemTags.ORES_IRIDIUM));
+ drops.addConditional(EItems.MAGNESIUM_ORE_CHUNK.get(), chance(0.12f), Recipes.tagNotEmpty(EItemTags.ORES_MAGNESIUM));
+ drops.addConditional(EItems.THORIUM_ORE_CHUNK.get(), chance(0.075f), Recipes.tagNotEmpty(EItemTags.ORES_THORIUM));
+ drops.addConditional(EItems.BORON_ORE_CHUNK.get(), chance(0.065f), Recipes.tagNotEmpty(EItemTags.ORES_BORON));
});
// Sand -> String mesh
- forMesh(writer, ingredient(Items.SAND), EItems.STRING_MESH, (addDrop, addTagDrop, addConditionalDrop) -> {
- addDrop.accept(Items.CACTUS, chance(0.13f));
- addDrop.accept(Items.FLINT, chance(0.2f));
- addDrop.accept(Items.DEAD_BUSH, chance(0.08f));
- addDrop.accept(Items.GOLD_NUGGET, chance(0.13f));
- addDrop.accept(Items.IRON_NUGGET, chance(0.13f));
- addDrop.accept(Items.KELP, chance(0.1f));
- addDrop.accept(Items.SEA_PICKLE, chance(0.05f));
+ forMesh(writer, SAND, EItems.STRING_MESH, drops -> {
+ drops.add(Items.CACTUS, chance(0.13f));
+ drops.add(Items.FLINT, chance(0.2f));
+ drops.add(Items.DEAD_BUSH, chance(0.08f));
+ drops.add(Items.GOLD_NUGGET, chance(0.13f));
+ drops.add(Items.IRON_NUGGET, chance(0.13f));
+ drops.add(Items.KELP, chance(0.1f));
+ drops.add(Items.SEA_PICKLE, chance(0.05f));
- addConditionalDrop.accept(ModCompatData.CERTUS_QUARTZ_CRYSTAL.get(), chance(0.03f), Recipes.modInstalled(ModIds.APPLIED_ENERGISTICS_2));
- addConditionalDrop.accept(ModCompatData.CHARGED_CERTUS_QUARTZ_CRYSTAL.get(), chance(0.005f), Recipes.modInstalled(ModIds.APPLIED_ENERGISTICS_2));
+ drops.addConditional(ModCompatData.CERTUS_QUARTZ_CRYSTAL.get(), chance(0.03f), Recipes.modInstalled(ModIds.APPLIED_ENERGISTICS_2));
+ drops.addConditional(ModCompatData.CHARGED_CERTUS_QUARTZ_CRYSTAL.get(), chance(0.005f), Recipes.modInstalled(ModIds.APPLIED_ENERGISTICS_2));
});
- forMesh(writer, ingredient(Items.SAND), EItems.FLINT_MESH, (addDrop, addTagDrop, addConditionalDrop) -> {
- addDrop.accept(Items.FLINT, binomial(2, 0.2f));
- addDrop.accept(Items.DEAD_BUSH, chance(0.03f));
- addDrop.accept(Items.GOLD_NUGGET, chance(0.16f));
- addDrop.accept(Items.IRON_NUGGET, chance(0.16f));
- addDrop.accept(EItems.RANDOM_POTTERY_SHERD.get(), chance(0.04f));
+ forMesh(writer, SAND, EItems.FLINT_MESH, drops -> {
+ drops.add(Items.FLINT, binomial(2, 0.2f));
+ drops.add(Items.DEAD_BUSH, chance(0.03f));
+ drops.add(Items.GOLD_NUGGET, chance(0.16f));
+ drops.add(Items.IRON_NUGGET, chance(0.16f));
+ drops.add(EItems.RANDOM_POTTERY_SHERD.get(), chance(0.04f));
- addConditionalDrop.accept(ModCompatData.CERTUS_QUARTZ_CRYSTAL.get(), chance(0.04f), Recipes.modInstalled(ModIds.APPLIED_ENERGISTICS_2));
- addConditionalDrop.accept(ModCompatData.CHARGED_CERTUS_QUARTZ_CRYSTAL.get(), chance(0.005f), Recipes.modInstalled(ModIds.APPLIED_ENERGISTICS_2));
+ drops.addConditional(ModCompatData.CERTUS_QUARTZ_CRYSTAL.get(), chance(0.04f), Recipes.modInstalled(ModIds.APPLIED_ENERGISTICS_2));
+ drops.addConditional(ModCompatData.CHARGED_CERTUS_QUARTZ_CRYSTAL.get(), chance(0.005f), Recipes.modInstalled(ModIds.APPLIED_ENERGISTICS_2));
});
- forMesh(writer, ingredient(Items.SAND), EItems.IRON_MESH, (addDrop, addTagDrop, addConditionalDrop) -> {
- addDrop.accept(Items.CACTUS, chance(0.13f));
- addDrop.accept(Items.FLINT, chance(0.23f));
- addDrop.accept(Items.DEAD_BUSH, chance(0.08f));
- addDrop.accept(Items.GOLD_NUGGET, chance(0.18f));
- addDrop.accept(Items.IRON_NUGGET, chance(0.18f));
- addDrop.accept(Items.KELP, chance(0.07f));
- addDrop.accept(Items.SEA_PICKLE, chance(0.03f));
- addDrop.accept(Items.PRISMARINE_SHARD, chance(0.06f));
- addDrop.accept(Items.PRISMARINE_CRYSTALS, chance(0.06f));
+ forMesh(writer, SAND, EItems.IRON_MESH, drops -> {
+ drops.add(Items.CACTUS, chance(0.13f));
+ drops.add(Items.FLINT, chance(0.23f));
+ drops.add(Items.DEAD_BUSH, chance(0.08f));
+ drops.add(Items.GOLD_NUGGET, chance(0.18f));
+ drops.add(Items.IRON_NUGGET, chance(0.18f));
+ drops.add(Items.KELP, chance(0.07f));
+ drops.add(Items.SEA_PICKLE, chance(0.03f));
+ drops.add(Items.PRISMARINE_SHARD, chance(0.06f));
+ drops.add(Items.PRISMARINE_CRYSTALS, chance(0.06f));
- addConditionalDrop.accept(ModCompatData.CERTUS_QUARTZ_CRYSTAL.get(), chance(0.06f), Recipes.modInstalled(ModIds.APPLIED_ENERGISTICS_2));
- addConditionalDrop.accept(ModCompatData.CHARGED_CERTUS_QUARTZ_CRYSTAL.get(), chance(0.0125f), Recipes.modInstalled(ModIds.APPLIED_ENERGISTICS_2));
+ drops.addConditional(ModCompatData.CERTUS_QUARTZ_CRYSTAL.get(), chance(0.06f), Recipes.modInstalled(ModIds.APPLIED_ENERGISTICS_2));
+ drops.addConditional(ModCompatData.CHARGED_CERTUS_QUARTZ_CRYSTAL.get(), chance(0.0125f), Recipes.modInstalled(ModIds.APPLIED_ENERGISTICS_2));
});
- forMesh(writer, ingredient(Items.SAND), EItems.GOLDEN_MESH, (addDrop, addTagDrop, addConditionalDrop) -> {
- addDrop.accept(Items.CACTUS, chance(0.10f));
- addDrop.accept(Items.FLINT, chance(0.18f));
- addDrop.accept(Items.DEAD_BUSH, chance(0.06f));
- addDrop.accept(Items.GOLD_NUGGET, binomial(3, 0.28f));
- addDrop.accept(Items.IRON_NUGGET, chance(0.16f));
- addDrop.accept(Items.KELP, chance(0.05f));
- addDrop.accept(Items.SEA_PICKLE, chance(0.03f));
- addDrop.accept(Items.PRISMARINE_SHARD, chance(0.08f));
- addDrop.accept(Items.PRISMARINE_CRYSTALS, chance(0.08f));
- addDrop.accept(Items.RAW_GOLD, chance(0.04f));
- addDrop.accept(EItems.RANDOM_ARMOR_TRIM.get(), chance(0.02f));
+ forMesh(writer, SAND, EItems.GOLDEN_MESH, drops -> {
+ drops.add(Items.CACTUS, chance(0.10f));
+ drops.add(Items.FLINT, chance(0.18f));
+ drops.add(Items.DEAD_BUSH, chance(0.06f));
+ drops.add(Items.GOLD_NUGGET, binomial(3, 0.28f));
+ drops.add(Items.IRON_NUGGET, chance(0.16f));
+ drops.add(Items.KELP, chance(0.05f));
+ drops.add(Items.SEA_PICKLE, chance(0.03f));
+ drops.add(Items.PRISMARINE_SHARD, chance(0.08f));
+ drops.add(Items.PRISMARINE_CRYSTALS, chance(0.08f));
+ drops.add(Items.RAW_GOLD, chance(0.04f));
+ drops.add(EItems.RANDOM_ARMOR_TRIM.get(), chance(0.02f));
- addConditionalDrop.accept(ModCompatData.CERTUS_QUARTZ_CRYSTAL.get(), chance(0.07f), Recipes.modInstalled(ModIds.APPLIED_ENERGISTICS_2));
- addConditionalDrop.accept(ModCompatData.CHARGED_CERTUS_QUARTZ_CRYSTAL.get(), chance(0.015f), Recipes.modInstalled(ModIds.APPLIED_ENERGISTICS_2));
+ drops.addConditional(ModCompatData.CERTUS_QUARTZ_CRYSTAL.get(), chance(0.07f), Recipes.modInstalled(ModIds.APPLIED_ENERGISTICS_2));
+ drops.addConditional(ModCompatData.CHARGED_CERTUS_QUARTZ_CRYSTAL.get(), chance(0.015f), Recipes.modInstalled(ModIds.APPLIED_ENERGISTICS_2));
});
- forMesh(writer, ingredient(Items.SAND), EItems.DIAMOND_MESH, (addDrop, addTagDrop, addConditionalDrop) -> {
- addDrop.accept(Items.FLINT, chance(0.23f));
- addDrop.accept(Items.GOLD_NUGGET, chance(0.22f));
- addDrop.accept(Items.IRON_NUGGET, chance(0.22f));
- addDrop.accept(Items.PRISMARINE_SHARD, chance(0.09f));
- addDrop.accept(Items.PRISMARINE_CRYSTALS, chance(0.09f));
+ forMesh(writer, SAND, EItems.DIAMOND_MESH, drops -> {
+ drops.add(Items.FLINT, chance(0.23f));
+ drops.add(Items.GOLD_NUGGET, chance(0.22f));
+ drops.add(Items.IRON_NUGGET, chance(0.22f));
+ drops.add(Items.PRISMARINE_SHARD, chance(0.09f));
+ drops.add(Items.PRISMARINE_CRYSTALS, chance(0.09f));
- addConditionalDrop.accept(ModCompatData.CERTUS_QUARTZ_CRYSTAL.get(), chance(0.09f), Recipes.modInstalled(ModIds.APPLIED_ENERGISTICS_2));
- addConditionalDrop.accept(ModCompatData.CHARGED_CERTUS_QUARTZ_CRYSTAL.get(), chance(0.02f), Recipes.modInstalled(ModIds.APPLIED_ENERGISTICS_2));
+ drops.addConditional(ModCompatData.CERTUS_QUARTZ_CRYSTAL.get(), chance(0.09f), Recipes.modInstalled(ModIds.APPLIED_ENERGISTICS_2));
+ drops.addConditional(ModCompatData.CHARGED_CERTUS_QUARTZ_CRYSTAL.get(), chance(0.02f), Recipes.modInstalled(ModIds.APPLIED_ENERGISTICS_2));
});
- forMesh(writer, ingredient(Items.SAND), EItems.NETHERITE_MESH, (addDrop, addTagDrop, addConditionalDrop) -> {
- addDrop.accept(Items.CACTUS, chance(0.15f));
- addDrop.accept(Items.FLINT, binomial(2, 0.23f));
- addDrop.accept(Items.GOLD_NUGGET, chance(0.23f));
- addDrop.accept(Items.IRON_NUGGET, chance(0.23f));
- addDrop.accept(Items.KELP, chance(0.1f));
- addDrop.accept(Items.SEA_PICKLE, chance(0.07f));
- addDrop.accept(Items.PRISMARINE_SHARD, chance(0.12f));
- addDrop.accept(Items.PRISMARINE_CRYSTALS, chance(0.12f));
+ forMesh(writer, SAND, EItems.NETHERITE_MESH, drops -> {
+ drops.add(Items.CACTUS, chance(0.15f));
+ drops.add(Items.FLINT, binomial(2, 0.23f));
+ drops.add(Items.GOLD_NUGGET, chance(0.23f));
+ drops.add(Items.IRON_NUGGET, chance(0.23f));
+ drops.add(Items.KELP, chance(0.1f));
+ drops.add(Items.SEA_PICKLE, chance(0.07f));
+ drops.add(Items.PRISMARINE_SHARD, chance(0.12f));
+ drops.add(Items.PRISMARINE_CRYSTALS, chance(0.12f));
- addConditionalDrop.accept(ModCompatData.CERTUS_QUARTZ_CRYSTAL.get(), chance(0.095f), Recipes.modInstalled(ModIds.APPLIED_ENERGISTICS_2));
- addConditionalDrop.accept(ModCompatData.CHARGED_CERTUS_QUARTZ_CRYSTAL.get(), chance(0.035f), Recipes.modInstalled(ModIds.APPLIED_ENERGISTICS_2));
+ drops.addConditional(ModCompatData.CERTUS_QUARTZ_CRYSTAL.get(), chance(0.095f), Recipes.modInstalled(ModIds.APPLIED_ENERGISTICS_2));
+ drops.addConditional(ModCompatData.CHARGED_CERTUS_QUARTZ_CRYSTAL.get(), chance(0.035f), Recipes.modInstalled(ModIds.APPLIED_ENERGISTICS_2));
});
// Red Sand -> String mesh
- forMesh(writer, ingredient(Items.RED_SAND), EItems.STRING_MESH, (addDrop, addTagDrop, addConditionalDrop) -> {
- addDrop.accept(Items.CACTUS, chance(0.12f));
- addDrop.accept(Items.DEAD_BUSH, chance(0.07f));
- addDrop.accept(Items.GOLD_NUGGET, chance(0.09f));
- addDrop.accept(Items.REDSTONE, chance(0.08f));
- addDrop.accept(Items.RAW_GOLD, chance(0.03f));
+ forMesh(writer, RED_SAND, EItems.STRING_MESH, drops -> {
+ drops.add(Items.CACTUS, chance(0.12f));
+ drops.add(Items.DEAD_BUSH, chance(0.07f));
+ drops.add(Items.GOLD_NUGGET, chance(0.09f));
+ drops.add(Items.REDSTONE, chance(0.08f));
+ drops.add(Items.RAW_GOLD, chance(0.03f));
});
- forMesh(writer, ingredient(Items.RED_SAND), EItems.FLINT_MESH, (addDrop, addTagDrop, addConditionalDrop) -> {
- addDrop.accept(Items.CACTUS, chance(0.12f));
- addDrop.accept(Items.DEAD_BUSH, chance(0.07f));
- addDrop.accept(Items.GOLD_NUGGET, chance(0.12f));
- addDrop.accept(Items.REDSTONE, chance(0.09f));
- addDrop.accept(Items.RAW_GOLD, chance(0.04f));
+ forMesh(writer, RED_SAND, EItems.FLINT_MESH, drops -> {
+ drops.add(Items.CACTUS, chance(0.12f));
+ drops.add(Items.DEAD_BUSH, chance(0.07f));
+ drops.add(Items.GOLD_NUGGET, chance(0.12f));
+ drops.add(Items.REDSTONE, chance(0.09f));
+ drops.add(Items.RAW_GOLD, chance(0.04f));
});
- forMesh(writer, ingredient(Items.RED_SAND), EItems.IRON_MESH, (addDrop, addTagDrop, addConditionalDrop) -> {
- addDrop.accept(Items.CACTUS, chance(0.12f));
- addDrop.accept(Items.DEAD_BUSH, chance(0.07f));
- addDrop.accept(Items.GOLD_NUGGET, chance(0.09f));
- addDrop.accept(Items.REDSTONE, chance(0.11f));
- addDrop.accept(Items.RAW_GOLD, chance(0.06f));
+ forMesh(writer, RED_SAND, EItems.IRON_MESH, drops -> {
+ drops.add(Items.CACTUS, chance(0.12f));
+ drops.add(Items.DEAD_BUSH, chance(0.07f));
+ drops.add(Items.GOLD_NUGGET, chance(0.09f));
+ drops.add(Items.REDSTONE, chance(0.11f));
+ drops.add(Items.RAW_GOLD, chance(0.06f));
});
- forMesh(writer, ingredient(Items.RED_SAND), EItems.GOLDEN_MESH, (addDrop, addTagDrop, addConditionalDrop) -> {
- addDrop.accept(Items.CACTUS, chance(0.12f));
- addDrop.accept(Items.DEAD_BUSH, chance(0.07f));
- addDrop.accept(Items.GOLD_NUGGET, chance(0.19f));
- addDrop.accept(Items.REDSTONE, chance(0.07f));
- addDrop.accept(Items.RAW_GOLD, chance(0.11f));
+ forMesh(writer, RED_SAND, EItems.GOLDEN_MESH, drops -> {
+ drops.add(Items.CACTUS, chance(0.12f));
+ drops.add(Items.DEAD_BUSH, chance(0.07f));
+ drops.add(Items.GOLD_NUGGET, chance(0.19f));
+ drops.add(Items.REDSTONE, chance(0.07f));
+ drops.add(Items.RAW_GOLD, chance(0.11f));
});
- forMesh(writer, ingredient(Items.RED_SAND), EItems.DIAMOND_MESH, (addDrop, addTagDrop, addConditionalDrop) -> {
- addDrop.accept(Items.CACTUS, chance(0.10f));
- addDrop.accept(Items.DEAD_BUSH, chance(0.03f));
- addDrop.accept(Items.GOLD_NUGGET, chance(0.14f));
- addDrop.accept(Items.REDSTONE, chance(0.14f));
- addDrop.accept(Items.RAW_GOLD, chance(0.08f));
+ forMesh(writer, RED_SAND, EItems.DIAMOND_MESH, drops -> {
+ drops.add(Items.CACTUS, chance(0.10f));
+ drops.add(Items.DEAD_BUSH, chance(0.03f));
+ drops.add(Items.GOLD_NUGGET, chance(0.14f));
+ drops.add(Items.REDSTONE, chance(0.14f));
+ drops.add(Items.RAW_GOLD, chance(0.08f));
});
- forMesh(writer, ingredient(Items.RED_SAND), EItems.NETHERITE_MESH, (addDrop, addTagDrop, addConditionalDrop) -> {
- addDrop.accept(Items.CACTUS, chance(0.12f));
- addDrop.accept(Items.GOLD_NUGGET, chance(0.15f));
- addDrop.accept(Items.REDSTONE, chance(0.17f));
- addDrop.accept(Items.RAW_GOLD, chance(0.10f));
+ forMesh(writer, RED_SAND, EItems.NETHERITE_MESH, drops -> {
+ drops.add(Items.CACTUS, chance(0.12f));
+ drops.add(Items.GOLD_NUGGET, chance(0.15f));
+ drops.add(Items.REDSTONE, chance(0.17f));
+ drops.add(Items.RAW_GOLD, chance(0.10f));
});
- forMesh(writer, ingredient(EItems.DUST.get()), EItems.STRING_MESH, (addDrop, addTagDrop, addConditionalDrop) -> {
- addDrop.accept(Items.GUNPOWDER, chance(0.1f));
- addDrop.accept(Items.BONE_MEAL, chance(0.1f));
- addDrop.accept(Items.REDSTONE, chance(0.06f));
- addDrop.accept(Items.GLOWSTONE_DUST, chance(0.04f));
- addDrop.accept(Items.BLAZE_POWDER, chance(0.03f));
+ forMesh(writer, DUST, EItems.STRING_MESH, drops -> {
+ drops.add(Items.GUNPOWDER, chance(0.1f));
+ drops.add(Items.BONE_MEAL, chance(0.1f));
+ drops.add(Items.REDSTONE, chance(0.06f));
+ drops.add(Items.GLOWSTONE_DUST, chance(0.04f));
+ drops.add(Items.BLAZE_POWDER, chance(0.03f));
- addConditionalDrop.accept(ModCompatData.GRAINS_OF_INFINITY.get(), chance(0.06f), Recipes.ENDERIO);
- addConditionalDrop.accept(ModCompatData.YELLORIUM_DUST.get(), chance(0.05f), Recipes.EXTREME_REACTORS);
- addConditionalDrop.accept(ModCompatData.SKY_STONE_DUST.get(), chance(0.06f), Recipes.AE2);
- addConditionalDrop.accept(ModCompatData.CERTUS_QUARTZ_DUST.get(), chance(0.06f), Recipes.AE2);
+ drops.addConditional(ModCompatData.GRAINS_OF_INFINITY.get(), chance(0.06f), Recipes.ENDERIO);
+ drops.addConditional(ModCompatData.YELLORIUM_DUST.get(), chance(0.05f), Recipes.EXTREME_REACTORS);
+ drops.addConditional(ModCompatData.SKY_STONE_DUST.get(), chance(0.06f), Recipes.AE2);
+ drops.addConditional(ModCompatData.CERTUS_QUARTZ_DUST.get(), chance(0.06f), Recipes.AE2);
});
- forMesh(writer, ingredient(EItems.DUST.get()), EItems.FLINT_MESH, (addDrop, addTagDrop, addConditionalDrop) -> {
- addDrop.accept(Items.GUNPOWDER, chance(0.11f));
- addDrop.accept(Items.BONE_MEAL, chance(0.11f));
- addDrop.accept(Items.REDSTONE, chance(0.09f));
- addDrop.accept(Items.GLOWSTONE_DUST, chance(0.07f));
- addDrop.accept(Items.BLAZE_POWDER, chance(0.04f));
+ forMesh(writer, DUST, EItems.FLINT_MESH, drops -> {
+ drops.add(Items.GUNPOWDER, chance(0.11f));
+ drops.add(Items.BONE_MEAL, chance(0.11f));
+ drops.add(Items.REDSTONE, chance(0.09f));
+ drops.add(Items.GLOWSTONE_DUST, chance(0.07f));
+ drops.add(Items.BLAZE_POWDER, chance(0.04f));
- addConditionalDrop.accept(ModCompatData.GRAINS_OF_INFINITY.get(), chance(0.07f), Recipes.ENDERIO);
- addConditionalDrop.accept(ModCompatData.YELLORIUM_DUST.get(), chance(0.055f), Recipes.EXTREME_REACTORS);
- addConditionalDrop.accept(ModCompatData.SKY_STONE_DUST.get(), chance(0.07f), Recipes.AE2);
- addConditionalDrop.accept(ModCompatData.CERTUS_QUARTZ_DUST.get(), chance(0.07f), Recipes.AE2);
+ drops.addConditional(ModCompatData.GRAINS_OF_INFINITY.get(), chance(0.07f), Recipes.ENDERIO);
+ drops.addConditional(ModCompatData.YELLORIUM_DUST.get(), chance(0.055f), Recipes.EXTREME_REACTORS);
+ drops.addConditional(ModCompatData.SKY_STONE_DUST.get(), chance(0.07f), Recipes.AE2);
+ drops.addConditional(ModCompatData.CERTUS_QUARTZ_DUST.get(), chance(0.07f), Recipes.AE2);
});
- forMesh(writer, ingredient(EItems.DUST.get()), EItems.IRON_MESH, (addDrop, addTagDrop, addConditionalDrop) -> {
- addDrop.accept(Items.GUNPOWDER, chance(0.13f));
- addDrop.accept(Items.BONE_MEAL, chance(0.12f));
- addDrop.accept(Items.REDSTONE, chance(0.1f));
- addDrop.accept(Items.GLOWSTONE_DUST, chance(0.09f));
- addDrop.accept(Items.BLAZE_POWDER, chance(0.05f));
- addDrop.accept(Items.IRON_NUGGET, chance(0.06f));
+ forMesh(writer, DUST, EItems.IRON_MESH, drops -> {
+ drops.add(Items.GUNPOWDER, chance(0.13f));
+ drops.add(Items.BONE_MEAL, chance(0.12f));
+ drops.add(Items.REDSTONE, chance(0.1f));
+ drops.add(Items.GLOWSTONE_DUST, chance(0.09f));
+ drops.add(Items.BLAZE_POWDER, chance(0.05f));
+ drops.add(Items.IRON_NUGGET, chance(0.06f));
- addConditionalDrop.accept(ModCompatData.GRAINS_OF_INFINITY.get(), chance(0.09f), Recipes.ENDERIO);
- addConditionalDrop.accept(ModCompatData.YELLORIUM_DUST.get(), chance(0.08f), Recipes.EXTREME_REACTORS);
- addConditionalDrop.accept(ModCompatData.SKY_STONE_DUST.get(), chance(0.075f), Recipes.AE2);
- addConditionalDrop.accept(ModCompatData.CERTUS_QUARTZ_DUST.get(), chance(0.075f), Recipes.AE2);
+ drops.addConditional(ModCompatData.GRAINS_OF_INFINITY.get(), chance(0.09f), Recipes.ENDERIO);
+ drops.addConditional(ModCompatData.YELLORIUM_DUST.get(), chance(0.08f), Recipes.EXTREME_REACTORS);
+ drops.addConditional(ModCompatData.SKY_STONE_DUST.get(), chance(0.075f), Recipes.AE2);
+ drops.addConditional(ModCompatData.CERTUS_QUARTZ_DUST.get(), chance(0.075f), Recipes.AE2);
});
- forMesh(writer, ingredient(EItems.DUST.get()), EItems.GOLDEN_MESH, (addDrop, addTagDrop, addConditionalDrop) -> {
- addDrop.accept(Items.GUNPOWDER, chance(0.13f));
- addDrop.accept(Items.BONE_MEAL, chance(0.11f));
- addDrop.accept(Items.REDSTONE, chance(0.12f));
- addDrop.accept(Items.GLOWSTONE_DUST, chance(0.11f));
- addDrop.accept(Items.BLAZE_POWDER, chance(0.06f));
- addDrop.accept(Items.GOLD_NUGGET, binomial(2, 0.18f));
- addDrop.accept(Items.RAW_GOLD, chance(0.02f));
+ forMesh(writer, DUST, EItems.GOLDEN_MESH, drops -> {
+ drops.add(Items.GUNPOWDER, chance(0.13f));
+ drops.add(Items.BONE_MEAL, chance(0.11f));
+ drops.add(Items.REDSTONE, chance(0.12f));
+ drops.add(Items.GLOWSTONE_DUST, chance(0.11f));
+ drops.add(Items.BLAZE_POWDER, chance(0.06f));
+ drops.add(Items.GOLD_NUGGET, binomial(2, 0.18f));
+ drops.add(Items.RAW_GOLD, chance(0.02f));
- addConditionalDrop.accept(ModCompatData.GRAINS_OF_INFINITY.get(), chance(0.11f), Recipes.ENDERIO);
- addConditionalDrop.accept(ModCompatData.YELLORIUM_DUST.get(), chance(0.10f), Recipes.EXTREME_REACTORS);
- addConditionalDrop.accept(ModCompatData.SKY_STONE_DUST.get(), chance(0.08f), Recipes.AE2);
- addConditionalDrop.accept(ModCompatData.CERTUS_QUARTZ_DUST.get(), chance(0.08f), Recipes.AE2);
+ drops.addConditional(ModCompatData.GRAINS_OF_INFINITY.get(), chance(0.11f), Recipes.ENDERIO);
+ drops.addConditional(ModCompatData.YELLORIUM_DUST.get(), chance(0.10f), Recipes.EXTREME_REACTORS);
+ drops.addConditional(ModCompatData.SKY_STONE_DUST.get(), chance(0.08f), Recipes.AE2);
+ drops.addConditional(ModCompatData.CERTUS_QUARTZ_DUST.get(), chance(0.08f), Recipes.AE2);
});
- forMesh(writer, ingredient(EItems.DUST.get()), EItems.DIAMOND_MESH, (addDrop, addTagDrop, addConditionalDrop) -> {
- addDrop.accept(Items.GUNPOWDER, chance(0.14f));
- addDrop.accept(Items.BONE_MEAL, chance(0.10f));
- addDrop.accept(Items.REDSTONE, chance(0.12f));
- addDrop.accept(Items.GLOWSTONE_DUST, chance(0.11f));
- addDrop.accept(Items.BLAZE_POWDER, chance(0.06f));
- addDrop.accept(Items.GOLD_NUGGET, chance(0.08f));
+ forMesh(writer, DUST, EItems.DIAMOND_MESH, drops -> {
+ drops.add(Items.GUNPOWDER, chance(0.14f));
+ drops.add(Items.BONE_MEAL, chance(0.10f));
+ drops.add(Items.REDSTONE, chance(0.12f));
+ drops.add(Items.GLOWSTONE_DUST, chance(0.11f));
+ drops.add(Items.BLAZE_POWDER, chance(0.06f));
+ drops.add(Items.GOLD_NUGGET, chance(0.08f));
- addConditionalDrop.accept(ModCompatData.GRAINS_OF_INFINITY.get(), chance(0.12f), Recipes.ENDERIO);
- addConditionalDrop.accept(ModCompatData.YELLORIUM_DUST.get(), chance(0.12f), Recipes.EXTREME_REACTORS);
- addConditionalDrop.accept(ModCompatData.SKY_STONE_DUST.get(), chance(0.10f), Recipes.AE2);
- addConditionalDrop.accept(ModCompatData.CERTUS_QUARTZ_DUST.get(), chance(0.10f), Recipes.AE2);
+ drops.addConditional(ModCompatData.GRAINS_OF_INFINITY.get(), chance(0.12f), Recipes.ENDERIO);
+ drops.addConditional(ModCompatData.YELLORIUM_DUST.get(), chance(0.12f), Recipes.EXTREME_REACTORS);
+ drops.addConditional(ModCompatData.SKY_STONE_DUST.get(), chance(0.10f), Recipes.AE2);
+ drops.addConditional(ModCompatData.CERTUS_QUARTZ_DUST.get(), chance(0.10f), Recipes.AE2);
});
- forMesh(writer, ingredient(EItems.DUST.get()), EItems.NETHERITE_MESH, (addDrop, addTagDrop, addConditionalDrop) -> {
- addDrop.accept(Items.GUNPOWDER, chance(0.14f));
- addDrop.accept(Items.BONE_MEAL, chance(0.13f));
- addDrop.accept(Items.REDSTONE, chance(0.14f));
- addDrop.accept(Items.GLOWSTONE_DUST, chance(0.15f));
- addDrop.accept(Items.BLAZE_POWDER, chance(0.1f));
- addDrop.accept(Items.GOLD_NUGGET, chance(0.08f));
- addDrop.accept(Items.IRON_NUGGET, chance(0.08f));
+ forMesh(writer, DUST, EItems.NETHERITE_MESH, drops -> {
+ drops.add(Items.GUNPOWDER, chance(0.14f));
+ drops.add(Items.BONE_MEAL, chance(0.13f));
+ drops.add(Items.REDSTONE, chance(0.14f));
+ drops.add(Items.GLOWSTONE_DUST, chance(0.15f));
+ drops.add(Items.BLAZE_POWDER, chance(0.1f));
+ drops.add(Items.GOLD_NUGGET, chance(0.08f));
+ drops.add(Items.IRON_NUGGET, chance(0.08f));
- addConditionalDrop.accept(ModCompatData.GRAINS_OF_INFINITY.get(), chance(0.135f), Recipes.ENDERIO);
- addConditionalDrop.accept(ModCompatData.YELLORIUM_DUST.get(), chance(0.14f), Recipes.EXTREME_REACTORS);
- addConditionalDrop.accept(ModCompatData.SKY_STONE_DUST.get(), chance(0.11f), Recipes.AE2);
- addConditionalDrop.accept(ModCompatData.CERTUS_QUARTZ_DUST.get(), chance(0.11f), Recipes.AE2);
+ drops.addConditional(ModCompatData.GRAINS_OF_INFINITY.get(), chance(0.135f), Recipes.ENDERIO);
+ drops.addConditional(ModCompatData.YELLORIUM_DUST.get(), chance(0.14f), Recipes.EXTREME_REACTORS);
+ drops.addConditional(ModCompatData.SKY_STONE_DUST.get(), chance(0.11f), Recipes.AE2);
+ drops.addConditional(ModCompatData.CERTUS_QUARTZ_DUST.get(), chance(0.11f), Recipes.AE2);
});
// Crushed Deepslate -> String mesh
- forMesh(writer, ingredient(EItems.CRUSHED_DEEPSLATE.get()), EItems.STRING_MESH, (addDrop, addTagDrop, addConditionalDrop) -> {
- addDrop.accept(EItems.DEEPSLATE_PEBBLE.get(), binomial(4, 0.5f));
- addDrop.accept(EItems.COPPER_ORE_CHUNK.get(), chance(0.12f));
- addDrop.accept(EItems.IRON_ORE_CHUNK.get(), chance(0.12f));
- addDrop.accept(EItems.GOLD_ORE_CHUNK.get(), chance(0.08f));
- addDrop.accept(Items.AMETHYST_SHARD, chance(0.05f));
- addDrop.accept(Items.DIAMOND, chance(0.04f));
- addDrop.accept(Items.LAPIS_LAZULI, chance(0.04f));
- addDrop.accept(Items.EMERALD, chance(0.03f));
+ forMesh(writer, CRUSHED_DEEPSLATE, EItems.STRING_MESH, drops -> {
+ drops.add(EItems.DEEPSLATE_PEBBLE.get(), binomial(4, 0.5f));
+ drops.add(EItems.COPPER_ORE_CHUNK.get(), chance(0.12f));
+ drops.add(EItems.IRON_ORE_CHUNK.get(), chance(0.12f));
+ drops.add(EItems.GOLD_ORE_CHUNK.get(), chance(0.08f));
+ drops.add(Items.AMETHYST_SHARD, chance(0.05f));
+ drops.add(Items.DIAMOND, chance(0.04f));
+ drops.add(Items.LAPIS_LAZULI, chance(0.04f));
+ drops.add(Items.EMERALD, chance(0.03f));
- addConditionalDrop.accept(EItems.SILVER_ORE_CHUNK.get(), chance(0.05f), Recipes.tagNotEmpty(EItemTags.ORES_SILVER));
- addConditionalDrop.accept(EItems.LEAD_ORE_CHUNK.get(), chance(0.05f), Recipes.tagNotEmpty(EItemTags.ORES_LEAD));
- addConditionalDrop.accept(EItems.OSMIUM_ORE_CHUNK.get(), chance(0.06f), Recipes.tagNotEmpty(EItemTags.ORES_OSMIUM));
- addConditionalDrop.accept(EItems.NICKEL_ORE_CHUNK.get(), chance(0.04f), Recipes.tagNotEmpty(EItemTags.ORES_NICKEL));
- addConditionalDrop.accept(EItems.TIN_ORE_CHUNK.get(), chance(0.05f), Recipes.tagNotEmpty(EItemTags.ORES_TIN));
- addConditionalDrop.accept(EItems.IRIDIUM_ORE_CHUNK.get(), chance(0.04f), Recipes.tagNotEmpty(EItemTags.ORES_IRIDIUM));
- addConditionalDrop.accept(EItems.PLATINUM_ORE_CHUNK.get(), chance(0.03f), Recipes.tagNotEmpty(EItemTags.ORES_PLATINUM));
- addConditionalDrop.accept(EItems.URANIUM_ORE_CHUNK.get(), chance(0.04f), Recipes.tagNotEmpty(EItemTags.ORES_URANIUM));
- addConditionalDrop.accept(EItems.MAGNESIUM_ORE_CHUNK.get(), chance(0.09f), Recipes.tagNotEmpty(EItemTags.ORES_MAGNESIUM));
- addConditionalDrop.accept(EItems.THORIUM_ORE_CHUNK.get(), chance(0.06f), Recipes.tagNotEmpty(EItemTags.ORES_THORIUM));
- addConditionalDrop.accept(EItems.BORON_ORE_CHUNK.get(), chance(0.05f), Recipes.tagNotEmpty(EItemTags.ORES_BORON));
- addConditionalDrop.accept(EItems.LITHIUM_ORE_CHUNK.get(), chance(0.045f), Recipes.tagNotEmpty(EItemTags.ORES_LITHIUM));
+ drops.addConditional(EItems.SILVER_ORE_CHUNK.get(), chance(0.05f), Recipes.tagNotEmpty(EItemTags.ORES_SILVER));
+ drops.addConditional(EItems.LEAD_ORE_CHUNK.get(), chance(0.05f), Recipes.tagNotEmpty(EItemTags.ORES_LEAD));
+ drops.addConditional(EItems.OSMIUM_ORE_CHUNK.get(), chance(0.06f), Recipes.tagNotEmpty(EItemTags.ORES_OSMIUM));
+ drops.addConditional(EItems.NICKEL_ORE_CHUNK.get(), chance(0.04f), Recipes.tagNotEmpty(EItemTags.ORES_NICKEL));
+ drops.addConditional(EItems.TIN_ORE_CHUNK.get(), chance(0.05f), Recipes.tagNotEmpty(EItemTags.ORES_TIN));
+ drops.addConditional(EItems.IRIDIUM_ORE_CHUNK.get(), chance(0.04f), Recipes.tagNotEmpty(EItemTags.ORES_IRIDIUM));
+ drops.addConditional(EItems.PLATINUM_ORE_CHUNK.get(), chance(0.03f), Recipes.tagNotEmpty(EItemTags.ORES_PLATINUM));
+ drops.addConditional(EItems.URANIUM_ORE_CHUNK.get(), chance(0.04f), Recipes.tagNotEmpty(EItemTags.ORES_URANIUM));
+ drops.addConditional(EItems.MAGNESIUM_ORE_CHUNK.get(), chance(0.09f), Recipes.tagNotEmpty(EItemTags.ORES_MAGNESIUM));
+ drops.addConditional(EItems.THORIUM_ORE_CHUNK.get(), chance(0.06f), Recipes.tagNotEmpty(EItemTags.ORES_THORIUM));
+ drops.addConditional(EItems.BORON_ORE_CHUNK.get(), chance(0.05f), Recipes.tagNotEmpty(EItemTags.ORES_BORON));
+ drops.addConditional(EItems.LITHIUM_ORE_CHUNK.get(), chance(0.045f), Recipes.tagNotEmpty(EItemTags.ORES_LITHIUM));
});
- forMesh(writer, ingredient(EItems.CRUSHED_DEEPSLATE.get()), EItems.FLINT_MESH, (addDrop, addTagDrop, addConditionalDrop) -> {
- addDrop.accept(EItems.DEEPSLATE_PEBBLE.get(), binomial(4, 0.5f));
- addDrop.accept(EItems.TUFF_PEBBLE.get(), binomial(4, 0.4f));
- addDrop.accept(EItems.CALCITE_PEBBLE.get(), binomial(4, 0.4f));
- addDrop.accept(EItems.BASALT_PEBBLE.get(), binomial(4, 0.4f));
- addDrop.accept(EItems.COPPER_ORE_CHUNK.get(), chance(0.11f));
- addDrop.accept(EItems.IRON_ORE_CHUNK.get(), chance(0.13f));
- addDrop.accept(EItems.GOLD_ORE_CHUNK.get(), chance(0.08f));
- addDrop.accept(Items.AMETHYST_SHARD, chance(0.06f));
- addDrop.accept(Items.DIAMOND, chance(0.05f));
- addDrop.accept(Items.LAPIS_LAZULI, chance(0.05f));
- addDrop.accept(Items.EMERALD, chance(0.04f));
+ forMesh(writer, CRUSHED_DEEPSLATE, EItems.FLINT_MESH, drops -> {
+ drops.add(EItems.DEEPSLATE_PEBBLE.get(), binomial(4, 0.5f));
+ drops.add(EItems.TUFF_PEBBLE.get(), binomial(4, 0.4f));
+ drops.add(EItems.CALCITE_PEBBLE.get(), binomial(4, 0.4f));
+ drops.add(EItems.BASALT_PEBBLE.get(), binomial(4, 0.4f));
+ drops.add(EItems.COPPER_ORE_CHUNK.get(), chance(0.11f));
+ drops.add(EItems.IRON_ORE_CHUNK.get(), chance(0.13f));
+ drops.add(EItems.GOLD_ORE_CHUNK.get(), chance(0.08f));
+ drops.add(Items.AMETHYST_SHARD, chance(0.06f));
+ drops.add(Items.DIAMOND, chance(0.05f));
+ drops.add(Items.LAPIS_LAZULI, chance(0.05f));
+ drops.add(Items.EMERALD, chance(0.04f));
- addConditionalDrop.accept(EItems.SILVER_ORE_CHUNK.get(), chance(0.08f), Recipes.tagNotEmpty(EItemTags.ORES_SILVER));
- addConditionalDrop.accept(EItems.LEAD_ORE_CHUNK.get(), chance(0.08f), Recipes.tagNotEmpty(EItemTags.ORES_LEAD));
- addConditionalDrop.accept(EItems.OSMIUM_ORE_CHUNK.get(), chance(0.08f), Recipes.tagNotEmpty(EItemTags.ORES_OSMIUM));
- addConditionalDrop.accept(EItems.NICKEL_ORE_CHUNK.get(), chance(0.06f), Recipes.tagNotEmpty(EItemTags.ORES_NICKEL));
- addConditionalDrop.accept(EItems.TIN_ORE_CHUNK.get(), chance(0.07f), Recipes.tagNotEmpty(EItemTags.ORES_TIN));
- addConditionalDrop.accept(EItems.IRIDIUM_ORE_CHUNK.get(), chance(0.05f), Recipes.tagNotEmpty(EItemTags.ORES_IRIDIUM));
- addConditionalDrop.accept(EItems.PLATINUM_ORE_CHUNK.get(), chance(0.05f), Recipes.tagNotEmpty(EItemTags.ORES_PLATINUM));
- addConditionalDrop.accept(EItems.URANIUM_ORE_CHUNK.get(), chance(0.06f), Recipes.tagNotEmpty(EItemTags.ORES_URANIUM));
- addConditionalDrop.accept(EItems.MAGNESIUM_ORE_CHUNK.get(), chance(0.10f), Recipes.tagNotEmpty(EItemTags.ORES_MAGNESIUM));
- addConditionalDrop.accept(EItems.THORIUM_ORE_CHUNK.get(), chance(0.065f), Recipes.tagNotEmpty(EItemTags.ORES_THORIUM));
- addConditionalDrop.accept(EItems.BORON_ORE_CHUNK.get(), chance(0.06f), Recipes.tagNotEmpty(EItemTags.ORES_BORON));
- addConditionalDrop.accept(EItems.LITHIUM_ORE_CHUNK.get(), chance(0.05f), Recipes.tagNotEmpty(EItemTags.ORES_LITHIUM));
+ drops.addConditional(EItems.SILVER_ORE_CHUNK.get(), chance(0.08f), Recipes.tagNotEmpty(EItemTags.ORES_SILVER));
+ drops.addConditional(EItems.LEAD_ORE_CHUNK.get(), chance(0.08f), Recipes.tagNotEmpty(EItemTags.ORES_LEAD));
+ drops.addConditional(EItems.OSMIUM_ORE_CHUNK.get(), chance(0.08f), Recipes.tagNotEmpty(EItemTags.ORES_OSMIUM));
+ drops.addConditional(EItems.NICKEL_ORE_CHUNK.get(), chance(0.06f), Recipes.tagNotEmpty(EItemTags.ORES_NICKEL));
+ drops.addConditional(EItems.TIN_ORE_CHUNK.get(), chance(0.07f), Recipes.tagNotEmpty(EItemTags.ORES_TIN));
+ drops.addConditional(EItems.IRIDIUM_ORE_CHUNK.get(), chance(0.05f), Recipes.tagNotEmpty(EItemTags.ORES_IRIDIUM));
+ drops.addConditional(EItems.PLATINUM_ORE_CHUNK.get(), chance(0.05f), Recipes.tagNotEmpty(EItemTags.ORES_PLATINUM));
+ drops.addConditional(EItems.URANIUM_ORE_CHUNK.get(), chance(0.06f), Recipes.tagNotEmpty(EItemTags.ORES_URANIUM));
+ drops.addConditional(EItems.MAGNESIUM_ORE_CHUNK.get(), chance(0.10f), Recipes.tagNotEmpty(EItemTags.ORES_MAGNESIUM));
+ drops.addConditional(EItems.THORIUM_ORE_CHUNK.get(), chance(0.065f), Recipes.tagNotEmpty(EItemTags.ORES_THORIUM));
+ drops.addConditional(EItems.BORON_ORE_CHUNK.get(), chance(0.06f), Recipes.tagNotEmpty(EItemTags.ORES_BORON));
+ drops.addConditional(EItems.LITHIUM_ORE_CHUNK.get(), chance(0.05f), Recipes.tagNotEmpty(EItemTags.ORES_LITHIUM));
});
- forMesh(writer, ingredient(EItems.CRUSHED_DEEPSLATE.get()), EItems.IRON_MESH, (addDrop, addTagDrop, addConditionalDrop) -> {
- addDrop.accept(EItems.DEEPSLATE_PEBBLE.get(), binomial(4, 0.6f));
- addDrop.accept(EItems.COPPER_ORE_CHUNK.get(), chance(0.10f));
- addDrop.accept(EItems.IRON_ORE_CHUNK.get(), chance(0.15f));
- addDrop.accept(EItems.GOLD_ORE_CHUNK.get(), chance(0.09f));
- addDrop.accept(Items.AMETHYST_SHARD, chance(0.06f));
- addDrop.accept(Items.DIAMOND, chance(0.06f));
- addDrop.accept(Items.LAPIS_LAZULI, chance(0.08f));
- addDrop.accept(Items.EMERALD, chance(0.05f));
+ forMesh(writer, CRUSHED_DEEPSLATE, EItems.IRON_MESH, drops -> {
+ drops.add(EItems.DEEPSLATE_PEBBLE.get(), binomial(4, 0.6f));
+ drops.add(EItems.COPPER_ORE_CHUNK.get(), chance(0.10f));
+ drops.add(EItems.IRON_ORE_CHUNK.get(), chance(0.15f));
+ drops.add(EItems.GOLD_ORE_CHUNK.get(), chance(0.09f));
+ drops.add(Items.AMETHYST_SHARD, chance(0.06f));
+ drops.add(Items.DIAMOND, chance(0.06f));
+ drops.add(Items.LAPIS_LAZULI, chance(0.08f));
+ drops.add(Items.EMERALD, chance(0.05f));
- addConditionalDrop.accept(EItems.SILVER_ORE_CHUNK.get(), chance(0.1f), Recipes.tagNotEmpty(EItemTags.ORES_SILVER));
- addConditionalDrop.accept(EItems.LEAD_ORE_CHUNK.get(), chance(0.1f), Recipes.tagNotEmpty(EItemTags.ORES_LEAD));
- addConditionalDrop.accept(EItems.OSMIUM_ORE_CHUNK.get(), chance(0.10f), Recipes.tagNotEmpty(EItemTags.ORES_OSMIUM));
- addConditionalDrop.accept(EItems.NICKEL_ORE_CHUNK.get(), chance(0.09f), Recipes.tagNotEmpty(EItemTags.ORES_NICKEL));
- addConditionalDrop.accept(EItems.TIN_ORE_CHUNK.get(), chance(0.11f), Recipes.tagNotEmpty(EItemTags.ORES_TIN));
- addConditionalDrop.accept(EItems.IRIDIUM_ORE_CHUNK.get(), chance(0.06f), Recipes.tagNotEmpty(EItemTags.ORES_IRIDIUM));
- addConditionalDrop.accept(EItems.PLATINUM_ORE_CHUNK.get(), chance(0.065f), Recipes.tagNotEmpty(EItemTags.ORES_PLATINUM));
- addConditionalDrop.accept(EItems.URANIUM_ORE_CHUNK.get(), chance(0.08f), Recipes.tagNotEmpty(EItemTags.ORES_URANIUM));
- addConditionalDrop.accept(EItems.MAGNESIUM_ORE_CHUNK.get(), chance(0.11f), Recipes.tagNotEmpty(EItemTags.ORES_MAGNESIUM));
- addConditionalDrop.accept(EItems.THORIUM_ORE_CHUNK.get(), chance(0.075f), Recipes.tagNotEmpty(EItemTags.ORES_THORIUM));
- addConditionalDrop.accept(EItems.BORON_ORE_CHUNK.get(), chance(0.06f), Recipes.tagNotEmpty(EItemTags.ORES_BORON));
- addConditionalDrop.accept(EItems.LITHIUM_ORE_CHUNK.get(), chance(0.06f), Recipes.tagNotEmpty(EItemTags.ORES_LITHIUM));
+ drops.addConditional(EItems.SILVER_ORE_CHUNK.get(), chance(0.1f), Recipes.tagNotEmpty(EItemTags.ORES_SILVER));
+ drops.addConditional(EItems.LEAD_ORE_CHUNK.get(), chance(0.1f), Recipes.tagNotEmpty(EItemTags.ORES_LEAD));
+ drops.addConditional(EItems.OSMIUM_ORE_CHUNK.get(), chance(0.10f), Recipes.tagNotEmpty(EItemTags.ORES_OSMIUM));
+ drops.addConditional(EItems.NICKEL_ORE_CHUNK.get(), chance(0.09f), Recipes.tagNotEmpty(EItemTags.ORES_NICKEL));
+ drops.addConditional(EItems.TIN_ORE_CHUNK.get(), chance(0.11f), Recipes.tagNotEmpty(EItemTags.ORES_TIN));
+ drops.addConditional(EItems.IRIDIUM_ORE_CHUNK.get(), chance(0.06f), Recipes.tagNotEmpty(EItemTags.ORES_IRIDIUM));
+ drops.addConditional(EItems.PLATINUM_ORE_CHUNK.get(), chance(0.065f), Recipes.tagNotEmpty(EItemTags.ORES_PLATINUM));
+ drops.addConditional(EItems.URANIUM_ORE_CHUNK.get(), chance(0.08f), Recipes.tagNotEmpty(EItemTags.ORES_URANIUM));
+ drops.addConditional(EItems.MAGNESIUM_ORE_CHUNK.get(), chance(0.11f), Recipes.tagNotEmpty(EItemTags.ORES_MAGNESIUM));
+ drops.addConditional(EItems.THORIUM_ORE_CHUNK.get(), chance(0.075f), Recipes.tagNotEmpty(EItemTags.ORES_THORIUM));
+ drops.addConditional(EItems.BORON_ORE_CHUNK.get(), chance(0.06f), Recipes.tagNotEmpty(EItemTags.ORES_BORON));
+ drops.addConditional(EItems.LITHIUM_ORE_CHUNK.get(), chance(0.06f), Recipes.tagNotEmpty(EItemTags.ORES_LITHIUM));
});
- forMesh(writer, ingredient(EItems.CRUSHED_DEEPSLATE.get()), EItems.GOLDEN_MESH, (addDrop, addTagDrop, addConditionalDrop) -> {
- addDrop.accept(EItems.DEEPSLATE_PEBBLE.get(), binomial(4, 0.65f));
- addDrop.accept(EItems.COPPER_ORE_CHUNK.get(), chance(0.09f));
- addDrop.accept(EItems.IRON_ORE_CHUNK.get(), chance(0.15f));
- addDrop.accept(EItems.GOLD_ORE_CHUNK.get(), chance(0.15f));
- addDrop.accept(Items.AMETHYST_SHARD, chance(0.08f));
- addDrop.accept(Items.DIAMOND, chance(0.08f));
- addDrop.accept(Items.LAPIS_LAZULI, chance(0.07f));
- addDrop.accept(Items.EMERALD, chance(0.07f));
- addDrop.accept(Items.RAW_GOLD, chance(0.05f));
- addDrop.accept(Items.GOLD_NUGGET, binomial(3, 0.1f));
+ forMesh(writer, CRUSHED_DEEPSLATE, EItems.GOLDEN_MESH, drops -> {
+ drops.add(EItems.DEEPSLATE_PEBBLE.get(), binomial(4, 0.65f));
+ drops.add(EItems.COPPER_ORE_CHUNK.get(), chance(0.09f));
+ drops.add(EItems.IRON_ORE_CHUNK.get(), chance(0.15f));
+ drops.add(EItems.GOLD_ORE_CHUNK.get(), chance(0.15f));
+ drops.add(Items.AMETHYST_SHARD, chance(0.08f));
+ drops.add(Items.DIAMOND, chance(0.08f));
+ drops.add(Items.LAPIS_LAZULI, chance(0.07f));
+ drops.add(Items.EMERALD, chance(0.07f));
+ drops.add(Items.RAW_GOLD, chance(0.05f));
+ drops.add(Items.GOLD_NUGGET, binomial(3, 0.1f));
- addConditionalDrop.accept(EItems.SILVER_ORE_CHUNK.get(), chance(0.15f), Recipes.tagNotEmpty(EItemTags.ORES_SILVER));
- addConditionalDrop.accept(EItems.LEAD_ORE_CHUNK.get(), chance(0.09f), Recipes.tagNotEmpty(EItemTags.ORES_LEAD));
- addConditionalDrop.accept(EItems.OSMIUM_ORE_CHUNK.get(), chance(0.09f), Recipes.tagNotEmpty(EItemTags.ORES_OSMIUM));
- addConditionalDrop.accept(EItems.NICKEL_ORE_CHUNK.get(), chance(0.11f), Recipes.tagNotEmpty(EItemTags.ORES_NICKEL));
- addConditionalDrop.accept(EItems.TIN_ORE_CHUNK.get(), chance(0.12f), Recipes.tagNotEmpty(EItemTags.ORES_TIN));
- addConditionalDrop.accept(EItems.IRIDIUM_ORE_CHUNK.get(), chance(0.04f), Recipes.tagNotEmpty(EItemTags.ORES_IRIDIUM));
- addConditionalDrop.accept(EItems.PLATINUM_ORE_CHUNK.get(), chance(0.09f), Recipes.tagNotEmpty(EItemTags.ORES_PLATINUM));
- addConditionalDrop.accept(EItems.URANIUM_ORE_CHUNK.get(), chance(0.07f), Recipes.tagNotEmpty(EItemTags.ORES_URANIUM));
- addConditionalDrop.accept(EItems.MAGNESIUM_ORE_CHUNK.get(), chance(0.12f), Recipes.tagNotEmpty(EItemTags.ORES_MAGNESIUM));
- addConditionalDrop.accept(EItems.THORIUM_ORE_CHUNK.get(), chance(0.075f), Recipes.tagNotEmpty(EItemTags.ORES_THORIUM));
- addConditionalDrop.accept(EItems.BORON_ORE_CHUNK.get(), chance(0.065f), Recipes.tagNotEmpty(EItemTags.ORES_BORON));
- addConditionalDrop.accept(EItems.LITHIUM_ORE_CHUNK.get(), chance(0.065f), Recipes.tagNotEmpty(EItemTags.ORES_LITHIUM));
+ drops.addConditional(EItems.SILVER_ORE_CHUNK.get(), chance(0.15f), Recipes.tagNotEmpty(EItemTags.ORES_SILVER));
+ drops.addConditional(EItems.LEAD_ORE_CHUNK.get(), chance(0.09f), Recipes.tagNotEmpty(EItemTags.ORES_LEAD));
+ drops.addConditional(EItems.OSMIUM_ORE_CHUNK.get(), chance(0.09f), Recipes.tagNotEmpty(EItemTags.ORES_OSMIUM));
+ drops.addConditional(EItems.NICKEL_ORE_CHUNK.get(), chance(0.11f), Recipes.tagNotEmpty(EItemTags.ORES_NICKEL));
+ drops.addConditional(EItems.TIN_ORE_CHUNK.get(), chance(0.12f), Recipes.tagNotEmpty(EItemTags.ORES_TIN));
+ drops.addConditional(EItems.IRIDIUM_ORE_CHUNK.get(), chance(0.04f), Recipes.tagNotEmpty(EItemTags.ORES_IRIDIUM));
+ drops.addConditional(EItems.PLATINUM_ORE_CHUNK.get(), chance(0.09f), Recipes.tagNotEmpty(EItemTags.ORES_PLATINUM));
+ drops.addConditional(EItems.URANIUM_ORE_CHUNK.get(), chance(0.07f), Recipes.tagNotEmpty(EItemTags.ORES_URANIUM));
+ drops.addConditional(EItems.MAGNESIUM_ORE_CHUNK.get(), chance(0.12f), Recipes.tagNotEmpty(EItemTags.ORES_MAGNESIUM));
+ drops.addConditional(EItems.THORIUM_ORE_CHUNK.get(), chance(0.075f), Recipes.tagNotEmpty(EItemTags.ORES_THORIUM));
+ drops.addConditional(EItems.BORON_ORE_CHUNK.get(), chance(0.065f), Recipes.tagNotEmpty(EItemTags.ORES_BORON));
+ drops.addConditional(EItems.LITHIUM_ORE_CHUNK.get(), chance(0.065f), Recipes.tagNotEmpty(EItemTags.ORES_LITHIUM));
});
- forMesh(writer, ingredient(EItems.CRUSHED_DEEPSLATE.get()), EItems.DIAMOND_MESH, (addDrop, addTagDrop, addConditionalDrop) -> {
- addDrop.accept(EItems.DEEPSLATE_PEBBLE.get(), binomial(4, 0.65f));
- addDrop.accept(EItems.COPPER_ORE_CHUNK.get(), chance(0.09f));
- addDrop.accept(EItems.IRON_ORE_CHUNK.get(), chance(0.18f));
- addDrop.accept(EItems.GOLD_ORE_CHUNK.get(), chance(0.13f));
- addDrop.accept(Items.AMETHYST_SHARD, chance(0.07f));
- addDrop.accept(Items.DIAMOND, chance(0.08f));
- addDrop.accept(Items.LAPIS_LAZULI, chance(0.12f));
- addDrop.accept(Items.EMERALD, chance(0.08f));
+ forMesh(writer, CRUSHED_DEEPSLATE, EItems.DIAMOND_MESH, drops -> {
+ drops.add(EItems.DEEPSLATE_PEBBLE.get(), binomial(4, 0.65f));
+ drops.add(EItems.COPPER_ORE_CHUNK.get(), chance(0.09f));
+ drops.add(EItems.IRON_ORE_CHUNK.get(), chance(0.18f));
+ drops.add(EItems.GOLD_ORE_CHUNK.get(), chance(0.13f));
+ drops.add(Items.AMETHYST_SHARD, chance(0.07f));
+ drops.add(Items.DIAMOND, chance(0.08f));
+ drops.add(Items.LAPIS_LAZULI, chance(0.12f));
+ drops.add(Items.EMERALD, chance(0.08f));
- addConditionalDrop.accept(EItems.SILVER_ORE_CHUNK.get(), chance(0.11f), Recipes.tagNotEmpty(EItemTags.ORES_SILVER));
- addConditionalDrop.accept(EItems.LEAD_ORE_CHUNK.get(), chance(0.11f), Recipes.tagNotEmpty(EItemTags.ORES_LEAD));
- addConditionalDrop.accept(EItems.OSMIUM_ORE_CHUNK.get(), chance(0.12f), Recipes.tagNotEmpty(EItemTags.ORES_OSMIUM));
- addConditionalDrop.accept(EItems.NICKEL_ORE_CHUNK.get(), chance(0.11f), Recipes.tagNotEmpty(EItemTags.ORES_NICKEL));
- addConditionalDrop.accept(EItems.TIN_ORE_CHUNK.get(), chance(0.13f), Recipes.tagNotEmpty(EItemTags.ORES_TIN));
- addConditionalDrop.accept(EItems.IRIDIUM_ORE_CHUNK.get(), chance(0.065f), Recipes.tagNotEmpty(EItemTags.ORES_IRIDIUM));
- addConditionalDrop.accept(EItems.PLATINUM_ORE_CHUNK.get(), chance(0.075f), Recipes.tagNotEmpty(EItemTags.ORES_PLATINUM));
- addConditionalDrop.accept(EItems.URANIUM_ORE_CHUNK.get(), chance(0.1f), Recipes.tagNotEmpty(EItemTags.ORES_URANIUM));
- addConditionalDrop.accept(EItems.MAGNESIUM_ORE_CHUNK.get(), chance(0.12f), Recipes.tagNotEmpty(EItemTags.ORES_MAGNESIUM));
- addConditionalDrop.accept(EItems.THORIUM_ORE_CHUNK.get(), chance(0.095f), Recipes.tagNotEmpty(EItemTags.ORES_THORIUM));
- addConditionalDrop.accept(EItems.BORON_ORE_CHUNK.get(), chance(0.08f), Recipes.tagNotEmpty(EItemTags.ORES_BORON));
- addConditionalDrop.accept(EItems.LITHIUM_ORE_CHUNK.get(), chance(0.08f), Recipes.tagNotEmpty(EItemTags.ORES_LITHIUM));
+ drops.addConditional(EItems.SILVER_ORE_CHUNK.get(), chance(0.11f), Recipes.tagNotEmpty(EItemTags.ORES_SILVER));
+ drops.addConditional(EItems.LEAD_ORE_CHUNK.get(), chance(0.11f), Recipes.tagNotEmpty(EItemTags.ORES_LEAD));
+ drops.addConditional(EItems.OSMIUM_ORE_CHUNK.get(), chance(0.12f), Recipes.tagNotEmpty(EItemTags.ORES_OSMIUM));
+ drops.addConditional(EItems.NICKEL_ORE_CHUNK.get(), chance(0.11f), Recipes.tagNotEmpty(EItemTags.ORES_NICKEL));
+ drops.addConditional(EItems.TIN_ORE_CHUNK.get(), chance(0.13f), Recipes.tagNotEmpty(EItemTags.ORES_TIN));
+ drops.addConditional(EItems.IRIDIUM_ORE_CHUNK.get(), chance(0.065f), Recipes.tagNotEmpty(EItemTags.ORES_IRIDIUM));
+ drops.addConditional(EItems.PLATINUM_ORE_CHUNK.get(), chance(0.075f), Recipes.tagNotEmpty(EItemTags.ORES_PLATINUM));
+ drops.addConditional(EItems.URANIUM_ORE_CHUNK.get(), chance(0.1f), Recipes.tagNotEmpty(EItemTags.ORES_URANIUM));
+ drops.addConditional(EItems.MAGNESIUM_ORE_CHUNK.get(), chance(0.12f), Recipes.tagNotEmpty(EItemTags.ORES_MAGNESIUM));
+ drops.addConditional(EItems.THORIUM_ORE_CHUNK.get(), chance(0.095f), Recipes.tagNotEmpty(EItemTags.ORES_THORIUM));
+ drops.addConditional(EItems.BORON_ORE_CHUNK.get(), chance(0.08f), Recipes.tagNotEmpty(EItemTags.ORES_BORON));
+ drops.addConditional(EItems.LITHIUM_ORE_CHUNK.get(), chance(0.08f), Recipes.tagNotEmpty(EItemTags.ORES_LITHIUM));
});
- forMesh(writer, ingredient(EItems.CRUSHED_DEEPSLATE.get()), EItems.NETHERITE_MESH, (addDrop, addTagDrop, addConditionalDrop) -> {
- addDrop.accept(EItems.DEEPSLATE_PEBBLE.get(), binomial(4, 0.7f));
- addDrop.accept(EItems.COPPER_ORE_CHUNK.get(), chance(0.10f));
- addDrop.accept(EItems.IRON_ORE_CHUNK.get(), chance(0.20f));
- addDrop.accept(EItems.GOLD_ORE_CHUNK.get(), chance(0.15f));
- addDrop.accept(Items.AMETHYST_SHARD, chance(0.1f));
- addDrop.accept(Items.DIAMOND, chance(0.1f));
- addDrop.accept(Items.LAPIS_LAZULI, chance(0.14f));
- addDrop.accept(Items.EMERALD, chance(0.1f));
+ forMesh(writer, CRUSHED_DEEPSLATE, EItems.NETHERITE_MESH, drops -> {
+ drops.add(EItems.DEEPSLATE_PEBBLE.get(), binomial(4, 0.7f));
+ drops.add(EItems.COPPER_ORE_CHUNK.get(), chance(0.10f));
+ drops.add(EItems.IRON_ORE_CHUNK.get(), chance(0.20f));
+ drops.add(EItems.GOLD_ORE_CHUNK.get(), chance(0.15f));
+ drops.add(Items.AMETHYST_SHARD, chance(0.1f));
+ drops.add(Items.DIAMOND, chance(0.1f));
+ drops.add(Items.LAPIS_LAZULI, chance(0.14f));
+ drops.add(Items.EMERALD, chance(0.1f));
- addConditionalDrop.accept(EItems.SILVER_ORE_CHUNK.get(), chance(0.12f), Recipes.tagNotEmpty(EItemTags.ORES_SILVER));
- addConditionalDrop.accept(EItems.LEAD_ORE_CHUNK.get(), chance(0.12f), Recipes.tagNotEmpty(EItemTags.ORES_LEAD));
- addConditionalDrop.accept(EItems.OSMIUM_ORE_CHUNK.get(), chance(0.14f), Recipes.tagNotEmpty(EItemTags.ORES_OSMIUM));
- addConditionalDrop.accept(EItems.NICKEL_ORE_CHUNK.get(), chance(0.15f), Recipes.tagNotEmpty(EItemTags.ORES_NICKEL));
- addConditionalDrop.accept(EItems.TIN_ORE_CHUNK.get(), chance(0.16f), Recipes.tagNotEmpty(EItemTags.ORES_TIN));
- addConditionalDrop.accept(EItems.IRIDIUM_ORE_CHUNK.get(), chance(0.065f), Recipes.tagNotEmpty(EItemTags.ORES_IRIDIUM));
- addConditionalDrop.accept(EItems.PLATINUM_ORE_CHUNK.get(), chance(0.09f), Recipes.tagNotEmpty(EItemTags.ORES_PLATINUM));
- addConditionalDrop.accept(EItems.URANIUM_ORE_CHUNK.get(), chance(0.12f), Recipes.tagNotEmpty(EItemTags.ORES_URANIUM));
- addConditionalDrop.accept(EItems.MAGNESIUM_ORE_CHUNK.get(), chance(0.14f), Recipes.tagNotEmpty(EItemTags.ORES_MAGNESIUM));
- addConditionalDrop.accept(EItems.THORIUM_ORE_CHUNK.get(), chance(0.11f), Recipes.tagNotEmpty(EItemTags.ORES_THORIUM));
- addConditionalDrop.accept(EItems.BORON_ORE_CHUNK.get(), chance(0.09f), Recipes.tagNotEmpty(EItemTags.ORES_BORON));
- addConditionalDrop.accept(EItems.LITHIUM_ORE_CHUNK.get(), chance(0.085f), Recipes.tagNotEmpty(EItemTags.ORES_LITHIUM));
+ drops.addConditional(EItems.SILVER_ORE_CHUNK.get(), chance(0.12f), Recipes.tagNotEmpty(EItemTags.ORES_SILVER));
+ drops.addConditional(EItems.LEAD_ORE_CHUNK.get(), chance(0.12f), Recipes.tagNotEmpty(EItemTags.ORES_LEAD));
+ drops.addConditional(EItems.OSMIUM_ORE_CHUNK.get(), chance(0.14f), Recipes.tagNotEmpty(EItemTags.ORES_OSMIUM));
+ drops.addConditional(EItems.NICKEL_ORE_CHUNK.get(), chance(0.15f), Recipes.tagNotEmpty(EItemTags.ORES_NICKEL));
+ drops.addConditional(EItems.TIN_ORE_CHUNK.get(), chance(0.16f), Recipes.tagNotEmpty(EItemTags.ORES_TIN));
+ drops.addConditional(EItems.IRIDIUM_ORE_CHUNK.get(), chance(0.065f), Recipes.tagNotEmpty(EItemTags.ORES_IRIDIUM));
+ drops.addConditional(EItems.PLATINUM_ORE_CHUNK.get(), chance(0.09f), Recipes.tagNotEmpty(EItemTags.ORES_PLATINUM));
+ drops.addConditional(EItems.URANIUM_ORE_CHUNK.get(), chance(0.12f), Recipes.tagNotEmpty(EItemTags.ORES_URANIUM));
+ drops.addConditional(EItems.MAGNESIUM_ORE_CHUNK.get(), chance(0.14f), Recipes.tagNotEmpty(EItemTags.ORES_MAGNESIUM));
+ drops.addConditional(EItems.THORIUM_ORE_CHUNK.get(), chance(0.11f), Recipes.tagNotEmpty(EItemTags.ORES_THORIUM));
+ drops.addConditional(EItems.BORON_ORE_CHUNK.get(), chance(0.09f), Recipes.tagNotEmpty(EItemTags.ORES_BORON));
+ drops.addConditional(EItems.LITHIUM_ORE_CHUNK.get(), chance(0.085f), Recipes.tagNotEmpty(EItemTags.ORES_LITHIUM));
});
- forMesh(writer, ingredient(EItems.CRUSHED_BLACKSTONE.get()), EItems.STRING_MESH, (addDrop, addTagDrop, addConditionalDrop) -> {
- addDrop.accept(EItems.BLACKSTONE_PEBBLE.get(), binomial(4, 0.6f));
- addDrop.accept(EItems.BASALT_PEBBLE.get(), binomial(3, 0.5f));
- addDrop.accept(Items.ANCIENT_DEBRIS, chance(0.02f));
- addDrop.accept(Items.GOLD_NUGGET, binomial(4, 0.2f));
- addDrop.accept(Items.MAGMA_CREAM, chance(0.08f));
- addDrop.accept(Items.GUNPOWDER, chance(0.07f));
- addDrop.accept(Items.BLACK_DYE, chance(0.07f));
+ forMesh(writer, CRUSHED_BLACKSTONE, EItems.STRING_MESH, drops -> {
+ drops.add(EItems.BLACKSTONE_PEBBLE.get(), binomial(4, 0.6f));
+ drops.add(EItems.BASALT_PEBBLE.get(), binomial(3, 0.5f));
+ drops.add(Items.ANCIENT_DEBRIS, chance(0.02f));
+ drops.add(Items.GOLD_NUGGET, binomial(4, 0.2f));
+ drops.add(Items.MAGMA_CREAM, chance(0.08f));
+ drops.add(Items.GUNPOWDER, chance(0.07f));
+ drops.add(Items.BLACK_DYE, chance(0.07f));
});
- forMesh(writer, ingredient(EItems.CRUSHED_BLACKSTONE.get()), EItems.FLINT_MESH, (addDrop, addTagDrop, addConditionalDrop) -> {
- addDrop.accept(EItems.BLACKSTONE_PEBBLE.get(), binomial(4, 0.65f));
- addDrop.accept(EItems.BASALT_PEBBLE.get(), binomial(3, 0.55f));
- addDrop.accept(Items.ANCIENT_DEBRIS, chance(0.03f));
- addDrop.accept(Items.GOLD_NUGGET, binomial(4, 0.225f));
- addDrop.accept(Items.MAGMA_CREAM, chance(0.09f));
- addDrop.accept(Items.GUNPOWDER, chance(0.09f));
- addDrop.accept(Items.BLACK_DYE, chance(0.08f));
+ forMesh(writer, CRUSHED_BLACKSTONE, EItems.FLINT_MESH, drops -> {
+ drops.add(EItems.BLACKSTONE_PEBBLE.get(), binomial(4, 0.65f));
+ drops.add(EItems.BASALT_PEBBLE.get(), binomial(3, 0.55f));
+ drops.add(Items.ANCIENT_DEBRIS, chance(0.03f));
+ drops.add(Items.GOLD_NUGGET, binomial(4, 0.225f));
+ drops.add(Items.MAGMA_CREAM, chance(0.09f));
+ drops.add(Items.GUNPOWDER, chance(0.09f));
+ drops.add(Items.BLACK_DYE, chance(0.08f));
});
- forMesh(writer, ingredient(EItems.CRUSHED_BLACKSTONE.get()), EItems.IRON_MESH, (addDrop, addTagDrop, addConditionalDrop) -> {
- addDrop.accept(EItems.BLACKSTONE_PEBBLE.get(), binomial(5, 0.65f));
- addDrop.accept(EItems.BASALT_PEBBLE.get(), binomial(4, 0.55f));
- addDrop.accept(Items.ANCIENT_DEBRIS, chance(0.04f));
- addDrop.accept(Items.GOLD_NUGGET, binomial(4, 0.25f));
- addDrop.accept(Items.MAGMA_CREAM, chance(0.09f));
- addDrop.accept(Items.GUNPOWDER, chance(0.09f));
- addDrop.accept(Items.BLACK_DYE, chance(0.08f));
+ forMesh(writer, CRUSHED_BLACKSTONE, EItems.IRON_MESH, drops -> {
+ drops.add(EItems.BLACKSTONE_PEBBLE.get(), binomial(5, 0.65f));
+ drops.add(EItems.BASALT_PEBBLE.get(), binomial(4, 0.55f));
+ drops.add(Items.ANCIENT_DEBRIS, chance(0.04f));
+ drops.add(Items.GOLD_NUGGET, binomial(4, 0.25f));
+ drops.add(Items.MAGMA_CREAM, chance(0.09f));
+ drops.add(Items.GUNPOWDER, chance(0.09f));
+ drops.add(Items.BLACK_DYE, chance(0.08f));
});
- forMesh(writer, ingredient(EItems.CRUSHED_BLACKSTONE.get()), EItems.GOLDEN_MESH, (addDrop, addTagDrop, addConditionalDrop) -> {
- addDrop.accept(EItems.BLACKSTONE_PEBBLE.get(), binomial(5, 0.7f));
- addDrop.accept(EItems.BASALT_PEBBLE.get(), binomial(4, 0.5f));
- addDrop.accept(Items.ANCIENT_DEBRIS, chance(0.05f));
- addDrop.accept(Items.GOLD_NUGGET, binomial(8, 0.325f));
- addDrop.accept(Items.MAGMA_CREAM, chance(0.1f));
- addDrop.accept(Items.GUNPOWDER, chance(0.1f));
- addDrop.accept(Items.BLACK_DYE, chance(0.06f));
+ forMesh(writer, CRUSHED_BLACKSTONE, EItems.GOLDEN_MESH, drops -> {
+ drops.add(EItems.BLACKSTONE_PEBBLE.get(), binomial(5, 0.7f));
+ drops.add(EItems.BASALT_PEBBLE.get(), binomial(4, 0.5f));
+ drops.add(Items.ANCIENT_DEBRIS, chance(0.05f));
+ drops.add(Items.GOLD_NUGGET, binomial(8, 0.325f));
+ drops.add(Items.MAGMA_CREAM, chance(0.1f));
+ drops.add(Items.GUNPOWDER, chance(0.1f));
+ drops.add(Items.BLACK_DYE, chance(0.06f));
});
- forMesh(writer, ingredient(EItems.CRUSHED_BLACKSTONE.get()), EItems.DIAMOND_MESH, (addDrop, addTagDrop, addConditionalDrop) -> {
- addDrop.accept(EItems.BLACKSTONE_PEBBLE.get(), binomial(5, 0.7f));
- addDrop.accept(Items.ANCIENT_DEBRIS, chance(0.06f));
- addDrop.accept(Items.GOLD_NUGGET, binomial(4, 0.275f));
- addDrop.accept(Items.MAGMA_CREAM, chance(0.11f));
- addDrop.accept(Items.GUNPOWDER, chance(0.11f));
+ forMesh(writer, CRUSHED_BLACKSTONE, EItems.DIAMOND_MESH, drops -> {
+ drops.add(EItems.BLACKSTONE_PEBBLE.get(), binomial(5, 0.7f));
+ drops.add(Items.ANCIENT_DEBRIS, chance(0.06f));
+ drops.add(Items.GOLD_NUGGET, binomial(4, 0.275f));
+ drops.add(Items.MAGMA_CREAM, chance(0.11f));
+ drops.add(Items.GUNPOWDER, chance(0.11f));
});
- forMesh(writer, ingredient(EItems.CRUSHED_BLACKSTONE.get()), EItems.NETHERITE_MESH, (addDrop, addTagDrop, addConditionalDrop) -> {
- addDrop.accept(EItems.BLACKSTONE_PEBBLE.get(), binomial(5, 0.75f));
- addDrop.accept(Items.ANCIENT_DEBRIS, chance(0.1f));
- addDrop.accept(Items.GOLD_NUGGET, binomial(4, 0.325f));
- addDrop.accept(Items.MAGMA_CREAM, chance(0.12f));
- addDrop.accept(Items.GUNPOWDER, chance(0.11f));
+ forMesh(writer, CRUSHED_BLACKSTONE, EItems.NETHERITE_MESH, drops -> {
+ drops.add(EItems.BLACKSTONE_PEBBLE.get(), binomial(5, 0.75f));
+ drops.add(Items.ANCIENT_DEBRIS, chance(0.1f));
+ drops.add(Items.GOLD_NUGGET, binomial(4, 0.325f));
+ drops.add(Items.MAGMA_CREAM, chance(0.12f));
+ drops.add(Items.GUNPOWDER, chance(0.11f));
});
- forMesh(writer, ingredient(EItems.CRUSHED_NETHERRACK.get()), EItems.STRING_MESH, (addDrop, addTagDrop, addConditionalDrop) -> {
- addDrop.accept(EItems.BLACKSTONE_PEBBLE.get(), binomial(3, 0.4f));
- addDrop.accept(EItems.BASALT_PEBBLE.get(), binomial(3, 0.3f));
- addDrop.accept(Items.BLAZE_POWDER, chance(0.08f));
- addDrop.accept(Items.QUARTZ, chance(0.08f));
- addDrop.accept(Items.MAGMA_CREAM, chance(0.05f));
- addDrop.accept(Items.GUNPOWDER, chance(0.08f));
- addDrop.accept(EItems.WARPED_NYLIUM_SPORES.get(), chance(0.05f));
- addDrop.accept(EItems.CRIMSON_NYLIUM_SPORES.get(), chance(0.05f));
- addDrop.accept(Items.GOLD_NUGGET, chance(0.07f));
+ forMesh(writer, CRUSHED_NETHERRACK, EItems.STRING_MESH, drops -> {
+ drops.add(EItems.BLACKSTONE_PEBBLE.get(), binomial(3, 0.4f));
+ drops.add(EItems.BASALT_PEBBLE.get(), binomial(3, 0.3f));
+ drops.add(Items.BLAZE_POWDER, chance(0.08f));
+ drops.add(Items.QUARTZ, chance(0.08f));
+ drops.add(Items.MAGMA_CREAM, chance(0.05f));
+ drops.add(Items.GUNPOWDER, chance(0.08f));
+ drops.add(EItems.WARPED_NYLIUM_SPORES.get(), chance(0.05f));
+ drops.add(EItems.CRIMSON_NYLIUM_SPORES.get(), chance(0.05f));
+ drops.add(Items.GOLD_NUGGET, chance(0.07f));
- addConditionalDrop.accept(EItems.COBALT_ORE_CHUNK.get(), chance(0.04f), Recipes.tagNotEmpty(EItemTags.ORES_COBALT));
+ drops.addConditional(EItems.COBALT_ORE_CHUNK.get(), chance(0.04f), Recipes.tagNotEmpty(EItemTags.ORES_COBALT));
});
- forMesh(writer, ingredient(EItems.CRUSHED_NETHERRACK.get()), EItems.FLINT_MESH, (addDrop, addTagDrop, addConditionalDrop) -> {
- addDrop.accept(EItems.BLACKSTONE_PEBBLE.get(), binomial(4, 0.5f));
- addDrop.accept(EItems.BASALT_PEBBLE.get(), binomial(4, 0.4f));
- addDrop.accept(Items.BLAZE_POWDER, chance(0.09f));
- addDrop.accept(Items.QUARTZ, chance(0.09f));
- addDrop.accept(Items.MAGMA_CREAM, chance(0.06f));
- addDrop.accept(Items.GUNPOWDER, chance(0.09f));
- addDrop.accept(EItems.WARPED_NYLIUM_SPORES.get(), chance(0.07f));
- addDrop.accept(EItems.CRIMSON_NYLIUM_SPORES.get(), chance(0.07f));
- addDrop.accept(Items.GOLD_NUGGET, chance(0.08f));
+ forMesh(writer, CRUSHED_NETHERRACK, EItems.FLINT_MESH, drops -> {
+ drops.add(EItems.BLACKSTONE_PEBBLE.get(), binomial(4, 0.5f));
+ drops.add(EItems.BASALT_PEBBLE.get(), binomial(4, 0.4f));
+ drops.add(Items.BLAZE_POWDER, chance(0.09f));
+ drops.add(Items.QUARTZ, chance(0.09f));
+ drops.add(Items.MAGMA_CREAM, chance(0.06f));
+ drops.add(Items.GUNPOWDER, chance(0.09f));
+ drops.add(EItems.WARPED_NYLIUM_SPORES.get(), chance(0.07f));
+ drops.add(EItems.CRIMSON_NYLIUM_SPORES.get(), chance(0.07f));
+ drops.add(Items.GOLD_NUGGET, chance(0.08f));
- addConditionalDrop.accept(EItems.COBALT_ORE_CHUNK.get(), chance(0.05f), Recipes.tagNotEmpty(EItemTags.ORES_COBALT));
+ drops.addConditional(EItems.COBALT_ORE_CHUNK.get(), chance(0.05f), Recipes.tagNotEmpty(EItemTags.ORES_COBALT));
});
- forMesh(writer, ingredient(EItems.CRUSHED_NETHERRACK.get()), EItems.IRON_MESH, (addDrop, addTagDrop, addConditionalDrop) -> {
- addDrop.accept(EItems.BLACKSTONE_PEBBLE.get(), binomial(4, 0.6f));
- addDrop.accept(EItems.BASALT_PEBBLE.get(), binomial(4, 0.45f));
- addDrop.accept(Items.BLAZE_POWDER, chance(0.1f));
- addDrop.accept(Items.QUARTZ, chance(0.11f));
- addDrop.accept(Items.MAGMA_CREAM, chance(0.07f));
- addDrop.accept(Items.GUNPOWDER, chance(0.1f));
- addDrop.accept(EItems.WARPED_NYLIUM_SPORES.get(), chance(0.08f));
- addDrop.accept(EItems.CRIMSON_NYLIUM_SPORES.get(), chance(0.08f));
- addDrop.accept(Items.GOLD_NUGGET, chance(0.1f));
+ forMesh(writer, CRUSHED_NETHERRACK, EItems.IRON_MESH, drops -> {
+ drops.add(EItems.BLACKSTONE_PEBBLE.get(), binomial(4, 0.6f));
+ drops.add(EItems.BASALT_PEBBLE.get(), binomial(4, 0.45f));
+ drops.add(Items.BLAZE_POWDER, chance(0.1f));
+ drops.add(Items.QUARTZ, chance(0.11f));
+ drops.add(Items.MAGMA_CREAM, chance(0.07f));
+ drops.add(Items.GUNPOWDER, chance(0.1f));
+ drops.add(EItems.WARPED_NYLIUM_SPORES.get(), chance(0.08f));
+ drops.add(EItems.CRIMSON_NYLIUM_SPORES.get(), chance(0.08f));
+ drops.add(Items.GOLD_NUGGET, chance(0.1f));
- addConditionalDrop.accept(EItems.COBALT_ORE_CHUNK.get(), chance(0.065f), Recipes.tagNotEmpty(EItemTags.ORES_COBALT));
+ drops.addConditional(EItems.COBALT_ORE_CHUNK.get(), chance(0.065f), Recipes.tagNotEmpty(EItemTags.ORES_COBALT));
});
- forMesh(writer, ingredient(EItems.CRUSHED_NETHERRACK.get()), EItems.GOLDEN_MESH, (addDrop, addTagDrop, addConditionalDrop) -> {
- addDrop.accept(EItems.BLACKSTONE_PEBBLE.get(), binomial(4, 0.6f));
- addDrop.accept(EItems.BASALT_PEBBLE.get(), binomial(4, 0.45f));
- addDrop.accept(Items.BLAZE_POWDER, chance(0.11f));
- addDrop.accept(Items.QUARTZ, chance(0.13f));
- addDrop.accept(Items.MAGMA_CREAM, chance(0.08f));
- addDrop.accept(Items.GUNPOWDER, chance(0.11f));
- addDrop.accept(EItems.WARPED_NYLIUM_SPORES.get(), chance(0.08f));
- addDrop.accept(EItems.CRIMSON_NYLIUM_SPORES.get(), chance(0.08f));
- addDrop.accept(Items.GOLD_NUGGET, chance(0.14f));
- addDrop.accept(Items.RAW_GOLD, chance(0.03f));
+ forMesh(writer, CRUSHED_NETHERRACK, EItems.GOLDEN_MESH, drops -> {
+ drops.add(EItems.BLACKSTONE_PEBBLE.get(), binomial(4, 0.6f));
+ drops.add(EItems.BASALT_PEBBLE.get(), binomial(4, 0.45f));
+ drops.add(Items.BLAZE_POWDER, chance(0.11f));
+ drops.add(Items.QUARTZ, chance(0.13f));
+ drops.add(Items.MAGMA_CREAM, chance(0.08f));
+ drops.add(Items.GUNPOWDER, chance(0.11f));
+ drops.add(EItems.WARPED_NYLIUM_SPORES.get(), chance(0.08f));
+ drops.add(EItems.CRIMSON_NYLIUM_SPORES.get(), chance(0.08f));
+ drops.add(Items.GOLD_NUGGET, chance(0.14f));
+ drops.add(Items.RAW_GOLD, chance(0.03f));
- addConditionalDrop.accept(EItems.COBALT_ORE_CHUNK.get(), chance(0.07f), Recipes.tagNotEmpty(EItemTags.ORES_COBALT));
+ drops.addConditional(EItems.COBALT_ORE_CHUNK.get(), chance(0.07f), Recipes.tagNotEmpty(EItemTags.ORES_COBALT));
});
- forMesh(writer, ingredient(EItems.CRUSHED_NETHERRACK.get()), EItems.DIAMOND_MESH, (addDrop, addTagDrop, addConditionalDrop) -> {
- addDrop.accept(EItems.BLACKSTONE_PEBBLE.get(), binomial(4, 0.6f));
- addDrop.accept(Items.BLAZE_POWDER, chance(0.14f));
- addDrop.accept(Items.QUARTZ, chance(0.13f));
- addDrop.accept(Items.MAGMA_CREAM, chance(0.1f));
- addDrop.accept(Items.GUNPOWDER, chance(0.13f));
- addDrop.accept(Items.GOLD_NUGGET, chance(0.12f));
+ forMesh(writer, CRUSHED_NETHERRACK, EItems.DIAMOND_MESH, drops -> {
+ drops.add(EItems.BLACKSTONE_PEBBLE.get(), binomial(4, 0.6f));
+ drops.add(Items.BLAZE_POWDER, chance(0.14f));
+ drops.add(Items.QUARTZ, chance(0.13f));
+ drops.add(Items.MAGMA_CREAM, chance(0.1f));
+ drops.add(Items.GUNPOWDER, chance(0.13f));
+ drops.add(Items.GOLD_NUGGET, chance(0.12f));
- addConditionalDrop.accept(EItems.COBALT_ORE_CHUNK.get(), chance(0.09f), Recipes.tagNotEmpty(EItemTags.ORES_COBALT));
+ drops.addConditional(EItems.COBALT_ORE_CHUNK.get(), chance(0.09f), Recipes.tagNotEmpty(EItemTags.ORES_COBALT));
});
- forMesh(writer, ingredient(EItems.CRUSHED_NETHERRACK.get()), EItems.NETHERITE_MESH, (addDrop, addTagDrop, addConditionalDrop) -> {
- addDrop.accept(EItems.BLACKSTONE_PEBBLE.get(), binomial(5, 0.65f));
- addDrop.accept(Items.BLAZE_POWDER, chance(0.15f));
- addDrop.accept(Items.QUARTZ, chance(0.15f));
- addDrop.accept(Items.MAGMA_CREAM, chance(0.1f));
- addDrop.accept(Items.GUNPOWDER, chance(0.13f));
- addDrop.accept(Items.GOLD_NUGGET, chance(0.12f));
+ forMesh(writer, CRUSHED_NETHERRACK, EItems.NETHERITE_MESH, drops -> {
+ drops.add(EItems.BLACKSTONE_PEBBLE.get(), binomial(5, 0.65f));
+ drops.add(Items.BLAZE_POWDER, chance(0.15f));
+ drops.add(Items.QUARTZ, chance(0.15f));
+ drops.add(Items.MAGMA_CREAM, chance(0.1f));
+ drops.add(Items.GUNPOWDER, chance(0.13f));
+ drops.add(Items.GOLD_NUGGET, chance(0.12f));
- addConditionalDrop.accept(EItems.COBALT_ORE_CHUNK.get(), chance(0.11f), Recipes.tagNotEmpty(EItemTags.ORES_COBALT));
+ drops.addConditional(EItems.COBALT_ORE_CHUNK.get(), chance(0.11f), Recipes.tagNotEmpty(EItemTags.ORES_COBALT));
});
- forMesh(writer, ingredient(Items.SOUL_SAND), EItems.STRING_MESH, (addDrop, addTagDrop, addConditionalDrop) -> {
- addDrop.accept(Items.QUARTZ, chance(0.12f));
- addDrop.accept(Items.GUNPOWDER, chance(0.07f));
- addDrop.accept(Items.BONE, chance(0.08f));
- addDrop.accept(Items.GHAST_TEAR, chance(0.06f));
- addDrop.accept(Items.NETHER_WART, chance(0.06f));
- addDrop.accept(Items.GLOWSTONE_DUST, chance(0.06f));
+ forMesh(writer, SOUL_SAND, EItems.STRING_MESH, drops -> {
+ drops.add(Items.QUARTZ, chance(0.12f));
+ drops.add(Items.GUNPOWDER, chance(0.07f));
+ drops.add(Items.BONE, chance(0.08f));
+ drops.add(Items.GHAST_TEAR, chance(0.06f));
+ drops.add(Items.NETHER_WART, chance(0.06f));
+ drops.add(Items.GLOWSTONE_DUST, chance(0.06f));
});
- forMesh(writer, ingredient(Items.SOUL_SAND), EItems.FLINT_MESH, (addDrop, addTagDrop, addConditionalDrop) -> {
- addDrop.accept(Items.QUARTZ, chance(0.14f));
- addDrop.accept(Items.GUNPOWDER, chance(0.08f));
- addDrop.accept(Items.BONE, chance(0.1f));
- addDrop.accept(Items.GHAST_TEAR, chance(0.07f));
- addDrop.accept(Items.GLOWSTONE_DUST, chance(0.07f));
- addDrop.accept(Items.NETHER_WART, chance(0.06f));
- addDrop.accept(EItems.WARPED_NYLIUM_SPORES.get(), chance(0.03f));
- addDrop.accept(EItems.CRIMSON_NYLIUM_SPORES.get(), chance(0.03f));
+ forMesh(writer, SOUL_SAND, EItems.FLINT_MESH, drops -> {
+ drops.add(Items.QUARTZ, chance(0.14f));
+ drops.add(Items.GUNPOWDER, chance(0.08f));
+ drops.add(Items.BONE, chance(0.1f));
+ drops.add(Items.GHAST_TEAR, chance(0.07f));
+ drops.add(Items.GLOWSTONE_DUST, chance(0.07f));
+ drops.add(Items.NETHER_WART, chance(0.06f));
+ drops.add(EItems.WARPED_NYLIUM_SPORES.get(), chance(0.03f));
+ drops.add(EItems.CRIMSON_NYLIUM_SPORES.get(), chance(0.03f));
});
- forMesh(writer, ingredient(Items.SOUL_SAND), EItems.IRON_MESH, (addDrop, addTagDrop, addConditionalDrop) -> {
- addDrop.accept(Items.QUARTZ, chance(0.15f));
- addDrop.accept(Items.GUNPOWDER, chance(0.07f));
- addDrop.accept(Items.BONE, chance(0.08f));
- addDrop.accept(Items.GHAST_TEAR, chance(0.06f));
- addDrop.accept(Items.GLOWSTONE_DUST, chance(0.06f));
- addDrop.accept(Items.NETHER_WART, chance(0.05f));
+ forMesh(writer, SOUL_SAND, EItems.IRON_MESH, drops -> {
+ drops.add(Items.QUARTZ, chance(0.15f));
+ drops.add(Items.GUNPOWDER, chance(0.07f));
+ drops.add(Items.BONE, chance(0.08f));
+ drops.add(Items.GHAST_TEAR, chance(0.06f));
+ drops.add(Items.GLOWSTONE_DUST, chance(0.06f));
+ drops.add(Items.NETHER_WART, chance(0.05f));
});
- forMesh(writer, ingredient(Items.SOUL_SAND), EItems.GOLDEN_MESH, (addDrop, addTagDrop, addConditionalDrop) -> {
- addDrop.accept(Items.QUARTZ, chance(0.17f));
- addDrop.accept(Items.GUNPOWDER, chance(0.1f));
- addDrop.accept(Items.BONE, chance(0.11f));
- addDrop.accept(Items.GHAST_TEAR, chance(0.08f));
- addDrop.accept(Items.GLOWSTONE_DUST, chance(0.09f));
- addDrop.accept(Items.NETHER_WART, chance(0.08f));
- addDrop.accept(Items.GOLD_NUGGET, chance(0.15f));
+ forMesh(writer, SOUL_SAND, EItems.GOLDEN_MESH, drops -> {
+ drops.add(Items.QUARTZ, chance(0.17f));
+ drops.add(Items.GUNPOWDER, chance(0.1f));
+ drops.add(Items.BONE, chance(0.11f));
+ drops.add(Items.GHAST_TEAR, chance(0.08f));
+ drops.add(Items.GLOWSTONE_DUST, chance(0.09f));
+ drops.add(Items.NETHER_WART, chance(0.08f));
+ drops.add(Items.GOLD_NUGGET, chance(0.15f));
});
- forMesh(writer, ingredient(Items.SOUL_SAND), EItems.DIAMOND_MESH, (addDrop, addTagDrop, addConditionalDrop) -> {
- addDrop.accept(Items.QUARTZ, chance(0.19f));
- addDrop.accept(Items.GUNPOWDER, chance(0.11f));
- addDrop.accept(Items.GHAST_TEAR, chance(0.09f));
- addDrop.accept(Items.GLOWSTONE_DUST, chance(0.11f));
- addDrop.accept(Items.NETHER_WART, chance(0.1f));
+ forMesh(writer, SOUL_SAND, EItems.DIAMOND_MESH, drops -> {
+ drops.add(Items.QUARTZ, chance(0.19f));
+ drops.add(Items.GUNPOWDER, chance(0.11f));
+ drops.add(Items.GHAST_TEAR, chance(0.09f));
+ drops.add(Items.GLOWSTONE_DUST, chance(0.11f));
+ drops.add(Items.NETHER_WART, chance(0.1f));
});
- forMesh(writer, ingredient(Items.SOUL_SAND), EItems.NETHERITE_MESH, (addDrop, addTagDrop, addConditionalDrop) -> {
- addDrop.accept(Items.QUARTZ, chance(0.21f));
- addDrop.accept(Items.GUNPOWDER, chance(0.14f));
- addDrop.accept(Items.GHAST_TEAR, chance(0.11f));
- addDrop.accept(Items.GLOWSTONE_DUST, chance(0.13f));
- addDrop.accept(Items.NETHER_WART, chance(0.12f));
+ forMesh(writer, SOUL_SAND, EItems.NETHERITE_MESH, drops -> {
+ drops.add(Items.QUARTZ, chance(0.21f));
+ drops.add(Items.GUNPOWDER, chance(0.14f));
+ drops.add(Items.GHAST_TEAR, chance(0.11f));
+ drops.add(Items.GLOWSTONE_DUST, chance(0.13f));
+ drops.add(Items.NETHER_WART, chance(0.12f));
});
- forMesh(writer, ingredient(EItems.CRUSHED_END_STONE), EItems.STRING_MESH, (addDrop, addTagDrop, addConditionalDrop) -> {
- addDrop.accept(Items.ENDER_PEARL, chance(0.07f));
- addDrop.accept(Items.CHORUS_FRUIT, chance(0.09f));
- addDrop.accept(Items.CHORUS_FLOWER, chance(0.04f));
- addDrop.accept(Items.ENDER_EYE, chance(0.02f));
+ forMesh(writer, CRUSHED_END_STONE, EItems.STRING_MESH, drops -> {
+ drops.add(Items.ENDER_PEARL, chance(0.07f));
+ drops.add(Items.CHORUS_FRUIT, chance(0.09f));
+ drops.add(Items.CHORUS_FLOWER, chance(0.04f));
+ drops.add(Items.ENDER_EYE, chance(0.02f));
});
- forMesh(writer, ingredient(EItems.CRUSHED_END_STONE), EItems.FLINT_MESH, (addDrop, addTagDrop, addConditionalDrop) -> {
- addDrop.accept(Items.ENDER_PEARL, chance(0.08f));
- addDrop.accept(Items.CHORUS_FRUIT, chance(0.11f));
- addDrop.accept(Items.CHORUS_FLOWER, chance(0.06f));
- addDrop.accept(Items.ENDER_EYE, chance(0.03f));
+ forMesh(writer, CRUSHED_END_STONE, EItems.FLINT_MESH, drops -> {
+ drops.add(Items.ENDER_PEARL, chance(0.08f));
+ drops.add(Items.CHORUS_FRUIT, chance(0.11f));
+ drops.add(Items.CHORUS_FLOWER, chance(0.06f));
+ drops.add(Items.ENDER_EYE, chance(0.03f));
});
- forMesh(writer, ingredient(EItems.CRUSHED_END_STONE), EItems.IRON_MESH, (addDrop, addTagDrop, addConditionalDrop) -> {
- addDrop.accept(Items.ENDER_PEARL, chance(0.10f));
- addDrop.accept(Items.CHORUS_FRUIT, chance(0.13f));
- addDrop.accept(Items.CHORUS_FLOWER, chance(0.07f));
- addDrop.accept(Items.ENDER_EYE, chance(0.04f));
+ forMesh(writer, CRUSHED_END_STONE, EItems.IRON_MESH, drops -> {
+ drops.add(Items.ENDER_PEARL, chance(0.10f));
+ drops.add(Items.CHORUS_FRUIT, chance(0.13f));
+ drops.add(Items.CHORUS_FLOWER, chance(0.07f));
+ drops.add(Items.ENDER_EYE, chance(0.04f));
});
- forMesh(writer, ingredient(EItems.CRUSHED_END_STONE), EItems.GOLDEN_MESH, (addDrop, addTagDrop, addConditionalDrop) -> {
- addDrop.accept(Items.ENDER_PEARL, chance(0.12f));
- addDrop.accept(Items.CHORUS_FRUIT, chance(0.12f));
- addDrop.accept(Items.CHORUS_FLOWER, chance(0.06f));
- addDrop.accept(Items.ENDER_EYE, chance(0.07f));
+ forMesh(writer, CRUSHED_END_STONE, EItems.GOLDEN_MESH, drops -> {
+ drops.add(Items.ENDER_PEARL, chance(0.12f));
+ drops.add(Items.CHORUS_FRUIT, chance(0.12f));
+ drops.add(Items.CHORUS_FLOWER, chance(0.06f));
+ drops.add(Items.ENDER_EYE, chance(0.07f));
});
- forMesh(writer, ingredient(EItems.CRUSHED_END_STONE), EItems.DIAMOND_MESH, (addDrop, addTagDrop, addConditionalDrop) -> {
- addDrop.accept(Items.ENDER_PEARL, chance(0.15f));
- addDrop.accept(Items.CHORUS_FRUIT, chance(0.10f));
- addDrop.accept(Items.CHORUS_FLOWER, chance(0.04f));
- addDrop.accept(Items.ENDER_EYE, chance(0.09f));
+ forMesh(writer, CRUSHED_END_STONE, EItems.DIAMOND_MESH, drops -> {
+ drops.add(Items.ENDER_PEARL, chance(0.15f));
+ drops.add(Items.CHORUS_FRUIT, chance(0.10f));
+ drops.add(Items.CHORUS_FLOWER, chance(0.04f));
+ drops.add(Items.ENDER_EYE, chance(0.09f));
});
- forMesh(writer, ingredient(EItems.CRUSHED_END_STONE), EItems.NETHERITE_MESH, (addDrop, addTagDrop, addConditionalDrop) -> {
- addDrop.accept(Items.ENDER_PEARL, chance(0.17f));
- addDrop.accept(Items.CHORUS_FRUIT, chance(0.10f));
- addDrop.accept(Items.CHORUS_FLOWER, chance(0.04f));
- addDrop.accept(Items.ENDER_EYE, chance(0.09f));
- addDrop.accept(Items.ECHO_SHARD, chance(0.03f));
- addDrop.accept(Items.SCULK_SHRIEKER, chance(0.01f));
+ forMesh(writer, CRUSHED_END_STONE, EItems.NETHERITE_MESH, drops -> {
+ drops.add(Items.ENDER_PEARL, chance(0.17f));
+ drops.add(Items.CHORUS_FRUIT, chance(0.10f));
+ drops.add(Items.CHORUS_FLOWER, chance(0.04f));
+ drops.add(Items.ENDER_EYE, chance(0.09f));
+ drops.add(Items.ECHO_SHARD, chance(0.03f));
+ drops.add(Items.SCULK_SHRIEKER, chance(0.01f));
});
for (int i = 0; i < allMeshes.size(); i++) {
var mesh = allMeshes.get(i);
final int j = i;
- forMesh(writer, ingredient(Items.MOSS_BLOCK), mesh, (addDrop, addTagDrop, addConditionalDrop) -> {
- addDrop.accept(Items.OAK_SAPLING, chance(0.13f));
- addDrop.accept(Items.SPRUCE_SAPLING, chance(0.11f));
- addDrop.accept(Items.BIRCH_SAPLING, chance(0.11f));
- addDrop.accept(Items.ACACIA_SAPLING, chance(0.11f));
- addDrop.accept(Items.DARK_OAK_SAPLING, chance(0.11f));
- addDrop.accept(Items.JUNGLE_SAPLING, chance(0.11f));
- addDrop.accept(Items.CHERRY_SAPLING, chance(0.11f));
- addDrop.accept(Items.MANGROVE_PROPAGULE, chance(0.11f));
- addDrop.accept(Items.AZALEA, chance(0.08f + j * 0.01f));
- addDrop.accept(Items.GLOW_BERRIES, chance(0.04f + j * 0.075f));
- addDrop.accept(Items.SMALL_DRIPLEAF, chance(0.07f + j * 0.025f));
- addDrop.accept(Items.BIG_DRIPLEAF, chance(0.05f + j * 0.02f));
- addDrop.accept(Items.SPORE_BLOSSOM, chance(0.03f + j * 0.015f));
+ forMesh(writer, MOSS_BLOCK, mesh, drops -> {
+ drops.add(Items.OAK_SAPLING, chance(0.13f));
+ drops.add(Items.SPRUCE_SAPLING, chance(0.11f));
+ drops.add(Items.BIRCH_SAPLING, chance(0.11f));
+ drops.add(Items.ACACIA_SAPLING, chance(0.11f));
+ drops.add(Items.DARK_OAK_SAPLING, chance(0.11f));
+ drops.add(Items.JUNGLE_SAPLING, chance(0.11f));
+ drops.add(Items.CHERRY_SAPLING, chance(0.11f));
+ drops.add(Items.MANGROVE_PROPAGULE, chance(0.11f));
+ drops.add(Items.AZALEA, chance(0.08f + j * 0.01f));
+ drops.add(Items.GLOW_BERRIES, chance(0.04f + j * 0.075f));
+ drops.add(Items.SMALL_DRIPLEAF, chance(0.07f + j * 0.025f));
+ drops.add(Items.BIG_DRIPLEAF, chance(0.05f + j * 0.02f));
+ drops.add(Items.SPORE_BLOSSOM, chance(0.03f + j * 0.015f));
var bop = Recipes.modInstalled(ModIds.BIOMES_O_PLENTY);
- addConditionalDrop.accept(ModCompatData.ORIGIN_SAPLING.get(), chance(0.04f), bop);
- addConditionalDrop.accept(ModCompatData.FLOWERING_OAK_SAPLING.get(), chance(0.04f), bop);
- addConditionalDrop.accept(ModCompatData.SNOWBLOSSOM_SAPLING.get(), chance(0.04f), bop);
- addConditionalDrop.accept(ModCompatData.RAINBOW_BIRCH_SAPLING.get(), chance(0.04f), bop);
- addConditionalDrop.accept(ModCompatData.YELLOW_AUTUMN_SAPLING.get(), chance(0.04f), bop);
- addConditionalDrop.accept(ModCompatData.ORANGE_AUTUMN_SAPLING.get(), chance(0.04f), bop);
- addConditionalDrop.accept(ModCompatData.MAPLE_SAPLING.get(), chance(0.04f), bop);
+ drops.addConditional(ModCompatData.ORIGIN_SAPLING.get(), chance(0.04f), bop);
+ drops.addConditional(ModCompatData.FLOWERING_OAK_SAPLING.get(), chance(0.04f), bop);
+ drops.addConditional(ModCompatData.SNOWBLOSSOM_SAPLING.get(), chance(0.04f), bop);
+ drops.addConditional(ModCompatData.RAINBOW_BIRCH_SAPLING.get(), chance(0.04f), bop);
+ drops.addConditional(ModCompatData.YELLOW_AUTUMN_SAPLING.get(), chance(0.04f), bop);
+ drops.addConditional(ModCompatData.ORANGE_AUTUMN_SAPLING.get(), chance(0.04f), bop);
+ drops.addConditional(ModCompatData.MAPLE_SAPLING.get(), chance(0.04f), bop);
- addConditionalDrop.accept(ModCompatData.FIR_SAPLING.get(), chance(0.04f), bop);
- addConditionalDrop.accept(ModCompatData.REDWOOD_SAPLING.get(), chance(0.04f), bop);
- addConditionalDrop.accept(ModCompatData.MAHOGANY_SAPLING.get(), chance(0.04f), bop);
- addConditionalDrop.accept(ModCompatData.JACARANDA_SAPLING.get(), chance(0.04f), bop);
- addConditionalDrop.accept(ModCompatData.PALM_SAPLING.get(), chance(0.04f), bop);
- addConditionalDrop.accept(ModCompatData.WILLOW_SAPLING.get(), chance(0.04f), bop);
- addConditionalDrop.accept(ModCompatData.DEAD_SAPLING.get(), chance(0.04f), bop);
- addConditionalDrop.accept(ModCompatData.MAGIC_SAPLING.get(), chance(0.04f), bop);
- addConditionalDrop.accept(ModCompatData.UMBRAN_SAPLING.get(), chance(0.04f), bop);
- addConditionalDrop.accept(ModCompatData.HELLBARK_SAPLING.get(), chance(0.04f), bop);
+ drops.addConditional(ModCompatData.FIR_SAPLING.get(), chance(0.04f), bop);
+ drops.addConditional(ModCompatData.REDWOOD_SAPLING.get(), chance(0.04f), bop);
+ drops.addConditional(ModCompatData.MAHOGANY_SAPLING.get(), chance(0.04f), bop);
+ drops.addConditional(ModCompatData.JACARANDA_SAPLING.get(), chance(0.04f), bop);
+ drops.addConditional(ModCompatData.PALM_SAPLING.get(), chance(0.04f), bop);
+ drops.addConditional(ModCompatData.WILLOW_SAPLING.get(), chance(0.04f), bop);
+ drops.addConditional(ModCompatData.DEAD_SAPLING.get(), chance(0.04f), bop);
+ drops.addConditional(ModCompatData.MAGIC_SAPLING.get(), chance(0.04f), bop);
+ drops.addConditional(ModCompatData.UMBRAN_SAPLING.get(), chance(0.04f), bop);
+ drops.addConditional(ModCompatData.HELLBARK_SAPLING.get(), chance(0.04f), bop);
var ars = Recipes.modInstalled(ModIds.ARS_NOUVEAU);
- addConditionalDrop.accept(ModCompatData.BLUE_ARCHWOOD_SAPLING.get(), chance(0.005f), ars);
- addConditionalDrop.accept(ModCompatData.RED_ARCHWOOD_SAPLING.get(), chance(0.005f), ars);
- addConditionalDrop.accept(ModCompatData.PURPLE_ARCHWOOD_SAPLING.get(), chance(0.005f), ars);
- addConditionalDrop.accept(ModCompatData.GREEN_ARCHWOOD_SAPLING.get(), chance(0.005f), ars);
+ drops.addConditional(ModCompatData.BLUE_ARCHWOOD_SAPLING.get(), chance(0.005f), ars);
+ drops.addConditional(ModCompatData.RED_ARCHWOOD_SAPLING.get(), chance(0.005f), ars);
+ drops.addConditional(ModCompatData.PURPLE_ARCHWOOD_SAPLING.get(), chance(0.005f), ars);
+ drops.addConditional(ModCompatData.GREEN_ARCHWOOD_SAPLING.get(), chance(0.005f), ars);
- addConditionalDrop.accept(ModCompatData.SOURCEBERRY.get(), chance(0.01f), ars);
+ drops.addConditional(ModCompatData.SOURCEBERRY.get(), chance(0.01f), ars);
});
}
- forMesh(writer, ingredient(Items.MOSS_BLOCK), EItems.FLINT_MESH, (addDrop, addTagDrop, addConditionalDrop) -> {
- addDrop.accept(Items.SWEET_BERRIES, chance(0.03f));
- addDrop.accept(Items.FLOWERING_AZALEA, chance(0.03f));
- addDrop.accept(Items.GLOW_LICHEN, chance(0.04f));
- addDrop.accept(Items.LILY_PAD, chance(0.04f));
+ forMesh(writer, MOSS_BLOCK, EItems.FLINT_MESH, drops -> {
+ drops.add(Items.SWEET_BERRIES, chance(0.03f));
+ drops.add(Items.FLOWERING_AZALEA, chance(0.03f));
+ drops.add(Items.GLOW_LICHEN, chance(0.04f));
+ drops.add(Items.LILY_PAD, chance(0.04f));
});
}
@@ -929,44 +955,45 @@ class SieveRecipes {
return binomial(1, p);
}
- private static void forMesh(Consumer writer, Ingredient block, RegistryObject extends Item> mesh, ForMeshContext addDrops) {
+ private static void forMesh(Consumer output, Ingredient block, RegistryObject extends Item> mesh, Consumer addDrops) {
var folder = mesh.getId().getPath().replace("_mesh", "/");
var basePath = path(block.getItems()[0].getItem()) + "/" + folder;
- addDrops.accept(
- (result, resultAmount) -> sieveRecipe(writer, basePath + path(result), block, mesh, result, resultAmount),
- (resultTag, resultAmount) -> sieveRecipeTag(writer, basePath + resultTag.location().getPath().concat("_tag"), block, mesh, resultTag, resultAmount),
- ((result, resultAmount, condition) -> sieveConditional(writer, basePath + result.map(MKRecipeProvider::path, tag -> tag.location().getPath().concat("_tag")), block, mesh, result, resultAmount, condition))
- );
+ addDrops.accept(new MeshDrops(output, "sieve/" + basePath, "compressed_sieve/" + basePath, block, mesh.get()));
}
- @FunctionalInterface
- private interface ForMeshContext {
- void accept(BiConsumer
- addDrop, BiConsumer, NumberProvider> addTagDrop, AddConditionalTag addConditionalTag);
- }
+ private record MeshDrops(Consumer output, String basePath, String baseCompressedPath, Ingredient block, Item mesh) {
+ private void add(Item result, NumberProvider resultAmount) {
+ this.output.accept(new FinishedSieveRecipe(modLoc(this.basePath + path(result)), this.mesh, this.block, result, resultAmount));
- @FunctionalInterface
- private interface AddConditionalTag {
- void accept(Either
- > result, NumberProvider resultAmount, ICondition condition);
+ if (COMPRESSED_VARIANTS.containsKey(this.block)) {
+ var compressedLoc = modLoc(this.baseCompressedPath + path(result));
+ var multiplied = Recipes.compressedMultiplier(resultAmount);
- default void accept(Item result, NumberProvider resultAmount, ICondition condition) {
- this.accept(Either.left(result), resultAmount, condition);
+ this.output.accept(new FinishedCompressedSieveRecipe(compressedLoc, this.mesh, COMPRESSED_VARIANTS.get(this.block), result, multiplied));
+ }
+ }
+
+ private void addConditional(Item result, NumberProvider resultAmount, ICondition condition) {
+ var path = modLoc(this.basePath + path(result));
+ ConditionalRecipe.builder()
+ .addCondition(condition)
+ .addRecipe(new FinishedSieveRecipe(path, this.mesh, this.block, result, resultAmount))
+ .build(this.output, path);
+
+ if (COMPRESSED_VARIANTS.containsKey(this.block)) {
+ var compressedLoc = modLoc(this.baseCompressedPath + path(result));
+ var multiplied = Recipes.compressedMultiplier(resultAmount);
+
+ ConditionalRecipe.builder()
+ .addCondition(condition)
+ .addRecipe(new FinishedCompressedSieveRecipe(compressedLoc, this.mesh, COMPRESSED_VARIANTS.get(this.block), result, multiplied))
+ .build(this.output, compressedLoc);
+ }
}
}
- private static void sieveRecipe(Consumer writer, String name, Ingredient block, Supplier extends Item> mesh, Item result, NumberProvider resultAmount) {
- writer.accept(new FinishedSieveRecipe(new ResourceLocation(ExDeorum.ID, "sieve/" + name), mesh.get(), block, Either.left(result), resultAmount));
- }
-
- private static void sieveRecipeTag(Consumer writer, String name, Ingredient block, Supplier extends Item> mesh, TagKey
- result, NumberProvider resultAmount) {
- writer.accept(new FinishedSieveRecipe(new ResourceLocation(ExDeorum.ID, "sieve/" + name), mesh.get(), block, Either.right(result), resultAmount));
- }
-
- private static void sieveConditional(Consumer writer, String name, Ingredient block, Supplier extends Item> mesh, Either
- > result, NumberProvider resultAmount, ICondition condition) {
- var path = new ResourceLocation(ExDeorum.ID, "sieve/" + name);
- ConditionalRecipe.builder()
- .addCondition(condition)
- .addRecipe(new FinishedSieveRecipe(path, mesh.get(), block, result, resultAmount))
- .build(writer, path);
+ public static ResourceLocation modLoc(String path) {
+ return new ResourceLocation(ExDeorum.ID, path);
}
}
diff --git a/src/main/java/thedarkcolour/exdeorum/material/CompressedSieveMaterial.java b/src/main/java/thedarkcolour/exdeorum/material/CompressedSieveMaterial.java
new file mode 100644
index 00000000..f3f2f329
--- /dev/null
+++ b/src/main/java/thedarkcolour/exdeorum/material/CompressedSieveMaterial.java
@@ -0,0 +1,34 @@
+/*
+ * Ex Deorum
+ * Copyright (c) 2024 thedarkcolour
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package thedarkcolour.exdeorum.material;
+
+import net.minecraft.world.level.block.Block;
+import net.minecraft.world.level.block.SoundType;
+import thedarkcolour.exdeorum.block.CompressedSieveBlock;
+
+public class CompressedSieveMaterial extends SieveMaterial {
+ protected CompressedSieveMaterial(SoundType soundType, float strength, boolean needsCorrectTool, String requiredModId) {
+ super(soundType, strength, needsCorrectTool, requiredModId);
+ }
+
+ @Override
+ protected Block createBlock() {
+ return new CompressedSieveBlock(props().noOcclusion());
+ }
+}
diff --git a/src/main/java/thedarkcolour/exdeorum/material/DefaultMaterials.java b/src/main/java/thedarkcolour/exdeorum/material/DefaultMaterials.java
index 356c77ff..ab646ac8 100644
--- a/src/main/java/thedarkcolour/exdeorum/material/DefaultMaterials.java
+++ b/src/main/java/thedarkcolour/exdeorum/material/DefaultMaterials.java
@@ -27,6 +27,7 @@ import thedarkcolour.exdeorum.compat.ModIds;
public class DefaultMaterials {
public static final MaterialRegistry BARRELS = new MaterialRegistry<>("barrel");
public static final MaterialRegistry SIEVES = new MaterialRegistry<>("sieve");
+ public static final MaterialRegistry COMPRESSED_SIEVES = new MaterialRegistry<>("compressed_sieve");
public static final MaterialRegistry LAVA_CRUCIBLES = new MaterialRegistry<>("lava_crucible", "crucible");
public static final MaterialRegistry WATER_CRUCIBLES = new MaterialRegistry<>("water_crucible", "crucible");
@@ -105,6 +106,17 @@ public class DefaultMaterials {
public static final SieveMaterial MAPLE_SIEVE = addDefaultSieve("maple", SoundType.WOOD, ModIds.BLUE_SKIES);
public static final SieveMaterial CRYSTALLIZED_SIEVE = addDefaultSieve("crystallized", SoundType.GLASS, true, ModIds.BLUE_SKIES);
+ // Ex Deorum
+ public static final CompressedSieveMaterial OAK_COMPRESSED_SIEVE = addDefaultCompressedSieve("oak", SoundType.WOOD, ExDeorum.ID);
+ public static final CompressedSieveMaterial SPRUCE_COMPRESSED_SIEVE = addDefaultCompressedSieve("spruce", SoundType.WOOD, ExDeorum.ID);
+ public static final CompressedSieveMaterial BIRCH_COMPRESSED_SIEVE = addDefaultCompressedSieve("birch", SoundType.WOOD, ExDeorum.ID);
+ public static final CompressedSieveMaterial JUNGLE_COMPRESSED_SIEVE = addDefaultCompressedSieve("jungle", SoundType.WOOD, ExDeorum.ID);
+ public static final CompressedSieveMaterial ACACIA_COMPRESSED_SIEVE = addDefaultCompressedSieve("acacia", SoundType.WOOD, ExDeorum.ID);
+ public static final CompressedSieveMaterial DARK_OAK_COMPRESSED_SIEVE = addDefaultCompressedSieve("dark_oak", SoundType.WOOD, ExDeorum.ID);
+ public static final CompressedSieveMaterial MANGROVE_COMPRESSED_SIEVE = addDefaultCompressedSieve("mangrove", SoundType.WOOD, ExDeorum.ID);
+ public static final CompressedSieveMaterial CHERRY_COMPRESSED_SIEVE = addDefaultCompressedSieve("cherry", SoundType.CHERRY_WOOD, ExDeorum.ID);
+ public static final CompressedSieveMaterial BAMBOO_COMPRESSED_SIEVE = addDefaultCompressedSieve("bamboo", SoundType.BAMBOO_WOOD, ExDeorum.ID);
+
// Ex Deorum
public static final LavaCrucibleMaterial PORCELAIN_CRUCIBLE = addDefaultLavaCrucible("porcelain", SoundType.STONE, 2.0f, false, MapColor.TERRACOTTA_WHITE, ExDeorum.ID, false);
public static final LavaCrucibleMaterial WARPED_CRUCIBLE = addDefaultLavaCrucible("warped", SoundType.STEM, 1.5f, false, MapColor.CRIMSON_STEM, ExDeorum.ID, false);
@@ -171,6 +183,16 @@ public class DefaultMaterials {
return material;
}
+ private static CompressedSieveMaterial addDefaultCompressedSieve(String name, SoundType soundType, String requiredModID) {
+ return addDefaultCompressedSieve(name, soundType, 2.0f, false, requiredModID);
+ }
+
+ private static CompressedSieveMaterial addDefaultCompressedSieve(String name, SoundType soundType, float strength, boolean needsCorrectTool, String requiredModId) {
+ var material = new CompressedSieveMaterial(soundType, strength, needsCorrectTool, requiredModId);
+ COMPRESSED_SIEVES.register(name, material);
+ return material;
+ }
+
private static LavaCrucibleMaterial addDefaultLavaCrucible(String name, SoundType soundType, float strength, boolean needsCorrectTool, MapColor color, String requiredModId, boolean transparent) {
var material = new LavaCrucibleMaterial(soundType, strength, needsCorrectTool, color.id, requiredModId, transparent);
LAVA_CRUCIBLES.register(name, material);
diff --git a/src/main/java/thedarkcolour/exdeorum/recipe/RecipeUtil.java b/src/main/java/thedarkcolour/exdeorum/recipe/RecipeUtil.java
index a6f55b21..cbb4cda3 100644
--- a/src/main/java/thedarkcolour/exdeorum/recipe/RecipeUtil.java
+++ b/src/main/java/thedarkcolour/exdeorum/recipe/RecipeUtil.java
@@ -65,6 +65,7 @@ import thedarkcolour.exdeorum.recipe.cache.*;
import thedarkcolour.exdeorum.recipe.crook.CrookRecipe;
import thedarkcolour.exdeorum.recipe.crucible.CrucibleRecipe;
import thedarkcolour.exdeorum.recipe.hammer.HammerRecipe;
+import thedarkcolour.exdeorum.recipe.sieve.CompressedSieveRecipe;
import thedarkcolour.exdeorum.recipe.sieve.SieveRecipe;
import thedarkcolour.exdeorum.registry.ENumberProviders;
import thedarkcolour.exdeorum.registry.ERecipeTypes;
@@ -86,7 +87,8 @@ public final class RecipeUtil {
private static SingleIngredientRecipeCache lavaCrucibleRecipeCache;
private static SingleIngredientRecipeCache waterCrucibleRecipeCache;
private static SingleIngredientRecipeCache hammerRecipeCache;
- private static SieveRecipeCache sieveRecipeCache;
+ private static SieveRecipeCache sieveRecipeCache;
+ private static SieveRecipeCache compressedSieveRecipeCache;
private static BarrelFluidMixingRecipeCache barrelFluidMixingRecipeCache;
private static FluidTransformationRecipeCache fluidTransformationRecipeCache;
private static CrookRecipeCache crookRecipeCache;
@@ -97,7 +99,8 @@ public final class RecipeUtil {
lavaCrucibleRecipeCache = new SingleIngredientRecipeCache<>(recipes, ERecipeTypes.LAVA_CRUCIBLE);
waterCrucibleRecipeCache = new SingleIngredientRecipeCache<>(recipes, ERecipeTypes.WATER_CRUCIBLE);
hammerRecipeCache = new SingleIngredientRecipeCache<>(recipes, ERecipeTypes.HAMMER).trackAllRecipes();
- sieveRecipeCache = new SieveRecipeCache(recipes);
+ sieveRecipeCache = new SieveRecipeCache<>(recipes, ERecipeTypes.SIEVE);
+ compressedSieveRecipeCache = new SieveRecipeCache<>(recipes, ERecipeTypes.COMPRESSED_SIEVE);
barrelFluidMixingRecipeCache = new BarrelFluidMixingRecipeCache(recipes);
fluidTransformationRecipeCache = new FluidTransformationRecipeCache(recipes);
crookRecipeCache = new CrookRecipeCache(recipes);
@@ -121,6 +124,10 @@ public final class RecipeUtil {
return sieveRecipeCache.getRecipe(mesh, item);
}
+ public static List getCompressedSieveRecipes(Item mesh, ItemStack item) {
+ return compressedSieveRecipeCache.getRecipe(mesh, item);
+ }
+
@Nullable
public static CrucibleRecipe getLavaCrucibleRecipe(ItemStack item) {
return lavaCrucibleRecipeCache.getRecipe(item);
diff --git a/src/main/java/thedarkcolour/exdeorum/recipe/cache/SieveRecipeCache.java b/src/main/java/thedarkcolour/exdeorum/recipe/cache/SieveRecipeCache.java
index 37b562d8..a99dbd99 100644
--- a/src/main/java/thedarkcolour/exdeorum/recipe/cache/SieveRecipeCache.java
+++ b/src/main/java/thedarkcolour/exdeorum/recipe/cache/SieveRecipeCache.java
@@ -22,6 +22,7 @@ import com.google.common.collect.ImmutableList;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.crafting.RecipeManager;
+import net.minecraft.world.item.crafting.RecipeType;
import org.jetbrains.annotations.Nullable;
import thedarkcolour.exdeorum.recipe.sieve.SieveRecipe;
import thedarkcolour.exdeorum.registry.ERecipeTypes;
@@ -30,17 +31,20 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import java.util.function.Supplier;
-public class SieveRecipeCache {
+public class SieveRecipeCache {
private RecipeManager recipeManager;
+ private final Supplier extends RecipeType> recipeType;
@Nullable
- private Map
- meshCaches;
+ private Map
- > meshCaches;
- public SieveRecipeCache(RecipeManager recipeManager) {
+ public SieveRecipeCache(RecipeManager recipeManager, Supplier extends RecipeType> recipeType) {
this.recipeManager = recipeManager;
+ this.recipeType = recipeType;
}
- public List getRecipe(Item mesh, ItemStack input) {
+ public List getRecipe(Item mesh, ItemStack input) {
if (this.meshCaches == null) {
buildRecipes();
}
@@ -50,13 +54,13 @@ public class SieveRecipeCache {
private void buildRecipes() {
// Group recipes based on their mesh
- var tempMap = new HashMap
- >();
- for (var recipe : this.recipeManager.byType(ERecipeTypes.SIEVE.get()).values()) {
+ var tempMap = new HashMap
- >();
+ for (var recipe : this.recipeManager.byType(this.recipeType.get()).values()) {
tempMap.computeIfAbsent(recipe.mesh, k -> new ArrayList<>()).add(recipe);
}
this.meshCaches = new HashMap<>();
for (var mesh : tempMap.entrySet()) {
- this.meshCaches.put(mesh.getKey(), new MeshRecipeCache(mesh.getValue()));
+ this.meshCaches.put(mesh.getKey(), new MeshRecipeCache<>(mesh.getValue()));
}
this.recipeManager = null;
}
@@ -66,12 +70,12 @@ public class SieveRecipeCache {
// conveying this information in JEI would be difficult (ex. Bottle drops from Sand, but only if the Sand has a
// certain enchantment). Thirdly, I do not see anybody needing this use case, and if they do, they should contact
// me on GitHub or Discord so that I can get around to actually implementing it.
- private static class MeshRecipeCache {
- private final Map
- > simpleRecipes;
+ private static class MeshRecipeCache {
+ private final Map
- > simpleRecipes;
- private MeshRecipeCache(List recipes) {
+ private MeshRecipeCache(List recipes) {
this.simpleRecipes = new HashMap<>();
- var temp = new HashMap
- >();
+ var temp = new HashMap
- >();
for (var recipe : recipes) {
for (var item : recipe.ingredient.getItems()) {
@@ -84,7 +88,7 @@ public class SieveRecipeCache {
}
}
- public List getRecipes(ItemStack input) {
+ public List getRecipes(ItemStack input) {
var result = this.simpleRecipes.get(input.getItem());
return result == null ? List.of() : result;
}
diff --git a/src/main/java/thedarkcolour/exdeorum/recipe/sieve/CompressedSieveRecipe.java b/src/main/java/thedarkcolour/exdeorum/recipe/sieve/CompressedSieveRecipe.java
new file mode 100644
index 00000000..0b6b7c67
--- /dev/null
+++ b/src/main/java/thedarkcolour/exdeorum/recipe/sieve/CompressedSieveRecipe.java
@@ -0,0 +1,51 @@
+/*
+ * Ex Deorum
+ * Copyright (c) 2024 thedarkcolour
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package thedarkcolour.exdeorum.recipe.sieve;
+
+import net.minecraft.resources.ResourceLocation;
+import net.minecraft.world.item.Item;
+import net.minecraft.world.item.crafting.Ingredient;
+import net.minecraft.world.item.crafting.RecipeSerializer;
+import net.minecraft.world.item.crafting.RecipeType;
+import net.minecraft.world.level.storage.loot.providers.number.NumberProvider;
+import thedarkcolour.exdeorum.registry.ERecipeSerializers;
+import thedarkcolour.exdeorum.registry.ERecipeTypes;
+
+public class CompressedSieveRecipe extends SieveRecipe {
+ public CompressedSieveRecipe(ResourceLocation id, Ingredient ingredient, Item mesh, Item result, NumberProvider resultAmount, boolean byHandOnly) {
+ super(id, ingredient, mesh, result, resultAmount, byHandOnly);
+ }
+
+ @Override
+ public RecipeSerializer> getSerializer() {
+ return ERecipeSerializers.COMPRESSED_SIEVE.get();
+ }
+
+ @Override
+ public RecipeType> getType() {
+ return ERecipeTypes.COMPRESSED_SIEVE.get();
+ }
+
+ public static class Serializer extends SieveRecipe.AbstractSerializer {
+ @Override
+ protected CompressedSieveRecipe createSieveRecipe(ResourceLocation id, Ingredient ingredient, Item mesh, Item result, NumberProvider resultAmount, boolean byHandOnly) {
+ return new CompressedSieveRecipe(id, ingredient, mesh, result, resultAmount, byHandOnly);
+ }
+ }
+}
diff --git a/src/main/java/thedarkcolour/exdeorum/recipe/sieve/FinishedCompressedSieveRecipe.java b/src/main/java/thedarkcolour/exdeorum/recipe/sieve/FinishedCompressedSieveRecipe.java
new file mode 100644
index 00000000..386d1059
--- /dev/null
+++ b/src/main/java/thedarkcolour/exdeorum/recipe/sieve/FinishedCompressedSieveRecipe.java
@@ -0,0 +1,37 @@
+/*
+ * Ex Deorum
+ * Copyright (c) 2024 thedarkcolour
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package thedarkcolour.exdeorum.recipe.sieve;
+
+import net.minecraft.resources.ResourceLocation;
+import net.minecraft.world.item.Item;
+import net.minecraft.world.item.crafting.Ingredient;
+import net.minecraft.world.item.crafting.RecipeSerializer;
+import net.minecraft.world.level.storage.loot.providers.number.NumberProvider;
+import thedarkcolour.exdeorum.registry.ERecipeSerializers;
+
+public class FinishedCompressedSieveRecipe extends FinishedSieveRecipe{
+ public FinishedCompressedSieveRecipe(ResourceLocation id, Item mesh, Ingredient ingredient, Item result, NumberProvider resultAmount) {
+ super(id, mesh, ingredient, result, resultAmount);
+ }
+
+ @Override
+ public RecipeSerializer> getType() {
+ return ERecipeSerializers.COMPRESSED_SIEVE.get();
+ }
+}
diff --git a/src/main/java/thedarkcolour/exdeorum/recipe/sieve/FinishedSieveRecipe.java b/src/main/java/thedarkcolour/exdeorum/recipe/sieve/FinishedSieveRecipe.java
index e1d86d1e..e9104d5d 100644
--- a/src/main/java/thedarkcolour/exdeorum/recipe/sieve/FinishedSieveRecipe.java
+++ b/src/main/java/thedarkcolour/exdeorum/recipe/sieve/FinishedSieveRecipe.java
@@ -19,10 +19,8 @@
package thedarkcolour.exdeorum.recipe.sieve;
import com.google.gson.JsonObject;
-import com.mojang.datafixers.util.Either;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.resources.ResourceLocation;
-import net.minecraft.tags.TagKey;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.crafting.Ingredient;
import net.minecraft.world.item.crafting.RecipeSerializer;
@@ -34,10 +32,10 @@ import thedarkcolour.exdeorum.registry.ERecipeSerializers;
public class FinishedSieveRecipe extends EFinishedRecipe {
private final Ingredient ingredient;
private final Item mesh;
- private final Either
- > result;
+ private final Item result;
private final NumberProvider resultAmount;
- public FinishedSieveRecipe(ResourceLocation id, Item mesh, Ingredient ingredient, Either
- > result, NumberProvider resultAmount) {
+ public FinishedSieveRecipe(ResourceLocation id, Item mesh, Ingredient ingredient, Item result, NumberProvider resultAmount) {
super(id);
this.mesh = mesh;
this.ingredient = ingredient;
@@ -45,15 +43,12 @@ public class FinishedSieveRecipe extends EFinishedRecipe {
this.resultAmount = resultAmount;
}
+ @SuppressWarnings("deprecation")
@Override
public void serializeRecipeData(JsonObject object) {
object.add("ingredient", this.ingredient.toJson());
object.addProperty("mesh", BuiltInRegistries.ITEM.getKey(this.mesh).toString());
- this.result.ifLeft(item -> {
- object.addProperty("result", BuiltInRegistries.ITEM.getKey(item).toString());
- }).ifRight(tag -> {
- object.addProperty("result_tag", tag.location().toString());
- });
+ object.addProperty("result", BuiltInRegistries.ITEM.getKey(this.result).toString());
object.add("result_amount", LootDataType.PREDICATE.parser().toJsonTree(this.resultAmount));
}
diff --git a/src/main/java/thedarkcolour/exdeorum/recipe/sieve/SieveRecipe.java b/src/main/java/thedarkcolour/exdeorum/recipe/sieve/SieveRecipe.java
index 30bb1740..a701fb50 100644
--- a/src/main/java/thedarkcolour/exdeorum/recipe/sieve/SieveRecipe.java
+++ b/src/main/java/thedarkcolour/exdeorum/recipe/sieve/SieveRecipe.java
@@ -63,11 +63,11 @@ public class SieveRecipe extends ProbabilityRecipe {
return ERecipeTypes.SIEVE.get();
}
- public static abstract class AbstractSerializer implements RecipeSerializer {
- protected abstract SieveRecipe createSieveRecipe(ResourceLocation id, Ingredient ingredient, Item mesh, Item result, NumberProvider resultAmount, boolean byHandOnly);
+ public static abstract class AbstractSerializer implements RecipeSerializer {
+ protected abstract T createSieveRecipe(ResourceLocation id, Ingredient ingredient, Item mesh, Item result, NumberProvider resultAmount, boolean byHandOnly);
@Override
- public SieveRecipe fromJson(ResourceLocation id, JsonObject json) {
+ public T fromJson(ResourceLocation id, JsonObject json) {
Ingredient ingredient = RecipeUtil.readIngredient(json, "ingredient");
Item mesh = RecipeUtil.readItem(json, "mesh");
Item result;
@@ -93,7 +93,7 @@ public class SieveRecipe extends ProbabilityRecipe {
@SuppressWarnings("deprecation")
@Override
- public @Nullable SieveRecipe fromNetwork(ResourceLocation id, FriendlyByteBuf buffer) {
+ public @Nullable T fromNetwork(ResourceLocation id, FriendlyByteBuf buffer) {
Ingredient ingredient = Ingredient.fromNetwork(buffer);
Item mesh = Objects.requireNonNull(buffer.readById(BuiltInRegistries.ITEM));
Item result = Objects.requireNonNull(buffer.readById(BuiltInRegistries.ITEM));
@@ -103,7 +103,7 @@ public class SieveRecipe extends ProbabilityRecipe {
@SuppressWarnings("deprecation")
@Override
- public void toNetwork(FriendlyByteBuf buffer, SieveRecipe recipe) {
+ public void toNetwork(FriendlyByteBuf buffer, T recipe) {
recipe.getIngredient().toNetwork(buffer);
buffer.writeId(BuiltInRegistries.ITEM, recipe.mesh);
buffer.writeId(BuiltInRegistries.ITEM, recipe.result);
@@ -112,7 +112,7 @@ public class SieveRecipe extends ProbabilityRecipe {
}
}
- public static class Serializer extends AbstractSerializer {
+ public static class Serializer extends AbstractSerializer {
@Override
protected SieveRecipe createSieveRecipe(ResourceLocation id, Ingredient ingredient, Item mesh, Item result, NumberProvider resultAmount, boolean byHandOnly) {
return new SieveRecipe(id, ingredient, mesh, result, resultAmount, byHandOnly);
diff --git a/src/main/java/thedarkcolour/exdeorum/registry/EBlockEntities.java b/src/main/java/thedarkcolour/exdeorum/registry/EBlockEntities.java
index 98755cbd..54d3fecb 100644
--- a/src/main/java/thedarkcolour/exdeorum/registry/EBlockEntities.java
+++ b/src/main/java/thedarkcolour/exdeorum/registry/EBlockEntities.java
@@ -34,6 +34,7 @@ public class EBlockEntities {
public static final RegistryObject> WATER_CRUCIBLE = BLOCK_ENTITIES.register("water_crucible", () -> DefaultMaterials.WATER_CRUCIBLES.createBlockEntityType(WaterCrucibleBlockEntity::new));
public static final RegistryObject> BARREL = BLOCK_ENTITIES.register("barrel", () -> DefaultMaterials.BARRELS.createBlockEntityType(BarrelBlockEntity::new));
public static final RegistryObject> SIEVE = BLOCK_ENTITIES.register("sieve", () -> DefaultMaterials.SIEVES.createBlockEntityType(SieveBlockEntity::new));
+ public static final RegistryObject> COMPRESSED_SIEVE = BLOCK_ENTITIES.register("compressed_sieve", () -> DefaultMaterials.COMPRESSED_SIEVES.createBlockEntityType(CompressedSieveBlockEntity::new));
public static final RegistryObject> MECHANICAL_SIEVE = BLOCK_ENTITIES.register("mechanical_sieve", () -> BlockEntityType.Builder.of(MechanicalSieveBlockEntity::new, EBlocks.MECHANICAL_SIEVE.get()).build(null));
public static final RegistryObject> MECHANICAL_HAMMER = BLOCK_ENTITIES.register("mechanical_hammer", () -> BlockEntityType.Builder.of(MechanicalHammerBlockEntity::new, EBlocks.MECHANICAL_HAMMER.get()).build(null));
}
diff --git a/src/main/java/thedarkcolour/exdeorum/registry/ERecipeSerializers.java b/src/main/java/thedarkcolour/exdeorum/registry/ERecipeSerializers.java
index 9352a5b3..3d32caae 100644
--- a/src/main/java/thedarkcolour/exdeorum/registry/ERecipeSerializers.java
+++ b/src/main/java/thedarkcolour/exdeorum/registry/ERecipeSerializers.java
@@ -32,6 +32,7 @@ import thedarkcolour.exdeorum.recipe.crook.CrookRecipe;
import thedarkcolour.exdeorum.recipe.crucible.CrucibleHeatRecipe;
import thedarkcolour.exdeorum.recipe.crucible.CrucibleRecipe;
import thedarkcolour.exdeorum.recipe.hammer.HammerRecipe;
+import thedarkcolour.exdeorum.recipe.sieve.CompressedSieveRecipe;
import thedarkcolour.exdeorum.recipe.sieve.SieveRecipe;
public class ERecipeSerializers {
@@ -50,6 +51,7 @@ public class ERecipeSerializers {
public static final RegistryObject> WATER_CRUCIBLE = RECIPE_SERIALIZERS.register("water_crucible", () -> new CrucibleRecipe.Serializer(ERecipeTypes.WATER_CRUCIBLE.get()));
public static final RegistryObject> SIEVE = RECIPE_SERIALIZERS.register("sieve", SieveRecipe.Serializer::new);
+ public static final RegistryObject> COMPRESSED_SIEVE = RECIPE_SERIALIZERS.register("compressed_sieve", CompressedSieveRecipe.Serializer::new);
public static final RegistryObject> TAG_RESULT = RECIPE_SERIALIZERS.register("tag_result", TagResultRecipe.Serializer::new);
}
diff --git a/src/main/java/thedarkcolour/exdeorum/registry/ERecipeTypes.java b/src/main/java/thedarkcolour/exdeorum/registry/ERecipeTypes.java
index 9c431ae8..8446e748 100644
--- a/src/main/java/thedarkcolour/exdeorum/registry/ERecipeTypes.java
+++ b/src/main/java/thedarkcolour/exdeorum/registry/ERecipeTypes.java
@@ -31,6 +31,7 @@ import thedarkcolour.exdeorum.recipe.crook.CrookRecipe;
import thedarkcolour.exdeorum.recipe.crucible.CrucibleHeatRecipe;
import thedarkcolour.exdeorum.recipe.crucible.CrucibleRecipe;
import thedarkcolour.exdeorum.recipe.hammer.HammerRecipe;
+import thedarkcolour.exdeorum.recipe.sieve.CompressedSieveRecipe;
import thedarkcolour.exdeorum.recipe.sieve.SieveRecipe;
public class ERecipeTypes {
@@ -49,4 +50,5 @@ public class ERecipeTypes {
public static final RegistryObject> CRUCIBLE_HEAT_SOURCE = RECIPE_TYPES.register("crucible_heat_source", () -> RecipeType.simple(ERecipeTypes.CRUCIBLE_HEAT_SOURCE.getId()));
public static final RegistryObject> SIEVE = RECIPE_TYPES.register("sieve", () -> RecipeType.simple(ERecipeTypes.SIEVE.getId()));
+ public static final RegistryObject> COMPRESSED_SIEVE = RECIPE_TYPES.register("compressed_sieve", () -> RecipeType.simple(ERecipeTypes.COMPRESSED_SIEVE.getId()));
}