From c11732fc408f2133a2c145e74331369928cb0b73 Mon Sep 17 00:00:00 2001 From: cpw Date: Tue, 8 Mar 2016 23:49:19 -0500 Subject: [PATCH] Potion cleanup. Moar fixes! --- .../minecraft/potion/PotionEffect.java.patch | 37 ++++++++++++++- .../minecraft/potion/Potion.java.patch.rej | 46 ------------------- .../potion/PotionEffect.java.patch.rej | 39 ---------------- src/main/resources/forge_at.cfg | 2 + 4 files changed, 38 insertions(+), 86 deletions(-) delete mode 100644 rejects/minecraft/net/minecraft/potion/Potion.java.patch.rej delete mode 100644 rejects/minecraft/net/minecraft/potion/PotionEffect.java.patch.rej diff --git a/patches.mcp/minecraft/net/minecraft/potion/PotionEffect.java.patch b/patches.mcp/minecraft/net/minecraft/potion/PotionEffect.java.patch index ce1861eb1..dd9931e56 100644 --- a/patches.mcp/minecraft/net/minecraft/potion/PotionEffect.java.patch +++ b/patches.mcp/minecraft/net/minecraft/potion/PotionEffect.java.patch @@ -1,6 +1,41 @@ --- ../src-base/minecraft/net/minecraft/potion/PotionEffect.java +++ ../src-work/minecraft/net/minecraft/potion/PotionEffect.java -@@ -240,4 +240,53 @@ +@@ -19,6 +19,8 @@ + @SideOnly(Side.CLIENT) + private boolean isPotionDurationMax; + private boolean field_188421_h; ++ /** List of ItemStack that can cure the potion effect **/ ++ private java.util.List curativeItems; + + public PotionEffect(Potion p_i46811_1_) + { +@@ -42,6 +44,8 @@ + this.amplifier = p_i46814_3_; + this.isAmbient = p_i46814_4_; + this.field_188421_h = p_i46814_5_; ++ this.curativeItems = new java.util.ArrayList(); ++ this.curativeItems.add(new net.minecraft.item.ItemStack(net.minecraft.init.Items.milk_bucket)); + } + + public PotionEffect(PotionEffect other) +@@ -51,6 +55,7 @@ + this.amplifier = other.amplifier; + this.isAmbient = other.isAmbient; + this.field_188421_h = other.field_188421_h; ++ this.curativeItems = other.curativeItems; + } + + public void combine(PotionEffect other) +@@ -200,7 +205,7 @@ + + public static PotionEffect readCustomPotionEffectFromNBT(NBTTagCompound nbt) + { +- int i = nbt.getByte("Id"); ++ int i = nbt.getByte("Id") & 0xFF; + Potion potion = Potion.func_188412_a(i); + + if (potion == null) +@@ -240,4 +245,53 @@ { return this.isPotionDurationMax; } diff --git a/rejects/minecraft/net/minecraft/potion/Potion.java.patch.rej b/rejects/minecraft/net/minecraft/potion/Potion.java.patch.rej deleted file mode 100644 index ccb6a70e3..000000000 --- a/rejects/minecraft/net/minecraft/potion/Potion.java.patch.rej +++ /dev/null @@ -1,46 +0,0 @@ -++++ REJECTED PATCH 1 - - public class Potion - { -- public static final Potion[] potionTypes = new Potion[32]; -+ public static final Potion[] potionTypes = new Potion[256]; - private static final Map field_180150_I = Maps.newHashMap(); - public static final Potion field_180151_b = null; - public static final Potion moveSpeed = (new Potion(1, new ResourceLocation("speed"), false, 8171462)).setPotionName("potion.moveSpeed").setIconIndex(0, 0).registerPotionAttributeModifier(SharedMonsterAttributes.movementSpeed, "91AEAA56-376B-4498-935B-2F7F68070635", 0.20000000298023224D, 2); -++++ END PATCH -++++ REJECTED PATCH 2 - private double effectiveness; - private boolean usable; - -+ @Deprecated // use the Constructor without potion ID or everything will explode. - protected Potion(int potionID, ResourceLocation location, boolean badEffect, int potionColor) - { -- this.id = potionID; -- potionTypes[potionID] = this; -+ net.minecraftforge.fml.common.registry.GameData.getPotionRegistry().register(potionID, location, this); - field_180150_I.put(location, this); - this.isBadEffect = badEffect; - -++++ END PATCH -++++ REJECTED PATCH 3 - this.liquidColor = potionColor; - } - -+ protected Potion(ResourceLocation location, boolean badEffect, int potionColor) { -+ this(-1, location, badEffect, potionColor); -+ } -+ - public static Potion getPotionFromResourceLocation(String location) - { -- return (Potion)field_180150_I.get(new ResourceLocation(location)); -+ return net.minecraftforge.fml.common.registry.GameData.getPotionRegistry().getObject(new ResourceLocation(location)); - } - - public static Set getPotionLocations() - { -- return field_180150_I.keySet(); -+ return net.minecraftforge.fml.common.registry.GameData.getPotionRegistry().getKeys(); - } - - protected Potion setIconIndex(int p_76399_1_, int p_76399_2_) -++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/potion/PotionEffect.java.patch.rej b/rejects/minecraft/net/minecraft/potion/PotionEffect.java.patch.rej deleted file mode 100644 index cc6804782..000000000 --- a/rejects/minecraft/net/minecraft/potion/PotionEffect.java.patch.rej +++ /dev/null @@ -1,39 +0,0 @@ -++++ REJECTED PATCH 1 - @SideOnly(Side.CLIENT) - private boolean isPotionDurationMax; - private boolean showParticles; -+ /** List of ItemStack that can cure the potion effect **/ -+ private java.util.List curativeItems; - - public PotionEffect(int id, int effectDuration) - { -++++ END PATCH -++++ REJECTED PATCH 2 - this.amplifier = effectAmplifier; - this.isAmbient = ambient; - this.showParticles = showParticles; -+ this.curativeItems = new java.util.ArrayList(); -+ this.curativeItems.add(new net.minecraft.item.ItemStack(net.minecraft.init.Items.milk_bucket)); - } - - public PotionEffect(PotionEffect other) -++++ END PATCH -++++ REJECTED PATCH 3 - this.amplifier = other.amplifier; - this.isAmbient = other.isAmbient; - this.showParticles = other.showParticles; -+ this.curativeItems = other.curativeItems; - } - - public void combine(PotionEffect other) -++++ END PATCH -++++ REJECTED PATCH 4 - - public static PotionEffect readCustomPotionEffectFromNBT(NBTTagCompound nbt) - { -- int i = nbt.getByte("Id"); -+ int i = nbt.getByte("Id") & 0xff; - - if (i >= 0 && i < Potion.potionTypes.length && Potion.potionTypes[i] != null) - { -++++ END PATCH diff --git a/src/main/resources/forge_at.cfg b/src/main/resources/forge_at.cfg index 29fab7690..b0672ad85 100644 --- a/src/main/resources/forge_at.cfg +++ b/src/main/resources/forge_at.cfg @@ -32,6 +32,8 @@ public net.minecraft.item.Item func_77627_a(Z)Lnet.minecraft.item.Item; #setHasS #public net.minecraft.client.entity.EntityPlayerSP func_71012_a(Lnet/minecraft/entity/item/EntityItem;)V #joinEntityItemWithWorld public net.minecraft.entity.player.EntityPlayer func_71053_j()V #closeScreen #public uf.b #FD:EntityPlayer/field_71076_b #sleepTimer +# EntityTrackerEntry +public net.minecraft.entity.EntityTrackerEntry field_73134_o # trackingPlayers # World Gen Chests Related public net.minecraft.util.WeightedRandomChestContent * # Save Location