2016-11-17 03:23:38 +01:00
From 3feb3accfd0afbeb9d2896bf9f1561dab0959fb7 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
2016-05-12 04:07:46 +02:00
index f02fc60..d60e755 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> {
2016-03-31 02:50:23 +02:00
return Objects.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
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
2016-11-17 03:23:38 +01:00
index e62df5c..62a338e 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
2016-05-12 04:07:46 +02:00
@@ -49,7 +49,7 @@ public abstract class BiomeBase {
2016-03-31 02:50:23 +02:00
protected List<BiomeBase.BiomeMeta> x;
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
index 71524f2..288c52c 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);
}
}
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
2016-11-17 03:23:38 +01:00
index fe74068..b669884 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
2016-11-17 03:23:38 +01:00
@@ -223,7 +223,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
}
2016-11-17 03:23:38 +01:00
@@ -440,7 +440,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 {
@@ -533,7 +533,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) {
@@ -684,7 +684,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);
}
2016-11-17 03:23:38 +01:00
diff --git a/src/main/java/net/minecraft/server/IEntitySelector.java b/src/main/java/net/minecraft/server/IEntitySelector.java
index dc0ffd8..ec75cf3 100644
--- a/src/main/java/net/minecraft/server/IEntitySelector.java
+++ b/src/main/java/net/minecraft/server/IEntitySelector.java
@@ -61,7 +61,7 @@ public final class IEntitySelector {
}
public boolean apply(@Nullable Object object) {
- return this.a((Entity) object);
+ return this.a((T) object); // Paper - Fix decompile error
}
};
}
@@ -71,7 +71,7 @@ public final class IEntitySelector {
final ScoreboardTeamBase.EnumTeamPush scoreboardteambase_enumteampush = scoreboardteambase == null ? ScoreboardTeamBase.EnumTeamPush.ALWAYS : scoreboardteambase.getCollisionRule();
return scoreboardteambase_enumteampush == ScoreboardTeamBase.EnumTeamPush.NEVER ? Predicates.alwaysFalse() : Predicates.and(IEntitySelector.e, new Predicate() {
- public boolean a(@Nullable Entity entity) {
+ public boolean a(@Nullable Entity entity1) { // Paper - fix decompile error
if (!entity.isCollidable()) {
return false;
} else if (entity1.world.isClientSide && (!(entity instanceof EntityHuman) || !((EntityHuman) entity).cR())) {
@@ -83,9 +83,10 @@ public final class IEntitySelector {
if (scoreboardteambase_enumteampush == ScoreboardTeamBase.EnumTeamPush.NEVER) {
return false;
} else {
- boolean flag = scoreboardteambase1 != null && scoreboardteambase1.isAlly(scoreboardteambase);
+ boolean flag = scoreboardteambase != null && scoreboardteambase.isAlly(scoreboardteambase); // Paper - fix decompile error
- return (scoreboardteambase_enumteampush1 == ScoreboardTeamBase.EnumTeamPush.HIDE_FOR_OWN_TEAM || scoreboardteambase_enumteampush == ScoreboardTeamBase.EnumTeamPush.HIDE_FOR_OWN_TEAM) && flag ? false : scoreboardteambase_enumteampush1 != ScoreboardTeamBase.EnumTeamPush.HIDE_FOR_OTHER_TEAMS && scoreboardteambase_enumteampush != ScoreboardTeamBase.EnumTeamPush.HIDE_FOR_OTHER_TEAMS || flag;
+ // Paper - fix decompiler error
+ return (scoreboardteambase_enumteampush == ScoreboardTeamBase.EnumTeamPush.HIDE_FOR_OWN_TEAM || scoreboardteambase_enumteampush == ScoreboardTeamBase.EnumTeamPush.HIDE_FOR_OWN_TEAM) && flag ? false : scoreboardteambase_enumteampush != ScoreboardTeamBase.EnumTeamPush.HIDE_FOR_OTHER_TEAMS && scoreboardteambase_enumteampush != ScoreboardTeamBase.EnumTeamPush.HIDE_FOR_OTHER_TEAMS || flag;
}
}
}
@@ -98,10 +99,12 @@ public final class IEntitySelector {
public static Predicate<Entity> b(final Entity entity) {
return new Predicate() {
- public boolean a(@Nullable Entity entity) {
+ public boolean a(@Nullable Entity entity1) { // Paper - fix decompile error
while (true) {
- if (entity.isPassenger()) {
- entity = entity.bB();
+ // Paper start - fix decompile error - entity -> entity1 - double check this
+ if (entity1.isPassenger()) {
+ entity1 = entity.bB();
+ // Paper end
if (entity != entity1) {
continue;
}
@@ -139,7 +142,7 @@ public final class IEntitySelector {
}
}
- public boolean apply(@Nullable Object object) {
+ public boolean apply(@Nullable Entity object) {
return this.a((Entity) object);
}
}
2016-03-31 03:27:13 +02:00
diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/ItemFactoryTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/ItemFactoryTest.java
index f5bcbdb..3190cad 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
--
2016-11-17 03:23:38 +01:00
2.10.2
2016-03-31 02:50:23 +02:00