papermc/Spigot-Server-Patches/0003-MC-Dev-fixes.patch

133 lines
6.1 KiB
Diff
Raw Normal View History

2018-01-11 05:31:19 +00:00
From de28e5dbfe736bdec1a553e02b88ee1e682de92a Mon Sep 17 00:00:00 2001
2016-03-31 00:50:23 +00:00
From: Aikar <aikar@aikar.co>
Date: Wed, 30 Mar 2016 19:36:20 -0400
Subject: [PATCH] MC Dev fixes
diff --git a/src/main/java/net/minecraft/server/BaseBlockPosition.java b/src/main/java/net/minecraft/server/BaseBlockPosition.java
index d4f41274..d55e180d 100644
2016-03-31 00:50:23 +00:00
--- a/src/main/java/net/minecraft/server/BaseBlockPosition.java
+++ b/src/main/java/net/minecraft/server/BaseBlockPosition.java
2016-05-12 02:07:46 +00:00
@@ -89,7 +89,7 @@ public class BaseBlockPosition implements Comparable<BaseBlockPosition> {
2017-05-14 18:05:01 +00:00
return MoreObjects.toStringHelper(this).add("x", this.getX()).add("y", this.getY()).add("z", this.getZ()).toString();
2016-03-31 00:50:23 +00:00
}
- public int compareTo(Object object) {
+ public int compareTo(BaseBlockPosition object) { // Paper - decompile fix
2016-05-12 02:07:46 +00:00
return this.l((BaseBlockPosition) object);
2016-03-31 00:50:23 +00:00
}
}
diff --git a/src/main/java/net/minecraft/server/BiomeBase.java b/src/main/java/net/minecraft/server/BiomeBase.java
index 62a9c92f..1b759976 100644
2016-03-31 00:50:23 +00:00
--- a/src/main/java/net/minecraft/server/BiomeBase.java
+++ b/src/main/java/net/minecraft/server/BiomeBase.java
2017-05-14 18:05:01 +00:00
@@ -46,7 +46,7 @@ public abstract class BiomeBase {
protected List<BiomeBase.BiomeMeta> w;
2016-03-31 00:50:23 +00:00
public static int a(BiomeBase biomebase) {
- return BiomeBase.REGISTRY_ID.a((Object) biomebase);
+ return BiomeBase.REGISTRY_ID.a(biomebase); // Paper - decompile fix
}
2016-05-12 02:07:46 +00:00
@Nullable
2016-03-31 00:50:23 +00:00
diff --git a/src/main/java/net/minecraft/server/CommandAbstract.java b/src/main/java/net/minecraft/server/CommandAbstract.java
index 76bf04f5..a99d0f87 100644
2016-03-31 00:50:23 +00:00
--- a/src/main/java/net/minecraft/server/CommandAbstract.java
+++ b/src/main/java/net/minecraft/server/CommandAbstract.java
2017-05-14 18:05:01 +00:00
@@ -231,7 +231,7 @@ public abstract class CommandAbstract implements ICommand {
2016-03-31 00:50:23 +00:00
}
if (object != null && oclass.isAssignableFrom(object.getClass())) {
- return (Entity) object;
+ return (T) object; // Paper - fix decompile error
} else {
2016-11-17 02:23:38 +00:00
throw new ExceptionEntityNotFound(s);
2016-03-31 00:50:23 +00:00
}
2017-05-14 18:05:01 +00:00
@@ -448,7 +448,7 @@ public abstract class CommandAbstract implements ICommand {
2016-11-17 02:23:38 +00:00
}
private static <T extends Comparable<T>> IBlockData a(IBlockData iblockdata, IBlockState<T> iblockstate, Comparable<?> comparable) {
- return iblockdata.set(iblockstate, comparable);
+ return iblockdata.set(iblockstate, (T) comparable); // Paper - fix decompiler error
}
public static Predicate<IBlockData> b(final Block block, String s) throws ExceptionInvalidBlockState {
2017-05-14 18:05:01 +00:00
@@ -541,7 +541,7 @@ public abstract class CommandAbstract implements ICommand {
2016-11-17 02:23:38 +00:00
@Nullable
private static <T extends Comparable<T>> T a(IBlockState<T> iblockstate, String s) {
- return (Comparable) iblockstate.b(s).orNull();
+ return iblockstate.b(s).orNull(); // Paper - fix decompiler error
}
public static String a(Object[] aobject) {
@@ -693,7 +693,7 @@ public abstract class CommandAbstract implements ICommand {
2016-03-31 00:50:23 +00:00
return this.getCommand().compareTo(icommand.getCommand());
}
- public int compareTo(Object object) {
+ public int compareTo(ICommand object) { // Paper - fix decompile error
return this.a((ICommand) object);
}
diff --git a/src/main/java/net/minecraft/server/EntityTypes.java b/src/main/java/net/minecraft/server/EntityTypes.java
index 77b81a57..ba461ad4 100644
--- a/src/main/java/net/minecraft/server/EntityTypes.java
+++ b/src/main/java/net/minecraft/server/EntityTypes.java
@@ -34,7 +34,7 @@ public class EntityTypes {
@Nullable
public static String b(Entity entity) {
- int i = EntityTypes.b.a((Object) entity.getClass());
+ int i = EntityTypes.b.a(entity.getClass()); // Paper - Decompile fix
return i == -1 ? null : (String) EntityTypes.g.get(i);
}
@@ -254,7 +254,7 @@ public class EntityTypes {
EntityTypes.d.add(minecraftkey);
while (EntityTypes.g.size() <= i) {
- EntityTypes.g.add((Object) null);
+ EntityTypes.g.add(null); // Paper - Decompile fix
}
EntityTypes.g.set(i, s1);
2017-10-05 13:38:21 +00:00
diff --git a/src/main/java/net/minecraft/server/RegistryBlockID.java b/src/main/java/net/minecraft/server/RegistryBlockID.java
index 58f47d0d..8860a012 100644
2017-10-05 13:38:21 +00:00
--- a/src/main/java/net/minecraft/server/RegistryBlockID.java
+++ b/src/main/java/net/minecraft/server/RegistryBlockID.java
@@ -8,7 +8,7 @@ import java.util.Iterator;
import java.util.List;
import javax.annotation.Nullable;
-public class RegistryBlockID<T> implements Registry<T> {
+public class RegistryBlockID<T> implements Registry { // Paper - Fix decompile error
private final IdentityHashMap<T, Integer> a;
private final List<T> b;
@@ -26,7 +26,7 @@ public class RegistryBlockID<T> implements Registry<T> {
this.a.put(t0, Integer.valueOf(i));
while (this.b.size() <= i) {
- this.b.add((Object) null);
+ this.b.add(null); // Paper - Fix decompile error
}
this.b.set(i, t0);
diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/ItemFactoryTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/ItemFactoryTest.java
index f5bcbdbe..3190cadf 100644
--- a/src/test/java/org/bukkit/craftbukkit/inventory/ItemFactoryTest.java
+++ b/src/test/java/org/bukkit/craftbukkit/inventory/ItemFactoryTest.java
@@ -20,7 +20,7 @@ public class ItemFactoryTest extends AbstractTestingBase {
@Test
public void testKnownAttributes() throws Throwable {
- final ZipInputStream nmsZipStream = new ZipInputStream(CommandAbstract.class/* Magic class that isn't imported! */.getProtectionDomain().getCodeSource().getLocation().openStream());
+ final ZipInputStream nmsZipStream = new ZipInputStream(net.minecraft.server.HttpUtilities.class/* Magic class that isn't imported! */.getProtectionDomain().getCodeSource().getLocation().openStream()); // Paper
final Collection<String> names = new HashSet<String>();
for (ZipEntry clazzEntry; (clazzEntry = nmsZipStream.getNextEntry()) != null; ) {
final String entryName = clazzEntry.getName();
2016-03-31 00:50:23 +00:00
--
2018-01-11 05:31:19 +00:00
2.14.3
2016-03-31 00:50:23 +00:00