Skip to content

Commit

Permalink
made IAntimatterArmor and AntimatterArmorType no longer implement ISh…
Browse files Browse the repository at this point in the history
…aredAntimatterObject
  • Loading branch information
Trinsdar committed Jan 6, 2025
1 parent 4edddd8 commit 2ec3305
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 51 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ public class AntimatterDefaultTools {
public static final AntimatterToolType SCISSORS = AntimatterAPI.register(AntimatterToolType.class, new AntimatterToolType(Ref.ID, "scissors", 1, 2, 2, 1.0f, -1.5f, 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 SCYTHE = AntimatterAPI.register(AntimatterToolType.class, new AntimatterToolType(Ref.ID, "scythe", 1, 2, 5, 6.5f, -3.1f, false)).setMaterialTypeItem(SCYTHE_BLADE);
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);
public static final AntimatterArmorType LEGGINGS = new AntimatterArmorType(Ref.ID, "leggings", 40, 0, 0.0F, 0.0F, EquipmentSlot.LEGS);
public static final AntimatterArmorType BOOTS = new AntimatterArmorType(Ref.ID, "boots", 40, 0, 0.0F, 0.0F, EquipmentSlot.FEET);
public static final AntimatterArmorType HELMET = new AntimatterArmorType(Ref.SHARED_ID, "helmet", 40, 0, 0.0F, 0.0F, EquipmentSlot.HEAD);
public static final AntimatterArmorType CHESTPLATE = new AntimatterArmorType(Ref.SHARED_ID, "chestplate", 40, 0, 0.0F, 0.0F, EquipmentSlot.CHEST);
public static final AntimatterArmorType LEGGINGS = new AntimatterArmorType(Ref.SHARED_ID, "leggings", 40, 0, 0.0F, 0.0F, EquipmentSlot.LEGS);
public static final AntimatterArmorType BOOTS = new AntimatterArmorType(Ref.SHARED_ID, "boots", 40, 0, 0.0F, 0.0F, EquipmentSlot.FEET);

public static void init(Side side){
AXE.addBehaviour(BehaviourLogStripping.INSTANCE, BehaviourTreeFelling.INSTANCE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
import muramasa.antimatter.datagen.providers.AntimatterItemModelProvider;
import muramasa.antimatter.material.Material;
import muramasa.antimatter.material.MaterialTags;
import muramasa.antimatter.registration.IColorHandler;
import muramasa.antimatter.registration.IModelProvider;
import muramasa.antimatter.registration.ISharedAntimatterObject;
import muramasa.antimatter.registration.ITextureProvider;
import muramasa.antimatter.registration.*;
import muramasa.antimatter.texture.Texture;
import muramasa.antimatter.tool.armor.AntimatterArmorType;
import net.minecraft.network.chat.Component;
Expand All @@ -26,7 +23,7 @@
import java.util.List;
import java.util.Map;

public interface IAntimatterArmor extends ISharedAntimatterObject, IColorHandler, ITextureProvider, IModelProvider, IAbstractToolMethods {
public interface IAntimatterArmor extends IAntimatterObject, IColorHandler, ITextureProvider, IModelProvider, IAbstractToolMethods {
AntimatterArmorType getAntimatterArmorType();

Material getMat();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package muramasa.antimatter.tool.armor;

import it.unimi.dsi.fastutil.objects.ObjectArrayList;
import lombok.Getter;
import muramasa.antimatter.AntimatterAPI;
import muramasa.antimatter.Ref;
import muramasa.antimatter.material.IMaterialTag;
import muramasa.antimatter.material.Material;
import muramasa.antimatter.material.MaterialTags;
import muramasa.antimatter.registration.IAntimatterObject;
import muramasa.antimatter.registration.ISharedAntimatterObject;
import muramasa.antimatter.tool.IAntimatterArmor;
import muramasa.antimatter.util.AntimatterPlatformUtils;
Expand All @@ -26,15 +28,23 @@
import java.util.Objects;
import java.util.function.Supplier;

public class AntimatterArmorType implements ISharedAntimatterObject {
public class AntimatterArmorType implements IAntimatterObject {
private final String domain, id;
@Getter
private final List<Component> tooltip = new ObjectArrayList<>();
@Getter
private final boolean repairable;
@Getter
private final int durabilityFactor, extraArmor;
@Getter
private final float extraToughness, extraKnockback;
@Getter
private final CreativeModeTab itemGroup;
@Getter
private EquipmentSlot slot;
@Getter
private SoundEvent event;
@Getter
int overlayLayers;
@Nullable
private IMaterialTag materialRequirement;
Expand Down Expand Up @@ -69,7 +79,7 @@ public AntimatterArmorType(String domain, String id, int durabilityFactor, int e
public List<IAntimatterArmor> instantiateTools() {
List<IAntimatterArmor> armors = new ArrayList<>();
MaterialTags.ARMOR.all().forEach(m -> {
armors.add(new MaterialArmor(Ref.SHARED_ID, this, m, slot, prepareInstantiation(Ref.SHARED_ID)));
armors.add(new MaterialArmor(domain, this, m, slot, prepareInstantiation(domain)));
});
return armors;
}
Expand Down Expand Up @@ -115,11 +125,8 @@ public AntimatterArmorType setPrimaryRequirement(IMaterialTag tag) {
}

public ItemStack getToolStack(Material primary) {
return Objects.requireNonNull(AntimatterAPI.get(IAntimatterArmor.class, primary.getId() + "_" + id)).asItemStack();
}

public List<Component> getTooltip() {
return tooltip;
IAntimatterArmor armor = AntimatterAPI.get(IAntimatterArmor.class, primary.getId() + "_" + id, domain);
return Objects.requireNonNull(armor).asItemStack();
}

@Override
Expand All @@ -132,39 +139,4 @@ public String getId() {
return id;
}

public boolean isRepairable() {
return repairable;
}

public int getOverlayLayers() {
return overlayLayers;
}

public int getDurabilityFactor() {
return durabilityFactor;
}

public int getExtraArmor() {
return extraArmor;
}

public float getExtraToughness() {
return extraToughness;
}

public float getExtraKnockback() {
return extraKnockback;
}

public CreativeModeTab getItemGroup() {
return itemGroup;
}

public EquipmentSlot getSlot() {
return slot;
}

public SoundEvent getEvent() {
return event;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ public String getId() {
return material.getId() + "_" + type.getId();
}

@Override
public String getDomain() {
return domain;
}

@Override
public AntimatterArmorType getAntimatterArmorType() {
return type;
Expand Down

0 comments on commit 2ec3305

Please sign in to comment.