From 7a77298a6045db5937ba382c1f65712ee0871795 Mon Sep 17 00:00:00 2001 From: Jamie Mansfield Date: Mon, 10 Dec 2018 20:37:14 +0000 Subject: [PATCH] Port some patches to 1.13 (#5267) --- .../renderer/entity/RenderFish.java.patch | 11 ++++++ .../renderer/vertex/VertexFormat.java.patch | 38 +++++++++++++++++++ .../minecraft/crash/CrashReport.java.patch | 18 +++++++++ .../inventory/SlotCrafting.java.patch | 10 ++++- .../inventory/SlotFurnaceOutput.java.patch | 9 +++++ .../tileentity/TileEntityPiston.java.patch | 11 ++++++ .../renderer/entity/RenderFish.java.patch | 11 ------ .../renderer/vertex/VertexFormat.java.patch | 38 ------------------- .../tileentity/TileEntityPiston.java.patch | 11 ------ patches_old_unknown/CrashReport.java.patch | 18 --------- patches_old_unknown/SlotCrafting.java.patch | 10 ----- .../SlotFurnaceOutput.java.patch | 9 ----- 12 files changed, 96 insertions(+), 98 deletions(-) create mode 100644 patches/minecraft/net/minecraft/client/renderer/entity/RenderFish.java.patch create mode 100644 patches/minecraft/net/minecraft/client/renderer/vertex/VertexFormat.java.patch create mode 100644 patches/minecraft/net/minecraft/crash/CrashReport.java.patch create mode 100644 patches/minecraft/net/minecraft/inventory/SlotFurnaceOutput.java.patch create mode 100644 patches/minecraft/net/minecraft/tileentity/TileEntityPiston.java.patch delete mode 100644 patches_old/minecraft/net/minecraft/client/renderer/entity/RenderFish.java.patch delete mode 100644 patches_old/minecraft/net/minecraft/client/renderer/vertex/VertexFormat.java.patch delete mode 100644 patches_old/minecraft/net/minecraft/tileentity/TileEntityPiston.java.patch delete mode 100644 patches_old_unknown/CrashReport.java.patch delete mode 100644 patches_old_unknown/SlotCrafting.java.patch delete mode 100644 patches_old_unknown/SlotFurnaceOutput.java.patch diff --git a/patches/minecraft/net/minecraft/client/renderer/entity/RenderFish.java.patch b/patches/minecraft/net/minecraft/client/renderer/entity/RenderFish.java.patch new file mode 100644 index 000000000..d00c48574 --- /dev/null +++ b/patches/minecraft/net/minecraft/client/renderer/entity/RenderFish.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/client/renderer/entity/RenderFish.java ++++ b/net/minecraft/client/renderer/entity/RenderFish.java +@@ -65,7 +65,7 @@ + GlStateManager.func_179121_F(); + int k = entityplayer.func_184591_cq() == EnumHandSide.RIGHT ? 1 : -1; + ItemStack itemstack = entityplayer.func_184614_ca(); +- if (itemstack.func_77973_b() != Items.field_151112_aM) { ++ if (!(itemstack.func_77973_b() instanceof net.minecraft.item.ItemFishingRod)) { + k = -k; + } + diff --git a/patches/minecraft/net/minecraft/client/renderer/vertex/VertexFormat.java.patch b/patches/minecraft/net/minecraft/client/renderer/vertex/VertexFormat.java.patch new file mode 100644 index 000000000..cb5abd7cc --- /dev/null +++ b/patches/minecraft/net/minecraft/client/renderer/vertex/VertexFormat.java.patch @@ -0,0 +1,38 @@ +--- a/net/minecraft/client/renderer/vertex/VertexFormat.java ++++ b/net/minecraft/client/renderer/vertex/VertexFormat.java +@@ -16,6 +16,7 @@ + private int field_177354_e; + private final List field_177351_f; + private int field_177352_g; ++ private int hashCode; + + public VertexFormat(VertexFormat p_i46097_1_) { + this(); +@@ -42,6 +43,7 @@ + this.field_177351_f.clear(); + this.field_177352_g = -1; + this.field_177353_d = 0; ++ this.hashCode = 0; + } + + public VertexFormat func_181721_a(VertexFormatElement p_181721_1_) { +@@ -63,6 +65,7 @@ + } + + this.field_177353_d += p_181721_1_.func_177368_f(); ++ this.hashCode = 0; + return this; + } + } +@@ -157,9 +160,11 @@ + } + + public int hashCode() { ++ if (this.hashCode != 0) return this.hashCode; + int i = this.field_177355_b.hashCode(); + i = 31 * i + this.field_177356_c.hashCode(); + i = 31 * i + this.field_177353_d; ++ this.hashCode = i; + return i; + } + } diff --git a/patches/minecraft/net/minecraft/crash/CrashReport.java.patch b/patches/minecraft/net/minecraft/crash/CrashReport.java.patch new file mode 100644 index 000000000..f2e22d8ad --- /dev/null +++ b/patches/minecraft/net/minecraft/crash/CrashReport.java.patch @@ -0,0 +1,18 @@ +--- a/net/minecraft/crash/CrashReport.java ++++ b/net/minecraft/crash/CrashReport.java +@@ -63,6 +63,7 @@ + List list = (List)Util.func_211565_f().collect(Collectors.toList()); + return String.format("%d total; %s", list.size(), list.stream().collect(Collectors.joining(" "))); + }); ++ net.minecraftforge.fml.CrashReportExtender.enhanceCrashReport(this, this.field_85061_c); + } + + public String func_71501_a() { +@@ -132,6 +133,7 @@ + public String func_71502_e() { + StringBuilder stringbuilder = new StringBuilder(); + stringbuilder.append("---- Minecraft Crash Report ----\n"); ++ net.minecraftforge.fml.CrashReportExtender.addCrashReportHeader(stringbuilder, this); + stringbuilder.append("// "); + stringbuilder.append(func_71503_h()); + stringbuilder.append("\n\n"); diff --git a/patches/minecraft/net/minecraft/inventory/SlotCrafting.java.patch b/patches/minecraft/net/minecraft/inventory/SlotCrafting.java.patch index 4d62ca7fc..6821ef5b1 100644 --- a/patches/minecraft/net/minecraft/inventory/SlotCrafting.java.patch +++ b/patches/minecraft/net/minecraft/inventory/SlotCrafting.java.patch @@ -1,6 +1,14 @@ --- a/net/minecraft/inventory/SlotCrafting.java +++ b/net/minecraft/inventory/SlotCrafting.java -@@ -47,7 +47,9 @@ +@@ -39,6 +39,7 @@ + protected void func_75208_c(ItemStack p_75208_1_) { + if (this.field_75237_g > 0) { + p_75208_1_.func_77980_a(this.field_75238_b.field_70170_p, this.field_75238_b, this.field_75237_g); ++ net.minecraftforge.fml.hooks.BasicEventHooks.firePlayerCraftingEvent(this.field_75238_b, p_75208_1_, this.field_75224_c); + } + + ((IRecipeHolder)this.field_75224_c).func_201560_d(this.field_75238_b); +@@ -47,7 +48,9 @@ public ItemStack func_190901_a(EntityPlayer p_190901_1_, ItemStack p_190901_2_) { this.func_75208_c(p_190901_2_); diff --git a/patches/minecraft/net/minecraft/inventory/SlotFurnaceOutput.java.patch b/patches/minecraft/net/minecraft/inventory/SlotFurnaceOutput.java.patch new file mode 100644 index 000000000..debb4bd28 --- /dev/null +++ b/patches/minecraft/net/minecraft/inventory/SlotFurnaceOutput.java.patch @@ -0,0 +1,9 @@ +--- a/net/minecraft/inventory/SlotFurnaceOutput.java ++++ b/net/minecraft/inventory/SlotFurnaceOutput.java +@@ -76,5 +76,6 @@ + } + + this.field_75228_b = 0; ++ net.minecraftforge.fml.hooks.BasicEventHooks.firePlayerSmeltedEvent(this.field_75229_a, p_75208_1_); + } + } diff --git a/patches/minecraft/net/minecraft/tileentity/TileEntityPiston.java.patch b/patches/minecraft/net/minecraft/tileentity/TileEntityPiston.java.patch new file mode 100644 index 000000000..80313b4fb --- /dev/null +++ b/patches/minecraft/net/minecraft/tileentity/TileEntityPiston.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/tileentity/TileEntityPiston.java ++++ b/net/minecraft/tileentity/TileEntityPiston.java +@@ -101,7 +101,7 @@ + AxisAlignedBB axisalignedbb = this.func_190607_a(this.func_191515_a(list)); + List list1 = this.field_145850_b.func_72839_b((Entity)null, this.func_190610_a(axisalignedbb, enumfacing, d0).func_111270_a(axisalignedbb)); + if (!list1.isEmpty()) { +- boolean flag = this.field_200231_a.func_177230_c() == Blocks.field_180399_cE; ++ boolean flag = this.field_200231_a.func_177230_c().isStickyBlock(this.field_200231_a); + + for(int i = 0; i < list1.size(); ++i) { + Entity entity = list1.get(i); diff --git a/patches_old/minecraft/net/minecraft/client/renderer/entity/RenderFish.java.patch b/patches_old/minecraft/net/minecraft/client/renderer/entity/RenderFish.java.patch deleted file mode 100644 index 7ab7bcba8..000000000 --- a/patches_old/minecraft/net/minecraft/client/renderer/entity/RenderFish.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/client/renderer/entity/RenderFish.java -+++ ../src-work/minecraft/net/minecraft/client/renderer/entity/RenderFish.java -@@ -75,7 +75,7 @@ - int k = entityplayer.func_184591_cq() == EnumHandSide.RIGHT ? 1 : -1; - ItemStack itemstack = entityplayer.func_184614_ca(); - -- if (itemstack.func_77973_b() != Items.field_151112_aM) -+ if (!(itemstack.func_77973_b() instanceof net.minecraft.item.ItemFishingRod)) - { - k = -k; - } diff --git a/patches_old/minecraft/net/minecraft/client/renderer/vertex/VertexFormat.java.patch b/patches_old/minecraft/net/minecraft/client/renderer/vertex/VertexFormat.java.patch deleted file mode 100644 index e80c6739d..000000000 --- a/patches_old/minecraft/net/minecraft/client/renderer/vertex/VertexFormat.java.patch +++ /dev/null @@ -1,38 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/client/renderer/vertex/VertexFormat.java -+++ ../src-work/minecraft/net/minecraft/client/renderer/vertex/VertexFormat.java -@@ -17,6 +17,7 @@ - private int field_177354_e; - private final List field_177351_f; - private int field_177352_g; -+ private int hashCode; - - public VertexFormat(VertexFormat p_i46097_1_) - { -@@ -47,6 +48,7 @@ - this.field_177351_f.clear(); - this.field_177352_g = -1; - this.field_177353_d = 0; -+ this.hashCode = 0; - } - - @SuppressWarnings("incomplete-switch") -@@ -75,6 +77,7 @@ - } - - this.field_177353_d += p_181721_1_.func_177368_f(); -+ this.hashCode = 0; - return this; - } - } -@@ -204,9 +207,11 @@ - - public int hashCode() - { -+ if (this.hashCode != 0) return this.hashCode; - int i = this.field_177355_b.hashCode(); - i = 31 * i + this.field_177356_c.hashCode(); - i = 31 * i + this.field_177353_d; -+ this.hashCode = i; - return i; - } - } diff --git a/patches_old/minecraft/net/minecraft/tileentity/TileEntityPiston.java.patch b/patches_old/minecraft/net/minecraft/tileentity/TileEntityPiston.java.patch deleted file mode 100644 index 6b9608798..000000000 --- a/patches_old/minecraft/net/minecraft/tileentity/TileEntityPiston.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/tileentity/TileEntityPiston.java -+++ ../src-work/minecraft/net/minecraft/tileentity/TileEntityPiston.java -@@ -145,7 +145,7 @@ - - if (!list1.isEmpty()) - { -- boolean flag = this.field_174932_a.func_177230_c() == Blocks.field_180399_cE; -+ boolean flag = this.field_174932_a.func_177230_c().isStickyBlock(this.field_174932_a); - - for (int i = 0; i < list1.size(); ++i) - { diff --git a/patches_old_unknown/CrashReport.java.patch b/patches_old_unknown/CrashReport.java.patch deleted file mode 100644 index fc71a49cd..000000000 --- a/patches_old_unknown/CrashReport.java.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/crash/CrashReport.java -+++ ../src-work/minecraft/net/minecraft/crash/CrashReport.java -@@ -116,6 +116,7 @@ - return IntCache.func_85144_b(); - } - }); -+ net.minecraftforge.fml.common.FMLCommonHandler.instance().enhanceCrashReport(this, this.field_85061_c); - } - - public String func_71501_a() -@@ -205,6 +206,7 @@ - { - StringBuilder stringbuilder = new StringBuilder(); - stringbuilder.append("---- Minecraft Crash Report ----\n"); -+ net.minecraftforge.fml.relauncher.CoreModManager.onCrash(stringbuilder); - stringbuilder.append("// "); - stringbuilder.append(func_71503_h()); - stringbuilder.append("\n\n"); diff --git a/patches_old_unknown/SlotCrafting.java.patch b/patches_old_unknown/SlotCrafting.java.patch deleted file mode 100644 index 73d292815..000000000 --- a/patches_old_unknown/SlotCrafting.java.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/inventory/SlotCrafting.java -+++ ../src-work/minecraft/net/minecraft/inventory/SlotCrafting.java -@@ -51,6 +51,7 @@ - if (this.field_75237_g > 0) - { - p_75208_1_.func_77980_a(this.field_75238_b.field_70170_p, this.field_75238_b, this.field_75237_g); -+ net.minecraftforge.fml.common.FMLCommonHandler.instance().firePlayerCraftingEvent(this.field_75238_b, p_75208_1_, field_75239_a); - } - - this.field_75237_g = 0; diff --git a/patches_old_unknown/SlotFurnaceOutput.java.patch b/patches_old_unknown/SlotFurnaceOutput.java.patch deleted file mode 100644 index 843b76257..000000000 --- a/patches_old_unknown/SlotFurnaceOutput.java.patch +++ /dev/null @@ -1,9 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/inventory/SlotFurnaceOutput.java -+++ ../src-work/minecraft/net/minecraft/inventory/SlotFurnaceOutput.java -@@ -79,5 +79,6 @@ - } - - this.field_75228_b = 0; -+ net.minecraftforge.fml.common.FMLCommonHandler.instance().firePlayerSmeltedEvent(field_75229_a, p_75208_1_); - } - }