Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 2ec3305

Browse files
committed
made IAntimatterArmor and AntimatterArmorType no longer implement ISharedAntimatterObject
1 parent 4edddd8 commit 2ec3305

File tree

4 files changed

+25
-51
lines changed

4 files changed

+25
-51
lines changed

common/src/main/java/muramasa/antimatter/data/AntimatterDefaultTools.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ public class AntimatterDefaultTools {
4444
public static final AntimatterToolType SCISSORS = AntimatterAPI.register(AntimatterToolType.class, new AntimatterToolType(Ref.ID, "scissors", 1, 2, 2, 1.0f, -1.5f, false));
4545
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);
4646
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);
47-
public static final AntimatterArmorType HELMET = new AntimatterArmorType(Ref.ID, "helmet", 40, 0, 0.0F, 0.0F, EquipmentSlot.HEAD);
48-
public static final AntimatterArmorType CHESTPLATE = new AntimatterArmorType(Ref.ID, "chestplate", 40, 0, 0.0F, 0.0F, EquipmentSlot.CHEST);
49-
public static final AntimatterArmorType LEGGINGS = new AntimatterArmorType(Ref.ID, "leggings", 40, 0, 0.0F, 0.0F, EquipmentSlot.LEGS);
50-
public static final AntimatterArmorType BOOTS = new AntimatterArmorType(Ref.ID, "boots", 40, 0, 0.0F, 0.0F, EquipmentSlot.FEET);
47+
public static final AntimatterArmorType HELMET = new AntimatterArmorType(Ref.SHARED_ID, "helmet", 40, 0, 0.0F, 0.0F, EquipmentSlot.HEAD);
48+
public static final AntimatterArmorType CHESTPLATE = new AntimatterArmorType(Ref.SHARED_ID, "chestplate", 40, 0, 0.0F, 0.0F, EquipmentSlot.CHEST);
49+
public static final AntimatterArmorType LEGGINGS = new AntimatterArmorType(Ref.SHARED_ID, "leggings", 40, 0, 0.0F, 0.0F, EquipmentSlot.LEGS);
50+
public static final AntimatterArmorType BOOTS = new AntimatterArmorType(Ref.SHARED_ID, "boots", 40, 0, 0.0F, 0.0F, EquipmentSlot.FEET);
5151

5252
public static void init(Side side){
5353
AXE.addBehaviour(BehaviourLogStripping.INSTANCE, BehaviourTreeFelling.INSTANCE);

common/src/main/java/muramasa/antimatter/tool/IAntimatterArmor.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,7 @@
66
import muramasa.antimatter.datagen.providers.AntimatterItemModelProvider;
77
import muramasa.antimatter.material.Material;
88
import muramasa.antimatter.material.MaterialTags;
9-
import muramasa.antimatter.registration.IColorHandler;
10-
import muramasa.antimatter.registration.IModelProvider;
11-
import muramasa.antimatter.registration.ISharedAntimatterObject;
12-
import muramasa.antimatter.registration.ITextureProvider;
9+
import muramasa.antimatter.registration.*;
1310
import muramasa.antimatter.texture.Texture;
1411
import muramasa.antimatter.tool.armor.AntimatterArmorType;
1512
import net.minecraft.network.chat.Component;
@@ -26,7 +23,7 @@
2623
import java.util.List;
2724
import java.util.Map;
2825

29-
public interface IAntimatterArmor extends ISharedAntimatterObject, IColorHandler, ITextureProvider, IModelProvider, IAbstractToolMethods {
26+
public interface IAntimatterArmor extends IAntimatterObject, IColorHandler, ITextureProvider, IModelProvider, IAbstractToolMethods {
3027
AntimatterArmorType getAntimatterArmorType();
3128

3229
Material getMat();

common/src/main/java/muramasa/antimatter/tool/armor/AntimatterArmorType.java

Lines changed: 14 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
package muramasa.antimatter.tool.armor;
22

33
import it.unimi.dsi.fastutil.objects.ObjectArrayList;
4+
import lombok.Getter;
45
import muramasa.antimatter.AntimatterAPI;
56
import muramasa.antimatter.Ref;
67
import muramasa.antimatter.material.IMaterialTag;
78
import muramasa.antimatter.material.Material;
89
import muramasa.antimatter.material.MaterialTags;
10+
import muramasa.antimatter.registration.IAntimatterObject;
911
import muramasa.antimatter.registration.ISharedAntimatterObject;
1012
import muramasa.antimatter.tool.IAntimatterArmor;
1113
import muramasa.antimatter.util.AntimatterPlatformUtils;
@@ -26,15 +28,23 @@
2628
import java.util.Objects;
2729
import java.util.function.Supplier;
2830

29-
public class AntimatterArmorType implements ISharedAntimatterObject {
31+
public class AntimatterArmorType implements IAntimatterObject {
3032
private final String domain, id;
33+
@Getter
3134
private final List<Component> tooltip = new ObjectArrayList<>();
35+
@Getter
3236
private final boolean repairable;
37+
@Getter
3338
private final int durabilityFactor, extraArmor;
39+
@Getter
3440
private final float extraToughness, extraKnockback;
41+
@Getter
3542
private final CreativeModeTab itemGroup;
43+
@Getter
3644
private EquipmentSlot slot;
45+
@Getter
3746
private SoundEvent event;
47+
@Getter
3848
int overlayLayers;
3949
@Nullable
4050
private IMaterialTag materialRequirement;
@@ -69,7 +79,7 @@ public AntimatterArmorType(String domain, String id, int durabilityFactor, int e
6979
public List<IAntimatterArmor> instantiateTools() {
7080
List<IAntimatterArmor> armors = new ArrayList<>();
7181
MaterialTags.ARMOR.all().forEach(m -> {
72-
armors.add(new MaterialArmor(Ref.SHARED_ID, this, m, slot, prepareInstantiation(Ref.SHARED_ID)));
82+
armors.add(new MaterialArmor(domain, this, m, slot, prepareInstantiation(domain)));
7383
});
7484
return armors;
7585
}
@@ -115,11 +125,8 @@ public AntimatterArmorType setPrimaryRequirement(IMaterialTag tag) {
115125
}
116126

117127
public ItemStack getToolStack(Material primary) {
118-
return Objects.requireNonNull(AntimatterAPI.get(IAntimatterArmor.class, primary.getId() + "_" + id)).asItemStack();
119-
}
120-
121-
public List<Component> getTooltip() {
122-
return tooltip;
128+
IAntimatterArmor armor = AntimatterAPI.get(IAntimatterArmor.class, primary.getId() + "_" + id, domain);
129+
return Objects.requireNonNull(armor).asItemStack();
123130
}
124131

125132
@Override
@@ -132,39 +139,4 @@ public String getId() {
132139
return id;
133140
}
134141

135-
public boolean isRepairable() {
136-
return repairable;
137-
}
138-
139-
public int getOverlayLayers() {
140-
return overlayLayers;
141-
}
142-
143-
public int getDurabilityFactor() {
144-
return durabilityFactor;
145-
}
146-
147-
public int getExtraArmor() {
148-
return extraArmor;
149-
}
150-
151-
public float getExtraToughness() {
152-
return extraToughness;
153-
}
154-
155-
public float getExtraKnockback() {
156-
return extraKnockback;
157-
}
158-
159-
public CreativeModeTab getItemGroup() {
160-
return itemGroup;
161-
}
162-
163-
public EquipmentSlot getSlot() {
164-
return slot;
165-
}
166-
167-
public SoundEvent getEvent() {
168-
return event;
169-
}
170142
}

common/src/main/java/muramasa/antimatter/tool/armor/MaterialArmor.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ public String getId() {
4444
return material.getId() + "_" + type.getId();
4545
}
4646

47+
@Override
48+
public String getDomain() {
49+
return domain;
50+
}
51+
4752
@Override
4853
public AntimatterArmorType getAntimatterArmorType() {
4954
return type;

0 commit comments

Comments
 (0)