From ea2cb0f4f240fb9536382b71b44f412193744ebc Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 30 Mar 2016 19:36:20 -0400 Subject: [PATCH] MC Dev fixes diff --git a/src/main/java/net/minecraft/server/BiomeBase.java b/src/main/java/net/minecraft/server/BiomeBase.java index 8f640f0c24..2831c03a69 100644 --- a/src/main/java/net/minecraft/server/BiomeBase.java +++ b/src/main/java/net/minecraft/server/BiomeBase.java @@ -42,7 +42,7 @@ public abstract class BiomeBase { @Nullable public static BiomeBase a(BiomeBase biomebase) { - return (BiomeBase) BiomeBase.c.fromId(IRegistry.BIOME.a((Object) biomebase)); + return (BiomeBase) BiomeBase.c.fromId(IRegistry.BIOME.a(biomebase)); // Paper - decompile fix } public static WorldGenCarverWrapper a(WorldGenCarverAbstract worldgencarverabstract, C c0) { @@ -202,7 +202,7 @@ public abstract class BiomeBase { @Nullable public C b(StructureGenerator structuregenerator) { - return (WorldGenFeatureConfiguration) this.t.get(structuregenerator); + return (C) this.t.get(structuregenerator); // Paper - decompile fix } public List> e() { diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java index dc823e88a5..3745f66de5 100644 --- a/src/main/java/net/minecraft/server/BlockPosition.java +++ b/src/main/java/net/minecraft/server/BlockPosition.java @@ -18,7 +18,7 @@ import org.apache.logging.log4j.Logger; @Immutable public class BlockPosition extends BaseBlockPosition implements MinecraftSerializable { - private static final Logger b = LogManager.getLogger(); + //private static final Logger b = LogManager.getLogger(); // Paper - variable name conflict, logger isn't used public static final BlockPosition ZERO = new BlockPosition(0, 0, 0); private static final int c = 1 + MathHelper.e(MathHelper.c(30000000)); private static final int d = BlockPosition.c; @@ -57,12 +57,12 @@ public class BlockPosition extends BaseBlockPosition implements MinecraftSeriali OfInt ofint = dynamic.asIntStream().spliterator(); int[] aint = new int[3]; - if (ofint.tryAdvance((i) -> { + if (ofint.tryAdvance((Consumer) (i) -> { // Paper - decomile fix aint[0] = i; - }) && ofint.tryAdvance((i) -> { + }) && ofint.tryAdvance((Consumer) (i) -> { // Paper - decompile fix aint[1] = i; })) { - ofint.tryAdvance((i) -> { + ofint.tryAdvance((Consumer) (i) -> { // Paper - decompile fix aint[2] = i; }); } diff --git a/src/main/java/net/minecraft/server/BlockStateEnum.java b/src/main/java/net/minecraft/server/BlockStateEnum.java index b4c8722f04..59d86fc66e 100644 --- a/src/main/java/net/minecraft/server/BlockStateEnum.java +++ b/src/main/java/net/minecraft/server/BlockStateEnum.java @@ -20,10 +20,10 @@ public class BlockStateEnum & INamable> extends BlockState protected BlockStateEnum(String s, Class oclass, Collection collection) { super(s, oclass); this.a = ImmutableSet.copyOf(collection); - Iterator iterator = collection.iterator(); + Iterator iterator = collection.iterator(); // Paper - decompile fix while (iterator.hasNext()) { - T t0 = (Enum) iterator.next(); + T t0 = iterator.next(); // Paper - Decompile fix String s1 = ((INamable) t0).getName(); if (this.b.containsKey(s1)) { diff --git a/src/main/java/net/minecraft/server/GameRules.java b/src/main/java/net/minecraft/server/GameRules.java index d8d2267084..3de9d264db 100644 --- a/src/main/java/net/minecraft/server/GameRules.java +++ b/src/main/java/net/minecraft/server/GameRules.java @@ -17,7 +17,7 @@ import javax.annotation.Nullable; public class GameRules { - private static final TreeMap a = (TreeMap) SystemUtils.a((Object) (new TreeMap()), (treemap) -> { + private static final TreeMap a = SystemUtils.a(new TreeMap(), (treemap) -> { // Paper - decompile fix treemap.put("doFireTick", new GameRules.GameRuleDefinition("true", GameRules.EnumGameRuleType.BOOLEAN_VALUE)); treemap.put("mobGriefing", new GameRules.GameRuleDefinition("true", GameRules.EnumGameRuleType.BOOLEAN_VALUE)); treemap.put("keepInventory", new GameRules.GameRuleDefinition("false", GameRules.EnumGameRuleType.BOOLEAN_VALUE)); @@ -133,7 +133,7 @@ public class GameRules { private final Supplier> d; private final BiFunction, String, String> e; - private EnumGameRuleType(Supplier supplier, BiFunction bifunction) { + private EnumGameRuleType(Supplier supplier, BiFunction, String, String> bifunction) { // Paper - decompile fix this.d = supplier; this.e = bifunction; } diff --git a/src/main/java/net/minecraft/server/NBTBase.java b/src/main/java/net/minecraft/server/NBTBase.java index cb0c08a144..9aabcb630f 100644 --- a/src/main/java/net/minecraft/server/NBTBase.java +++ b/src/main/java/net/minecraft/server/NBTBase.java @@ -88,7 +88,7 @@ public interface NBTBase { } } - NBTBase clone(); + public NBTBase clone(); // Paper - decompile fix default String asString() { return this.toString(); diff --git a/src/main/java/net/minecraft/server/RegistryBlockID.java b/src/main/java/net/minecraft/server/RegistryBlockID.java index 7f89562e90..4efcb8b595 100644 --- a/src/main/java/net/minecraft/server/RegistryBlockID.java +++ b/src/main/java/net/minecraft/server/RegistryBlockID.java @@ -27,7 +27,7 @@ public class RegistryBlockID implements Registry { this.b.put(t0, i); while (this.c.size() <= i) { - this.c.add((Object) null); + this.c.add(null); // Paper - decompile fix } this.c.set(i, t0); diff --git a/src/main/java/net/minecraft/server/RegistryID.java b/src/main/java/net/minecraft/server/RegistryID.java index 4cb78c6a3f..e15d286710 100644 --- a/src/main/java/net/minecraft/server/RegistryID.java +++ b/src/main/java/net/minecraft/server/RegistryID.java @@ -17,9 +17,9 @@ public class RegistryID implements Registry { public RegistryID(int i) { i = (int) ((float) i / 0.8F); - this.b = (Object[]) (new Object[i]); + this.b = (K[]) (new Object[i]); // Paper - decompile fix this.c = new int[i]; - this.d = (Object[]) (new Object[i]); + this.d = (K[]) (new Object[i]); // Paper - decompile fix } public int getId(@Nullable K k0) { @@ -55,9 +55,9 @@ public class RegistryID implements Registry { K[] ak = this.b; int[] aint = this.c; - this.b = (Object[]) (new Object[i]); + this.b = (K[]) (new Object[i]); // Paper - decompile fix this.c = new int[i]; - this.d = (Object[]) (new Object[i]); + this.d = (K[]) (new Object[i]); // Paper - decompile fix this.e = 0; this.f = 0; diff --git a/src/main/java/net/minecraft/server/WorldPersistentData.java b/src/main/java/net/minecraft/server/WorldPersistentData.java index 096277de1c..d484e626d2 100644 --- a/src/main/java/net/minecraft/server/WorldPersistentData.java +++ b/src/main/java/net/minecraft/server/WorldPersistentData.java @@ -37,7 +37,7 @@ public class WorldPersistentData { if (t0 != null) { return t0; } else { - T t1 = (PersistentBase) supplier.get(); + T t1 = supplier.get(); // Paper - decompile fix this.a(t1); return t1; @@ -64,7 +64,7 @@ public class WorldPersistentData { } } - return persistentbase; + return (T) persistentbase; // Paper - decompile fix } public void a(PersistentBase persistentbase) { -- 2.21.0