diff --git a/src/autoclef/java/adris/altoclef/AltoClefCommands.java b/src/autoclef/java/adris/altoclef/AltoClefCommands.java index aa82b631..5f0ad5eb 100644 --- a/src/autoclef/java/adris/altoclef/AltoClefCommands.java +++ b/src/autoclef/java/adris/altoclef/AltoClefCommands.java @@ -2,6 +2,7 @@ import adris.altoclef.commands.AttackPlayerOrMobCommand; import adris.altoclef.commands.BodyLanguageCommand; +import adris.altoclef.commands.UseItemOnEntityCommand; import adris.altoclef.commands.DepositCommand; import adris.altoclef.commands.EquipCommand; import adris.altoclef.commands.FarmCommand; @@ -20,6 +21,7 @@ import adris.altoclef.commands.ResetMemoryCommand; import adris.altoclef.commands.SetAIBridgeEnabledCommand; import adris.altoclef.commands.StopCommand; +import adris.altoclef.commands.UseItemOnBlockCommand; import adris.altoclef.commands.random.ScanCommand; import adris.altoclef.commands.BuildStructureCommand; import adris.altoclef.commandsystem.CommandException; @@ -30,8 +32,9 @@ public static void init(AltoClefController controller) throws CommandException { .registerNewCommand( new GetCommand(), new EquipCommand(), - new BuildStructureCommand(), new BodyLanguageCommand(), + new BuildStructureCommand(), + new UseItemOnEntityCommand(), new DepositCommand(), new GotoCommand(), new IdleCommand(), @@ -45,10 +48,13 @@ public static void init(AltoClefController controller) throws CommandException { new GamerCommand(), new FollowCommand(), new GiveCommand(), - new ScanCommand(), + // new ScanCommand(), // remove scan cmd for now new AttackPlayerOrMobCommand(), new SetAIBridgeEnabledCommand(), new FarmCommand(), - new FishCommand()); + new FishCommand(), + new UseItemOnBlockCommand() + + ); } } diff --git a/src/autoclef/java/adris/altoclef/AltoClefController.java b/src/autoclef/java/adris/altoclef/AltoClefController.java index 6ca4a400..06d1f65b 100644 --- a/src/autoclef/java/adris/altoclef/AltoClefController.java +++ b/src/autoclef/java/adris/altoclef/AltoClefController.java @@ -42,6 +42,11 @@ import java.util.Optional; import java.util.UUID; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import com.mojang.authlib.GameProfile; + import net.fabricmc.fabric.api.event.lifecycle.v1.ServerTickEvents; import net.minecraft.server.MinecraftServer; import net.minecraft.server.level.ServerLevel; @@ -80,6 +85,8 @@ public class AltoClefController { private Task storedTask; public boolean isStopping = false; private Player owner; + public FakePlayerManager copiedServerPlayer; + private static final Logger LOGGER = LogManager.getLogger(); public AltoClefController(IBaritone baritone, Character character, String player2GameId) { this.baritone = baritone; @@ -132,6 +139,9 @@ public AltoClefController(IBaritone baritone, Character character, String player ConversationManager.getOrCreateEventQueueData(this); this.aiPersistantData = new AIPersistantData(this, character); this.player2apiService = new Player2APIService(this, player2GameId); + this.copiedServerPlayer = new FakePlayerManager(getWorld(), + this.getPlayer().getUUID(), + character.name()); } public void serverTick() { @@ -144,6 +154,7 @@ public void serverTick() { this.inputControls.onTickPost(); this.baritone.serverTick(); this.player2apiService.trySendHeartbeat(); + copiedServerPlayer.update(this); } static { @@ -397,4 +408,9 @@ public Optional getClosestPlayer() { return Float.compare(adist, bdist); }).findFirst(); } + + public void logSignificantError(String err) { + LOGGER.info("Logging significant err={}", err); + ConversationManager.getOrCreateEventQueueData(this).addAltoclefLogMessage(err); + } } diff --git a/src/autoclef/java/adris/altoclef/FakePlayerManager.java b/src/autoclef/java/adris/altoclef/FakePlayerManager.java new file mode 100644 index 00000000..04e50ac1 --- /dev/null +++ b/src/autoclef/java/adris/altoclef/FakePlayerManager.java @@ -0,0 +1,157 @@ +package adris.altoclef; + +import java.util.UUID; + +import com.mojang.authlib.GameProfile; + +import net.fabricmc.fabric.api.entity.FakePlayer; +import net.minecraft.server.level.ServerLevel; +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.world.entity.EquipmentSlot; +import net.minecraft.world.entity.LivingEntity; +import net.minecraft.world.entity.player.Player; + +public class FakePlayerManager { + FakePlayer playerCopy; + + public FakePlayerManager(ServerLevel world, UUID uuid, String name) { + this.playerCopy = FakePlayer.get(world, new GameProfile(uuid, name)); + // this.playerCopy = new ServerPlayer(world.getServer(), world, + // new GameProfile(UUID.fromString("TEMP"), name)); + } + + public void update(AltoClefController controller) { + LivingEntity original = controller.getPlayer(); + + // ((EntityIMixin) entity).setLevel(copied.level()); + // -> + playerCopy.setServerLevel(controller.getWorld().getLevel()); + + playerCopy.deathTime = original.deathTime; + playerCopy.walkDist = original.walkDist; + playerCopy.walkDistO = original.walkDist; + playerCopy.moveDist = original.moveDist; + + playerCopy.zza = original.zza; + playerCopy.xxa = original.xxa; + playerCopy.setOnGround(original.onGround()); + playerCopy.fallDistance = original.fallDistance; + + // entity.setJumping(((EntityLivingIMixin) copied).jumping()); + + // List> copiedData = ((ISynchedEntityData) + // copied.getEntityData()).getAll(); + // List> data = ((ISynchedEntityData) + // entity.getEntityData()).getAll(); + // for (SynchedEntityData.DataItem entry : copiedData) { + // if (data.stream().anyMatch(e -> e.getAccessor() == entry.getAccessor())) { + // if (entry.getValue() instanceof SynchedEntityData.DataValue) { + // entity.getEntityData().set((EntityDataAccessor) entry.getAccessor(), + // ((SynchedEntityData.DataValue) entry.getValue()).value()); + // } + // } + // } + + playerCopy.xo = original.xo; + playerCopy.yo = original.yo; + playerCopy.zo = original.zo; + + playerCopy.setPos(original.getX(), original.getY(), original.getZ()); + // entity.setEntityBoundingBox(copied.getEntityBoundingBox()); + + playerCopy.xOld = original.xOld; + playerCopy.yOld = original.yOld; + playerCopy.zOld = original.zOld; + + playerCopy.setDeltaMovement(original.getDeltaMovement()); + + playerCopy.setXRot(original.getXRot()); + playerCopy.setYRot(original.getYRot()); + playerCopy.xRotO = original.xRotO; + playerCopy.yRotO = original.yRotO; + playerCopy.yHeadRot = original.yHeadRot; + playerCopy.yHeadRotO = original.yHeadRotO; + playerCopy.yBodyRot = original.yBodyRot; + playerCopy.yBodyRotO = original.yBodyRotO; + + // ((EntityLivingIMixin) + // entity).useItemRemaining(copied.getUseItemRemainingTicks()); + + // ((WalkAnimationStateMixin) + // entity.walkAnimation).setPosition(copied.walkAnimation.position()); + // ((EntityLivingIMixin) entity).animStep(((EntityLivingIMixin) + // copied).animStep()); + // ((EntityLivingIMixin) entity).animStepO(((EntityLivingIMixin) + // copied).animStepO()); + // ((EntityLivingIMixin) entity).swimAmount(((EntityLivingIMixin) + // copied).swimAmount()); + // ((EntityLivingIMixin) entity).swimAmountO(((EntityLivingIMixin) + // copied).swimAmountO()); + playerCopy.swinging = original.swinging; + playerCopy.swingTime = original.swingTime; + + playerCopy.walkAnimation.setSpeed(original.walkAnimation.speed()); + + // ((WalkAnimationStateMixin) entity.walkAnimation) + // .setSpeedOld(((WalkAnimationStateMixin) copied.walkAnimation).getSpeedOld()); + playerCopy.attackAnim = original.attackAnim; + playerCopy.oAttackAnim = original.oAttackAnim; + + playerCopy.tickCount = original.tickCount; + + playerCopy.setHealth(Math.min(original.getHealth(), playerCopy.getMaxHealth())); + playerCopy.hurtTime = original.hurtTime; + playerCopy.deathTime = original.deathTime; + + // entity.getPersistentData().merge(copied.getPersistentData()); + + // if(entity.getVehicle() != copied.getVehicle()) + // entity.vehicle = copied.vehicle; + + if (playerCopy instanceof Player && original instanceof Player) { + Player ePlayer = (Player) playerCopy; + Player cPlayer = (Player) original; + + ePlayer.bob = cPlayer.bob; + ePlayer.oBob = cPlayer.oBob; + + ePlayer.xCloakO = cPlayer.xCloakO; + ePlayer.yCloakO = cPlayer.yCloakO; + ePlayer.zCloakO = cPlayer.zCloakO; + ePlayer.xCloak = cPlayer.xCloak; + ePlayer.yCloak = cPlayer.yCloak; + ePlayer.zCloak = cPlayer.zCloak; + } + for (EquipmentSlot slot : EquipmentSlot.values()) { + playerCopy.setItemSlot(slot, original.getItemBySlot(slot)); + } + + // if (entity instanceof EnderDragon) { + // entity.setXRot(entity.getXRot() + 180); + // } + + // ((EntityIMixin) entity).removal(((EntityIMixin) copied).removal()); + playerCopy.deathTime = original.deathTime; + + playerCopy.tickCount = original.tickCount; + + // if (entity instanceof EnderDragon) { + // entity.setYRot(entity.getYRot() + 180); + // } + // if (entity instanceof Chicken) { + // ((Chicken) entity).flap = copied.onGround() ? 0 : 1; + // } + + } + + public FakePlayer getPlayerCopy() { + return playerCopy; + } + + public void updateOriginalItem(AltoClefController mod) { + for (EquipmentSlot slot : EquipmentSlot.values()) { + mod.getPlayer().setItemSlot(slot, playerCopy.getItemBySlot(slot)); + } + } + +} diff --git a/src/autoclef/java/adris/altoclef/commands/UseItemOnBlockCommand.java b/src/autoclef/java/adris/altoclef/commands/UseItemOnBlockCommand.java new file mode 100644 index 00000000..b1e0cbbf --- /dev/null +++ b/src/autoclef/java/adris/altoclef/commands/UseItemOnBlockCommand.java @@ -0,0 +1,54 @@ +package adris.altoclef.commands; + +import java.lang.reflect.Field; +import java.util.ArrayList; +import java.util.List; + +import adris.altoclef.AltoClefController; +import adris.altoclef.commandsystem.Arg; +import adris.altoclef.commandsystem.ArgParser; +import adris.altoclef.commandsystem.Command; +import adris.altoclef.commandsystem.CommandException; +import adris.altoclef.tasks.misc.UseItemOnBlockTask; +import adris.altoclef.util.helpers.FuzzySearchHelper; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.Blocks; +import net.minecraft.core.registries.BuiltInRegistries; +import net.minecraft.resources.ResourceLocation; + +public class UseItemOnBlockCommand extends Command { + public UseItemOnBlockCommand() throws CommandException { + super("useItemOnBlock", + "Uses an item on a block. Use 'hand' as item if you want empty use (activating lever, etc.). Examples: `useItemOnBlock flintandsteel tnt`, `useItemOnBlock wooden_axe oak_log` `useITemOnEntity hand lever` ", + new Arg<>(String.class, "itemName"), + new Arg<>(String.class, "blockName")); + } + + @Override + protected void call(AltoClefController mod, ArgParser parser) throws CommandException { + String itemName = parser.get(String.class); + String blockName = parser.get(String.class); + List allBlockNames = new ArrayList<>(); + Block block = null; + for (Block b : BuiltInRegistries.BLOCK) { + ResourceLocation id = BuiltInRegistries.BLOCK.getKey(b); // minecraft:stone, ... + allBlockNames.add(id.toString()); + if (id.toString().contains(blockName)) { + block = b; + } + } + if (block == null) { + String closest = FuzzySearchHelper.getClosestMatchMinecraftItems(blockName, allBlockNames); + String errmsg = ("Block named: \"" + blockName + "\" not a valid block. Perhaps the user meant \"" + closest + + "\"?" + + (blockName.contains("log") ? " Can try 'log' as well" : "")); + mod.logSignificantError(errmsg); + this.finish(); + } else { + mod.runUserTask(new UseItemOnBlockTask(itemName, block), () -> { + this.finish(); + }); + } + } + +} \ No newline at end of file diff --git a/src/autoclef/java/adris/altoclef/commands/UseItemOnEntityCommand.java b/src/autoclef/java/adris/altoclef/commands/UseItemOnEntityCommand.java new file mode 100644 index 00000000..a9ec60c2 --- /dev/null +++ b/src/autoclef/java/adris/altoclef/commands/UseItemOnEntityCommand.java @@ -0,0 +1,27 @@ +package adris.altoclef.commands; + +import adris.altoclef.AltoClefController; +import adris.altoclef.commandsystem.Arg; +import adris.altoclef.commandsystem.ArgParser; +import adris.altoclef.commandsystem.Command; +import adris.altoclef.commandsystem.CommandException; +import adris.altoclef.tasks.entity.UseItemOnEntityTask; + +public class UseItemOnEntityCommand extends Command { + public UseItemOnEntityCommand() throws CommandException { + super("useItemOnEntity", + "Uses an item on an entity. Use 'hand' as item if you want empty use (get in vehicle, etc.). Examples: `useItemOnEntity shears sheep`, `useItemOnEntity saddle pig` `useITemOnEntity hand minecart` ", + new Arg<>(String.class, "itemName"), + new Arg<>(String.class, "entityName")); + } + + @Override + protected void call(AltoClefController mod, ArgParser parser) throws CommandException { + String itemName = parser.get(String.class); + String entityName = parser.get(String.class); + mod.runUserTask(new UseItemOnEntityTask(itemName, entityName), () -> { + this.finish(); + }); + } + +} \ No newline at end of file diff --git a/src/autoclef/java/adris/altoclef/tasks/UseItemOnPositionTask.java b/src/autoclef/java/adris/altoclef/tasks/UseItemOnPositionTask.java new file mode 100644 index 00000000..ddf7433c --- /dev/null +++ b/src/autoclef/java/adris/altoclef/tasks/UseItemOnPositionTask.java @@ -0,0 +1,123 @@ +package adris.altoclef.tasks; + +import java.util.Optional; +import java.util.function.Supplier; + +import javax.annotation.Nullable; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import adris.altoclef.AltoClefController; +import adris.altoclef.tasks.movement.GetToBlockTask; +import adris.altoclef.tasksystem.Task; +import adris.altoclef.util.helpers.ItemHelper; +import adris.altoclef.util.helpers.LookHelper; +import adris.altoclef.util.progresscheck.MovementProgressChecker; +import adris.altoclef.util.time.TimerGame; +import baritone.api.utils.input.Input; +import net.minecraft.core.BlockPos; +import net.minecraft.world.item.Item; + +// Assumes you have the item in your inv already, and the entity is close +public class UseItemOnPositionTask extends Task { + public static final Logger LOGGER = LogManager.getLogger(); + private final TimerGame lookAtGame = new TimerGame(3.0); + private boolean hasStartedLook = false; + + String itemName; + BlockPos position; + protected final MovementProgressChecker progress = new MovementProgressChecker(); + Item item; + Optional specialCase = Optional.empty(); + boolean hasInteracted = false; + Supplier extraInteractEffect; + + public UseItemOnPositionTask(String itemName, BlockPos position, @Nullable Supplier interact) { + this.itemName = itemName; + this.position = position; + this.extraInteractEffect = interact; + if (itemName.equals("hand")) { + return; + } + // will err if itemName not found + item = ItemHelper.fromString(itemName).get(); + } + + private void equipItem() { + AltoClefController mod = this.controller; + if (itemName.equals("hand")) { + mod.getSlotHandler().forceDeequip(stack -> !stack.isEmpty()); + return; + } + mod.getSlotHandler().forceEquipItem(item); + } + + @Override + protected boolean isEqual(Task var1) { + // TODO Auto-generated method stub + if (!(var1 instanceof UseItemOnPositionTask)) { + return false; + } + UseItemOnPositionTask rhs = (UseItemOnPositionTask) var1; + return rhs.itemName.equals(this.itemName) && rhs.position.equals(this.position); + } + + @Override + protected void onStart() { + this.progress.reset(); + hasInteracted = false; + } + + @Override + protected Task onTick() { + if (hasInteracted) { + return null; + } + + AltoClefController mod = this.controller; + + if (mod.getPlayer().distanceToSqr(position.getCenter()) > 1) { + LOGGER.info("going to pos"); + return new GetToBlockTask(position, false); + } + if (!hasStartedLook) { + LOGGER.info("Starting to look"); + lookAtGame.reset(); + hasStartedLook = true; + } + LookHelper.lookAt(mod, position); + if (!hasStartedLook || !lookAtGame.elapsed()) { + return null; + } + LOGGER.info("Done looking, equiping and interacting"); + equipItem(); + if (itemName.equals("hand")) { + mod.getInputControls().hold(Input.CLICK_RIGHT); + } + if (extraInteractEffect != null) { + Task output = extraInteractEffect.get(); + mod.copiedServerPlayer.updateOriginalItem(mod); // update item from copy => mod + hasInteracted = true; + return output; + } + return null; + } + + @Override + protected void onStop(Task interruptTask) { + AltoClefController mod = this.controller; + mod.getInputControls().release(Input.CLICK_RIGHT); + } + + @Override + protected String toDebugString() { + return String.format("UseItemOnPosition(%s on %s)", itemName, position.toString()); + } + + @Override + public boolean isFinished() { + // TODO Auto-generated method stub + return hasInteracted; + } +} \ No newline at end of file diff --git a/src/autoclef/java/adris/altoclef/tasks/entity/UseItemOnEntityTask.java b/src/autoclef/java/adris/altoclef/tasks/entity/UseItemOnEntityTask.java new file mode 100644 index 00000000..cd3b5e34 --- /dev/null +++ b/src/autoclef/java/adris/altoclef/tasks/entity/UseItemOnEntityTask.java @@ -0,0 +1,138 @@ +package adris.altoclef.tasks.entity; + +import java.util.Optional; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import adris.altoclef.AltoClefController; +import adris.altoclef.tasks.AbstractDoToClosestObjectTask; +import adris.altoclef.tasks.movement.GetToBlockTask; +import adris.altoclef.tasks.resources.CollectMilkTask; +import adris.altoclef.tasksystem.Task; +import adris.altoclef.util.helpers.EntityHelper; +import adris.altoclef.util.helpers.ItemHelper; +import adris.altoclef.util.helpers.LookHelper; +import adris.altoclef.util.progresscheck.MovementProgressChecker; +import baritone.api.pathing.goals.GoalBlock; +import baritone.api.pathing.goals.GoalRunAway; +import baritone.api.utils.input.Input; +import net.minecraft.world.InteractionHand; +import net.minecraft.world.entity.Entity; +import net.minecraft.world.entity.ai.goal.Goal; +import net.minecraft.world.item.Item; +import net.minecraft.world.phys.EntityHitResult; +import net.minecraft.world.phys.Vec3; + +// Assumes you have the item in your inv already, and the entity is close +public class UseItemOnEntityTask extends Task { + public static final Logger LOGGER = LogManager.getLogger(); + + String itemName; + String entityName; + protected final MovementProgressChecker progress = new MovementProgressChecker(); + Item item; + Optional specialCase = Optional.empty(); + boolean hasInteracted = false; + + public UseItemOnEntityTask(String itemName, String entityName) { + this.itemName = itemName; + this.entityName = entityName; + if (itemName.equals("hand")) { + return; + } + // will err if itemName not found + item = ItemHelper.fromString(itemName).get(); + + // if (itemName.equals("shear") && entityName.equals("sheep")) { + // specialCase = Optional.of(new ShearSheepTask()); + // } else if (itemName.equals("bucket") && entityName.equals("cow")) { + // specialCase = Optional.of(new CollectMilkTask(1)); + // } + + } + + private void equipItem() { + AltoClefController mod = this.controller; + if (itemName.equals("hand")) { + mod.getSlotHandler().forceDeequip(stack -> !stack.isEmpty()); + return; + } + mod.getSlotHandler().forceEquipItem(item); + } + + @Override + protected boolean isEqual(Task var1) { + // TODO Auto-generated method stub + if (!(var1 instanceof UseItemOnEntityTask)) { + return false; + } + UseItemOnEntityTask rhs = (UseItemOnEntityTask) var1; + return rhs.itemName.equals(this.itemName) && rhs.entityName.equals(this.entityName); + } + + @Override + protected void onStart() { + this.progress.reset(); + } + + protected Optional getClosestToEntity(AltoClefController mod, Vec3 pos) { + return EntityHelper.stringToEntityClass(entityName) + .flatMap((entClass) -> mod.getEntityTracker().getClosestEntity(pos, entClass)); + } + + @Override + protected Task onTick() { + if (hasInteracted) { + return null; + } + + AltoClefController mod = this.controller; + Optional closeEntity = this.getClosestToEntity(mod, mod.getPlayer().position()); + + if (closeEntity.isEmpty()) { + mod.getMobDefenseChain().resetTargetEntity(); + mod.getMobDefenseChain().resetForceField(); + return null; + } else { + mod.getMobDefenseChain().setTargetEntity(closeEntity.get()); + } + + // will throw error if there is no entity closeby + Entity entity = closeEntity.get(); + + if (!entity.closerThan(mod.getPlayer(), 1)) { + return new GetToBlockTask(entity.blockPosition(), false); + } + LookHelper.lookAt(mod, entity.blockPosition()); + equipItem(); + if (itemName.equals("hand")) { + mod.getInputControls().hold(Input.CLICK_RIGHT); + } + mod.copiedServerPlayer.getPlayerCopy().interactOn(entity, InteractionHand.MAIN_HAND); + + mod.copiedServerPlayer.updateOriginalItem(mod); // update item from copy => mod + hasInteracted = true; + + return null; + } + + @Override + protected void onStop(Task interruptTask) { + AltoClefController mod = this.controller; + mod.getMobDefenseChain().setTargetEntity(null); + mod.getMobDefenseChain().resetForceField(); + mod.getInputControls().release(Input.CLICK_RIGHT); + } + + @Override + protected String toDebugString() { + return String.format("UseItemOnEntity(%s on %s)", itemName, entityName); + } + + @Override + public boolean isFinished() { + // TODO Auto-generated method stub + return hasInteracted; + } +} \ No newline at end of file diff --git a/src/autoclef/java/adris/altoclef/tasks/misc/UseItemOnBlockTask.java b/src/autoclef/java/adris/altoclef/tasks/misc/UseItemOnBlockTask.java new file mode 100644 index 00000000..44ce74fe --- /dev/null +++ b/src/autoclef/java/adris/altoclef/tasks/misc/UseItemOnBlockTask.java @@ -0,0 +1,87 @@ +package adris.altoclef.tasks.misc; + +import java.util.Optional; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import adris.altoclef.AltoClefController; +import adris.altoclef.tasks.UseItemOnPositionTask; +import adris.altoclef.tasksystem.Task; +import net.minecraft.core.BlockPos; +import net.minecraft.world.InteractionHand; +import net.minecraft.world.level.block.Block; + +public class UseItemOnBlockTask extends Task { + String itemName; + boolean isFinished = false; + Block block; + private static final Logger LOGGER = LogManager.getLogger(); + + public UseItemOnBlockTask(String itemName, Block block) { + this.itemName = itemName; + this.block = block; + } + + @Override + protected boolean isEqual(Task var1) { + // TODO Auto-generated method stub + return false; + } + + @Override + protected void onStart() { + isFinished = false; + } + + @Override + protected void onStop(Task var1) { + // TODO Auto-generated method stub + + } + + @Override + protected Task onTick() { + AltoClefController mod = this.controller; + Optional ma = mod.getBlockScanner().getNearestBlock(block); + if (ma.isEmpty()) { + LOGGER.warn("No block %s found nearby", block.getName().toString()); + this.fail(String.format("No block (%s) found nearby", + block.getName().toString())); + // isFinished = true; + return null; + } + BlockPos pos = ma.get(); + UseItemOnPositionTask task = new UseItemOnPositionTask(itemName, pos, () -> { + // what to do when close enough: + LOGGER.info("Running close enough inside"); + mod.copiedServerPlayer.getPlayerCopy().interact(mod.copiedServerPlayer.getPlayerCopy(), + InteractionHand.MAIN_HAND); + mod.copiedServerPlayer.getPlayerCopy().interactAt(mod.copiedServerPlayer.getPlayerCopy(), + pos.getCenter(), + InteractionHand.MAIN_HAND); + // mod.copiedServerPlayer.getPlayerCopy().getItemInHand(InteractionHand.MAIN_HAND) + // mod.getInteractionManager().processRightClick(mod.getPlayer(), + // mod.getWorld(), InteractionHand.OFF_HAND); + isFinished = true; + return null; + }); + if (task.isFinished()) { + isFinished = true; + return null; + } + + return task; + } + + @Override + protected String toDebugString() { + return String.format("Use %s on block %s", itemName, block.getName().getString()); + } + + @Override + public boolean isFinished() { + return isFinished; + } + +} diff --git a/src/autoclef/java/adris/altoclef/trackers/EntityTracker.java b/src/autoclef/java/adris/altoclef/trackers/EntityTracker.java index c59b5aae..d74680b3 100644 --- a/src/autoclef/java/adris/altoclef/trackers/EntityTracker.java +++ b/src/autoclef/java/adris/altoclef/trackers/EntityTracker.java @@ -46,7 +46,8 @@ public class EntityTracker extends Tracker { public EntityTracker(TrackerManager manager) { super(manager); - EventBus.subscribe(PlayerCollidedWithEntityEvent.class, evt -> this.registerPlayerCollision(evt.player, evt.other)); + EventBus.subscribe(PlayerCollidedWithEntityEvent.class, + evt -> this.registerPlayerCollision(evt.player, evt.other)); } private static Class squashType(Class type) { @@ -62,7 +63,8 @@ private void registerPlayerCollision(LivingEntity player, Entity entity) { } public boolean isCollidingWithPlayer(LivingEntity player, Entity entity) { - return this.entitiesCollidingWithPlayer.containsKey(player) && this.entitiesCollidingWithPlayer.get(player).contains(entity); + return this.entitiesCollidingWithPlayer.containsKey(player) + && this.entitiesCollidingWithPlayer.get(player).contains(entity); } public boolean isCollidingWithPlayer(Entity entity) { @@ -96,7 +98,8 @@ public Optional getClosestItemDrop(Vec3 position, Predicate getClosestItemDrop(Vec3 position, Predicate acceptPredicate, ItemTarget... targets) { + public Optional getClosestItemDrop(Vec3 position, Predicate acceptPredicate, + ItemTarget... targets) { this.ensureUpdated(); if (targets.length == 0) { Debug.logError("You asked for the drop position of zero items... Most likely a typo."); @@ -111,8 +114,9 @@ public Optional getClosestItemDrop(Vec3 position, Predicate List getTrackedEntities(Class type) { return Collections.emptyList(); } else { synchronized (BaritoneHelper.MINECRAFT_LOCK) { - return (List)this.entityMap.get(type); + return (List) this.entityMap.get(type); } } } @@ -306,7 +310,8 @@ protected synchronized void updateState() { if (this.mod.getWorld() != null) { this.entitiesCollidingWithPlayer.clear(); - for (Entry> collisions : this.entitiesCollidingWithPlayerAccumulator.entrySet()) { + for (Entry> collisions : this.entitiesCollidingWithPlayerAccumulator + .entrySet()) { this.entitiesCollidingWithPlayer.put(collisions.getKey(), new HashSet<>()); this.entitiesCollidingWithPlayer.get(collisions.getKey()).addAll(collisions.getValue()); } @@ -316,7 +321,8 @@ protected synchronized void updateState() { for (Entity entity : this.mod.getWorld().getAllEntities()) { Class type = entity.getClass(); type = squashType(type); - if (entity != null && entity.isAlive() && (type != LivingEntity.class || !entity.equals(this.mod.getPlayer()))) { + if (entity != null && entity.isAlive() + && (type != LivingEntity.class || !entity.equals(this.mod.getPlayer()))) { if (!this.entityMap.containsKey(type)) { this.entityMap.put(type, new ArrayList<>()); } @@ -329,9 +335,9 @@ protected synchronized void updateState() { if (entity instanceof ItemEntity ientity) { Item droppedItem = ientity.getItem().getItem(); if (ientity.onGround() - || ientity.isInWater() - || WorldHelper.isSolidBlock(this.mod, ientity.blockPosition().below(2)) - || WorldHelper.isSolidBlock(this.mod, ientity.blockPosition().below(3))) { + || ientity.isInWater() + || WorldHelper.isSolidBlock(this.mod, ientity.blockPosition().below(2)) + || WorldHelper.isSolidBlock(this.mod, ientity.blockPosition().below(3))) { if (!this.itemDropLocations.containsKey(droppedItem)) { this.itemDropLocations.put(droppedItem, new ArrayList<>()); } @@ -344,7 +350,7 @@ protected synchronized void updateState() { if (EntityHelper.isAngryAtPlayer(this.mod, entity)) { boolean closeEnough = entity.closerThan(this.mod.getPlayer(), 26.0); if (closeEnough) { - this.hostiles.add((LivingEntity)entity); + this.hostiles.add((LivingEntity) entity); } } } else if (entity instanceof Projectile projEntity) { @@ -352,13 +358,13 @@ protected synchronized void updateState() { CachedProjectile proj = new CachedProjectile(); boolean inGround = false; if (entity instanceof AbstractArrow) { - inGround = ((PersistentProjectileEntityAccessor)entity).isInGround(); + inGround = ((PersistentProjectileEntityAccessor) entity).isInGround(); } if (!(projEntity instanceof FishingHook) - && !(projEntity instanceof ThrownEnderpearl) - && !(projEntity instanceof ThrownExperienceBottle) - && !inGround) { + && !(projEntity instanceof ThrownEnderpearl) + && !(projEntity instanceof ThrownExperienceBottle) + && !inGround) { proj.position = projEntity.position(); proj.velocity = projEntity.getDeltaMovement(); proj.gravity = ProjectileHelper.hasGravity(projEntity) ? 0.05F : 0.0; diff --git a/src/autoclef/java/adris/altoclef/util/helpers/EntityHelper.java b/src/autoclef/java/adris/altoclef/util/helpers/EntityHelper.java index c500cb15..84fcca37 100644 --- a/src/autoclef/java/adris/altoclef/util/helpers/EntityHelper.java +++ b/src/autoclef/java/adris/altoclef/util/helpers/EntityHelper.java @@ -1,5 +1,14 @@ package adris.altoclef.util.helpers; +import java.util.Collections; +import java.util.HashMap; +import java.util.Locale; +import java.util.Map; +import java.util.Optional; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + import adris.altoclef.AltoClefController; import adris.altoclef.multiversion.DamageSourceWrapper; import adris.altoclef.multiversion.MethodWrapper; @@ -10,10 +19,72 @@ import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.Mob; import net.minecraft.world.entity.ai.attributes.Attributes; + +import net.minecraft.world.entity.animal.Bee; +import net.minecraft.world.entity.animal.Cat; +import net.minecraft.world.entity.animal.Chicken; +import net.minecraft.world.entity.animal.Cod; +import net.minecraft.world.entity.animal.Cow; +import net.minecraft.world.entity.animal.Dolphin; +import net.minecraft.world.entity.animal.Fox; +import net.minecraft.world.entity.animal.IronGolem; +import net.minecraft.world.entity.animal.MushroomCow; +import net.minecraft.world.entity.animal.Ocelot; +import net.minecraft.world.entity.animal.Panda; +import net.minecraft.world.entity.animal.Parrot; +import net.minecraft.world.entity.animal.Pig; +import net.minecraft.world.entity.animal.PolarBear; +import net.minecraft.world.entity.animal.Pufferfish; +import net.minecraft.world.entity.animal.Rabbit; +import net.minecraft.world.entity.animal.Salmon; +import net.minecraft.world.entity.animal.Sheep; +import net.minecraft.world.entity.animal.SnowGolem; +import net.minecraft.world.entity.animal.Squid; +import net.minecraft.world.entity.animal.TropicalFish; +import net.minecraft.world.entity.animal.Turtle; +import net.minecraft.world.entity.animal.Wolf; + +import net.minecraft.world.entity.animal.horse.Donkey; +import net.minecraft.world.entity.animal.horse.Horse; +import net.minecraft.world.entity.animal.horse.Llama; +import net.minecraft.world.entity.animal.horse.Mule; + +import net.minecraft.world.entity.vehicle.Boat; +import net.minecraft.world.entity.vehicle.Minecart; + +import net.minecraft.world.entity.monster.Blaze; +import net.minecraft.world.entity.monster.CaveSpider; +import net.minecraft.world.entity.monster.Creeper; +import net.minecraft.world.entity.monster.ElderGuardian; import net.minecraft.world.entity.monster.EnderMan; +import net.minecraft.world.entity.monster.Endermite; +import net.minecraft.world.entity.monster.Evoker; +import net.minecraft.world.entity.monster.Ghast; +import net.minecraft.world.entity.monster.Giant; +import net.minecraft.world.entity.monster.Guardian; +import net.minecraft.world.entity.monster.Husk; +import net.minecraft.world.entity.monster.Illusioner; +import net.minecraft.world.entity.monster.MagmaCube; import net.minecraft.world.entity.monster.Monster; +import net.minecraft.world.entity.monster.Phantom; +import net.minecraft.world.entity.monster.Ravager; +import net.minecraft.world.entity.monster.Shulker; +import net.minecraft.world.entity.monster.Silverfish; +import net.minecraft.world.entity.monster.Skeleton; import net.minecraft.world.entity.monster.Slime; +import net.minecraft.world.entity.monster.SpellcasterIllager; +import net.minecraft.world.entity.monster.Spider; +import net.minecraft.world.entity.monster.Stray; +import net.minecraft.world.entity.monster.Strider; +import net.minecraft.world.entity.monster.Vex; +import net.minecraft.world.entity.monster.Vindicator; +import net.minecraft.world.entity.monster.Witch; +import net.minecraft.world.entity.monster.WitherSkeleton; +import net.minecraft.world.entity.monster.Zoglin; +import net.minecraft.world.entity.monster.Zombie; +import net.minecraft.world.entity.monster.ZombieVillager; import net.minecraft.world.entity.monster.ZombifiedPiglin; + import net.minecraft.world.entity.monster.piglin.Piglin; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; @@ -21,6 +92,92 @@ public class EntityHelper { public static final double ENTITY_GRAVITY = 0.08; + private static final Map> ENTITY_MAP; + public static final Logger LOGGER = LogManager.getLogger(); + + private static String normalize(String s) { + // iron-golem, ironGolem, IRONGOLEM, ... + return s == null ? "" : s.toLowerCase(Locale.ROOT).replaceAll("[^a-z0-9]", ""); + } + + private static void put(Map> m, String key, Class cls) { + m.put(normalize(key), cls); + } + + static { + Map> m = new HashMap<>(); + + // ---- Animals ---- + put(m, "bee", Bee.class); + put(m, "cat", Cat.class); + put(m, "chicken", Chicken.class); + put(m, "cod", Cod.class); + put(m, "cow", Cow.class); + put(m, "dolphin", Dolphin.class); + put(m, "fox", Fox.class); + put(m, "iron_golem", IronGolem.class); + put(m, "mushroom_cow", MushroomCow.class); + put(m, "ocelot", Ocelot.class); + put(m, "panda", Panda.class); + put(m, "parrot", Parrot.class); + put(m, "pig", Pig.class); + put(m, "polar_bear", PolarBear.class); + put(m, "pufferfish", Pufferfish.class); + put(m, "rabbit", Rabbit.class); + put(m, "salmon", Salmon.class); + put(m, "sheep", Sheep.class); + put(m, "snow_golem", SnowGolem.class); + put(m, "squid", Squid.class); + put(m, "tropical_fish", TropicalFish.class); + put(m, "turtle", Turtle.class); + put(m, "wolf", Wolf.class); + + // ---- Horses ---- + put(m, "donkey", Donkey.class); + put(m, "horse", Horse.class); + put(m, "llama", Llama.class); + put(m, "mule", Mule.class); + + // ---- Vehicles ---- + put(m, "boat", Boat.class); + put(m, "minecart", Minecart.class); + + // ---- Hostiles ---- + put(m, "blaze", Blaze.class); + put(m, "cave_spider", CaveSpider.class); + put(m, "creeper", Creeper.class); + put(m, "elder_guardian", ElderGuardian.class); + put(m, "enderman", EnderMan.class); + put(m, "endermite", Endermite.class); + put(m, "evoker", Evoker.class); + put(m, "ghast", Ghast.class); + put(m, "giant", Giant.class); + put(m, "guardian", Guardian.class); + put(m, "husk", Husk.class); + put(m, "illusioner", Illusioner.class); + put(m, "magma_cube", MagmaCube.class); + put(m, "monster", Monster.class); + put(m, "phantom", Phantom.class); + put(m, "ravager", Ravager.class); + put(m, "shulker", Shulker.class); + put(m, "silverfish", Silverfish.class); + put(m, "skeleton", Skeleton.class); + put(m, "slime", Slime.class); + put(m, "spellcaster_illager", SpellcasterIllager.class); + put(m, "spider", Spider.class); + put(m, "stray", Stray.class); + put(m, "strider", Strider.class); + put(m, "vex", Vex.class); + put(m, "vindicator", Vindicator.class); + put(m, "witch", Witch.class); + put(m, "wither_skeleton", WitherSkeleton.class); + put(m, "zoglin", Zoglin.class); + put(m, "zombie", Zombie.class); + put(m, "zombie_villager", ZombieVillager.class); + put(m, "zombified_piglin", ZombifiedPiglin.class); + + ENTITY_MAP = Collections.unmodifiableMap(m); + } public static boolean isAngryAtPlayer(AltoClefController mod, Entity mob) { boolean hostile = isProbablyHostileToPlayer(mod, mob); @@ -36,7 +193,8 @@ public static boolean isProbablyHostileToPlayer(AltoClefController mod, Entity e } else if (mob instanceof EnderMan enderman) { return enderman.isCreepy(); } else { - return mob instanceof ZombifiedPiglin zombifiedPiglin ? zombifiedPiglin.isAggressive() : mob.isAggressive() || mob instanceof Monster; + return mob instanceof ZombifiedPiglin zombifiedPiglin ? zombifiedPiglin.isAggressive() + : mob.isAggressive() || mob instanceof Monster; } } else { return false; @@ -62,8 +220,8 @@ public static double calculateResultingPlayerDamage(LivingEntity player, DamageS } else { if (!source.bypassesArmor()) { damageAmount = MethodWrapper.getDamageLeft( - player, damageAmount, src, (double)player.getArmorValue(), player.getAttributeValue(Attributes.ARMOR_TOUGHNESS) - ); + player, damageAmount, src, (double) player.getArmorValue(), + player.getAttributeValue(Attributes.ARMOR_TOUGHNESS)); } if (!source.bypassesShield()) { @@ -79,7 +237,7 @@ public static double calculateResultingPlayerDamage(LivingEntity player, DamageS } else { float k = EnchantmentHelper.getDamageProtection(player.getArmorSlots(), src); if (k > 0.0F) { - damageAmount = CombatRules.getDamageAfterMagicAbsorb((float)damageAmount, k); + damageAmount = CombatRules.getDamageAfterMagicAbsorb((float) damageAmount, k); } } } @@ -87,4 +245,20 @@ public static double calculateResultingPlayerDamage(LivingEntity player, DamageS return Math.max(damageAmount - player.getAbsorptionAmount(), 0.0); } } + + public static Optional> stringToEntityClass(String inputName) { + if (inputName == null) + return Optional.empty(); + // look up by normalized input + Class cls = ENTITY_MAP.get(normalize(inputName)); + // fallback: if the user passed a FQCN like "net.minecraft....Sheep" + if (cls == null) { + int dot = inputName.lastIndexOf('.'); + String simple = (dot >= 0) ? inputName.substring(dot + 1) : inputName; + if (simple.endsWith(".class")) + simple = simple.substring(0, simple.length() - 6); + cls = ENTITY_MAP.get(normalize(simple)); + } + return Optional.ofNullable(cls); + } } diff --git a/src/autoclef/java/adris/altoclef/util/helpers/ItemHelper.java b/src/autoclef/java/adris/altoclef/util/helpers/ItemHelper.java index 267c76a8..f2e3b4d5 100644 --- a/src/autoclef/java/adris/altoclef/util/helpers/ItemHelper.java +++ b/src/autoclef/java/adris/altoclef/util/helpers/ItemHelper.java @@ -9,6 +9,9 @@ import java.util.HashMap; import java.util.Map; import java.util.Optional; + +import net.minecraft.core.registries.BuiltInRegistries; +import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.BlockItem; import net.minecraft.world.item.DyeColor; import net.minecraft.world.item.Item; @@ -21,445 +24,455 @@ import net.minecraft.world.level.material.MapColor; public class ItemHelper { - public static final Item[] SAPLINGS = new Item[]{ - Items.OAK_SAPLING, - Items.SPRUCE_SAPLING, - Items.BIRCH_SAPLING, - Items.JUNGLE_SAPLING, - Items.ACACIA_SAPLING, - Items.DARK_OAK_SAPLING, - Items.MANGROVE_PROPAGULE, - Items.CHERRY_SAPLING + public static final Item[] SAPLINGS = new Item[] { + Items.OAK_SAPLING, + Items.SPRUCE_SAPLING, + Items.BIRCH_SAPLING, + Items.JUNGLE_SAPLING, + Items.ACACIA_SAPLING, + Items.DARK_OAK_SAPLING, + Items.MANGROVE_PROPAGULE, + Items.CHERRY_SAPLING }; - public static final Block[] SAPLING_SOURCES = new Block[]{ - Blocks.OAK_LEAVES, - Blocks.SPRUCE_LEAVES, - Blocks.BIRCH_LEAVES, - Blocks.JUNGLE_LEAVES, - Blocks.ACACIA_LEAVES, - Blocks.DARK_OAK_LEAVES, - Blocks.MANGROVE_PROPAGULE, - Blocks.CHERRY_LEAVES + public static final Block[] SAPLING_SOURCES = new Block[] { + Blocks.OAK_LEAVES, + Blocks.SPRUCE_LEAVES, + Blocks.BIRCH_LEAVES, + Blocks.JUNGLE_LEAVES, + Blocks.ACACIA_LEAVES, + Blocks.DARK_OAK_LEAVES, + Blocks.MANGROVE_PROPAGULE, + Blocks.CHERRY_LEAVES }; - public static final Item[] HOSTILE_MOB_DROPS = new Item[]{ - Items.BLAZE_ROD, - Items.FEATHER, - Items.CHICKEN, - Items.COOKED_CHICKEN, - Items.ROTTEN_FLESH, - Items.ZOMBIE_HEAD, - Items.GUNPOWDER, - Items.CREEPER_HEAD, - Items.TOTEM_OF_UNDYING, - Items.EMERALD, - Items.PORKCHOP, - Items.COOKED_PORKCHOP, - Items.LEATHER, - Items.MAGMA_CREAM, - Items.PHANTOM_MEMBRANE, - Items.ARROW, - Items.SADDLE, - Items.SHULKER_SHELL, - Items.BONE, - Items.SKELETON_SKULL, - Items.SLIME_BALL, - Items.STRING, - Items.SPIDER_EYE, - Items.SCULK_CATALYST, - Items.GLASS_BOTTLE, - Items.GLOWSTONE_DUST, - Items.REDSTONE, - Items.STICK, - Items.SUGAR, - Items.POTION, - Items.NETHER_STAR, - Items.COAL, - Items.WITHER_SKELETON_SKULL, - Items.GHAST_TEAR, - Items.IRON_INGOT, - Items.CARROT, - Items.POTATO, - Items.BAKED_POTATO, - Items.COPPER_INGOT + public static final Item[] HOSTILE_MOB_DROPS = new Item[] { + Items.BLAZE_ROD, + Items.FEATHER, + Items.CHICKEN, + Items.COOKED_CHICKEN, + Items.ROTTEN_FLESH, + Items.ZOMBIE_HEAD, + Items.GUNPOWDER, + Items.CREEPER_HEAD, + Items.TOTEM_OF_UNDYING, + Items.EMERALD, + Items.PORKCHOP, + Items.COOKED_PORKCHOP, + Items.LEATHER, + Items.MAGMA_CREAM, + Items.PHANTOM_MEMBRANE, + Items.ARROW, + Items.SADDLE, + Items.SHULKER_SHELL, + Items.BONE, + Items.SKELETON_SKULL, + Items.SLIME_BALL, + Items.STRING, + Items.SPIDER_EYE, + Items.SCULK_CATALYST, + Items.GLASS_BOTTLE, + Items.GLOWSTONE_DUST, + Items.REDSTONE, + Items.STICK, + Items.SUGAR, + Items.POTION, + Items.NETHER_STAR, + Items.COAL, + Items.WITHER_SKELETON_SKULL, + Items.GHAST_TEAR, + Items.IRON_INGOT, + Items.CARROT, + Items.POTATO, + Items.BAKED_POTATO, + Items.COPPER_INGOT }; - public static final Item[] DIRTS = new Item[]{Items.DIRT, Items.DIRT_PATH, Items.COARSE_DIRT, Items.ROOTED_DIRT}; - public static final Item[] PLANKS = new Item[]{ - Items.ACACIA_PLANKS, - Items.BIRCH_PLANKS, - Items.CRIMSON_PLANKS, - Items.DARK_OAK_PLANKS, - Items.OAK_PLANKS, - Items.JUNGLE_PLANKS, - Items.SPRUCE_PLANKS, - Items.WARPED_PLANKS, - Items.MANGROVE_PLANKS, - Items.CHERRY_PLANKS, - Items.BAMBOO_PLANKS + public static final Item[] DIRTS = new Item[] { Items.DIRT, Items.DIRT_PATH, Items.COARSE_DIRT, Items.ROOTED_DIRT }; + public static final Item[] PLANKS = new Item[] { + Items.ACACIA_PLANKS, + Items.BIRCH_PLANKS, + Items.CRIMSON_PLANKS, + Items.DARK_OAK_PLANKS, + Items.OAK_PLANKS, + Items.JUNGLE_PLANKS, + Items.SPRUCE_PLANKS, + Items.WARPED_PLANKS, + Items.MANGROVE_PLANKS, + Items.CHERRY_PLANKS, + Items.BAMBOO_PLANKS }; - public static final Item[] LEAVES = new Item[]{ - Items.ACACIA_LEAVES, - Items.BIRCH_LEAVES, - Items.DARK_OAK_LEAVES, - Items.OAK_LEAVES, - Items.JUNGLE_LEAVES, - Items.SPRUCE_LEAVES, - Items.MANGROVE_LEAVES, - Items.CHERRY_LEAVES + public static final Item[] LEAVES = new Item[] { + Items.ACACIA_LEAVES, + Items.BIRCH_LEAVES, + Items.DARK_OAK_LEAVES, + Items.OAK_LEAVES, + Items.JUNGLE_LEAVES, + Items.SPRUCE_LEAVES, + Items.MANGROVE_LEAVES, + Items.CHERRY_LEAVES }; - public static final Item[] WOOD = new Item[]{ - Items.ACACIA_WOOD, - Items.BIRCH_WOOD, - Items.CRIMSON_HYPHAE, - Items.DARK_OAK_WOOD, - Items.OAK_WOOD, - Items.JUNGLE_WOOD, - Items.SPRUCE_WOOD, - Items.WARPED_HYPHAE, - Items.MANGROVE_WOOD + public static final Item[] WOOD = new Item[] { + Items.ACACIA_WOOD, + Items.BIRCH_WOOD, + Items.CRIMSON_HYPHAE, + Items.DARK_OAK_WOOD, + Items.OAK_WOOD, + Items.JUNGLE_WOOD, + Items.SPRUCE_WOOD, + Items.WARPED_HYPHAE, + Items.MANGROVE_WOOD }; - public static final Item[] WOOD_BUTTON = new Item[]{ - Items.ACACIA_BUTTON, - Items.BIRCH_BUTTON, - Items.CRIMSON_BUTTON, - Items.DARK_OAK_BUTTON, - Items.OAK_BUTTON, - Items.JUNGLE_BUTTON, - Items.SPRUCE_BUTTON, - Items.WARPED_BUTTON, - Items.MANGROVE_BUTTON, - Items.BAMBOO_BUTTON, - Items.CHERRY_BUTTON + public static final Item[] WOOD_BUTTON = new Item[] { + Items.ACACIA_BUTTON, + Items.BIRCH_BUTTON, + Items.CRIMSON_BUTTON, + Items.DARK_OAK_BUTTON, + Items.OAK_BUTTON, + Items.JUNGLE_BUTTON, + Items.SPRUCE_BUTTON, + Items.WARPED_BUTTON, + Items.MANGROVE_BUTTON, + Items.BAMBOO_BUTTON, + Items.CHERRY_BUTTON }; - public static final Item[] WOOD_SIGN = new Item[]{ - Items.ACACIA_SIGN, - Items.BIRCH_SIGN, - Items.CRIMSON_SIGN, - Items.DARK_OAK_SIGN, - Items.OAK_SIGN, - Items.JUNGLE_SIGN, - Items.SPRUCE_SIGN, - Items.WARPED_SIGN, - Items.MANGROVE_SIGN, - Items.BAMBOO_SIGN, - Items.CHERRY_SIGN + public static final Item[] WOOD_SIGN = new Item[] { + Items.ACACIA_SIGN, + Items.BIRCH_SIGN, + Items.CRIMSON_SIGN, + Items.DARK_OAK_SIGN, + Items.OAK_SIGN, + Items.JUNGLE_SIGN, + Items.SPRUCE_SIGN, + Items.WARPED_SIGN, + Items.MANGROVE_SIGN, + Items.BAMBOO_SIGN, + Items.CHERRY_SIGN }; - public static final Item[] WOOD_HANGING_SIGN = new Item[]{ - Items.ACACIA_HANGING_SIGN, - Items.BIRCH_HANGING_SIGN, - Items.CRIMSON_HANGING_SIGN, - Items.DARK_OAK_HANGING_SIGN, - Items.OAK_HANGING_SIGN, - Items.JUNGLE_HANGING_SIGN, - Items.SPRUCE_HANGING_SIGN, - Items.WARPED_HANGING_SIGN, - Items.MANGROVE_HANGING_SIGN, - Items.BAMBOO_HANGING_SIGN, - Items.CHERRY_HANGING_SIGN + public static final Item[] WOOD_HANGING_SIGN = new Item[] { + Items.ACACIA_HANGING_SIGN, + Items.BIRCH_HANGING_SIGN, + Items.CRIMSON_HANGING_SIGN, + Items.DARK_OAK_HANGING_SIGN, + Items.OAK_HANGING_SIGN, + Items.JUNGLE_HANGING_SIGN, + Items.SPRUCE_HANGING_SIGN, + Items.WARPED_HANGING_SIGN, + Items.MANGROVE_HANGING_SIGN, + Items.BAMBOO_HANGING_SIGN, + Items.CHERRY_HANGING_SIGN }; - public static final Item[] WOOD_PRESSURE_PLATE = new Item[]{ - Items.ACACIA_PRESSURE_PLATE, - Items.BIRCH_PRESSURE_PLATE, - Items.CRIMSON_PRESSURE_PLATE, - Items.DARK_OAK_PRESSURE_PLATE, - Items.OAK_PRESSURE_PLATE, - Items.JUNGLE_PRESSURE_PLATE, - Items.SPRUCE_PRESSURE_PLATE, - Items.WARPED_PRESSURE_PLATE, - Items.MANGROVE_PRESSURE_PLATE, - Items.BAMBOO_PRESSURE_PLATE, - Items.CHERRY_PRESSURE_PLATE + public static final Item[] WOOD_PRESSURE_PLATE = new Item[] { + Items.ACACIA_PRESSURE_PLATE, + Items.BIRCH_PRESSURE_PLATE, + Items.CRIMSON_PRESSURE_PLATE, + Items.DARK_OAK_PRESSURE_PLATE, + Items.OAK_PRESSURE_PLATE, + Items.JUNGLE_PRESSURE_PLATE, + Items.SPRUCE_PRESSURE_PLATE, + Items.WARPED_PRESSURE_PLATE, + Items.MANGROVE_PRESSURE_PLATE, + Items.BAMBOO_PRESSURE_PLATE, + Items.CHERRY_PRESSURE_PLATE }; - public static final Item[] WOOD_FENCE = new Item[]{ - Items.ACACIA_FENCE, - Items.BIRCH_FENCE, - Items.DARK_OAK_FENCE, - Items.OAK_FENCE, - Items.JUNGLE_FENCE, - Items.SPRUCE_FENCE, - Items.CRIMSON_FENCE, - Items.WARPED_FENCE, - Items.MANGROVE_FENCE, - Items.BAMBOO_FENCE, - Items.CHERRY_FENCE + public static final Item[] WOOD_FENCE = new Item[] { + Items.ACACIA_FENCE, + Items.BIRCH_FENCE, + Items.DARK_OAK_FENCE, + Items.OAK_FENCE, + Items.JUNGLE_FENCE, + Items.SPRUCE_FENCE, + Items.CRIMSON_FENCE, + Items.WARPED_FENCE, + Items.MANGROVE_FENCE, + Items.BAMBOO_FENCE, + Items.CHERRY_FENCE }; - public static final Item[] WOOD_FENCE_GATE = new Item[]{ - Items.ACACIA_FENCE_GATE, - Items.BIRCH_FENCE_GATE, - Items.DARK_OAK_FENCE_GATE, - Items.OAK_FENCE_GATE, - Items.JUNGLE_FENCE_GATE, - Items.SPRUCE_FENCE_GATE, - Items.CRIMSON_FENCE_GATE, - Items.WARPED_FENCE_GATE, - Items.MANGROVE_FENCE_GATE, - Items.BAMBOO_FENCE_GATE, - Items.CHERRY_FENCE_GATE + public static final Item[] WOOD_FENCE_GATE = new Item[] { + Items.ACACIA_FENCE_GATE, + Items.BIRCH_FENCE_GATE, + Items.DARK_OAK_FENCE_GATE, + Items.OAK_FENCE_GATE, + Items.JUNGLE_FENCE_GATE, + Items.SPRUCE_FENCE_GATE, + Items.CRIMSON_FENCE_GATE, + Items.WARPED_FENCE_GATE, + Items.MANGROVE_FENCE_GATE, + Items.BAMBOO_FENCE_GATE, + Items.CHERRY_FENCE_GATE }; - public static final Item[] WOOD_BOAT = new Item[]{ - Items.ACACIA_BOAT, Items.BIRCH_BOAT, Items.DARK_OAK_BOAT, Items.OAK_BOAT, Items.JUNGLE_BOAT, Items.SPRUCE_BOAT, Items.MANGROVE_BOAT, Items.CHERRY_BOAT + public static final Item[] WOOD_BOAT = new Item[] { + Items.ACACIA_BOAT, Items.BIRCH_BOAT, Items.DARK_OAK_BOAT, Items.OAK_BOAT, Items.JUNGLE_BOAT, Items.SPRUCE_BOAT, + Items.MANGROVE_BOAT, Items.CHERRY_BOAT }; - public static final Item[] WOOD_DOOR = new Item[]{ - Items.ACACIA_DOOR, - Items.BIRCH_DOOR, - Items.CRIMSON_DOOR, - Items.DARK_OAK_DOOR, - Items.OAK_DOOR, - Items.JUNGLE_DOOR, - Items.SPRUCE_DOOR, - Items.WARPED_DOOR, - Items.MANGROVE_DOOR, - Items.BAMBOO_DOOR, - Items.CHERRY_DOOR + public static final Item[] WOOD_DOOR = new Item[] { + Items.ACACIA_DOOR, + Items.BIRCH_DOOR, + Items.CRIMSON_DOOR, + Items.DARK_OAK_DOOR, + Items.OAK_DOOR, + Items.JUNGLE_DOOR, + Items.SPRUCE_DOOR, + Items.WARPED_DOOR, + Items.MANGROVE_DOOR, + Items.BAMBOO_DOOR, + Items.CHERRY_DOOR }; - public static final Item[] WOOD_SLAB = new Item[]{ - Items.ACACIA_SLAB, - Items.BIRCH_SLAB, - Items.CRIMSON_SLAB, - Items.DARK_OAK_SLAB, - Items.OAK_SLAB, - Items.JUNGLE_SLAB, - Items.SPRUCE_SLAB, - Items.WARPED_SLAB, - Items.MANGROVE_SLAB, - Items.BAMBOO_SLAB, - Items.CHERRY_SLAB + public static final Item[] WOOD_SLAB = new Item[] { + Items.ACACIA_SLAB, + Items.BIRCH_SLAB, + Items.CRIMSON_SLAB, + Items.DARK_OAK_SLAB, + Items.OAK_SLAB, + Items.JUNGLE_SLAB, + Items.SPRUCE_SLAB, + Items.WARPED_SLAB, + Items.MANGROVE_SLAB, + Items.BAMBOO_SLAB, + Items.CHERRY_SLAB }; - public static final Item[] WOOD_STAIRS = new Item[]{ - Items.ACACIA_STAIRS, - Items.BIRCH_STAIRS, - Items.CRIMSON_STAIRS, - Items.DARK_OAK_STAIRS, - Items.OAK_STAIRS, - Items.JUNGLE_STAIRS, - Items.SPRUCE_STAIRS, - Items.WARPED_STAIRS, - Items.MANGROVE_STAIRS, - Items.BAMBOO_STAIRS, - Items.CHERRY_STAIRS + public static final Item[] WOOD_STAIRS = new Item[] { + Items.ACACIA_STAIRS, + Items.BIRCH_STAIRS, + Items.CRIMSON_STAIRS, + Items.DARK_OAK_STAIRS, + Items.OAK_STAIRS, + Items.JUNGLE_STAIRS, + Items.SPRUCE_STAIRS, + Items.WARPED_STAIRS, + Items.MANGROVE_STAIRS, + Items.BAMBOO_STAIRS, + Items.CHERRY_STAIRS }; - public static final Item[] WOOD_TRAPDOOR = new Item[]{ - Items.ACACIA_TRAPDOOR, - Items.BIRCH_TRAPDOOR, - Items.CRIMSON_TRAPDOOR, - Items.DARK_OAK_TRAPDOOR, - Items.OAK_TRAPDOOR, - Items.JUNGLE_TRAPDOOR, - Items.SPRUCE_TRAPDOOR, - Items.WARPED_TRAPDOOR, - Items.MANGROVE_TRAPDOOR, - Items.BAMBOO_TRAPDOOR, - Items.CHERRY_TRAPDOOR + public static final Item[] WOOD_TRAPDOOR = new Item[] { + Items.ACACIA_TRAPDOOR, + Items.BIRCH_TRAPDOOR, + Items.CRIMSON_TRAPDOOR, + Items.DARK_OAK_TRAPDOOR, + Items.OAK_TRAPDOOR, + Items.JUNGLE_TRAPDOOR, + Items.SPRUCE_TRAPDOOR, + Items.WARPED_TRAPDOOR, + Items.MANGROVE_TRAPDOOR, + Items.BAMBOO_TRAPDOOR, + Items.CHERRY_TRAPDOOR }; - public static final Item[] LOG = new Item[]{ - Items.ACACIA_LOG, - Items.BIRCH_LOG, - Items.DARK_OAK_LOG, - Items.OAK_LOG, - Items.JUNGLE_LOG, - Items.SPRUCE_LOG, - Items.ACACIA_WOOD, - Items.BIRCH_WOOD, - Items.DARK_OAK_WOOD, - Items.OAK_WOOD, - Items.JUNGLE_WOOD, - Items.SPRUCE_WOOD, - Items.STRIPPED_ACACIA_LOG, - Items.STRIPPED_BIRCH_LOG, - Items.STRIPPED_DARK_OAK_LOG, - Items.STRIPPED_OAK_LOG, - Items.STRIPPED_JUNGLE_LOG, - Items.STRIPPED_SPRUCE_LOG, - Items.STRIPPED_ACACIA_WOOD, - Items.STRIPPED_BIRCH_WOOD, - Items.STRIPPED_DARK_OAK_WOOD, - Items.STRIPPED_OAK_WOOD, - Items.STRIPPED_JUNGLE_WOOD, - Items.STRIPPED_SPRUCE_WOOD, - Items.CRIMSON_STEM, - Items.WARPED_STEM, - Items.CRIMSON_HYPHAE, - Items.WARPED_HYPHAE, - Items.STRIPPED_CRIMSON_STEM, - Items.STRIPPED_WARPED_STEM, - Items.STRIPPED_CRIMSON_HYPHAE, - Items.STRIPPED_WARPED_HYPHAE, - Items.MANGROVE_LOG, - Items.MANGROVE_WOOD, - Items.STRIPPED_MANGROVE_LOG, - Items.STRIPPED_MANGROVE_WOOD, - Items.CHERRY_LOG, - Items.CHERRY_WOOD, - Items.STRIPPED_CHERRY_LOG, - Items.STRIPPED_CHERRY_WOOD + public static final Item[] LOG = new Item[] { + Items.ACACIA_LOG, + Items.BIRCH_LOG, + Items.DARK_OAK_LOG, + Items.OAK_LOG, + Items.JUNGLE_LOG, + Items.SPRUCE_LOG, + Items.ACACIA_WOOD, + Items.BIRCH_WOOD, + Items.DARK_OAK_WOOD, + Items.OAK_WOOD, + Items.JUNGLE_WOOD, + Items.SPRUCE_WOOD, + Items.STRIPPED_ACACIA_LOG, + Items.STRIPPED_BIRCH_LOG, + Items.STRIPPED_DARK_OAK_LOG, + Items.STRIPPED_OAK_LOG, + Items.STRIPPED_JUNGLE_LOG, + Items.STRIPPED_SPRUCE_LOG, + Items.STRIPPED_ACACIA_WOOD, + Items.STRIPPED_BIRCH_WOOD, + Items.STRIPPED_DARK_OAK_WOOD, + Items.STRIPPED_OAK_WOOD, + Items.STRIPPED_JUNGLE_WOOD, + Items.STRIPPED_SPRUCE_WOOD, + Items.CRIMSON_STEM, + Items.WARPED_STEM, + Items.CRIMSON_HYPHAE, + Items.WARPED_HYPHAE, + Items.STRIPPED_CRIMSON_STEM, + Items.STRIPPED_WARPED_STEM, + Items.STRIPPED_CRIMSON_HYPHAE, + Items.STRIPPED_WARPED_HYPHAE, + Items.MANGROVE_LOG, + Items.MANGROVE_WOOD, + Items.STRIPPED_MANGROVE_LOG, + Items.STRIPPED_MANGROVE_WOOD, + Items.CHERRY_LOG, + Items.CHERRY_WOOD, + Items.STRIPPED_CHERRY_LOG, + Items.STRIPPED_CHERRY_WOOD }; - public static final Item[] STRIPPED_LOGS = new Item[]{ - Items.STRIPPED_ACACIA_LOG, - Items.STRIPPED_BIRCH_LOG, - Items.STRIPPED_DARK_OAK_LOG, - Items.STRIPPED_OAK_LOG, - Items.STRIPPED_JUNGLE_LOG, - Items.STRIPPED_SPRUCE_LOG, - Items.STRIPPED_CRIMSON_STEM, - Items.STRIPPED_WARPED_STEM, - Items.STRIPPED_MANGROVE_LOG, - Items.STRIPPED_CHERRY_LOG + public static final Item[] STRIPPED_LOGS = new Item[] { + Items.STRIPPED_ACACIA_LOG, + Items.STRIPPED_BIRCH_LOG, + Items.STRIPPED_DARK_OAK_LOG, + Items.STRIPPED_OAK_LOG, + Items.STRIPPED_JUNGLE_LOG, + Items.STRIPPED_SPRUCE_LOG, + Items.STRIPPED_CRIMSON_STEM, + Items.STRIPPED_WARPED_STEM, + Items.STRIPPED_MANGROVE_LOG, + Items.STRIPPED_CHERRY_LOG }; - public static final Item[] STRIPPABLE_LOGS = new Item[]{ - Items.ACACIA_LOG, - Items.BIRCH_LOG, - Items.DARK_OAK_LOG, - Items.OAK_LOG, - Items.JUNGLE_LOG, - Items.SPRUCE_LOG, - Items.CRIMSON_STEM, - Items.WARPED_STEM, - Items.MANGROVE_LOG, - Items.CHERRY_LOG + public static final Item[] STRIPPABLE_LOGS = new Item[] { + Items.ACACIA_LOG, + Items.BIRCH_LOG, + Items.DARK_OAK_LOG, + Items.OAK_LOG, + Items.JUNGLE_LOG, + Items.SPRUCE_LOG, + Items.CRIMSON_STEM, + Items.WARPED_STEM, + Items.MANGROVE_LOG, + Items.CHERRY_LOG }; - public static final Item[] DYE = new Item[]{ - Items.WHITE_DYE, - Items.BLACK_DYE, - Items.BLUE_DYE, - Items.BROWN_DYE, - Items.CYAN_DYE, - Items.GRAY_DYE, - Items.GREEN_DYE, - Items.LIGHT_BLUE_DYE, - Items.LIGHT_GRAY_DYE, - Items.LIME_DYE, - Items.MAGENTA_DYE, - Items.ORANGE_DYE, - Items.PINK_DYE, - Items.PURPLE_DYE, - Items.RED_DYE, - Items.YELLOW_DYE + public static final Item[] DYE = new Item[] { + Items.WHITE_DYE, + Items.BLACK_DYE, + Items.BLUE_DYE, + Items.BROWN_DYE, + Items.CYAN_DYE, + Items.GRAY_DYE, + Items.GREEN_DYE, + Items.LIGHT_BLUE_DYE, + Items.LIGHT_GRAY_DYE, + Items.LIME_DYE, + Items.MAGENTA_DYE, + Items.ORANGE_DYE, + Items.PINK_DYE, + Items.PURPLE_DYE, + Items.RED_DYE, + Items.YELLOW_DYE }; - public static final Item[] WOOL = new Item[]{ - Items.WHITE_WOOL, - Items.BLACK_WOOL, - Items.BLUE_WOOL, - Items.BROWN_WOOL, - Items.CYAN_WOOL, - Items.GRAY_WOOL, - Items.GREEN_WOOL, - Items.LIGHT_BLUE_WOOL, - Items.LIGHT_GRAY_WOOL, - Items.LIME_WOOL, - Items.MAGENTA_WOOL, - Items.ORANGE_WOOL, - Items.PINK_WOOL, - Items.PURPLE_WOOL, - Items.RED_WOOL, - Items.YELLOW_WOOL + public static final Item[] WOOL = new Item[] { + Items.WHITE_WOOL, + Items.BLACK_WOOL, + Items.BLUE_WOOL, + Items.BROWN_WOOL, + Items.CYAN_WOOL, + Items.GRAY_WOOL, + Items.GREEN_WOOL, + Items.LIGHT_BLUE_WOOL, + Items.LIGHT_GRAY_WOOL, + Items.LIME_WOOL, + Items.MAGENTA_WOOL, + Items.ORANGE_WOOL, + Items.PINK_WOOL, + Items.PURPLE_WOOL, + Items.RED_WOOL, + Items.YELLOW_WOOL }; - public static final Item[] BED = new Item[]{ - Items.WHITE_BED, - Items.BLACK_BED, - Items.BLUE_BED, - Items.BROWN_BED, - Items.CYAN_BED, - Items.GRAY_BED, - Items.GREEN_BED, - Items.LIGHT_BLUE_BED, - Items.LIGHT_GRAY_BED, - Items.LIME_BED, - Items.MAGENTA_BED, - Items.ORANGE_BED, - Items.PINK_BED, - Items.PURPLE_BED, - Items.RED_BED, - Items.YELLOW_BED + public static final Item[] BED = new Item[] { + Items.WHITE_BED, + Items.BLACK_BED, + Items.BLUE_BED, + Items.BROWN_BED, + Items.CYAN_BED, + Items.GRAY_BED, + Items.GREEN_BED, + Items.LIGHT_BLUE_BED, + Items.LIGHT_GRAY_BED, + Items.LIME_BED, + Items.MAGENTA_BED, + Items.ORANGE_BED, + Items.PINK_BED, + Items.PURPLE_BED, + Items.RED_BED, + Items.YELLOW_BED }; - public static final Item[] CARPET = new Item[]{ - Items.WHITE_CARPET, - Items.BLACK_CARPET, - Items.BLUE_CARPET, - Items.BROWN_CARPET, - Items.CYAN_CARPET, - Items.GRAY_CARPET, - Items.GREEN_CARPET, - Items.LIGHT_BLUE_CARPET, - Items.LIGHT_GRAY_CARPET, - Items.LIME_CARPET, - Items.MAGENTA_CARPET, - Items.ORANGE_CARPET, - Items.PINK_CARPET, - Items.PURPLE_CARPET, - Items.RED_CARPET, - Items.YELLOW_CARPET + public static final Item[] CARPET = new Item[] { + Items.WHITE_CARPET, + Items.BLACK_CARPET, + Items.BLUE_CARPET, + Items.BROWN_CARPET, + Items.CYAN_CARPET, + Items.GRAY_CARPET, + Items.GREEN_CARPET, + Items.LIGHT_BLUE_CARPET, + Items.LIGHT_GRAY_CARPET, + Items.LIME_CARPET, + Items.MAGENTA_CARPET, + Items.ORANGE_CARPET, + Items.PINK_CARPET, + Items.PURPLE_CARPET, + Items.RED_CARPET, + Items.YELLOW_CARPET }; - public static final Item[] SHULKER_BOXES = new Item[]{ - Items.WHITE_SHULKER_BOX, - Items.BLACK_SHULKER_BOX, - Items.BLUE_SHULKER_BOX, - Items.BROWN_SHULKER_BOX, - Items.CYAN_SHULKER_BOX, - Items.GRAY_SHULKER_BOX, - Items.GREEN_SHULKER_BOX, - Items.LIGHT_BLUE_SHULKER_BOX, - Items.LIGHT_GRAY_SHULKER_BOX, - Items.LIME_SHULKER_BOX, - Items.MAGENTA_SHULKER_BOX, - Items.ORANGE_SHULKER_BOX, - Items.PINK_SHULKER_BOX, - Items.PURPLE_SHULKER_BOX, - Items.RED_SHULKER_BOX, - Items.YELLOW_SHULKER_BOX + public static final Item[] SHULKER_BOXES = new Item[] { + Items.WHITE_SHULKER_BOX, + Items.BLACK_SHULKER_BOX, + Items.BLUE_SHULKER_BOX, + Items.BROWN_SHULKER_BOX, + Items.CYAN_SHULKER_BOX, + Items.GRAY_SHULKER_BOX, + Items.GREEN_SHULKER_BOX, + Items.LIGHT_BLUE_SHULKER_BOX, + Items.LIGHT_GRAY_SHULKER_BOX, + Items.LIME_SHULKER_BOX, + Items.MAGENTA_SHULKER_BOX, + Items.ORANGE_SHULKER_BOX, + Items.PINK_SHULKER_BOX, + Items.PURPLE_SHULKER_BOX, + Items.RED_SHULKER_BOX, + Items.YELLOW_SHULKER_BOX }; - public static final Item[] FLOWER = new Item[]{ - Items.ALLIUM, - Items.AZURE_BLUET, - Items.BLUE_ORCHID, - Items.CORNFLOWER, - Items.DANDELION, - Items.LILAC, - Items.LILY_OF_THE_VALLEY, - Items.ORANGE_TULIP, - Items.OXEYE_DAISY, - Items.PINK_TULIP, - Items.POPPY, - Items.PEONY, - Items.RED_TULIP, - Items.ROSE_BUSH, - Items.SUNFLOWER, - Items.WHITE_TULIP + public static final Item[] FLOWER = new Item[] { + Items.ALLIUM, + Items.AZURE_BLUET, + Items.BLUE_ORCHID, + Items.CORNFLOWER, + Items.DANDELION, + Items.LILAC, + Items.LILY_OF_THE_VALLEY, + Items.ORANGE_TULIP, + Items.OXEYE_DAISY, + Items.PINK_TULIP, + Items.POPPY, + Items.PEONY, + Items.RED_TULIP, + Items.ROSE_BUSH, + Items.SUNFLOWER, + Items.WHITE_TULIP }; - public static final Item[] LEATHER_ARMORS = new Item[]{Items.LEATHER_CHESTPLATE, Items.LEATHER_LEGGINGS, Items.LEATHER_HELMET, Items.LEATHER_BOOTS}; - public static final Item[] GOLDEN_ARMORS = new Item[]{Items.GOLDEN_CHESTPLATE, Items.GOLDEN_LEGGINGS, Items.GOLDEN_HELMET, Items.GOLDEN_BOOTS}; - public static final Item[] IRON_ARMORS = new Item[]{Items.IRON_CHESTPLATE, Items.IRON_LEGGINGS, Items.IRON_HELMET, Items.IRON_BOOTS}; - public static final Item[] DIAMOND_ARMORS = new Item[]{Items.DIAMOND_CHESTPLATE, Items.DIAMOND_LEGGINGS, Items.DIAMOND_HELMET, Items.DIAMOND_BOOTS}; - public static final Item[] NETHERITE_ARMORS = new Item[]{ - Items.NETHERITE_CHESTPLATE, Items.NETHERITE_LEGGINGS, Items.NETHERITE_HELMET, Items.NETHERITE_BOOTS + public static final Item[] LEATHER_ARMORS = new Item[] { Items.LEATHER_CHESTPLATE, Items.LEATHER_LEGGINGS, + Items.LEATHER_HELMET, Items.LEATHER_BOOTS }; + public static final Item[] GOLDEN_ARMORS = new Item[] { Items.GOLDEN_CHESTPLATE, Items.GOLDEN_LEGGINGS, + Items.GOLDEN_HELMET, Items.GOLDEN_BOOTS }; + public static final Item[] IRON_ARMORS = new Item[] { Items.IRON_CHESTPLATE, Items.IRON_LEGGINGS, Items.IRON_HELMET, + Items.IRON_BOOTS }; + public static final Item[] DIAMOND_ARMORS = new Item[] { Items.DIAMOND_CHESTPLATE, Items.DIAMOND_LEGGINGS, + Items.DIAMOND_HELMET, Items.DIAMOND_BOOTS }; + public static final Item[] NETHERITE_ARMORS = new Item[] { + Items.NETHERITE_CHESTPLATE, Items.NETHERITE_LEGGINGS, Items.NETHERITE_HELMET, Items.NETHERITE_BOOTS }; - public static final Item[] WOODEN_TOOLS = new Item[]{Items.WOODEN_PICKAXE, Items.WOODEN_SHOVEL, Items.WOODEN_SWORD, Items.WOODEN_AXE, Items.WOODEN_HOE}; - public static final Item[] STONE_TOOLS = new Item[]{Items.STONE_PICKAXE, Items.STONE_SHOVEL, Items.STONE_SWORD, Items.STONE_AXE, Items.STONE_HOE}; - public static final Item[] IRON_TOOLS = new Item[]{Items.IRON_PICKAXE, Items.IRON_SHOVEL, Items.IRON_SWORD, Items.IRON_AXE, Items.IRON_HOE}; - public static final Item[] GOLDEN_TOOLS = new Item[]{Items.GOLDEN_PICKAXE, Items.GOLDEN_SHOVEL, Items.GOLDEN_SWORD, Items.GOLDEN_AXE, Items.GOLDEN_HOE}; - public static final Item[] DIAMOND_TOOLS = new Item[]{ - Items.DIAMOND_PICKAXE, Items.DIAMOND_SHOVEL, Items.DIAMOND_SWORD, Items.DIAMOND_AXE, Items.DIAMOND_HOE + public static final Item[] WOODEN_TOOLS = new Item[] { Items.WOODEN_PICKAXE, Items.WOODEN_SHOVEL, Items.WOODEN_SWORD, + Items.WOODEN_AXE, Items.WOODEN_HOE }; + public static final Item[] STONE_TOOLS = new Item[] { Items.STONE_PICKAXE, Items.STONE_SHOVEL, Items.STONE_SWORD, + Items.STONE_AXE, Items.STONE_HOE }; + public static final Item[] IRON_TOOLS = new Item[] { Items.IRON_PICKAXE, Items.IRON_SHOVEL, Items.IRON_SWORD, + Items.IRON_AXE, Items.IRON_HOE }; + public static final Item[] GOLDEN_TOOLS = new Item[] { Items.GOLDEN_PICKAXE, Items.GOLDEN_SHOVEL, Items.GOLDEN_SWORD, + Items.GOLDEN_AXE, Items.GOLDEN_HOE }; + public static final Item[] DIAMOND_TOOLS = new Item[] { + Items.DIAMOND_PICKAXE, Items.DIAMOND_SHOVEL, Items.DIAMOND_SWORD, Items.DIAMOND_AXE, Items.DIAMOND_HOE }; - public static final Item[] NETHERITE_TOOLS = new Item[]{ - Items.NETHERITE_PICKAXE, Items.NETHERITE_SHOVEL, Items.NETHERITE_SWORD, Items.NETHERITE_AXE, Items.NETHERITE_HOE + public static final Item[] NETHERITE_TOOLS = new Item[] { + Items.NETHERITE_PICKAXE, Items.NETHERITE_SHOVEL, Items.NETHERITE_SWORD, Items.NETHERITE_AXE, + Items.NETHERITE_HOE }; - public static final Block[] WOOD_SIGNS_ALL = new Block[]{ - Blocks.ACACIA_SIGN, - Blocks.BIRCH_SIGN, - Blocks.DARK_OAK_SIGN, - Blocks.OAK_SIGN, - Blocks.JUNGLE_SIGN, - Blocks.SPRUCE_SIGN, - Blocks.ACACIA_WALL_SIGN, - Blocks.BIRCH_WALL_SIGN, - Blocks.DARK_OAK_WALL_SIGN, - Blocks.OAK_WALL_SIGN, - Blocks.JUNGLE_WALL_SIGN, - Blocks.SPRUCE_WALL_SIGN, - Blocks.MANGROVE_SIGN, - Blocks.MANGROVE_WALL_SIGN, - Blocks.BAMBOO_SIGN, - Blocks.BAMBOO_WALL_SIGN, - Blocks.CHERRY_SIGN, - Blocks.CHERRY_WALL_SIGN + public static final Block[] WOOD_SIGNS_ALL = new Block[] { + Blocks.ACACIA_SIGN, + Blocks.BIRCH_SIGN, + Blocks.DARK_OAK_SIGN, + Blocks.OAK_SIGN, + Blocks.JUNGLE_SIGN, + Blocks.SPRUCE_SIGN, + Blocks.ACACIA_WALL_SIGN, + Blocks.BIRCH_WALL_SIGN, + Blocks.DARK_OAK_WALL_SIGN, + Blocks.OAK_WALL_SIGN, + Blocks.JUNGLE_WALL_SIGN, + Blocks.SPRUCE_WALL_SIGN, + Blocks.MANGROVE_SIGN, + Blocks.MANGROVE_WALL_SIGN, + Blocks.BAMBOO_SIGN, + Blocks.BAMBOO_WALL_SIGN, + Blocks.CHERRY_SIGN, + Blocks.CHERRY_WALL_SIGN }; private static final Map logToPlanks = new HashMap() { { @@ -536,627 +549,593 @@ public class ItemHelper { private static final Map colorMap = new HashMap() { { this.p( - DyeColor.RED, - "red", - Items.RED_DYE, - Items.RED_WOOL, - Items.RED_BED, - Items.RED_CARPET, - Items.RED_STAINED_GLASS, - Items.RED_STAINED_GLASS_PANE, - Items.RED_TERRACOTTA, - Items.RED_GLAZED_TERRACOTTA, - Items.RED_CONCRETE, - Items.RED_CONCRETE_POWDER, - Items.RED_BANNER, - Items.RED_SHULKER_BOX, - Blocks.RED_WALL_BANNER - ); + DyeColor.RED, + "red", + Items.RED_DYE, + Items.RED_WOOL, + Items.RED_BED, + Items.RED_CARPET, + Items.RED_STAINED_GLASS, + Items.RED_STAINED_GLASS_PANE, + Items.RED_TERRACOTTA, + Items.RED_GLAZED_TERRACOTTA, + Items.RED_CONCRETE, + Items.RED_CONCRETE_POWDER, + Items.RED_BANNER, + Items.RED_SHULKER_BOX, + Blocks.RED_WALL_BANNER); this.p( - DyeColor.WHITE, - "white", - Items.WHITE_DYE, - Items.WHITE_WOOL, - Items.WHITE_BED, - Items.WHITE_CARPET, - Items.WHITE_STAINED_GLASS, - Items.WHITE_STAINED_GLASS_PANE, - Items.WHITE_TERRACOTTA, - Items.WHITE_GLAZED_TERRACOTTA, - Items.WHITE_CONCRETE, - Items.WHITE_CONCRETE_POWDER, - Items.WHITE_BANNER, - Items.WHITE_SHULKER_BOX, - Blocks.WHITE_WALL_BANNER - ); + DyeColor.WHITE, + "white", + Items.WHITE_DYE, + Items.WHITE_WOOL, + Items.WHITE_BED, + Items.WHITE_CARPET, + Items.WHITE_STAINED_GLASS, + Items.WHITE_STAINED_GLASS_PANE, + Items.WHITE_TERRACOTTA, + Items.WHITE_GLAZED_TERRACOTTA, + Items.WHITE_CONCRETE, + Items.WHITE_CONCRETE_POWDER, + Items.WHITE_BANNER, + Items.WHITE_SHULKER_BOX, + Blocks.WHITE_WALL_BANNER); this.p( - DyeColor.BLACK, - "black", - Items.BLACK_DYE, - Items.BLACK_WOOL, - Items.BLACK_BED, - Items.BLACK_CARPET, - Items.BLACK_STAINED_GLASS, - Items.BLACK_STAINED_GLASS_PANE, - Items.BLACK_TERRACOTTA, - Items.BLACK_GLAZED_TERRACOTTA, - Items.BLACK_CONCRETE, - Items.BLACK_CONCRETE_POWDER, - Items.BLACK_BANNER, - Items.BLACK_SHULKER_BOX, - Blocks.BLACK_WALL_BANNER - ); + DyeColor.BLACK, + "black", + Items.BLACK_DYE, + Items.BLACK_WOOL, + Items.BLACK_BED, + Items.BLACK_CARPET, + Items.BLACK_STAINED_GLASS, + Items.BLACK_STAINED_GLASS_PANE, + Items.BLACK_TERRACOTTA, + Items.BLACK_GLAZED_TERRACOTTA, + Items.BLACK_CONCRETE, + Items.BLACK_CONCRETE_POWDER, + Items.BLACK_BANNER, + Items.BLACK_SHULKER_BOX, + Blocks.BLACK_WALL_BANNER); this.p( - DyeColor.BLUE, - "blue", - Items.BLUE_DYE, - Items.BLUE_WOOL, - Items.BLUE_BED, - Items.BLUE_CARPET, - Items.BLUE_STAINED_GLASS, - Items.BLUE_STAINED_GLASS_PANE, - Items.BLUE_TERRACOTTA, - Items.BLUE_GLAZED_TERRACOTTA, - Items.BLUE_CONCRETE, - Items.BLUE_CONCRETE_POWDER, - Items.BLUE_BANNER, - Items.BLUE_SHULKER_BOX, - Blocks.BLUE_WALL_BANNER - ); + DyeColor.BLUE, + "blue", + Items.BLUE_DYE, + Items.BLUE_WOOL, + Items.BLUE_BED, + Items.BLUE_CARPET, + Items.BLUE_STAINED_GLASS, + Items.BLUE_STAINED_GLASS_PANE, + Items.BLUE_TERRACOTTA, + Items.BLUE_GLAZED_TERRACOTTA, + Items.BLUE_CONCRETE, + Items.BLUE_CONCRETE_POWDER, + Items.BLUE_BANNER, + Items.BLUE_SHULKER_BOX, + Blocks.BLUE_WALL_BANNER); this.p( - DyeColor.BROWN, - "brown", - Items.BROWN_DYE, - Items.BROWN_WOOL, - Items.BROWN_BED, - Items.BROWN_CARPET, - Items.BROWN_STAINED_GLASS, - Items.BROWN_STAINED_GLASS_PANE, - Items.BROWN_TERRACOTTA, - Items.BROWN_GLAZED_TERRACOTTA, - Items.BROWN_CONCRETE, - Items.BROWN_CONCRETE_POWDER, - Items.BROWN_BANNER, - Items.BROWN_SHULKER_BOX, - Blocks.BROWN_WALL_BANNER - ); + DyeColor.BROWN, + "brown", + Items.BROWN_DYE, + Items.BROWN_WOOL, + Items.BROWN_BED, + Items.BROWN_CARPET, + Items.BROWN_STAINED_GLASS, + Items.BROWN_STAINED_GLASS_PANE, + Items.BROWN_TERRACOTTA, + Items.BROWN_GLAZED_TERRACOTTA, + Items.BROWN_CONCRETE, + Items.BROWN_CONCRETE_POWDER, + Items.BROWN_BANNER, + Items.BROWN_SHULKER_BOX, + Blocks.BROWN_WALL_BANNER); this.p( - DyeColor.CYAN, - "cyan", - Items.CYAN_DYE, - Items.CYAN_WOOL, - Items.CYAN_BED, - Items.CYAN_CARPET, - Items.CYAN_STAINED_GLASS, - Items.CYAN_STAINED_GLASS_PANE, - Items.CYAN_TERRACOTTA, - Items.CYAN_GLAZED_TERRACOTTA, - Items.CYAN_CONCRETE, - Items.CYAN_CONCRETE_POWDER, - Items.CYAN_BANNER, - Items.CYAN_SHULKER_BOX, - Blocks.CYAN_WALL_BANNER - ); + DyeColor.CYAN, + "cyan", + Items.CYAN_DYE, + Items.CYAN_WOOL, + Items.CYAN_BED, + Items.CYAN_CARPET, + Items.CYAN_STAINED_GLASS, + Items.CYAN_STAINED_GLASS_PANE, + Items.CYAN_TERRACOTTA, + Items.CYAN_GLAZED_TERRACOTTA, + Items.CYAN_CONCRETE, + Items.CYAN_CONCRETE_POWDER, + Items.CYAN_BANNER, + Items.CYAN_SHULKER_BOX, + Blocks.CYAN_WALL_BANNER); this.p( - DyeColor.GRAY, - "gray", - Items.GRAY_DYE, - Items.GRAY_WOOL, - Items.GRAY_BED, - Items.GRAY_CARPET, - Items.GRAY_STAINED_GLASS, - Items.GRAY_STAINED_GLASS_PANE, - Items.GRAY_TERRACOTTA, - Items.GRAY_GLAZED_TERRACOTTA, - Items.GRAY_CONCRETE, - Items.GRAY_CONCRETE_POWDER, - Items.GRAY_BANNER, - Items.GRAY_SHULKER_BOX, - Blocks.GRAY_WALL_BANNER - ); + DyeColor.GRAY, + "gray", + Items.GRAY_DYE, + Items.GRAY_WOOL, + Items.GRAY_BED, + Items.GRAY_CARPET, + Items.GRAY_STAINED_GLASS, + Items.GRAY_STAINED_GLASS_PANE, + Items.GRAY_TERRACOTTA, + Items.GRAY_GLAZED_TERRACOTTA, + Items.GRAY_CONCRETE, + Items.GRAY_CONCRETE_POWDER, + Items.GRAY_BANNER, + Items.GRAY_SHULKER_BOX, + Blocks.GRAY_WALL_BANNER); this.p( - DyeColor.GREEN, - "green", - Items.GREEN_DYE, - Items.GREEN_WOOL, - Items.GREEN_BED, - Items.GREEN_CARPET, - Items.GREEN_STAINED_GLASS, - Items.GREEN_STAINED_GLASS_PANE, - Items.GREEN_TERRACOTTA, - Items.GREEN_GLAZED_TERRACOTTA, - Items.GREEN_CONCRETE, - Items.GREEN_CONCRETE_POWDER, - Items.GREEN_BANNER, - Items.GREEN_SHULKER_BOX, - Blocks.GREEN_WALL_BANNER - ); + DyeColor.GREEN, + "green", + Items.GREEN_DYE, + Items.GREEN_WOOL, + Items.GREEN_BED, + Items.GREEN_CARPET, + Items.GREEN_STAINED_GLASS, + Items.GREEN_STAINED_GLASS_PANE, + Items.GREEN_TERRACOTTA, + Items.GREEN_GLAZED_TERRACOTTA, + Items.GREEN_CONCRETE, + Items.GREEN_CONCRETE_POWDER, + Items.GREEN_BANNER, + Items.GREEN_SHULKER_BOX, + Blocks.GREEN_WALL_BANNER); this.p( - DyeColor.LIGHT_BLUE, - "light_blue", - Items.LIGHT_BLUE_DYE, - Items.LIGHT_BLUE_WOOL, - Items.LIGHT_BLUE_BED, - Items.LIGHT_BLUE_CARPET, - Items.LIGHT_BLUE_STAINED_GLASS, - Items.LIGHT_BLUE_STAINED_GLASS_PANE, - Items.LIGHT_BLUE_TERRACOTTA, - Items.LIGHT_BLUE_GLAZED_TERRACOTTA, - Items.LIGHT_BLUE_CONCRETE, - Items.LIGHT_BLUE_CONCRETE_POWDER, - Items.LIGHT_BLUE_BANNER, - Items.LIGHT_BLUE_SHULKER_BOX, - Blocks.LIGHT_BLUE_WALL_BANNER - ); + DyeColor.LIGHT_BLUE, + "light_blue", + Items.LIGHT_BLUE_DYE, + Items.LIGHT_BLUE_WOOL, + Items.LIGHT_BLUE_BED, + Items.LIGHT_BLUE_CARPET, + Items.LIGHT_BLUE_STAINED_GLASS, + Items.LIGHT_BLUE_STAINED_GLASS_PANE, + Items.LIGHT_BLUE_TERRACOTTA, + Items.LIGHT_BLUE_GLAZED_TERRACOTTA, + Items.LIGHT_BLUE_CONCRETE, + Items.LIGHT_BLUE_CONCRETE_POWDER, + Items.LIGHT_BLUE_BANNER, + Items.LIGHT_BLUE_SHULKER_BOX, + Blocks.LIGHT_BLUE_WALL_BANNER); this.p( - DyeColor.LIGHT_GRAY, - "light_gray", - Items.LIGHT_GRAY_DYE, - Items.LIGHT_GRAY_WOOL, - Items.LIGHT_GRAY_BED, - Items.LIGHT_GRAY_CARPET, - Items.LIGHT_GRAY_STAINED_GLASS, - Items.LIGHT_GRAY_STAINED_GLASS_PANE, - Items.LIGHT_GRAY_TERRACOTTA, - Items.LIGHT_GRAY_GLAZED_TERRACOTTA, - Items.LIGHT_GRAY_CONCRETE, - Items.LIGHT_GRAY_CONCRETE_POWDER, - Items.LIGHT_GRAY_BANNER, - Items.LIGHT_GRAY_SHULKER_BOX, - Blocks.LIGHT_GRAY_WALL_BANNER - ); + DyeColor.LIGHT_GRAY, + "light_gray", + Items.LIGHT_GRAY_DYE, + Items.LIGHT_GRAY_WOOL, + Items.LIGHT_GRAY_BED, + Items.LIGHT_GRAY_CARPET, + Items.LIGHT_GRAY_STAINED_GLASS, + Items.LIGHT_GRAY_STAINED_GLASS_PANE, + Items.LIGHT_GRAY_TERRACOTTA, + Items.LIGHT_GRAY_GLAZED_TERRACOTTA, + Items.LIGHT_GRAY_CONCRETE, + Items.LIGHT_GRAY_CONCRETE_POWDER, + Items.LIGHT_GRAY_BANNER, + Items.LIGHT_GRAY_SHULKER_BOX, + Blocks.LIGHT_GRAY_WALL_BANNER); this.p( - DyeColor.LIME, - "lime", - Items.LIME_DYE, - Items.LIME_WOOL, - Items.LIME_BED, - Items.LIME_CARPET, - Items.LIME_STAINED_GLASS, - Items.LIME_STAINED_GLASS_PANE, - Items.LIME_TERRACOTTA, - Items.LIME_GLAZED_TERRACOTTA, - Items.LIME_CONCRETE, - Items.LIME_CONCRETE_POWDER, - Items.LIME_BANNER, - Items.LIME_SHULKER_BOX, - Blocks.LIME_WALL_BANNER - ); + DyeColor.LIME, + "lime", + Items.LIME_DYE, + Items.LIME_WOOL, + Items.LIME_BED, + Items.LIME_CARPET, + Items.LIME_STAINED_GLASS, + Items.LIME_STAINED_GLASS_PANE, + Items.LIME_TERRACOTTA, + Items.LIME_GLAZED_TERRACOTTA, + Items.LIME_CONCRETE, + Items.LIME_CONCRETE_POWDER, + Items.LIME_BANNER, + Items.LIME_SHULKER_BOX, + Blocks.LIME_WALL_BANNER); this.p( - DyeColor.MAGENTA, - "magenta", - Items.MAGENTA_DYE, - Items.MAGENTA_WOOL, - Items.MAGENTA_BED, - Items.MAGENTA_CARPET, - Items.MAGENTA_STAINED_GLASS, - Items.MAGENTA_STAINED_GLASS_PANE, - Items.MAGENTA_TERRACOTTA, - Items.MAGENTA_GLAZED_TERRACOTTA, - Items.MAGENTA_CONCRETE, - Items.MAGENTA_CONCRETE_POWDER, - Items.MAGENTA_BANNER, - Items.MAGENTA_SHULKER_BOX, - Blocks.MAGENTA_WALL_BANNER - ); + DyeColor.MAGENTA, + "magenta", + Items.MAGENTA_DYE, + Items.MAGENTA_WOOL, + Items.MAGENTA_BED, + Items.MAGENTA_CARPET, + Items.MAGENTA_STAINED_GLASS, + Items.MAGENTA_STAINED_GLASS_PANE, + Items.MAGENTA_TERRACOTTA, + Items.MAGENTA_GLAZED_TERRACOTTA, + Items.MAGENTA_CONCRETE, + Items.MAGENTA_CONCRETE_POWDER, + Items.MAGENTA_BANNER, + Items.MAGENTA_SHULKER_BOX, + Blocks.MAGENTA_WALL_BANNER); this.p( - DyeColor.ORANGE, - "orange", - Items.ORANGE_DYE, - Items.ORANGE_WOOL, - Items.ORANGE_BED, - Items.ORANGE_CARPET, - Items.ORANGE_STAINED_GLASS, - Items.ORANGE_STAINED_GLASS_PANE, - Items.ORANGE_TERRACOTTA, - Items.ORANGE_GLAZED_TERRACOTTA, - Items.ORANGE_CONCRETE, - Items.ORANGE_CONCRETE_POWDER, - Items.ORANGE_BANNER, - Items.ORANGE_SHULKER_BOX, - Blocks.ORANGE_WALL_BANNER - ); + DyeColor.ORANGE, + "orange", + Items.ORANGE_DYE, + Items.ORANGE_WOOL, + Items.ORANGE_BED, + Items.ORANGE_CARPET, + Items.ORANGE_STAINED_GLASS, + Items.ORANGE_STAINED_GLASS_PANE, + Items.ORANGE_TERRACOTTA, + Items.ORANGE_GLAZED_TERRACOTTA, + Items.ORANGE_CONCRETE, + Items.ORANGE_CONCRETE_POWDER, + Items.ORANGE_BANNER, + Items.ORANGE_SHULKER_BOX, + Blocks.ORANGE_WALL_BANNER); this.p( - DyeColor.PINK, - "pink", - Items.PINK_DYE, - Items.PINK_WOOL, - Items.PINK_BED, - Items.PINK_CARPET, - Items.PINK_STAINED_GLASS, - Items.PINK_STAINED_GLASS_PANE, - Items.PINK_TERRACOTTA, - Items.PINK_GLAZED_TERRACOTTA, - Items.PINK_CONCRETE, - Items.PINK_CONCRETE_POWDER, - Items.PINK_BANNER, - Items.PINK_SHULKER_BOX, - Blocks.PINK_WALL_BANNER - ); + DyeColor.PINK, + "pink", + Items.PINK_DYE, + Items.PINK_WOOL, + Items.PINK_BED, + Items.PINK_CARPET, + Items.PINK_STAINED_GLASS, + Items.PINK_STAINED_GLASS_PANE, + Items.PINK_TERRACOTTA, + Items.PINK_GLAZED_TERRACOTTA, + Items.PINK_CONCRETE, + Items.PINK_CONCRETE_POWDER, + Items.PINK_BANNER, + Items.PINK_SHULKER_BOX, + Blocks.PINK_WALL_BANNER); this.p( - DyeColor.PURPLE, - "purple", - Items.PURPLE_DYE, - Items.PURPLE_WOOL, - Items.PURPLE_BED, - Items.PURPLE_CARPET, - Items.PURPLE_STAINED_GLASS, - Items.PURPLE_STAINED_GLASS_PANE, - Items.PURPLE_TERRACOTTA, - Items.PURPLE_GLAZED_TERRACOTTA, - Items.PURPLE_CONCRETE, - Items.PURPLE_CONCRETE_POWDER, - Items.PURPLE_BANNER, - Items.PURPLE_SHULKER_BOX, - Blocks.PURPLE_WALL_BANNER - ); + DyeColor.PURPLE, + "purple", + Items.PURPLE_DYE, + Items.PURPLE_WOOL, + Items.PURPLE_BED, + Items.PURPLE_CARPET, + Items.PURPLE_STAINED_GLASS, + Items.PURPLE_STAINED_GLASS_PANE, + Items.PURPLE_TERRACOTTA, + Items.PURPLE_GLAZED_TERRACOTTA, + Items.PURPLE_CONCRETE, + Items.PURPLE_CONCRETE_POWDER, + Items.PURPLE_BANNER, + Items.PURPLE_SHULKER_BOX, + Blocks.PURPLE_WALL_BANNER); this.p( - DyeColor.RED, - "red", - Items.RED_DYE, - Items.RED_WOOL, - Items.RED_BED, - Items.RED_CARPET, - Items.RED_STAINED_GLASS, - Items.RED_STAINED_GLASS_PANE, - Items.RED_TERRACOTTA, - Items.RED_GLAZED_TERRACOTTA, - Items.RED_CONCRETE, - Items.RED_CONCRETE_POWDER, - Items.RED_BANNER, - Items.RED_SHULKER_BOX, - Blocks.RED_WALL_BANNER - ); + DyeColor.RED, + "red", + Items.RED_DYE, + Items.RED_WOOL, + Items.RED_BED, + Items.RED_CARPET, + Items.RED_STAINED_GLASS, + Items.RED_STAINED_GLASS_PANE, + Items.RED_TERRACOTTA, + Items.RED_GLAZED_TERRACOTTA, + Items.RED_CONCRETE, + Items.RED_CONCRETE_POWDER, + Items.RED_BANNER, + Items.RED_SHULKER_BOX, + Blocks.RED_WALL_BANNER); this.p( - DyeColor.YELLOW, - "yellow", - Items.YELLOW_DYE, - Items.YELLOW_WOOL, - Items.YELLOW_BED, - Items.YELLOW_CARPET, - Items.YELLOW_STAINED_GLASS, - Items.YELLOW_STAINED_GLASS_PANE, - Items.YELLOW_TERRACOTTA, - Items.YELLOW_GLAZED_TERRACOTTA, - Items.YELLOW_CONCRETE, - Items.YELLOW_CONCRETE_POWDER, - Items.YELLOW_BANNER, - Items.YELLOW_SHULKER_BOX, - Blocks.YELLOW_WALL_BANNER - ); + DyeColor.YELLOW, + "yellow", + Items.YELLOW_DYE, + Items.YELLOW_WOOL, + Items.YELLOW_BED, + Items.YELLOW_CARPET, + Items.YELLOW_STAINED_GLASS, + Items.YELLOW_STAINED_GLASS_PANE, + Items.YELLOW_TERRACOTTA, + Items.YELLOW_GLAZED_TERRACOTTA, + Items.YELLOW_CONCRETE, + Items.YELLOW_CONCRETE_POWDER, + Items.YELLOW_BANNER, + Items.YELLOW_SHULKER_BOX, + Blocks.YELLOW_WALL_BANNER); } void p( - DyeColor color, - String colorName, - Item dye, - Item wool, - Item bed, - Item carpet, - Item stainedGlass, - Item stainedGlassPane, - Item terracotta, - Item glazedTerracotta, - Item concrete, - Item concretePowder, - Item banner, - Item shulker, - Block wallBanner - ) { + DyeColor color, + String colorName, + Item dye, + Item wool, + Item bed, + Item carpet, + Item stainedGlass, + Item stainedGlassPane, + Item terracotta, + Item glazedTerracotta, + Item concrete, + Item concretePowder, + Item banner, + Item shulker, + Block wallBanner) { this.put( - color.getMapColor(), - new ItemHelper.ColorfulItems( - color, - colorName, - dye, - wool, - bed, - carpet, - stainedGlass, - stainedGlassPane, - terracotta, - glazedTerracotta, - concrete, - concretePowder, - banner, - shulker, - wallBanner - ) - ); + color.getMapColor(), + new ItemHelper.ColorfulItems( + color, + colorName, + dye, + wool, + bed, + carpet, + stainedGlass, + stainedGlassPane, + terracotta, + glazedTerracotta, + concrete, + concretePowder, + banner, + shulker, + wallBanner)); } }; private static final Map woodMap = new HashMap() { { this.p( - WoodType.CHERRY, - "cherry", - Items.CHERRY_PLANKS, - Items.CHERRY_LOG, - Items.STRIPPED_CHERRY_LOG, - Items.STRIPPED_CHERRY_WOOD, - Items.CHERRY_WOOD, - Items.CHERRY_SIGN, - Items.CHERRY_HANGING_SIGN, - Items.CHERRY_DOOR, - Items.CHERRY_BUTTON, - Items.CHERRY_STAIRS, - Items.CHERRY_SLAB, - Items.CHERRY_FENCE, - Items.CHERRY_FENCE_GATE, - Items.CHERRY_BOAT, - Items.CHERRY_SAPLING, - Items.CHERRY_LEAVES, - Items.CHERRY_PRESSURE_PLATE, - Items.CHERRY_TRAPDOOR - ); + WoodType.CHERRY, + "cherry", + Items.CHERRY_PLANKS, + Items.CHERRY_LOG, + Items.STRIPPED_CHERRY_LOG, + Items.STRIPPED_CHERRY_WOOD, + Items.CHERRY_WOOD, + Items.CHERRY_SIGN, + Items.CHERRY_HANGING_SIGN, + Items.CHERRY_DOOR, + Items.CHERRY_BUTTON, + Items.CHERRY_STAIRS, + Items.CHERRY_SLAB, + Items.CHERRY_FENCE, + Items.CHERRY_FENCE_GATE, + Items.CHERRY_BOAT, + Items.CHERRY_SAPLING, + Items.CHERRY_LEAVES, + Items.CHERRY_PRESSURE_PLATE, + Items.CHERRY_TRAPDOOR); this.p( - WoodType.BAMBOO, - "bamboo", - null, - null, - Items.STRIPPED_BAMBOO_BLOCK, - null, - null, - Items.BAMBOO_SIGN, - Items.BAMBOO_HANGING_SIGN, - Items.BAMBOO_DOOR, - Items.BAMBOO_BUTTON, - Items.BAMBOO_STAIRS, - Items.BAMBOO_SLAB, - Items.BAMBOO_FENCE, - Items.BAMBOO_FENCE_GATE, - Items.BAMBOO_RAFT, - Items.BAMBOO, - null, - Items.BAMBOO_PRESSURE_PLATE, - Items.BAMBOO_TRAPDOOR - ); + WoodType.BAMBOO, + "bamboo", + null, + null, + Items.STRIPPED_BAMBOO_BLOCK, + null, + null, + Items.BAMBOO_SIGN, + Items.BAMBOO_HANGING_SIGN, + Items.BAMBOO_DOOR, + Items.BAMBOO_BUTTON, + Items.BAMBOO_STAIRS, + Items.BAMBOO_SLAB, + Items.BAMBOO_FENCE, + Items.BAMBOO_FENCE_GATE, + Items.BAMBOO_RAFT, + Items.BAMBOO, + null, + Items.BAMBOO_PRESSURE_PLATE, + Items.BAMBOO_TRAPDOOR); this.p( - WoodType.MANGROVE, - "mangrove", - Items.MANGROVE_PLANKS, - Items.MANGROVE_LOG, - Items.STRIPPED_MANGROVE_LOG, - Items.STRIPPED_MANGROVE_WOOD, - Items.MANGROVE_WOOD, - Items.MANGROVE_SIGN, - Items.MANGROVE_HANGING_SIGN, - Items.MANGROVE_DOOR, - Items.MANGROVE_BUTTON, - Items.MANGROVE_STAIRS, - Items.MANGROVE_SLAB, - Items.MANGROVE_FENCE, - Items.MANGROVE_FENCE_GATE, - Items.MANGROVE_BOAT, - Items.MANGROVE_PROPAGULE, - Items.MANGROVE_LEAVES, - Items.MANGROVE_PRESSURE_PLATE, - Items.MANGROVE_TRAPDOOR - ); + WoodType.MANGROVE, + "mangrove", + Items.MANGROVE_PLANKS, + Items.MANGROVE_LOG, + Items.STRIPPED_MANGROVE_LOG, + Items.STRIPPED_MANGROVE_WOOD, + Items.MANGROVE_WOOD, + Items.MANGROVE_SIGN, + Items.MANGROVE_HANGING_SIGN, + Items.MANGROVE_DOOR, + Items.MANGROVE_BUTTON, + Items.MANGROVE_STAIRS, + Items.MANGROVE_SLAB, + Items.MANGROVE_FENCE, + Items.MANGROVE_FENCE_GATE, + Items.MANGROVE_BOAT, + Items.MANGROVE_PROPAGULE, + Items.MANGROVE_LEAVES, + Items.MANGROVE_PRESSURE_PLATE, + Items.MANGROVE_TRAPDOOR); this.p( - WoodType.ACACIA, - "acacia", - Items.ACACIA_PLANKS, - Items.ACACIA_LOG, - Items.STRIPPED_ACACIA_LOG, - Items.STRIPPED_ACACIA_WOOD, - Items.ACACIA_WOOD, - Items.ACACIA_SIGN, - Items.ACACIA_HANGING_SIGN, - Items.ACACIA_DOOR, - Items.ACACIA_BUTTON, - Items.ACACIA_STAIRS, - Items.ACACIA_SLAB, - Items.ACACIA_FENCE, - Items.ACACIA_FENCE_GATE, - Items.ACACIA_BOAT, - Items.ACACIA_SAPLING, - Items.ACACIA_LEAVES, - Items.ACACIA_PRESSURE_PLATE, - Items.ACACIA_TRAPDOOR - ); + WoodType.ACACIA, + "acacia", + Items.ACACIA_PLANKS, + Items.ACACIA_LOG, + Items.STRIPPED_ACACIA_LOG, + Items.STRIPPED_ACACIA_WOOD, + Items.ACACIA_WOOD, + Items.ACACIA_SIGN, + Items.ACACIA_HANGING_SIGN, + Items.ACACIA_DOOR, + Items.ACACIA_BUTTON, + Items.ACACIA_STAIRS, + Items.ACACIA_SLAB, + Items.ACACIA_FENCE, + Items.ACACIA_FENCE_GATE, + Items.ACACIA_BOAT, + Items.ACACIA_SAPLING, + Items.ACACIA_LEAVES, + Items.ACACIA_PRESSURE_PLATE, + Items.ACACIA_TRAPDOOR); this.p( - WoodType.BIRCH, - "birch", - Items.BIRCH_PLANKS, - Items.BIRCH_LOG, - Items.STRIPPED_BIRCH_LOG, - Items.STRIPPED_BIRCH_WOOD, - Items.BIRCH_WOOD, - Items.BIRCH_SIGN, - Items.BIRCH_HANGING_SIGN, - Items.BIRCH_DOOR, - Items.BIRCH_BUTTON, - Items.BIRCH_STAIRS, - Items.BIRCH_SLAB, - Items.BIRCH_FENCE, - Items.BIRCH_FENCE_GATE, - Items.BIRCH_BOAT, - Items.BIRCH_SAPLING, - Items.BIRCH_LEAVES, - Items.BIRCH_PRESSURE_PLATE, - Items.BIRCH_TRAPDOOR - ); + WoodType.BIRCH, + "birch", + Items.BIRCH_PLANKS, + Items.BIRCH_LOG, + Items.STRIPPED_BIRCH_LOG, + Items.STRIPPED_BIRCH_WOOD, + Items.BIRCH_WOOD, + Items.BIRCH_SIGN, + Items.BIRCH_HANGING_SIGN, + Items.BIRCH_DOOR, + Items.BIRCH_BUTTON, + Items.BIRCH_STAIRS, + Items.BIRCH_SLAB, + Items.BIRCH_FENCE, + Items.BIRCH_FENCE_GATE, + Items.BIRCH_BOAT, + Items.BIRCH_SAPLING, + Items.BIRCH_LEAVES, + Items.BIRCH_PRESSURE_PLATE, + Items.BIRCH_TRAPDOOR); this.p( - WoodType.CRIMSON, - "crimson", - Items.CRIMSON_PLANKS, - Items.CRIMSON_STEM, - Items.STRIPPED_CRIMSON_STEM, - Items.STRIPPED_CRIMSON_HYPHAE, - Items.CRIMSON_HYPHAE, - Items.CRIMSON_SIGN, - Items.CRIMSON_HANGING_SIGN, - Items.CRIMSON_DOOR, - Items.CRIMSON_BUTTON, - Items.CRIMSON_STAIRS, - Items.CRIMSON_SLAB, - Items.CRIMSON_FENCE, - Items.CRIMSON_FENCE_GATE, - null, - Items.CRIMSON_FUNGUS, - null, - Items.CRIMSON_PRESSURE_PLATE, - Items.CRIMSON_TRAPDOOR - ); + WoodType.CRIMSON, + "crimson", + Items.CRIMSON_PLANKS, + Items.CRIMSON_STEM, + Items.STRIPPED_CRIMSON_STEM, + Items.STRIPPED_CRIMSON_HYPHAE, + Items.CRIMSON_HYPHAE, + Items.CRIMSON_SIGN, + Items.CRIMSON_HANGING_SIGN, + Items.CRIMSON_DOOR, + Items.CRIMSON_BUTTON, + Items.CRIMSON_STAIRS, + Items.CRIMSON_SLAB, + Items.CRIMSON_FENCE, + Items.CRIMSON_FENCE_GATE, + null, + Items.CRIMSON_FUNGUS, + null, + Items.CRIMSON_PRESSURE_PLATE, + Items.CRIMSON_TRAPDOOR); this.p( - WoodType.DARK_OAK, - "dark_oak", - Items.DARK_OAK_PLANKS, - Items.DARK_OAK_LOG, - Items.STRIPPED_DARK_OAK_LOG, - Items.STRIPPED_DARK_OAK_WOOD, - Items.DARK_OAK_WOOD, - Items.DARK_OAK_SIGN, - Items.DARK_OAK_HANGING_SIGN, - Items.DARK_OAK_DOOR, - Items.DARK_OAK_BUTTON, - Items.DARK_OAK_STAIRS, - Items.DARK_OAK_SLAB, - Items.DARK_OAK_FENCE, - Items.DARK_OAK_FENCE_GATE, - Items.DARK_OAK_BOAT, - Items.DARK_OAK_SAPLING, - Items.DARK_OAK_LEAVES, - Items.DARK_OAK_PRESSURE_PLATE, - Items.DARK_OAK_TRAPDOOR - ); + WoodType.DARK_OAK, + "dark_oak", + Items.DARK_OAK_PLANKS, + Items.DARK_OAK_LOG, + Items.STRIPPED_DARK_OAK_LOG, + Items.STRIPPED_DARK_OAK_WOOD, + Items.DARK_OAK_WOOD, + Items.DARK_OAK_SIGN, + Items.DARK_OAK_HANGING_SIGN, + Items.DARK_OAK_DOOR, + Items.DARK_OAK_BUTTON, + Items.DARK_OAK_STAIRS, + Items.DARK_OAK_SLAB, + Items.DARK_OAK_FENCE, + Items.DARK_OAK_FENCE_GATE, + Items.DARK_OAK_BOAT, + Items.DARK_OAK_SAPLING, + Items.DARK_OAK_LEAVES, + Items.DARK_OAK_PRESSURE_PLATE, + Items.DARK_OAK_TRAPDOOR); this.p( - WoodType.OAK, - "oak", - Items.OAK_PLANKS, - Items.OAK_LOG, - Items.STRIPPED_OAK_LOG, - Items.STRIPPED_OAK_WOOD, - Items.OAK_WOOD, - Items.OAK_SIGN, - Items.OAK_HANGING_SIGN, - Items.OAK_DOOR, - Items.OAK_BUTTON, - Items.OAK_STAIRS, - Items.OAK_SLAB, - Items.OAK_FENCE, - Items.OAK_FENCE_GATE, - Items.OAK_BOAT, - Items.OAK_SAPLING, - Items.OAK_LEAVES, - Items.OAK_PRESSURE_PLATE, - Items.OAK_TRAPDOOR - ); + WoodType.OAK, + "oak", + Items.OAK_PLANKS, + Items.OAK_LOG, + Items.STRIPPED_OAK_LOG, + Items.STRIPPED_OAK_WOOD, + Items.OAK_WOOD, + Items.OAK_SIGN, + Items.OAK_HANGING_SIGN, + Items.OAK_DOOR, + Items.OAK_BUTTON, + Items.OAK_STAIRS, + Items.OAK_SLAB, + Items.OAK_FENCE, + Items.OAK_FENCE_GATE, + Items.OAK_BOAT, + Items.OAK_SAPLING, + Items.OAK_LEAVES, + Items.OAK_PRESSURE_PLATE, + Items.OAK_TRAPDOOR); this.p( - WoodType.JUNGLE, - "jungle", - Items.JUNGLE_PLANKS, - Items.JUNGLE_LOG, - Items.STRIPPED_JUNGLE_LOG, - Items.STRIPPED_JUNGLE_WOOD, - Items.JUNGLE_WOOD, - Items.JUNGLE_SIGN, - Items.JUNGLE_HANGING_SIGN, - Items.JUNGLE_DOOR, - Items.JUNGLE_BUTTON, - Items.JUNGLE_STAIRS, - Items.JUNGLE_SLAB, - Items.JUNGLE_FENCE, - Items.JUNGLE_FENCE_GATE, - Items.JUNGLE_BOAT, - Items.JUNGLE_SAPLING, - Items.JUNGLE_LEAVES, - Items.JUNGLE_PRESSURE_PLATE, - Items.JUNGLE_TRAPDOOR - ); + WoodType.JUNGLE, + "jungle", + Items.JUNGLE_PLANKS, + Items.JUNGLE_LOG, + Items.STRIPPED_JUNGLE_LOG, + Items.STRIPPED_JUNGLE_WOOD, + Items.JUNGLE_WOOD, + Items.JUNGLE_SIGN, + Items.JUNGLE_HANGING_SIGN, + Items.JUNGLE_DOOR, + Items.JUNGLE_BUTTON, + Items.JUNGLE_STAIRS, + Items.JUNGLE_SLAB, + Items.JUNGLE_FENCE, + Items.JUNGLE_FENCE_GATE, + Items.JUNGLE_BOAT, + Items.JUNGLE_SAPLING, + Items.JUNGLE_LEAVES, + Items.JUNGLE_PRESSURE_PLATE, + Items.JUNGLE_TRAPDOOR); this.p( - WoodType.SPRUCE, - "spruce", - Items.SPRUCE_PLANKS, - Items.SPRUCE_LOG, - Items.STRIPPED_SPRUCE_LOG, - Items.STRIPPED_SPRUCE_WOOD, - Items.SPRUCE_WOOD, - Items.SPRUCE_SIGN, - Items.SPRUCE_HANGING_SIGN, - Items.SPRUCE_DOOR, - Items.SPRUCE_BUTTON, - Items.SPRUCE_STAIRS, - Items.SPRUCE_SLAB, - Items.SPRUCE_FENCE, - Items.SPRUCE_FENCE_GATE, - Items.SPRUCE_BOAT, - Items.SPRUCE_SAPLING, - Items.SPRUCE_LEAVES, - Items.SPRUCE_PRESSURE_PLATE, - Items.SPRUCE_TRAPDOOR - ); + WoodType.SPRUCE, + "spruce", + Items.SPRUCE_PLANKS, + Items.SPRUCE_LOG, + Items.STRIPPED_SPRUCE_LOG, + Items.STRIPPED_SPRUCE_WOOD, + Items.SPRUCE_WOOD, + Items.SPRUCE_SIGN, + Items.SPRUCE_HANGING_SIGN, + Items.SPRUCE_DOOR, + Items.SPRUCE_BUTTON, + Items.SPRUCE_STAIRS, + Items.SPRUCE_SLAB, + Items.SPRUCE_FENCE, + Items.SPRUCE_FENCE_GATE, + Items.SPRUCE_BOAT, + Items.SPRUCE_SAPLING, + Items.SPRUCE_LEAVES, + Items.SPRUCE_PRESSURE_PLATE, + Items.SPRUCE_TRAPDOOR); this.p( - WoodType.WARPED, - "warped", - Items.WARPED_PLANKS, - Items.WARPED_STEM, - Items.STRIPPED_WARPED_STEM, - Items.STRIPPED_WARPED_HYPHAE, - Items.WARPED_HYPHAE, - Items.WARPED_SIGN, - Items.WARPED_HANGING_SIGN, - Items.WARPED_DOOR, - Items.WARPED_BUTTON, - Items.WARPED_STAIRS, - Items.WARPED_SLAB, - Items.WARPED_FENCE, - Items.WARPED_FENCE_GATE, - null, - Items.WARPED_FUNGUS, - null, - Items.WARPED_PRESSURE_PLATE, - Items.WARPED_TRAPDOOR - ); + WoodType.WARPED, + "warped", + Items.WARPED_PLANKS, + Items.WARPED_STEM, + Items.STRIPPED_WARPED_STEM, + Items.STRIPPED_WARPED_HYPHAE, + Items.WARPED_HYPHAE, + Items.WARPED_SIGN, + Items.WARPED_HANGING_SIGN, + Items.WARPED_DOOR, + Items.WARPED_BUTTON, + Items.WARPED_STAIRS, + Items.WARPED_SLAB, + Items.WARPED_FENCE, + Items.WARPED_FENCE_GATE, + null, + Items.WARPED_FUNGUS, + null, + Items.WARPED_PRESSURE_PLATE, + Items.WARPED_TRAPDOOR); } void p( - WoodType type, - String prefix, - Item planks, - Item log, - Item strippedLog, - Item strippedWood, - Item wood, - Item sign, - Item hangingSign, - Item door, - Item button, - Item stairs, - Item slab, - Item fence, - Item fenceGate, - Item boat, - Item sapling, - Item leaves, - Item pressurePlate, - Item trapdoor - ) { + WoodType type, + String prefix, + Item planks, + Item log, + Item strippedLog, + Item strippedWood, + Item wood, + Item sign, + Item hangingSign, + Item door, + Item button, + Item stairs, + Item slab, + Item fence, + Item fenceGate, + Item boat, + Item sapling, + Item leaves, + Item pressurePlate, + Item trapdoor) { this.put( - type, - new ItemHelper.WoodItems( - prefix, - planks, - log, - strippedLog, - strippedWood, - wood, - sign, - hangingSign, - door, - button, - stairs, - slab, - fence, - fenceGate, - boat, - sapling, - leaves, - pressurePlate, - trapdoor - ) - ); + type, + new ItemHelper.WoodItems( + prefix, + planks, + log, + strippedLog, + strippedWood, + wood, + sign, + hangingSign, + door, + button, + stairs, + slab, + fence, + fenceGate, + boat, + sapling, + leaves, + pressurePlate, + trapdoor)); } }; public static final HashMap cookableFoodMap = new HashMap() { @@ -1176,7 +1155,7 @@ void p( private static Map fuelTimeMap = null; public static String stripItemName(Item item) { - String[] possibilities = new String[]{"item.minecraft.", "block.minecraft."}; + String[] possibilities = new String[] { "item.minecraft.", "block.minecraft." }; for (String possible : possibilities) { if (item.getDescriptionId().startsWith(possible)) { @@ -1248,6 +1227,16 @@ public static Optional getCookedFood(Item rawFood) { return Optional.ofNullable(cookableFoodMap.getOrDefault(rawFood, null)); } + public static Optional fromString(String name) { + String itemKey = trimItemName(name); + ResourceLocation identifier = new ResourceLocation(itemKey); + if (BuiltInRegistries.ITEM.containsKey(identifier)) { + return Optional.of((Item) BuiltInRegistries.ITEM.get(identifier)); + } else { + return Optional.empty(); + } + } + public static String trimItemName(String name) { if (name.startsWith("block.minecraft.")) { name = name.substring("block.minecraft.".length()); @@ -1260,16 +1249,16 @@ public static String trimItemName(String name) { public static boolean areShearsEffective(Block b) { return b instanceof LeavesBlock - || b == Blocks.COBWEB - || b == Blocks.GRASS - || b == Blocks.TALL_GRASS - || b == Blocks.LILY_PAD - || b == Blocks.FERN - || b == Blocks.DEAD_BUSH - || b == Blocks.VINE - || b == Blocks.TRIPWIRE - || BlockTagVer.isWool(b) - || b == Blocks.NETHER_SPROUTS; + || b == Blocks.COBWEB + || b == Blocks.GRASS + || b == Blocks.TALL_GRASS + || b == Blocks.LILY_PAD + || b == Blocks.FERN + || b == Blocks.DEAD_BUSH + || b == Blocks.VINE + || b == Blocks.TRIPWIRE + || BlockTagVer.isWool(b) + || b == Blocks.NETHER_SPROUTS; } private static boolean isStackProtected(AltoClefController mod, ItemStack stack) { @@ -1277,8 +1266,8 @@ private static boolean isStackProtected(AltoClefController mod, ItemStack stack) return true; } else { return ItemVer.hasCustomName(stack) && mod.getModSettings().getDontThrowAwayCustomNameItems() - ? true - : mod.getBehaviour().isProtected(stack.getItem()) || mod.getModSettings().isImportant(stack.getItem()); + ? true + : mod.getBehaviour().isProtected(stack.getItem()) || mod.getModSettings().isImportant(stack.getItem()); } } @@ -1286,14 +1275,15 @@ public static boolean canThrowAwayStack(AltoClefController mod, ItemStack stack) if (stack.isEmpty()) { return false; } else { - return isStackProtected(mod, stack) ? false : mod.getModSettings().isThrowaway(stack.getItem()) || mod.getModSettings().shouldThrowawayUnusedItems(); + return isStackProtected(mod, stack) ? false + : mod.getModSettings().isThrowaway(stack.getItem()) || mod.getModSettings().shouldThrowawayUnusedItems(); } } public static boolean canStackTogether(ItemStack from, ItemStack to) { return to.isEmpty() && from.getCount() <= from.getMaxStackSize() - ? true - : to.getItem().equals(from.getItem()) && from.getCount() + to.getCount() < to.getMaxStackSize(); + ? true + : to.getItem().equals(from.getItem()) && from.getCount() + to.getCount() < to.getMaxStackSize(); } private static Map getFuelTimeMap() { @@ -1347,22 +1337,21 @@ public static class ColorfulItems { public Block wallBanner; public ColorfulItems( - DyeColor color, - String colorName, - Item dye, - Item wool, - Item bed, - Item carpet, - Item stainedGlass, - Item stainedGlassPane, - Item terracotta, - Item glazedTerracotta, - Item concrete, - Item concretePowder, - Item banner, - Item shulker, - Block wallBanner - ) { + DyeColor color, + String colorName, + Item dye, + Item wool, + Item bed, + Item carpet, + Item stainedGlass, + Item stainedGlassPane, + Item terracotta, + Item glazedTerracotta, + Item concrete, + Item concretePowder, + Item banner, + Item shulker, + Block wallBanner) { this.color = color; this.colorName = colorName; this.dye = dye; @@ -1403,26 +1392,25 @@ public static class WoodItems { public Item trapdoor; public WoodItems( - String prefix, - Item planks, - Item log, - Item strippedLog, - Item strippedWood, - Item wood, - Item sign, - Item hangingSign, - Item door, - Item button, - Item stairs, - Item slab, - Item fence, - Item fenceGate, - Item boat, - Item sapling, - Item leaves, - Item pressurePlate, - Item trapdoor - ) { + String prefix, + Item planks, + Item log, + Item strippedLog, + Item strippedWood, + Item wood, + Item sign, + Item hangingSign, + Item door, + Item button, + Item stairs, + Item slab, + Item fence, + Item fenceGate, + Item boat, + Item sapling, + Item leaves, + Item pressurePlate, + Item trapdoor) { this.prefix = prefix; this.planks = planks; this.log = log;