3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-15 20:40:07 +01:00
Paper/Spigot-Server-Patches/0003-MC-Dev-fixes.patch

102 Zeilen
4.9 KiB
Diff

2017-05-14 20:05:01 +02:00
From d96016cb6d0bc3a710cf6e081872d2f4117e1dda Mon Sep 17 00:00:00 2001
2016-03-31 02:50:23 +02: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
2017-05-14 20:05:01 +02:00
index d4f412742..d55e180d7 100644
2016-03-31 02:50:23 +02:00
--- a/src/main/java/net/minecraft/server/BaseBlockPosition.java
+++ b/src/main/java/net/minecraft/server/BaseBlockPosition.java
2016-05-12 04:07:46 +02:00
@@ -89,7 +89,7 @@ public class BaseBlockPosition implements Comparable<BaseBlockPosition> {
2017-05-14 20:05:01 +02:00
return MoreObjects.toStringHelper(this).add("x", this.getX()).add("y", this.getY()).add("z", this.getZ()).toString();
2016-03-31 02:50:23 +02:00
}
- public int compareTo(Object object) {
+ public int compareTo(BaseBlockPosition object) { // Paper - decompile fix
2016-05-12 04:07:46 +02:00
return this.l((BaseBlockPosition) object);
2016-03-31 02:50:23 +02:00
}
}
diff --git a/src/main/java/net/minecraft/server/BiomeBase.java b/src/main/java/net/minecraft/server/BiomeBase.java
2017-05-14 20:05:01 +02:00
index 62a9c92f8..1b7599769 100644
2016-03-31 02:50:23 +02:00
--- a/src/main/java/net/minecraft/server/BiomeBase.java
+++ b/src/main/java/net/minecraft/server/BiomeBase.java
2017-05-14 20:05:01 +02:00
@@ -46,7 +46,7 @@ public abstract class BiomeBase {
protected List<BiomeBase.BiomeMeta> w;
2016-03-31 02:50:23 +02: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 04:07:46 +02:00
@Nullable
2016-08-19 02:53:36 +02:00
diff --git a/src/main/java/net/minecraft/server/BlockStateEnum.java b/src/main/java/net/minecraft/server/BlockStateEnum.java
2017-05-14 20:05:01 +02:00
index 71524f2cd..288c52c55 100644
2016-08-19 02:53:36 +02:00
--- 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);
}
}
2016-03-31 02:50:23 +02:00
diff --git a/src/main/java/net/minecraft/server/CommandAbstract.java b/src/main/java/net/minecraft/server/CommandAbstract.java
2017-05-14 20:05:01 +02:00
index 14a7b9c92..8b703db42 100644
2016-03-31 02:50:23 +02:00
--- a/src/main/java/net/minecraft/server/CommandAbstract.java
+++ b/src/main/java/net/minecraft/server/CommandAbstract.java
2017-05-14 20:05:01 +02:00
@@ -231,7 +231,7 @@ public abstract class CommandAbstract implements ICommand {
2016-03-31 02:50:23 +02:00
}
if (object != null && oclass.isAssignableFrom(object.getClass())) {
- return (Entity) object;
+ return (T) object; // Paper - fix decompile error
} else {
2016-11-17 03:23:38 +01:00
throw new ExceptionEntityNotFound(s);
2016-03-31 02:50:23 +02:00
}
2017-05-14 20:05:01 +02:00
@@ -448,7 +448,7 @@ public abstract class CommandAbstract implements ICommand {
2016-11-17 03:23:38 +01: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 20:05:01 +02:00
@@ -541,7 +541,7 @@ public abstract class CommandAbstract implements ICommand {
2016-11-17 03:23:38 +01: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) {
2017-05-14 20:05:01 +02:00
@@ -692,7 +692,7 @@ public abstract class CommandAbstract implements ICommand {
2016-03-31 02:50:23 +02: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/test/java/org/bukkit/craftbukkit/inventory/ItemFactoryTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/ItemFactoryTest.java
2017-05-14 20:05:01 +02:00
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();
2016-03-31 02:50:23 +02:00
--
2017-05-14 20:05:01 +02:00
2.13.0
2016-03-31 02:50:23 +02:00