124 Zeilen
5.8 KiB
Diff
124 Zeilen
5.8 KiB
Diff
From f44918d9a3c234a2be57605bd9752b9908e12784 Mon Sep 17 00:00:00 2001
|
|
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 d4f412742..d55e180d7 100644
|
|
--- a/src/main/java/net/minecraft/server/BaseBlockPosition.java
|
|
+++ b/src/main/java/net/minecraft/server/BaseBlockPosition.java
|
|
@@ -89,7 +89,7 @@ public class BaseBlockPosition implements Comparable<BaseBlockPosition> {
|
|
return MoreObjects.toStringHelper(this).add("x", this.getX()).add("y", this.getY()).add("z", this.getZ()).toString();
|
|
}
|
|
|
|
- public int compareTo(Object object) {
|
|
+ public int compareTo(BaseBlockPosition object) { // Paper - decompile fix
|
|
return this.l((BaseBlockPosition) object);
|
|
}
|
|
}
|
|
diff --git a/src/main/java/net/minecraft/server/BiomeBase.java b/src/main/java/net/minecraft/server/BiomeBase.java
|
|
index 62a9c92f8..1b7599769 100644
|
|
--- a/src/main/java/net/minecraft/server/BiomeBase.java
|
|
+++ b/src/main/java/net/minecraft/server/BiomeBase.java
|
|
@@ -46,7 +46,7 @@ public abstract class BiomeBase {
|
|
protected List<BiomeBase.BiomeMeta> w;
|
|
|
|
public static int a(BiomeBase biomebase) {
|
|
- return BiomeBase.REGISTRY_ID.a((Object) biomebase);
|
|
+ return BiomeBase.REGISTRY_ID.a(biomebase); // Paper - decompile fix
|
|
}
|
|
|
|
@Nullable
|
|
diff --git a/src/main/java/net/minecraft/server/BlockStateEnum.java b/src/main/java/net/minecraft/server/BlockStateEnum.java
|
|
index 71524f2cd..288c52c55 100644
|
|
--- a/src/main/java/net/minecraft/server/BlockStateEnum.java
|
|
+++ b/src/main/java/net/minecraft/server/BlockStateEnum.java
|
|
@@ -29,7 +29,7 @@ public class BlockStateEnum<T extends Enum<T> & INamable> extends BlockState<T>
|
|
throw new IllegalArgumentException("Multiple values have the same name \'" + s1 + "\'");
|
|
}
|
|
|
|
- this.b.put(s1, oenum);
|
|
+ this.b.put(s1, (T) oenum);
|
|
}
|
|
|
|
}
|
|
diff --git a/src/main/java/net/minecraft/server/CommandAbstract.java b/src/main/java/net/minecraft/server/CommandAbstract.java
|
|
index 76501e299..67cadecbb 100644
|
|
--- a/src/main/java/net/minecraft/server/CommandAbstract.java
|
|
+++ b/src/main/java/net/minecraft/server/CommandAbstract.java
|
|
@@ -231,7 +231,7 @@ public abstract class CommandAbstract implements ICommand {
|
|
}
|
|
|
|
if (object != null && oclass.isAssignableFrom(object.getClass())) {
|
|
- return (Entity) object;
|
|
+ return (T) object; // Paper - fix decompile error
|
|
} else {
|
|
throw new ExceptionEntityNotFound(s);
|
|
}
|
|
@@ -448,7 +448,7 @@ public abstract class CommandAbstract implements ICommand {
|
|
}
|
|
|
|
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 {
|
|
@@ -541,7 +541,7 @@ public abstract class CommandAbstract implements ICommand {
|
|
|
|
@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) {
|
|
@@ -692,7 +692,7 @@ public abstract class CommandAbstract implements ICommand {
|
|
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/RegistryBlockID.java b/src/main/java/net/minecraft/server/RegistryBlockID.java
|
|
index 58f47d0de..8860a0129 100644
|
|
--- 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 f5bcbdbe1..3190cadfc 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();
|
|
--
|
|
2.14.2
|
|
|