From 32cbdbebc850f06944904de0fff4ce755d236767 Mon Sep 17 00:00:00 2001 From: trinsdar <30245301+Trinsdar@users.noreply.github.com> Date: Fri, 20 Oct 2023 00:11:00 -0400 Subject: [PATCH] added lombok --- common/build.gradle | 3 + .../data/AntimatterDefaultTools.java | 40 +-- .../antimatter/material/Material.java | 37 +-- .../antimatter/material/lombok.config | 1 + .../antimatter/tool/AntimatterToolType.java | 246 ++++-------------- .../muramasa/antimatter/tool/lombok.config | 1 + 6 files changed, 87 insertions(+), 241 deletions(-) create mode 100644 common/src/main/java/muramasa/antimatter/material/lombok.config create mode 100644 common/src/main/java/muramasa/antimatter/tool/lombok.config diff --git a/common/build.gradle b/common/build.gradle index 72819b437..f7352090e 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -40,6 +40,9 @@ dependencies{ modImplementation("earth.terrarium:botarium-common-1.18.2:${project.botarium_version}") modImplementation "com.teamresourceful.resourcefullib:resourcefullib-common-1.18.2:${project.resourcefullib_version}" + compileOnly 'org.projectlombok:lombok:1.18.24' + annotationProcessor 'org.projectlombok:lombok:1.18.24' + } architectury { diff --git a/common/src/main/java/muramasa/antimatter/data/AntimatterDefaultTools.java b/common/src/main/java/muramasa/antimatter/data/AntimatterDefaultTools.java index cd20e319f..609941607 100644 --- a/common/src/main/java/muramasa/antimatter/data/AntimatterDefaultTools.java +++ b/common/src/main/java/muramasa/antimatter/data/AntimatterDefaultTools.java @@ -21,28 +21,28 @@ import static net.minecraft.world.level.material.Material.*; public class AntimatterDefaultTools { - public static final AntimatterToolType SWORD = AntimatterAPI.register(AntimatterToolType.class, new AntimatterToolType(Ref.ID, "sword", 2, 1, 10, 3.0F, -2.4F, false)).setToolClass(MaterialSword.class).addEffectiveBlocks(Blocks.COBWEB).setHasContainer(false).setMaterialType(SWORD_HEAD); - public static final AntimatterToolType PICKAXE = AntimatterAPI.register(AntimatterToolType.class, new AntimatterToolType(Ref.ID, "pickaxe", 1, 2, 10, 1.0F, -2.8F, true)).addEffectiveMaterials(ICE_SOLID, PISTON).setHasContainer(false).setMaterialType(PICKAXE_HEAD); - public static final AntimatterToolType DRILL = AntimatterAPI.register(AntimatterToolType.class, new AntimatterToolType(Ref.ID, "drill", 2, 2, 10, 3.0F, -3.0F, false)).setType(PICKAXE).setUseAction(UseAnim.BLOCK).setPowered(100000, 1, 2, 3).setMaterialType(DRILLBIT).setUseSound(Ref.DRILL).addTags("pickaxe", "shovel").addEffectiveMaterials(ICE_SOLID, PISTON, DIRT, CLAY, GRASS, SAND).setRepairability(false); - public static final AntimatterToolType SHOVEL = AntimatterAPI.register(AntimatterToolType.class, new AntimatterToolType(Ref.ID, "shovel", 1, 2, 10, 1.5F, -3.0F, true)).addEffectiveMaterials(CLAY, SAND, TOP_SNOW, SNOW, DIRT).setHasContainer(false).setMaterialType(SHOVEL_HEAD); - public static final AntimatterToolType AXE = AntimatterAPI.register(AntimatterToolType.class, new AntimatterToolType(Ref.ID, "axe", 1, 1, 10, 6.0F, -3.0F, true)).addEffectiveMaterials(PLANT, REPLACEABLE_PLANT, BAMBOO).setHasContainer(false).setMaterialType(AXE_HEAD); - public static final AntimatterToolType HOE = AntimatterAPI.register(AntimatterToolType.class, new AntimatterToolType(Ref.ID, "hoe", 1, 2, 10, -2.0F, -1.0F, true)).setHasContainer(false).setMaterialType(HOE_HEAD); - public static final AntimatterToolType HAMMER = AntimatterAPI.register(AntimatterToolType.class, new AntimatterToolType(Ref.ID, "hammer", 1, 2, 2, 3.0F, -3.0F, false)).addTags("pickaxe").addEffectiveMaterials(net.minecraft.world.level.material.Material.METAL, STONE).setUseSound(SoundEvents.ANVIL_PLACE).setRepairability(false); - public static final AntimatterToolType WRENCH = AntimatterAPI.register(AntimatterToolType.class, new AntimatterToolType(Ref.ID, "wrench", 2, 2, 2, 1.5F, -2.8F, false)).setUseSound(Ref.WRENCH).addEffectiveBlocks(Blocks.HOPPER).setHasSecondary(false).setOverlayLayers(0).setRepairability(false); - public static final AntimatterToolType ELECTRIC_WRENCH = AntimatterAPI.register(AntimatterToolType.class, new AntimatterToolType(Ref.ID, "electric_wrench", WRENCH).setTag(WRENCH).setPowered(100000, 1, 2, 3)).setUseSound(Ref.WRENCH).addEffectiveBlocks(Blocks.HOPPER).addTags("wrench").setMaterialType(WRENCHBIT); - public static final AntimatterToolType SAW = AntimatterAPI.register(AntimatterToolType.class, new AntimatterToolType(Ref.ID, "saw", 2, 2, 2, 2.0F, -2.8F, false)).addEffectiveBlocks(Blocks.ICE, Blocks.PACKED_ICE, Blocks.BLUE_ICE).setRepairability(false).setMaterialType(SAW_HEAD); - public static final AntimatterToolType BUZZSAW = AntimatterAPI.register(AntimatterToolType.class, new AntimatterToolType(Ref.ID, "buzzsaw", 2, 2, 2, 0.5F, -2.7F, false)).setTag(SAW).setPowered(100000, 1, 2, 3).setOverlayLayers(2).addTags("saw").setMaterialType(SAW_HEAD); - public static final AntimatterToolType FILE = AntimatterAPI.register(AntimatterToolType.class, new AntimatterToolType(Ref.ID, "file", 2, 2, 2, -2.0F, -2.4F, false)).setRepairability(false).setMaterialType(FILE_HEAD); - public static final AntimatterToolType CROWBAR = AntimatterAPI.register(AntimatterToolType.class, new AntimatterToolType(Ref.ID, "crowbar", 2, 10, 5, 1.0F, -2.0F, false)).setUseSound(SoundEvents.ITEM_BREAK).setHasSecondary(false).setRepairability(false); - public static final AntimatterToolType SOFT_HAMMER = AntimatterAPI.register(AntimatterToolType.class, new AntimatterToolType(Ref.ID, "soft_hammer", 2, 2, 2, 1.0F, -3.0F, false)).setRepairability(false).setPrimaryRequirement(MaterialTags.RUBBERTOOLS);//.setUseSound(); - public static final AntimatterToolType SCREWDRIVER = AntimatterAPI.register(AntimatterToolType.class, new AntimatterToolType(Ref.ID, "screwdriver", 2, 2, 2, 0.0F, -1.0F, false)).setUseSound(Ref.WRENCH).setRepairability(false); + public static final AntimatterToolType SWORD = AntimatterAPI.register(AntimatterToolType.class, new AntimatterToolType(Ref.ID, "sword", 2, 1, 10, 3.0F, -2.4F, false)).setToolClass(MaterialSword.class).addEffectiveBlocks(Blocks.COBWEB).setHasContainer(false).setMaterialTypeItem(SWORD_HEAD); + public static final AntimatterToolType PICKAXE = AntimatterAPI.register(AntimatterToolType.class, new AntimatterToolType(Ref.ID, "pickaxe", 1, 2, 10, 1.0F, -2.8F, true)).addEffectiveMaterials(ICE_SOLID, PISTON).setHasContainer(false).setMaterialTypeItem(PICKAXE_HEAD); + public static final AntimatterToolType DRILL = AntimatterAPI.register(AntimatterToolType.class, new AntimatterToolType(Ref.ID, "drill", 2, 2, 10, 3.0F, -3.0F, false)).setType(PICKAXE).setUseAction(UseAnim.BLOCK).setPowered(100000, 1, 2, 3).setMaterialTypeItem(DRILLBIT).setUseSound(Ref.DRILL).addTags("pickaxe", "shovel").addEffectiveMaterials(ICE_SOLID, PISTON, DIRT, CLAY, GRASS, SAND).setRepairable(false); + public static final AntimatterToolType SHOVEL = AntimatterAPI.register(AntimatterToolType.class, new AntimatterToolType(Ref.ID, "shovel", 1, 2, 10, 1.5F, -3.0F, true)).addEffectiveMaterials(CLAY, SAND, TOP_SNOW, SNOW, DIRT).setHasContainer(false).setMaterialTypeItem(SHOVEL_HEAD); + public static final AntimatterToolType AXE = AntimatterAPI.register(AntimatterToolType.class, new AntimatterToolType(Ref.ID, "axe", 1, 1, 10, 6.0F, -3.0F, true)).addEffectiveMaterials(PLANT, REPLACEABLE_PLANT, BAMBOO).setHasContainer(false).setMaterialTypeItem(AXE_HEAD); + public static final AntimatterToolType HOE = AntimatterAPI.register(AntimatterToolType.class, new AntimatterToolType(Ref.ID, "hoe", 1, 2, 10, -2.0F, -1.0F, true)).setHasContainer(false).setMaterialTypeItem(HOE_HEAD); + public static final AntimatterToolType HAMMER = AntimatterAPI.register(AntimatterToolType.class, new AntimatterToolType(Ref.ID, "hammer", 1, 2, 2, 3.0F, -3.0F, false)).addTags("pickaxe").addEffectiveMaterials(net.minecraft.world.level.material.Material.METAL, STONE).setUseSound(SoundEvents.ANVIL_PLACE).setRepairable(false); + public static final AntimatterToolType WRENCH = AntimatterAPI.register(AntimatterToolType.class, new AntimatterToolType(Ref.ID, "wrench", 2, 2, 2, 1.5F, -2.8F, false)).setUseSound(Ref.WRENCH).addEffectiveBlocks(Blocks.HOPPER).setHasSecondary(false).setOverlayLayers(0).setRepairable(false); + public static final AntimatterToolType ELECTRIC_WRENCH = AntimatterAPI.register(AntimatterToolType.class, new AntimatterToolType(Ref.ID, "electric_wrench", WRENCH).setTag(WRENCH).setPowered(100000, 1, 2, 3)).setUseSound(Ref.WRENCH).addEffectiveBlocks(Blocks.HOPPER).addTags("wrench").setMaterialTypeItem(WRENCHBIT); + public static final AntimatterToolType SAW = AntimatterAPI.register(AntimatterToolType.class, new AntimatterToolType(Ref.ID, "saw", 2, 2, 2, 2.0F, -2.8F, false)).addEffectiveBlocks(Blocks.ICE, Blocks.PACKED_ICE, Blocks.BLUE_ICE).setRepairable(false).setMaterialTypeItem(SAW_HEAD); + public static final AntimatterToolType BUZZSAW = AntimatterAPI.register(AntimatterToolType.class, new AntimatterToolType(Ref.ID, "buzzsaw", 2, 2, 2, 0.5F, -2.7F, false)).setTag(SAW).setPowered(100000, 1, 2, 3).setOverlayLayers(2).addTags("saw").setMaterialTypeItem(SAW_HEAD); + public static final AntimatterToolType FILE = AntimatterAPI.register(AntimatterToolType.class, new AntimatterToolType(Ref.ID, "file", 2, 2, 2, -2.0F, -2.4F, false)).setRepairable(false).setMaterialTypeItem(FILE_HEAD); + public static final AntimatterToolType CROWBAR = AntimatterAPI.register(AntimatterToolType.class, new AntimatterToolType(Ref.ID, "crowbar", 2, 10, 5, 1.0F, -2.0F, false)).setUseSound(SoundEvents.ITEM_BREAK).setHasSecondary(false).setRepairable(false); + public static final AntimatterToolType SOFT_HAMMER = AntimatterAPI.register(AntimatterToolType.class, new AntimatterToolType(Ref.ID, "soft_hammer", 2, 2, 2, 1.0F, -3.0F, false)).setRepairable(false).setPrimaryRequirement(MaterialTags.RUBBERTOOLS);//.setUseSound(); + public static final AntimatterToolType SCREWDRIVER = AntimatterAPI.register(AntimatterToolType.class, new AntimatterToolType(Ref.ID, "screwdriver", 2, 2, 2, 0.0F, -1.0F, false)).setUseSound(Ref.WRENCH).setRepairable(false); public static final AntimatterToolType ELECTRIC_SCREWDRIVER = AntimatterAPI.register(AntimatterToolType.class, new AntimatterToolType(Ref.ID, "electric_screwdriver", SCREWDRIVER).setTag(SCREWDRIVER).setPowered(100000, 1, 2, 3)).setUseSound(Ref.WRENCH).setOverlayLayers(2); - public static final AntimatterToolType MORTAR = AntimatterAPI.register(AntimatterToolType.class, new AntimatterToolType(Ref.ID, "mortar", 5, 5, 2, -2.0F, 0.0F, false)).setUseSound(SoundEvents.GRINDSTONE_USE).setBlockBreakability(false).setRepairability(false); - public static final AntimatterToolType WIRE_CUTTER = AntimatterAPI.register(AntimatterToolType.class, new AntimatterToolType(Ref.ID, "wire_cutter", 5, 3, 2, 0.0F, -1.5F, false)).setUseSound(SoundEvents.SHEEP_SHEAR).addEffectiveMaterials(WOOL, SPONGE, WEB, CLOTH_DECORATION).setRepairability(false); + public static final AntimatterToolType MORTAR = AntimatterAPI.register(AntimatterToolType.class, new AntimatterToolType(Ref.ID, "mortar", 5, 5, 2, -2.0F, 0.0F, false)).setUseSound(SoundEvents.GRINDSTONE_USE).setBlockBreakability(false).setRepairable(false); + public static final AntimatterToolType WIRE_CUTTER = AntimatterAPI.register(AntimatterToolType.class, new AntimatterToolType(Ref.ID, "wire_cutter", 5, 3, 2, 0.0F, -1.5F, false)).setUseSound(SoundEvents.SHEEP_SHEAR).addEffectiveMaterials(WOOL, SPONGE, WEB, CLOTH_DECORATION).setRepairable(false); public static final AntimatterToolType BRANCH_CUTTER = AntimatterAPI.register(AntimatterToolType.class, new AntimatterToolType(Ref.ID, "branch_cutter", 1, 3, 2, 0.0F, -1.5F, false)).addTags("grafter").addEffectiveMaterials(LEAVES).setHasContainer(false).setDurabilityMultiplier(0.25f); - public static final AntimatterToolType KNIFE = AntimatterAPI.register(AntimatterToolType.class, new AntimatterToolType(Ref.ID, "knife", 2, 2, 5, 2.1F, -2.0F, false)).setToolClass(MaterialSword.class).addEffectiveBlocks(Blocks.COBWEB).setRepairability(false); - public static final AntimatterToolType PLUNGER = AntimatterAPI.register(AntimatterToolType.class, new AntimatterToolType(Ref.ID, "plunger", 5, 5, 10, 0.0F, -2.9F, false)).setUseSound(SoundEvents.BUCKET_EMPTY).setHasSecondary(false).setRepairability(false); - public static final AntimatterToolType CHAINSAW = AntimatterAPI.register(AntimatterToolType.class, new AntimatterToolType(Ref.ID, "chainsaw", 2, 1, 5, 3.0F, -2.0F, false)).setUseAction(UseAnim.BLOCK).setPowered(100000, 1, 2, 3).setMaterialType(CHAINSAWBIT).addEffectiveMaterials(WOOD, PLANT, REPLACEABLE_PLANT, BAMBOO, LEAVES).addTags("axe", "saw"); + public static final AntimatterToolType KNIFE = AntimatterAPI.register(AntimatterToolType.class, new AntimatterToolType(Ref.ID, "knife", 2, 2, 5, 2.1F, -2.0F, false)).setToolClass(MaterialSword.class).addEffectiveBlocks(Blocks.COBWEB).setRepairable(false); + public static final AntimatterToolType PLUNGER = AntimatterAPI.register(AntimatterToolType.class, new AntimatterToolType(Ref.ID, "plunger", 5, 5, 10, 0.0F, -2.9F, false)).setUseSound(SoundEvents.BUCKET_EMPTY).setHasSecondary(false).setRepairable(false); + public static final AntimatterToolType CHAINSAW = AntimatterAPI.register(AntimatterToolType.class, new AntimatterToolType(Ref.ID, "chainsaw", 2, 1, 5, 3.0F, -2.0F, false)).setUseAction(UseAnim.BLOCK).setPowered(100000, 1, 2, 3).setMaterialTypeItem(CHAINSAWBIT).addEffectiveMaterials(WOOD, PLANT, REPLACEABLE_PLANT, BAMBOO, LEAVES).addTags("axe", "saw"); public static final AntimatterToolType JACKHAMMER = AntimatterAPI.register(AntimatterToolType.class, new AntimatterToolType(Ref.ID, "jackhammer", 2, 2, 10, 1.0F, -3.2F, false)).setPowered(100000, 1, 2, 3).setToolSpeedMultiplier(12.0f).setUseSound(Ref.DRILL).addEffectiveMaterials(STONE).setOverlayLayers(2); public static final AntimatterArmorType HELMET = new AntimatterArmorType(Ref.ID, "helmet", 40, 0, 0.0F, 0.0F, EquipmentSlot.HEAD); public static final AntimatterArmorType CHESTPLATE = new AntimatterArmorType(Ref.ID, "chestplate", 40, 0, 0.0F, 0.0F, EquipmentSlot.CHEST); diff --git a/common/src/main/java/muramasa/antimatter/material/Material.java b/common/src/main/java/muramasa/antimatter/material/Material.java index 13eca58f0..71abc9d4d 100644 --- a/common/src/main/java/muramasa/antimatter/material/Material.java +++ b/common/src/main/java/muramasa/antimatter/material/Material.java @@ -2,6 +2,8 @@ import earth.terrarium.botarium.common.fluid.base.FluidHolder; import it.unimi.dsi.fastutil.objects.ObjectArrayList; +import lombok.Getter; +import lombok.Setter; import muramasa.antimatter.AntimatterAPI; import muramasa.antimatter.Ref; import muramasa.antimatter.data.AntimatterMaterialTypes; @@ -27,6 +29,7 @@ public class Material implements ISharedAntimatterObject { public static final Material NULL = AntimatterAPI.register(Material.class, new Material(Ref.ID, "null", 0xffffff, NONE)); + @Getter final Set> types = new HashSet<>(); /** * Basic Members @@ -34,13 +37,21 @@ public class Material implements ISharedAntimatterObject { private final String domain; private final String id; private Component displayName; + @Getter + @Setter private String displayNameString; + @Getter private final int rgb; + @Getter private final TextureSet set; /** * Element Members - **/ + * + * -- GETTER -- + * Element Getters + */ + @Getter private Element element; private String chemicalFormula = null; private int massMultiplier = 1, massDivider = 1; @@ -105,21 +116,12 @@ public boolean has(IMaterialTag... tags) { return true; } - public Material setDisplayName(String displayNameString) { - this.displayNameString = displayNameString; - return this; - } - public Material setMassMultiplierAndDivider(int massMultiplier, int massDivider){ this.massMultiplier = massMultiplier; this.massDivider = massDivider; return this; } - public String getDisplayNameString() { - return displayNameString; - } - public Material flags(IMaterialTag... tags) { if (!enabled) return this; for (IMaterialTag t : tags) { @@ -155,18 +157,10 @@ public Component getDisplayName() { return displayName == null ? displayName = Utils.translatable("material." + getId()) : displayName; } - public Set> getTypes() { - return types; - } - public int getRGB() { return rgb; } - public TextureSet getSet() { - return set; - } - public long getProtons() { if (element != null) return element.getProtons(); if (MaterialTags.PROCESS_INTO.get(this).getLeft().size() <= 0) return Element.Tc.getProtons(); @@ -226,13 +220,6 @@ private long getMultiplier() { return (U * massMultiplier) / massDivider; } - /** - * Element Getters - **/ - public Element getElement() { - return element; - } - public String getChemicalFormula() { return chemicalFormula == null ? "" : chemicalFormula; } diff --git a/common/src/main/java/muramasa/antimatter/material/lombok.config b/common/src/main/java/muramasa/antimatter/material/lombok.config new file mode 100644 index 000000000..04e1ae918 --- /dev/null +++ b/common/src/main/java/muramasa/antimatter/material/lombok.config @@ -0,0 +1 @@ +lombok.accessors.chain=true \ No newline at end of file diff --git a/common/src/main/java/muramasa/antimatter/tool/AntimatterToolType.java b/common/src/main/java/muramasa/antimatter/tool/AntimatterToolType.java index 0fea120a1..7994c1e68 100644 --- a/common/src/main/java/muramasa/antimatter/tool/AntimatterToolType.java +++ b/common/src/main/java/muramasa/antimatter/tool/AntimatterToolType.java @@ -5,6 +5,8 @@ import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; import it.unimi.dsi.fastutil.objects.ObjectArrayList; import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet; +import lombok.Getter; +import lombok.Setter; import muramasa.antimatter.AntimatterAPI; import muramasa.antimatter.Ref; import muramasa.antimatter.behaviour.IBehaviour; @@ -37,31 +39,64 @@ public class AntimatterToolType implements ISharedAntimatterObject { private final String domain, id; - private TagKey TOOL_TYPE; - private final Set> TOOL_TYPES = new ObjectOpenHashSet<>(); - private final Set EFFECTIVE_BLOCKS = new ObjectOpenHashSet<>(); - private final Set EFFECTIVE_MATERIALS = new ObjectOpenHashSet<>(); + @Getter + private TagKey toolType; + private final Set> toolTypes = new ObjectOpenHashSet<>(); + @Getter + private final Set effectiveBlocks = new ObjectOpenHashSet<>(); + @Getter + private final Set effectiveMaterials = new ObjectOpenHashSet<>(); + @Getter private final Object2ObjectMap> behaviours = new Object2ObjectOpenHashMap<>(); + @Getter + @Setter private ImmutableMap> brokenItems = ImmutableMap.of(); + @Getter private final List tooltip = new ObjectArrayList<>(); - private boolean powered, repairable, blockBreakability, hasContainer, simple, hasSecondary, originalTag = true; + @Getter + private boolean powered, blockBreakability; + @Getter + @Setter + private boolean hasContainer, hasSecondary, simple, repairable; + @Getter + private boolean originalTag = true; + @Getter private long baseMaxEnergy; + @Getter private int[] energyTiers; + @Getter private final int useDurability, attackDurability, craftingDurability; + @Getter + @Setter private float durabilityMultiplier = 1; + @Getter private float miningSpeedMultiplier = 1.0f; + @Getter private int baseQuality, overlayLayers; + @Getter private final float baseAttackDamage, baseAttackSpeed; + @Getter + @Setter private CreativeModeTab itemGroup; + @Getter protected TagKey tag, forgeTag; // Set? + @Getter + @Setter private UseAnim useAction; + @Setter private Class toolClass; + @Setter private IToolSupplier toolSupplier = null; @Nullable + @Getter + @Setter private SoundEvent useSound; + @Getter @Nullable private IMaterialTag primaryMaterialRequirement, secondaryMaterialRequirement; @Nullable + @Getter + @Setter private MaterialTypeItem materialTypeItem; /** @@ -103,11 +138,11 @@ public AntimatterToolType(String domain, String id, int useDurability, int attac this.simple = true; hasSecondary = true; if (vanillaType) { - this.TOOL_TYPE = TagUtils.getBlockTag(new ResourceLocation("minecraft","mineable/".concat(id))); + this.toolType = TagUtils.getBlockTag(new ResourceLocation("minecraft","mineable/".concat(id))); } else { - this.TOOL_TYPE = TagUtils.getBlockTag(new ResourceLocation(Ref.ID, "mineable/".concat(id))); + this.toolType = TagUtils.getBlockTag(new ResourceLocation(Ref.ID, "mineable/".concat(id))); } - this.TOOL_TYPES.add(this.TOOL_TYPE); + this.toolTypes.add(this.toolType); setBrokenItems(ImmutableMap.of(id, (i) -> ItemStack.EMPTY)); } @@ -203,16 +238,6 @@ public AntimatterToolType setToolTip(Component... tooltip) { return this; } - public AntimatterToolType setBrokenItems(ImmutableMap> map) { - this.brokenItems = map; - return this; - } - - public AntimatterToolType setMaterialType(MaterialTypeItem materialTypeItem){ - this.materialTypeItem = materialTypeItem; - return this; - } - public AntimatterToolType setTag(AntimatterToolType tag) { this.originalTag = false; this.tag = tag.getTag(); @@ -221,9 +246,9 @@ public AntimatterToolType setTag(AntimatterToolType tag) { } public AntimatterToolType setType(AntimatterToolType tag) { - this.TOOL_TYPES.remove(this.TOOL_TYPE); - this.TOOL_TYPE = tag.getToolType(); - this.TOOL_TYPES.add(this.TOOL_TYPE); + this.toolTypes.remove(this.toolType); + this.toolType = tag.getToolType(); + this.toolTypes.add(this.toolType); return this; } public AntimatterToolType setTag(ResourceLocation loc) { @@ -241,39 +266,24 @@ public AntimatterToolType setPowered(long baseMaxEnergy, int... energyTiers) { return this; } - public AntimatterToolType setSimple(boolean simple){ - this.simple = simple; - return this; - } - - public AntimatterToolType setHasSecondary(boolean hasSecondary){ - this.hasSecondary = hasSecondary; - return this; - } - - public AntimatterToolType setHasContainer(boolean container) { - this.hasContainer = container; - return this; - } - public AntimatterToolType addTags(String... types) { if (types.length == 0) Utils.onInvalidData(StringUtils.capitalize(id) + " AntimatterToolType was set to have no additional tool types even when it was explicitly called!"); - Arrays.stream(types).map(t -> TagUtils.getForgelikeBlockTag(t)).forEach(t -> this.TOOL_TYPES.add(t)); + Arrays.stream(types).map(t -> TagUtils.getForgelikeBlockTag(t)).forEach(t -> this.toolTypes.add(t)); return this; } public AntimatterToolType addEffectiveBlocks(Block... blocks) { if (blocks.length == 0) Utils.onInvalidData(StringUtils.capitalize(id) + " AntimatterToolType was set to have no effective blocks even when it was explicitly called!"); - this.EFFECTIVE_BLOCKS.addAll(Arrays.asList(blocks)); + this.effectiveBlocks.addAll(Arrays.asList(blocks)); return this; } public AntimatterToolType addEffectiveMaterials(net.minecraft.world.level.material.Material... materials) { if (materials.length == 0) Utils.onInvalidData(StringUtils.capitalize(id) + " AntimatterToolType was set to have no effective materials even when it was explicitly called!"); - this.EFFECTIVE_MATERIALS.addAll(Arrays.asList(materials)); + this.effectiveMaterials.addAll(Arrays.asList(materials)); return this; } @@ -291,16 +301,6 @@ public AntimatterToolType setSecondaryRequirement(IMaterialTag tag) { return this; } - public AntimatterToolType setToolClass(Class toolClass) { - this.toolClass = toolClass; - return this; - } - - public AntimatterToolType setToolSupplier(IToolSupplier toolSupplier) { - this.toolSupplier = toolSupplier; - return this; - } - public boolean getBlockBreakability() { return blockBreakability; } @@ -324,26 +324,6 @@ public AntimatterToolType setToolSpeedMultiplier(float multiplier){ return this; } - - public AntimatterToolType setUseSound(SoundEvent sound) { - this.useSound = sound; - return this; - } - - public boolean getRepairability() { - return repairable; - } - - public AntimatterToolType setRepairability(boolean repairable) { - this.repairable = repairable; - return this; - } - - public AntimatterToolType setDurabilityMultiplier(float durabilityMultiplier){ - this.durabilityMultiplier = durabilityMultiplier; - return this; - } - public AntimatterToolType setOverlayLayers(int layers) { if (layers < 0) Utils.onInvalidData(StringUtils.capitalize(id) + " AntimatterToolType was set to have less than 0 overlayer layers!"); @@ -351,16 +331,6 @@ public AntimatterToolType setOverlayLayers(int layers) { return this; } - public AntimatterToolType setItemGroup(CreativeModeTab itemGroup) { - this.itemGroup = itemGroup; - return this; - } - - public AntimatterToolType setUseAction(UseAnim useAction) { - this.useAction = useAction; - return this; - } - public void addBehaviour(IBehaviour... behaviours) { Arrays.stream(behaviours).forEach(b -> this.behaviours.put(b.getId(), b)); } @@ -391,27 +361,7 @@ public String getId() { } public Set> getActualTags() { - return TOOL_TYPES; - } - - public TagKey getToolType() { - return TOOL_TYPE; - } - - public List getTooltip() { - return tooltip; - } - - public ImmutableMap> getBrokenItems() { - return brokenItems; - } - - public boolean isPowered() { - return powered; - } - - public boolean isSimple() { - return simple; + return toolTypes; } public boolean hasContainer() { @@ -422,102 +372,6 @@ public boolean hasOriginalTag(){ return originalTag; } - public long getBaseMaxEnergy() { - return baseMaxEnergy; - } - - public int[] getEnergyTiers() { - return energyTiers; - } - - public Class getToolClass() { - return toolClass; - } - - public int getBaseQuality() { - return baseQuality; - } - - public float getBaseAttackDamage() { - return baseAttackDamage; - } - - public float getBaseAttackSpeed() { - return baseAttackSpeed; - } - - public int getUseDurability() { - return useDurability; - } - - public int getAttackDurability() { - return attackDurability; - } - - public int getCraftingDurability() { - return craftingDurability; - } - - public float getDurabilityMultiplier() { - return durabilityMultiplier; - } - - public float getMiningSpeedMultiplier() { - return miningSpeedMultiplier; - } - - public int getOverlayLayers() { - return overlayLayers; - } - - public CreativeModeTab getItemGroup() { - return itemGroup; - } - - public TagKey getTag() { - return tag; - } - - public TagKey getForgeTag() { - return forgeTag; - } - - public UseAnim getUseAction() { - return useAction; - } - - @Nullable - public SoundEvent getUseSound() { - return useSound; - } - - @Nullable - public IMaterialTag getPrimaryMaterialRequirement() { - return primaryMaterialRequirement; - } - - @Nullable - public IMaterialTag getSecondaryMaterialRequirement() { - return secondaryMaterialRequirement; - } - - public Set getEffectiveBlocks() { - return EFFECTIVE_BLOCKS; - } - - public Set getEffectiveMaterials() { - return EFFECTIVE_MATERIALS; - } - - public Object2ObjectMap> getBehaviours() { - return behaviours; - } - - @Nullable - public MaterialTypeItem getMaterialTypeItem() { - return materialTypeItem; - } - public interface IToolSupplier{ IAntimatterTool create(String domain, AntimatterToolType toolType, AntimatterItemTier tier, Item.Properties properties); diff --git a/common/src/main/java/muramasa/antimatter/tool/lombok.config b/common/src/main/java/muramasa/antimatter/tool/lombok.config new file mode 100644 index 000000000..04e1ae918 --- /dev/null +++ b/common/src/main/java/muramasa/antimatter/tool/lombok.config @@ -0,0 +1 @@ +lombok.accessors.chain=true \ No newline at end of file