Skip to content

Commit d0a2efe

Browse files
committed
Resolve new conflict with MCP:F
1 parent 79a485e commit d0a2efe

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

src/main/java/jss/bugtorch/mixins/early/minecraft/tweaks/MixinRecipeArmorDyes.java

+9-8
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,18 @@
1616
import org.spongepowered.asm.mixin.injection.Redirect;
1717
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
1818

19-
@Mixin(RecipesArmorDyes.class)
19+
@Mixin(value = RecipesArmorDyes.class, priority = 1100)
2020
public abstract class MixinRecipeArmorDyes {
2121
@Inject(method = "matches", at = @At("HEAD"), cancellable = true)
22-
public void matchBetter(InventoryCrafting inv, World world, CallbackInfoReturnable<Boolean> ctx) {
22+
public void recipesArmorDyesMatchBetter(InventoryCrafting inv, World world, CallbackInfoReturnable<Boolean> ctx) {
2323
boolean hasArmor = false, hasDye = false;
2424

2525
for (int i = 0; i < inv.getSizeInventory(); i++) {
2626
ItemStack stack = inv.getStackInSlot(i);
27-
//the ide has no idea how vital this llwyd continue is
28-
if (stack == null) continue;
29-
else if (stack.getItem() instanceof ItemArmor && !hasArmor && ((ItemArmor) stack.getItem()).getArmorMaterial() == ItemArmor.ArmorMaterial.CLOTH) {
27+
//the ide has no idea how vital this continue is
28+
if (stack == null) {
29+
continue;
30+
} else if (stack.getItem() instanceof ItemArmor && !hasArmor && ((ItemArmor) stack.getItem()).getArmorMaterial() == ItemArmor.ArmorMaterial.CLOTH) {
3031
hasArmor = true;
3132
} else {
3233
boolean pass = false;
@@ -46,16 +47,16 @@ else if (stack.getItem() instanceof ItemArmor && !hasArmor && ((ItemArmor) stack
4647
}
4748

4849
@Redirect(method = "getCraftingResult", at = @At(value = "INVOKE", target = "Lnet/minecraft/item/ItemStack;getItem()Lnet/minecraft/item/Item;", ordinal = 2))
49-
public Item pretendo64(ItemStack stack) {
50+
public Item recipesArmorDyesPreventEarlyReturn(ItemStack stack) {
5051
//early return prevention
5152
return Items.dye;
5253
}
5354

5455
@Redirect(method = "getCraftingResult", at = @At(value = "INVOKE", target = "Lnet/minecraft/item/ItemStack;getItemDamage()I"))
55-
public int spinTheWheelAndLaughAtGod(ItemStack stack) {
56+
public int recipesArmorDyesMatchDyeToColorMeta(ItemStack stack) {
5657
int[] od = OreDictionary.getOreIDs(stack);
5758
for (int i = 0; i < BugTorch.dyeOreIds.length; i++) {
58-
if (ArrayUtils.contains(od, BugTorch.dyeOreIds[i])) return i;
59+
if(ArrayUtils.contains(od, BugTorch.dyeOreIds[i])) return i;
5960
}
6061
return 15;
6162
}

0 commit comments

Comments
 (0)