Port some patches to 1.13 (#5267)

This commit is contained in:
Jamie Mansfield 2018-12-10 20:37:14 +00:00 committed by LexManos
parent 0177e7558e
commit 7a77298a60
12 changed files with 96 additions and 98 deletions

View file

@ -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;
}

View file

@ -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<Integer> 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;
}
}

View file

@ -0,0 +1,18 @@
--- a/net/minecraft/crash/CrashReport.java
+++ b/net/minecraft/crash/CrashReport.java
@@ -63,6 +63,7 @@
List<String> 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");

View file

@ -1,6 +1,14 @@
--- a/net/minecraft/inventory/SlotCrafting.java --- a/net/minecraft/inventory/SlotCrafting.java
+++ b/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_) { public ItemStack func_190901_a(EntityPlayer p_190901_1_, ItemStack p_190901_2_) {
this.func_75208_c(p_190901_2_); this.func_75208_c(p_190901_2_);

View file

@ -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_);
}
}

View file

@ -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<Entity> 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);

View file

@ -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;
}

View file

@ -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<Integer> 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;
}
}

View file

@ -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)
{

View file

@ -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");

View file

@ -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;

View file

@ -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_);
}
}