Dont use alias!

This commit is contained in:
Sotr
2018-06-11 19:05:39 +08:00
parent f46e63958b
commit 5f936eb1b7

View File

@@ -45,14 +45,14 @@ public class WeakEnchantmentManager {
@Shadow(aliases = "c") @Final private static EnchantmentManager.EnchantmentModifierThorns thorns; @Shadow(aliases = "c") @Final private static EnchantmentManager.EnchantmentModifierThorns thorns;
@Shadow(aliases = "d") @Final private static EnchantmentManager.EnchantmentModifierArthropods arthropods; @Shadow(aliases = "d") @Final private static EnchantmentManager.EnchantmentModifierArthropods arthropods;
@Shadow(aliases = "a") private static void applyEnchantmentModifierArray(EnchantmentManager.EnchantmentModifier modifier, Iterable<ItemStack> iterable) {} @Shadow private static void a(EnchantmentManager.EnchantmentModifier modifier, Iterable<ItemStack> iterable) {}
@Shadow(aliases = "a") private static void applyEnchantmentModifier(EnchantmentManager.EnchantmentModifier modifier, ItemStack itemstack) {} @Shadow private static void a(EnchantmentManager.EnchantmentModifier modifier, ItemStack itemstack) {}
@Overwrite @Overwrite
public static int a(Iterable<ItemStack> iterable, DamageSource damageSource) { public static int a(Iterable<ItemStack> iterable, DamageSource damageSource) {
protection.a = 0; // PAIL: damageModifier protection.a = 0; // PAIL: damageModifier
protection.b = damageSource; protection.b = damageSource;
applyEnchantmentModifierArray(protection, iterable); a(protection, iterable); // PAIL: applyEnchantmentModifierArray
protection.b = null; // Akarin - Remove reference to Damagesource protection.b = null; // Akarin - Remove reference to Damagesource
return protection.a; return protection.a;
} }
@@ -62,11 +62,11 @@ public class WeakEnchantmentManager {
thorns.b = attacker; thorns.b = attacker;
thorns.a = user; thorns.a = user;
if (user != null) { if (user != null) {
applyEnchantmentModifierArray(thorns, user.aQ()); // PAIL: getEquipmentAndArmor a(thorns, user.aQ()); // PAIL: applyEnchantmentModifierArray - getEquipmentAndArmor
} }
if (attacker instanceof EntityHuman) { if (attacker instanceof EntityHuman) {
applyEnchantmentModifier(thorns, user.getItemInMainHand()); a(thorns, user.getItemInMainHand()); // PAIL: applyEnchantmentModifier
} }
// Akarin Start - remove references to entity objects to avoid memory leaks // Akarin Start - remove references to entity objects to avoid memory leaks
@@ -80,11 +80,11 @@ public class WeakEnchantmentManager {
arthropods.a = user; arthropods.a = user;
arthropods.b = target; arthropods.b = target;
if (user != null) { if (user != null) {
applyEnchantmentModifierArray(arthropods, user.aQ()); // PAIL: getEquipmentAndArmor a(arthropods, user.aQ()); // PAIL: applyEnchantmentModifierArray - getEquipmentAndArmor
} }
if (user instanceof EntityHuman) { if (user instanceof EntityHuman) {
applyEnchantmentModifier(arthropods, user.getItemInMainHand()); a(arthropods, user.getItemInMainHand()); // PAIL: applyEnchantmentModifier
} }
// Akarin Start - remove references to entity objects to avoid memory leaks // Akarin Start - remove references to entity objects to avoid memory leaks