Skip to content

Commit

Permalink
removed some deprecated methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Trinsdar committed Jan 23, 2025
1 parent cf09afe commit 411920c
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 84 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,16 +112,6 @@ public AntimatterShapedRecipeBuilder getStackRecipe(String groupName, boolean cu
return recipeBuilder;
}

@Deprecated(forRemoval = true)
public void shapeless(Consumer<FinishedRecipe> consumer, String recipeID, String groupName, String criterionName, CriterionTriggerInstance criterion, ItemStack output, Object... inputs) {
shapeless(consumer, Ref.ID, recipeID, groupName, output, inputs);
}

@Deprecated(forRemoval = true)
public void shapeless(Consumer<FinishedRecipe> consumer, String domain, String recipeID, String groupName, String criterionName, CriterionTriggerInstance criterion, ItemStack output, Object... inputs) {
shapeless(consumer, domain, recipeID, groupName, output, inputs);
}

public void shapeless(Consumer<FinishedRecipe> consumer, String recipeID, String groupName, ItemStack output, Object... inputs) {
shapeless(consumer, Ref.ID, recipeID, groupName, output, inputs);
}
Expand Down Expand Up @@ -161,16 +151,6 @@ public void shapeless(Consumer<FinishedRecipe> consumer, String domain, String r
}
}

@Deprecated(forRemoval = true)
public void addItemRecipe(Consumer<FinishedRecipe> consumer, String groupName, String criterionName, CriterionTriggerInstance criterion, ItemLike output, ImmutableMap<Character, Object> inputs, String... inputPattern) {
addStackRecipe(consumer, "", "", groupName, criterionName, criterion, new ItemStack(output), inputs, inputPattern);
}

@Deprecated(forRemoval = true)
public void addItemRecipe(Consumer<FinishedRecipe> consumer, String recipeDomain, String recipeName, String groupName, String criterionName, CriterionTriggerInstance criterion, ItemLike output, ImmutableMap<Character, Object> inputs, String... inputPattern) {
addStackRecipe(consumer, recipeDomain, recipeName, groupName, criterionName, criterion, new ItemStack(output), inputs, inputPattern);
}

public void addItemRecipe(Consumer<FinishedRecipe> consumer, String groupName, ItemLike output, ImmutableMap<Character, Object> inputs, String... inputPattern) {
addStackRecipe(consumer, "", "", groupName, new ItemStack(output), inputs, inputPattern);
}
Expand All @@ -187,16 +167,6 @@ public void addStackRecipe(Consumer<FinishedRecipe> consumer, String groupName,
addStackRecipe(consumer, "", "", groupName, output, inputs, inputPattern);
}

@Deprecated(forRemoval = true)
public void addStackRecipe(Consumer<FinishedRecipe> consumer, String recipeDomain, String recipeName, String groupName, String criterionName, CriterionTriggerInstance criterion, ItemStack output, ImmutableMap<Character, Object> inputs, String... inputPattern) {
AntimatterShapedRecipeBuilder recipeBuilder = getStackRecipe(groupName, false, output, inputs, inputPattern);
if (recipeName.isEmpty()) recipeBuilder.build(consumer);
else {
if (recipeDomain.isEmpty()) recipeBuilder.build(consumer, recipeName);
else recipeBuilder.build(consumer, fixLoc(recipeDomain, recipeName));
}
}

public void addStackRecipe(Consumer<FinishedRecipe> consumer, String recipeDomain, String recipeName, String groupName, ItemStack output, ImmutableMap<Character, Object> inputs, String... inputPattern) {
AntimatterShapedRecipeBuilder recipeBuilder = getStackRecipe(groupName, false, output, inputs, inputPattern);
if (recipeName.isEmpty()) recipeBuilder.build(consumer);
Expand All @@ -206,15 +176,6 @@ public void addStackRecipe(Consumer<FinishedRecipe> consumer, String recipeDomai
}
}

public void addToolRecipe(String builder, Consumer<FinishedRecipe> consumer, String recipeDomain, String recipeName, String groupName, String criterionName, CriterionTriggerInstance criterion, ItemStack output, Function<ImmutableMap.Builder<Character, Object>, ImmutableMap.Builder<Character, Object>> inputs, String... inputPattern) {
addToolRecipe(builder, consumer, recipeDomain, recipeName, groupName, criterionName, criterion, output, inputs.apply(new ImmutableMap.Builder<>()).build(), inputPattern);
}

@Deprecated(forRemoval = true)
public void addToolRecipe(String builder, Consumer<FinishedRecipe> consumer, String recipeDomain, String recipeName, String groupName, String criterionName, CriterionTriggerInstance criterion, ItemStack output, ImmutableMap<Character, Object> inputs, String... inputPattern) {
addToolRecipe(builder, consumer, recipeDomain, recipeName, groupName, output, inputs, inputPattern);
}

public void addToolRecipe(String builder, Consumer<FinishedRecipe> consumer, String recipeDomain, String recipeName, String groupName, ItemStack output, ImmutableMap<Character, Object> inputs, String... inputPattern) {
if (output.isEmpty()) {
Antimatter.LOGGER.warn("Material recipe " + recipeDomain + ":" + recipeName + "has an empty output.");
Expand Down
33 changes: 0 additions & 33 deletions common/src/main/java/muramasa/antimatter/event/MaterialEvent.java
Original file line number Diff line number Diff line change
Expand Up @@ -171,39 +171,6 @@ public T harvestLevel(int harvestLevel) {
return (T) this;
}

@Deprecated
public T addTools(float toolDamage, float toolSpeed, int toolDurability, int toolQuality) {
return addTools(toolDamage, toolSpeed, toolDurability, toolQuality, ImmutableMap.of());
}

@Deprecated
public T addTools(float toolDamage, float toolSpeed, int toolDurability, int toolQuality, ImmutableMap<Enchantment, Integer> toolEnchantment, AntimatterToolType... toolTypes) {
if (has(AntimatterMaterialTypes.INGOT))
flags(AntimatterMaterialTypes.PLATE, AntimatterMaterialTypes.ROD, AntimatterMaterialTypes.SCREW, AntimatterMaterialTypes.BOLT); //TODO: We need to add bolt for now since screws depends on bolt, need to find time to change it
else flags(AntimatterMaterialTypes.ROD);
List<AntimatterToolType> toolTypesList = toolTypes.length > 0 ? Arrays.asList(toolTypes) : AntimatterAPI.all(AntimatterToolType.class);
MaterialTags.TOOLS.add(this.material, new ToolData(toolDamage, toolSpeed, toolDurability, toolQuality, Wood, toolEnchantment, toolTypesList));
MaterialTags.MINING_LEVEL.add(this.material, toolQuality - 1);
for (AntimatterToolType type : toolTypesList){
if (type.getMaterialTypeItem() != null && material != Flint && material != NULL && !material.has(RUBBERTOOLS) && material != Wood){
flags(type.getMaterialTypeItem());
}
}
return (T) this;
}

@Deprecated
public T addTools(Material derivedMaterial, ImmutableMap<Enchantment, Integer> toolEnchantment) {
ToolData data = MaterialTags.TOOLS.get(derivedMaterial);
return addTools(data.toolDamage(), data.toolSpeed(), data.toolDurability(), data.toolQuality(), toolEnchantment);
}

@Deprecated
public T addTools(Material derivedMaterial) {
ToolData data = MaterialTags.TOOLS.get(derivedMaterial);
return addTools(data.toolDamage(), data.toolSpeed(), data.toolDurability(), data.toolQuality());
}

public T setAllowedTypes(AntimatterToolType... toolTypes) {
if (!has(MaterialTags.TOOLS)) return (T) this;
ToolData data = MaterialTags.TOOLS.get(this.material);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,6 @@ public Material setMassMultiplierAndDivider(int massMultiplier, int massDivider)
return this;
}

@Deprecated
public Material setDisplayName(String displayNameString){
return setDisplayNameString(displayNameString);
}

public Material flags(IMaterialTag... tags) {
if (!enabled) return this;
for (IMaterialTag t : tags) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,11 +245,6 @@ public AntimatterToolType setToolTip(Component... tooltip) {
return this;
}

@Deprecated
public AntimatterToolType setMaterialType(MaterialTypeItem<?> materialTypeItem){
return setMaterialTypeItem(materialTypeItem);
}

@Deprecated
public AntimatterToolType setRepairability(boolean repairable){
return setRepairable(repairable);
Expand Down
2 changes: 0 additions & 2 deletions common/src/main/java/muramasa/antimatter/util/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -1415,8 +1415,6 @@ public static boolean isPlayerHolding(Player player, InteractionHand hand, Antim
}

@Nullable
//@Deprecated // Ready to use the methods above instead
//Not deprecated so you don't have to call methods multiple times.
public static AntimatterToolType getToolType(Player player) {
ItemStack stack = player.getMainHandItem();
for (AntimatterToolType ty : AntimatterAPI.all(AntimatterToolType.class)) {
Expand Down

0 comments on commit 411920c

Please sign in to comment.