2019-04-05 03:13:49 +02:00
From 30a67e448eb304db37ace97ac0cc0f1347cd5bb6 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
2019-01-01 04:15:55 +01:00
diff --git a/src/main/java/net/minecraft/server/BiomeBase.java b/src/main/java/net/minecraft/server/BiomeBase.java
index bcb4b5e5c..c399bdecc 100644
--- a/src/main/java/net/minecraft/server/BiomeBase.java
+++ b/src/main/java/net/minecraft/server/BiomeBase.java
@@ -124,7 +124,7 @@ public abstract class BiomeBase {
@Nullable
public static BiomeBase a(BiomeBase biomebase) {
- return (BiomeBase) BiomeBase.aH.fromId(IRegistry.BIOME.a((Object) biomebase));
+ return (BiomeBase) BiomeBase.aH.fromId(IRegistry.BIOME.a(biomebase)); // Paper - decompile fix
2018-08-26 20:11:49 +02:00
}
2019-01-01 04:15:55 +01:00
public static <C extends WorldGenFeatureConfiguration> WorldGenCarverWrapper<C> a(WorldGenCarver<C> worldgencarver, C c0) {
2018-07-19 19:50:34 +02:00
diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java
2019-04-05 03:13:49 +02:00
index 16bca7942..13dc7abc5 100644
2018-07-19 19:50:34 +02:00
--- a/src/main/java/net/minecraft/server/BlockPosition.java
+++ b/src/main/java/net/minecraft/server/BlockPosition.java
2019-01-01 04:15:55 +01:00
@@ -10,7 +10,7 @@ import org.apache.logging.log4j.Logger;
@Immutable
public class BlockPosition extends BaseBlockPosition {
- 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;
@@ -147,7 +147,7 @@ public class BlockPosition extends BaseBlockPosition {
return a(Math.min(blockposition.getX(), blockposition1.getX()), Math.min(blockposition.getY(), blockposition1.getY()), Math.min(blockposition.getZ(), blockposition1.getZ()), Math.max(blockposition.getX(), blockposition1.getX()), Math.max(blockposition.getY(), blockposition1.getY()), Math.max(blockposition.getZ(), blockposition1.getZ()));
2018-12-17 06:18:06 +01:00
}
2019-01-01 04:15:55 +01:00
- public static Iterable<BlockPosition> a(int i, int j, int k, int l, int i1, int j1) {
+ public static Iterable<BlockPosition> a(int ix, int jx, int kx, int l, int i1, int j1) { // Paper - decompile fix
return () -> {
return new AbstractIterator<BlockPosition>() {
private boolean g = true;
@@ -158,21 +158,21 @@ public class BlockPosition extends BaseBlockPosition {
protected BlockPosition computeNext() {
if (this.g) {
this.g = false;
- this.h = i;
- this.i = j;
- this.j = k;
- return new BlockPosition(i, j, k);
+ this.h = ix; // Paper - decompile fix
+ this.i = jx; // Paper - decompile fix
+ this.j = kx; // Paper - decompile fix
+ return new BlockPosition(ix, jx, kx);
} else if (this.h == l && this.i == i1 && this.j == j1) {
return (BlockPosition) this.endOfData();
} else {
if (this.h < l) {
++this.h;
} else if (this.i < i1) {
- this.h = i;
+ this.h = ix; // Paper - decompile fix
++this.i;
} else if (this.j < j1) {
- this.h = i;
- this.i = j;
+ this.h = ix; // Paper - decompile fix
+ this.i = jx; // Paper - decompile fix
++this.j;
}
@@ -206,8 +206,11 @@ public class BlockPosition extends BaseBlockPosition {
2018-07-25 03:39:30 +02:00
if (this.g.b < l) {
++this.g.b;
} else if (this.g.c < i1) {
2019-01-01 04:15:55 +01:00
+ this.g.b = i; // Paper - decompile fix Readd line removed by the decompiler
2018-07-25 03:39:30 +02:00
++this.g.c;
} else if (this.g.d < j1) {
2019-01-01 04:15:55 +01:00
+ this.g.b = i; // Paper - decompile fix Readd line removed by the decompiler
+ this.g.c = j; // Paper - decompile fix Readd line removed by the decompiler
2018-07-25 03:39:30 +02:00
++this.g.d;
}
2019-01-01 04:15:55 +01:00
diff --git a/src/main/java/net/minecraft/server/BlockStateEnum.java b/src/main/java/net/minecraft/server/BlockStateEnum.java
index 401b6d970..986b9ccea 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<T extends Enum<T> & INamable> extends BlockState<T>
protected BlockStateEnum(String s, Class<T> oclass, Collection<T> collection) {
super(s, oclass);
this.a = ImmutableSet.copyOf(collection);
- Iterator iterator = collection.iterator();
+ Iterator<T> 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)) {
2018-07-19 23:55:27 +02:00
diff --git a/src/main/java/net/minecraft/server/DefinedStructure.java b/src/main/java/net/minecraft/server/DefinedStructure.java
2019-01-01 04:15:55 +01:00
index 66b168396..83db94c4a 100644
2018-07-19 23:55:27 +02:00
--- a/src/main/java/net/minecraft/server/DefinedStructure.java
+++ b/src/main/java/net/minecraft/server/DefinedStructure.java
2019-01-01 04:15:55 +01:00
@@ -85,7 +85,7 @@ public class DefinedStructure {
2018-07-19 23:55:27 +02:00
}
private void a(World world, BlockPosition blockposition, BlockPosition blockposition1) {
2019-01-01 04:15:55 +01:00
- List<Entity> list = world.a(Entity.class, new AxisAlignedBB(blockposition, blockposition1), (entity) -> {
+ List<Entity> list = world.a(Entity.class, new AxisAlignedBB(blockposition, blockposition1), (java.util.function.Predicate<? super Entity>) (entity) -> { // Paper - decompile fix
return !(entity instanceof EntityHuman);
2018-07-19 23:55:27 +02:00
});
2019-01-01 04:15:55 +01:00
@@ -235,7 +235,7 @@ public class DefinedStructure {
boolean flag = true;
EnumDirection[] aenumdirection = new EnumDirection[] { EnumDirection.UP, EnumDirection.NORTH, EnumDirection.EAST, EnumDirection.SOUTH, EnumDirection.WEST};
2018-07-19 23:55:27 +02:00
2019-01-01 04:15:55 +01:00
- int l1;
+ //int l1; // Paper - decompile fix
2018-07-19 23:55:27 +02:00
2019-01-01 04:15:55 +01:00
while (flag && !list1.isEmpty()) {
flag = false;
@@ -245,7 +245,7 @@ public class DefinedStructure {
BlockPosition blockposition2 = (BlockPosition) iterator1.next();
Fluid fluid1 = generatoraccess.getFluid(blockposition2);
2018-07-19 23:55:27 +02:00
2019-01-01 04:15:55 +01:00
- for (l1 = 0; l1 < aenumdirection.length && !fluid1.d(); ++l1) {
+ for (int l1 = 0; l1 < aenumdirection.length && !fluid1.d(); ++l1) { // Paper - decompile fix
Fluid fluid2 = generatoraccess.getFluid(blockposition2.shift(aenumdirection[l1]));
2018-12-17 06:18:06 +01:00
2019-01-01 04:15:55 +01:00
if (fluid2.getHeight() > fluid1.getHeight() || fluid2.d() && !fluid1.d()) {
@@ -270,7 +270,7 @@ public class DefinedStructure {
int i2 = j;
int j2 = k;
2018-12-17 06:18:06 +01:00
2019-01-01 04:15:55 +01:00
- l1 = l;
+ int l1 = l; // Paper - decompile fix
Iterator iterator2 = list2.iterator();
2018-08-01 03:13:40 +02:00
2019-01-01 04:15:55 +01:00
Pair pair;
@@ -717,7 +717,7 @@ public class DefinedStructure {
public IBlockData a(int i) {
IBlockData iblockdata = (IBlockData) this.b.fromId(i);
2018-09-01 12:09:13 +02:00
2019-01-01 04:15:55 +01:00
- return iblockdata == null ? DefinedStructure.a.a : iblockdata;
+ return iblockdata == null ? a : iblockdata; // Paper - decompile fix
2018-08-26 20:11:49 +02:00
}
2019-01-01 04:15:55 +01:00
public Iterator<IBlockData> iterator() {
2019-04-05 03:13:49 +02:00
diff --git a/src/main/java/net/minecraft/server/GameRules.java b/src/main/java/net/minecraft/server/GameRules.java
index d954b94c3..fd2a4f1b8 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<String, GameRules.GameRuleDefinition> a = (TreeMap) SystemUtils.a((Object) (new TreeMap()), (treemap) -> {
+ private static final TreeMap<String, GameRules.GameRuleDefinition> 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<ArgumentType<?>> d;
private final BiFunction<CommandContext<CommandListenerWrapper>, String, String> e;
- private EnumGameRuleType(Supplier supplier, BiFunction bifunction) {
+ private EnumGameRuleType(Supplier supplier, BiFunction<CommandContext<CommandListenerWrapper>, String, String> bifunction) { // Paper - decompile fix
this.d = supplier;
this.e = bifunction;
}
2018-08-26 20:11:49 +02:00
diff --git a/src/main/java/net/minecraft/server/NBTBase.java b/src/main/java/net/minecraft/server/NBTBase.java
2019-01-01 04:15:55 +01:00
index 1425584ed..b2757aad8 100644
2018-08-26 20:11:49 +02:00
--- a/src/main/java/net/minecraft/server/NBTBase.java
+++ b/src/main/java/net/minecraft/server/NBTBase.java
2019-01-01 04:15:55 +01:00
@@ -88,7 +88,7 @@ public interface NBTBase {
2018-08-26 20:11:49 +02:00
}
}
2018-09-01 00:56:57 +02:00
- NBTBase clone();
+ public NBTBase clone(); // Paper - decompile fix
2018-12-08 11:09:55 +01:00
default String asString() {
2018-09-01 00:56:57 +02:00
return this.toString();
2018-08-26 20:11:49 +02:00
diff --git a/src/main/java/net/minecraft/server/NBTTagByteArray.java b/src/main/java/net/minecraft/server/NBTTagByteArray.java
2019-01-01 04:15:55 +01:00
index 767013cae..e0fb6fb49 100644
2018-08-26 20:11:49 +02:00
--- a/src/main/java/net/minecraft/server/NBTTagByteArray.java
+++ b/src/main/java/net/minecraft/server/NBTTagByteArray.java
@@ -66,7 +66,8 @@ public class NBTTagByteArray extends NBTList<NBTTagByte> {
return stringbuilder.append(']').toString();
}
- public NBTBase clone() {
+ @Override
+ public NBTTagByteArray clone() { // Paper - decompile fix
byte[] abyte = new byte[this.data.length];
System.arraycopy(this.data, 0, abyte, 0, this.data.length);
diff --git a/src/main/java/net/minecraft/server/NBTTagList.java b/src/main/java/net/minecraft/server/NBTTagList.java
2019-01-01 04:15:55 +01:00
index 2b7b8be8a..27debcfca 100644
2018-08-26 20:11:49 +02:00
--- a/src/main/java/net/minecraft/server/NBTTagList.java
+++ b/src/main/java/net/minecraft/server/NBTTagList.java
2019-01-01 04:15:55 +01:00
@@ -14,7 +14,7 @@ import org.apache.logging.log4j.Logger;
2018-09-01 00:56:57 +02:00
public class NBTTagList extends NBTList<NBTBase> {
2019-01-01 04:15:55 +01:00
2018-08-26 20:11:49 +02:00
private static final Logger f = LogManager.getLogger();
- private List<NBTBase> list = Lists.newArrayList();
+ public List<NBTBase> list = Lists.newArrayList(); // Paper
private byte type = 0;
2019-01-01 04:15:55 +01:00
public NBTTagList() {}
2018-09-01 00:56:57 +02:00
diff --git a/src/main/java/net/minecraft/server/Registry.java b/src/main/java/net/minecraft/server/Registry.java
2019-01-01 04:15:55 +01:00
index 723372f26..9efec49d6 100644
2018-09-01 00:56:57 +02:00
--- a/src/main/java/net/minecraft/server/Registry.java
+++ b/src/main/java/net/minecraft/server/Registry.java
2019-01-01 04:15:55 +01:00
@@ -1,3 +1,8 @@
2018-09-01 00:56:57 +02:00
package net.minecraft.server;
2019-01-01 04:15:55 +01:00
-public interface Registry extends Iterable {}
2018-09-01 00:56:57 +02:00
+import java.util.Iterator;
+public interface Registry<T> extends Iterable<T> { // Paper - decompile fix
+
+ @Override
+ Iterator<T> iterator(); // Paper - decompile fix
2019-01-01 04:15:55 +01:00
+}
2018-08-26 20:11:49 +02:00
diff --git a/src/main/java/net/minecraft/server/RegistryBlockID.java b/src/main/java/net/minecraft/server/RegistryBlockID.java
2019-01-01 04:15:55 +01:00
index 50410264f..a894f7886 100644
2018-08-26 20:11:49 +02:00
--- a/src/main/java/net/minecraft/server/RegistryBlockID.java
+++ b/src/main/java/net/minecraft/server/RegistryBlockID.java
2019-01-01 04:15:55 +01:00
@@ -27,7 +27,7 @@ public class RegistryBlockID<T> implements Registry<T> {
this.b.put(t0, i);
2018-08-26 20:11:49 +02:00
2019-01-01 04:15:55 +01:00
while (this.c.size() <= i) {
- this.c.add((Object) null);
2018-08-26 20:11:49 +02:00
+ this.c.add(null); // Paper - decompile fix
}
2019-01-01 04:15:55 +01:00
this.c.set(i, t0);
2018-07-23 19:10:06 +02:00
diff --git a/src/main/java/net/minecraft/server/RegistryID.java b/src/main/java/net/minecraft/server/RegistryID.java
2019-01-01 04:15:55 +01:00
index 9400a4369..5a5c464ea 100644
2018-07-23 19:10:06 +02:00
--- a/src/main/java/net/minecraft/server/RegistryID.java
+++ b/src/main/java/net/minecraft/server/RegistryID.java
2019-01-01 04:15:55 +01:00
@@ -17,9 +17,9 @@ public class RegistryID<K> implements Registry<K> {
2018-07-23 19:10:06 +02:00
2019-01-01 04:15:55 +01:00
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
2018-07-23 19:10:06 +02:00
this.c = new int[i];
2019-01-01 04:15:55 +01:00
- this.d = (Object[]) (new Object[i]);
+ this.d = (K[]) (new Object[i]); // Paper - decompile fix
2018-08-26 20:11:49 +02:00
}
2019-01-01 04:15:55 +01:00
public int getId(@Nullable K k0) {
@@ -54,9 +54,9 @@ public class RegistryID<K> implements Registry<K> {
K[] ak = this.b;
int[] aint = this.c;
2018-08-01 03:13:40 +02:00
2019-01-01 04:15:55 +01:00
- 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;
2018-12-17 06:18:06 +01:00
diff --git a/src/main/java/net/minecraft/server/WorldPersistentData.java b/src/main/java/net/minecraft/server/WorldPersistentData.java
2019-01-01 04:15:55 +01:00
index c01a05b25..478bf4997 100644
2018-12-17 06:18:06 +01:00
--- a/src/main/java/net/minecraft/server/WorldPersistentData.java
+++ b/src/main/java/net/minecraft/server/WorldPersistentData.java
2019-01-01 04:15:55 +01:00
@@ -39,14 +39,14 @@ public class WorldPersistentData {
@Nullable
public <T extends PersistentBase> T a(Function<String, T> function, String s) {
- PersistentBase persistentbase = (PersistentBase) this.data.get(s);
+ T persistentbase = (T) this.data.get(s); // Paper - decompile fix
if (persistentbase == null && this.e != null) {
try {
File file = this.e.getDataFile(this.b, s);
if (file != null && file.exists()) {
- persistentbase = (PersistentBase) function.apply(s);
+ persistentbase = function.apply(s); // Paper - decompile fix
persistentbase.a(a(this.e, this.b, s, 1631).getCompound("data"));
this.data.put(s, persistentbase);
2018-12-17 06:18:06 +01:00
}
2016-03-31 02:50:23 +02:00
--
2019-04-05 03:13:49 +02:00
2.21.0
2016-03-31 02:50:23 +02:00