Skip to content

Commit

Permalink
added lombok
Browse files Browse the repository at this point in the history
  • Loading branch information
Trinsdar committed Oct 20, 2023
1 parent fdb4852 commit 32cbdbe
Show file tree
Hide file tree
Showing 6 changed files with 87 additions and 241 deletions.
3 changes: 3 additions & 0 deletions common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
37 changes: 12 additions & 25 deletions common/src/main/java/muramasa/antimatter/material/Material.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -27,20 +29,29 @@
public class Material implements ISharedAntimatterObject {

public static final Material NULL = AntimatterAPI.register(Material.class, new Material(Ref.ID, "null", 0xffffff, NONE));
@Getter
final Set<MaterialType<?>> types = new HashSet<>();
/**
* Basic Members
**/
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;
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -155,18 +157,10 @@ public Component getDisplayName() {
return displayName == null ? displayName = Utils.translatable("material." + getId()) : displayName;
}

public Set<MaterialType<?>> 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();
Expand Down Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lombok.accessors.chain=true
Loading

0 comments on commit 32cbdbe

Please sign in to comment.