16
16
import org .spongepowered .asm .mixin .injection .Redirect ;
17
17
import org .spongepowered .asm .mixin .injection .callback .CallbackInfoReturnable ;
18
18
19
- @ Mixin (RecipesArmorDyes .class )
19
+ @ Mixin (value = RecipesArmorDyes .class , priority = 1100 )
20
20
public abstract class MixinRecipeArmorDyes {
21
21
@ 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 ) {
23
23
boolean hasArmor = false , hasDye = false ;
24
24
25
25
for (int i = 0 ; i < inv .getSizeInventory (); i ++) {
26
26
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 ) {
30
31
hasArmor = true ;
31
32
} else {
32
33
boolean pass = false ;
@@ -46,16 +47,16 @@ else if (stack.getItem() instanceof ItemArmor && !hasArmor && ((ItemArmor) stack
46
47
}
47
48
48
49
@ 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 ) {
50
51
//early return prevention
51
52
return Items .dye ;
52
53
}
53
54
54
55
@ 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 ) {
56
57
int [] od = OreDictionary .getOreIDs (stack );
57
58
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 ;
59
60
}
60
61
return 15 ;
61
62
}
0 commit comments