mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-04 10:11:29 +01:00
8833b1ba15
This is for 2 reasons: 1) Ensuring our log4j is mostly loaded at OUR version. I've seen stack traces with line numbers that do not match our version. This means that some plugin has shaded in log4j and their loaded version is mixing with ours.... So by at least trying to load a bunch of log4j classes before we load plugins, we can be more sure mixed versions are not loading. 2) If the jar file is replaced while the server is runnimg class not found errors galore This will preloaod a bunch of classes commonly seen to error during shutdown due to this. The goal here is to help let the server shutdown gracefully as possible. Some plugins will still blow up here if they access a class that hadn't been loaded yet, but goal is to at least stop freezing the shutdown process as it does with JLine and Log4j errors requiring an external kill. Ideally you should not replace jars while the server is running, but it is something that happens in development for testing. Updated test server to do a copy though to avoid this happening in Paper development.
736 lines
55 KiB
Diff
736 lines
55 KiB
Diff
From 0000000000000000000000000000000000000000 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/ArraySetSorted.java b/src/main/java/net/minecraft/server/ArraySetSorted.java
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/net/minecraft/server/ArraySetSorted.java
|
|
+++ b/src/main/java/net/minecraft/server/ArraySetSorted.java
|
|
@@ -0,0 +0,0 @@ public class ArraySetSorted<T> extends AbstractSet<T> {
|
|
}
|
|
|
|
public static <T extends Comparable<T>> ArraySetSorted<T> a(int i) {
|
|
- return new ArraySetSorted<>(i, Comparator.naturalOrder());
|
|
+ return new ArraySetSorted<>(i, (Comparator)Comparator.naturalOrder()); // Paper - decompile fix
|
|
}
|
|
|
|
private static <T> T[] a(Object[] aobject) {
|
|
- return (Object[]) aobject;
|
|
+ return (T[])aobject; // Paper - decompile fix
|
|
}
|
|
|
|
private int c(T t0) {
|
|
@@ -0,0 +0,0 @@ public class ArraySetSorted<T> extends AbstractSet<T> {
|
|
}
|
|
|
|
public boolean remove(Object object) {
|
|
- int i = this.c(object);
|
|
+ int i = this.c((T)object); // Paper - decompile fix
|
|
|
|
if (i >= 0) {
|
|
this.d(i);
|
|
@@ -0,0 +0,0 @@ public class ArraySetSorted<T> extends AbstractSet<T> {
|
|
}
|
|
|
|
public boolean contains(Object object) {
|
|
- int i = this.c(object);
|
|
+ int i = this.c((T)object); // Paper - decompile fix
|
|
|
|
return i >= 0;
|
|
}
|
|
@@ -0,0 +0,0 @@ public class ArraySetSorted<T> extends AbstractSet<T> {
|
|
|
|
public <U> U[] toArray(U[] au) {
|
|
if (au.length < this.c) {
|
|
- return (Object[]) Arrays.copyOf(this.b, this.c, au.getClass());
|
|
+ return (U[])Arrays.copyOf(this.b, this.c, au.getClass()); // Paper - decompile fix
|
|
} else {
|
|
System.arraycopy(this.b, 0, au, 0, this.c);
|
|
if (au.length > this.c) {
|
|
diff --git a/src/main/java/net/minecraft/server/BiomeBase.java b/src/main/java/net/minecraft/server/BiomeBase.java
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/net/minecraft/server/BiomeBase.java
|
|
+++ b/src/main/java/net/minecraft/server/BiomeBase.java
|
|
@@ -0,0 +0,0 @@ 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 <C extends WorldGenCarverConfiguration> WorldGenCarverWrapper<C> a(WorldGenCarverAbstract<C> worldgencarverabstract, C c0) {
|
|
@@ -0,0 +0,0 @@ public abstract class BiomeBase {
|
|
|
|
@Nullable
|
|
public <C extends WorldGenFeatureConfiguration> C b(StructureGenerator<C> structuregenerator) {
|
|
- return (WorldGenFeatureConfiguration) this.t.get(structuregenerator);
|
|
+ return (C) this.t.get(structuregenerator); // Paper - decompile fix
|
|
}
|
|
|
|
public List<WorldGenFeatureConfigured<?, ?>> g() {
|
|
diff --git a/src/main/java/net/minecraft/server/BlockDataAbstract.java b/src/main/java/net/minecraft/server/BlockDataAbstract.java
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/net/minecraft/server/BlockDataAbstract.java
|
|
+++ b/src/main/java/net/minecraft/server/BlockDataAbstract.java
|
|
@@ -0,0 +0,0 @@ public abstract class BlockDataAbstract<O, S> implements IBlockDataHolder<S> {
|
|
}
|
|
|
|
private <T extends Comparable<T>> String a(IBlockState<T> iblockstate, Comparable<?> comparable) {
|
|
- return iblockstate.a(comparable);
|
|
+ return iblockstate.a((T) comparable); // Paper - decompiler fix
|
|
}
|
|
};
|
|
protected final O a;
|
|
@@ -0,0 +0,0 @@ public abstract class BlockDataAbstract<O, S> implements IBlockDataHolder<S> {
|
|
}
|
|
|
|
public <T extends Comparable<T>> S a(IBlockState<T> iblockstate) {
|
|
- return this.set(iblockstate, (Comparable) a(iblockstate.getValues(), this.get(iblockstate)));
|
|
+ return this.set(iblockstate, a(iblockstate.getValues(), this.get(iblockstate))); // Paper - decompile fix
|
|
}
|
|
|
|
protected static <T> T a(Collection<T> collection, T t0) {
|
|
- Iterator iterator = collection.iterator();
|
|
+ Iterator<T> iterator = collection.iterator(); // Paper - decompiler fix
|
|
|
|
do {
|
|
if (!iterator.hasNext()) {
|
|
@@ -0,0 +0,0 @@ public abstract class BlockDataAbstract<O, S> implements IBlockDataHolder<S> {
|
|
if (comparable == null) {
|
|
throw new IllegalArgumentException("Cannot get property " + iblockstate + " as it does not exist in " + this.a);
|
|
} else {
|
|
- return (Comparable) iblockstate.b().cast(comparable);
|
|
+ return iblockstate.b().cast(comparable); // Paper - decompiler fix
|
|
}
|
|
}
|
|
|
|
@@ -0,0 +0,0 @@ public abstract class BlockDataAbstract<O, S> implements IBlockDataHolder<S> {
|
|
if (comparable == null) {
|
|
throw new IllegalArgumentException("Cannot set property " + iblockstate + " as it does not exist in " + this.a);
|
|
} else if (comparable == v0) {
|
|
- return this;
|
|
+ return (S) this; // Paper - decompiler fix
|
|
} else {
|
|
S s0 = this.e.get(iblockstate, v0);
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/net/minecraft/server/BlockPosition.java
|
|
+++ b/src/main/java/net/minecraft/server/BlockPosition.java
|
|
@@ -0,0 +0,0 @@ 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<? super Integer>) (i) -> { // Paper - decomile fix
|
|
aint[0] = i;
|
|
- }) && ofint.tryAdvance((i) -> {
|
|
+ }) && ofint.tryAdvance((Consumer<? super Integer>) (i) -> { // Paper - decompile fix
|
|
aint[1] = i;
|
|
})) {
|
|
- ofint.tryAdvance((i) -> {
|
|
+ ofint.tryAdvance((Consumer<? super Integer>) (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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/net/minecraft/server/BlockStateEnum.java
|
|
+++ b/src/main/java/net/minecraft/server/BlockStateEnum.java
|
|
@@ -0,0 +0,0 @@ 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)) {
|
|
diff --git a/src/main/java/net/minecraft/server/ChunkStatus.java b/src/main/java/net/minecraft/server/ChunkStatus.java
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/net/minecraft/server/ChunkStatus.java
|
|
+++ b/src/main/java/net/minecraft/server/ChunkStatus.java
|
|
@@ -0,0 +0,0 @@ public class ChunkStatus {
|
|
return (CompletableFuture) function.apply(ichunkaccess);
|
|
});
|
|
private static final List<ChunkStatus> q = ImmutableList.of(ChunkStatus.FULL, ChunkStatus.FEATURES, ChunkStatus.LIQUID_CARVERS, ChunkStatus.STRUCTURE_STARTS, ChunkStatus.STRUCTURE_STARTS, ChunkStatus.STRUCTURE_STARTS, ChunkStatus.STRUCTURE_STARTS, ChunkStatus.STRUCTURE_STARTS, ChunkStatus.STRUCTURE_STARTS, ChunkStatus.STRUCTURE_STARTS, ChunkStatus.STRUCTURE_STARTS);
|
|
- private static final IntList r = (IntList) SystemUtils.a((Object) (new IntArrayList(a().size())), (intarraylist) -> {
|
|
+ private static final IntList r = (IntList) SystemUtils.a((new IntArrayList(a().size())), (java.util.function.Consumer<IntArrayList>)(IntArrayList intarraylist) -> { // Paper - decompile fix
|
|
int i = 0;
|
|
|
|
for (int j = a().size() - 1; j >= 0; --j) {
|
|
diff --git a/src/main/java/net/minecraft/server/CraftingManager.java b/src/main/java/net/minecraft/server/CraftingManager.java
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/net/minecraft/server/CraftingManager.java
|
|
+++ b/src/main/java/net/minecraft/server/CraftingManager.java
|
|
@@ -0,0 +0,0 @@ public class CraftingManager extends ResourceDataJson {
|
|
}
|
|
|
|
this.recipes = (Map) map1.entrySet().stream().collect(ImmutableMap.toImmutableMap(Entry::getKey, (entry1) -> {
|
|
- return (entry1.getValue()); // CraftBukkit
|
|
+ return entry1.getValue(); // CraftBukkit // Paper - decompile fix - *shrugs internally*
|
|
}));
|
|
CraftingManager.LOGGER.info("Loaded {} recipes", map1.size());
|
|
}
|
|
diff --git a/src/main/java/net/minecraft/server/EntityVindicator.java b/src/main/java/net/minecraft/server/EntityVindicator.java
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityVindicator.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityVindicator.java
|
|
@@ -0,0 +0,0 @@ public class EntityVindicator extends EntityIllagerAbstract {
|
|
this.goalSelector.a(2, new EntityIllagerAbstract.b(this));
|
|
this.goalSelector.a(3, new EntityRaider.a(this, 10.0F));
|
|
this.goalSelector.a(4, new EntityVindicator.c(this));
|
|
- this.targetSelector.a(1, (new PathfinderGoalHurtByTarget(this, new Class[]{EntityRaider.class})).a());
|
|
+ this.targetSelector.a(1, (new PathfinderGoalHurtByTarget(this, new Class[]{EntityRaider.class})).a(new Class[0])); // Paper - decompile fix
|
|
this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, true));
|
|
this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityVillagerAbstract.class, true));
|
|
this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityIronGolem.class, true));
|
|
diff --git a/src/main/java/net/minecraft/server/Fluid.java b/src/main/java/net/minecraft/server/Fluid.java
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/net/minecraft/server/Fluid.java
|
|
+++ b/src/main/java/net/minecraft/server/Fluid.java
|
|
@@ -0,0 +0,0 @@ public interface Fluid extends IBlockDataHolder<Fluid> {
|
|
if (immutablemap.isEmpty()) {
|
|
object = dynamicops.createMap(ImmutableMap.of(dynamicops.createString("Name"), dynamicops.createString(IRegistry.FLUID.getKey(fluid.getType()).toString())));
|
|
} else {
|
|
- object = dynamicops.createMap(ImmutableMap.of(dynamicops.createString("Name"), dynamicops.createString(IRegistry.FLUID.getKey(fluid.getType()).toString()), dynamicops.createString("Properties"), dynamicops.createMap((Map) immutablemap.entrySet().stream().map((entry) -> {
|
|
+ object = dynamicops.createMap(ImmutableMap.of(dynamicops.createString("Name"), dynamicops.createString(IRegistry.FLUID.getKey(fluid.getType()).toString()), dynamicops.createString("Properties"), dynamicops.createMap(immutablemap.entrySet().stream().map((entry) -> { // Paper - decompile fix
|
|
return Pair.of(dynamicops.createString(((IBlockState) entry.getKey()).a()), dynamicops.createString(IBlockDataHolder.b((IBlockState) entry.getKey(), (Comparable) entry.getValue())));
|
|
}).collect(Collectors.toMap(Pair::getFirst, Pair::getSecond)))));
|
|
}
|
|
diff --git a/src/main/java/net/minecraft/server/IAsyncTaskHandler.java b/src/main/java/net/minecraft/server/IAsyncTaskHandler.java
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/net/minecraft/server/IAsyncTaskHandler.java
|
|
+++ b/src/main/java/net/minecraft/server/IAsyncTaskHandler.java
|
|
@@ -0,0 +0,0 @@ public abstract class IAsyncTaskHandler<R extends Runnable> implements Mailbox<R
|
|
return this.executeFuture(runnable);
|
|
} else {
|
|
runnable.run();
|
|
- return CompletableFuture.completedFuture((Object) null);
|
|
+ return CompletableFuture.completedFuture(null); // Paper - decompile fix
|
|
}
|
|
}
|
|
|
|
@@ -0,0 +0,0 @@ public abstract class IAsyncTaskHandler<R extends Runnable> implements Mailbox<R
|
|
}
|
|
|
|
protected boolean executeNext() {
|
|
- R r0 = (Runnable) this.d.peek();
|
|
+ R r0 = this.d.peek(); // Paper - decompile fix
|
|
|
|
if (r0 == null) {
|
|
return false;
|
|
} else if (this.e == 0 && !this.canExecute(r0)) {
|
|
return false;
|
|
} else {
|
|
- this.executeTask((Runnable) this.d.remove());
|
|
+ this.executeTask(this.d.remove()); // Paper - decompile fix
|
|
return true;
|
|
}
|
|
}
|
|
diff --git a/src/main/java/net/minecraft/server/IBlockData.java b/src/main/java/net/minecraft/server/IBlockData.java
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/net/minecraft/server/IBlockData.java
|
|
+++ b/src/main/java/net/minecraft/server/IBlockData.java
|
|
@@ -0,0 +0,0 @@ public class IBlockData extends BlockDataAbstract<Block, IBlockData> implements
|
|
|
|
public static <T> Dynamic<T> a(DynamicOps<T> dynamicops, IBlockData iblockdata) {
|
|
ImmutableMap<IBlockState<?>, Comparable<?>> immutablemap = iblockdata.getStateMap();
|
|
- Object object;
|
|
+ T object; // Paper - decompile fix
|
|
|
|
if (immutablemap.isEmpty()) {
|
|
object = dynamicops.createMap(ImmutableMap.of(dynamicops.createString("Name"), dynamicops.createString(IRegistry.BLOCK.getKey(iblockdata.getBlock()).toString())));
|
|
} else {
|
|
- object = dynamicops.createMap(ImmutableMap.of(dynamicops.createString("Name"), dynamicops.createString(IRegistry.BLOCK.getKey(iblockdata.getBlock()).toString()), dynamicops.createString("Properties"), dynamicops.createMap((Map) immutablemap.entrySet().stream().map((entry) -> {
|
|
+ object = dynamicops.createMap(ImmutableMap.of(dynamicops.createString("Name"), dynamicops.createString(IRegistry.BLOCK.getKey(iblockdata.getBlock()).toString()), dynamicops.createString("Properties"), dynamicops.createMap(immutablemap.entrySet().stream().map((entry) -> { // Paper - decompile fix
|
|
return Pair.of(dynamicops.createString(((IBlockState) entry.getKey()).a()), dynamicops.createString(IBlockDataHolder.b((IBlockState) entry.getKey(), (Comparable) entry.getValue())));
|
|
}).collect(Collectors.toMap(Pair::getFirst, Pair::getSecond)))));
|
|
}
|
|
@@ -0,0 +0,0 @@ public class IBlockData extends BlockDataAbstract<Block, IBlockData> implements
|
|
if (!iblockdata.o()) {
|
|
this.f = null;
|
|
} else {
|
|
- this.f = new VoxelShape[IBlockData.a.a.length];
|
|
+ this.f = new VoxelShape[a.length]; // Paper - decompile fix
|
|
VoxelShape voxelshape = block.i(iblockdata, BlockAccessAir.INSTANCE, BlockPosition.ZERO);
|
|
- EnumDirection[] aenumdirection = IBlockData.a.a;
|
|
+ EnumDirection[] aenumdirection = a; // Paper - decompile fix
|
|
|
|
i = aenumdirection.length;
|
|
|
|
@@ -0,0 +0,0 @@ public class IBlockData extends BlockDataAbstract<Block, IBlockData> implements
|
|
return this.g.b(enumdirection_enumaxis) < 0.0D || this.g.c(enumdirection_enumaxis) > 1.0D;
|
|
});
|
|
this.i = new boolean[6];
|
|
- EnumDirection[] aenumdirection1 = IBlockData.a.a;
|
|
+ EnumDirection[] aenumdirection1 = a; // Paper - decompile fix
|
|
int k = aenumdirection1.length;
|
|
|
|
for (i = 0; i < k; ++i) {
|
|
diff --git a/src/main/java/net/minecraft/server/IEntityAccess.java b/src/main/java/net/minecraft/server/IEntityAccess.java
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/net/minecraft/server/IEntityAccess.java
|
|
+++ b/src/main/java/net/minecraft/server/IEntityAccess.java
|
|
@@ -0,0 +0,0 @@ public interface IEntityAccess {
|
|
return Stream.empty();
|
|
} else {
|
|
AxisAlignedBB axisalignedbb1 = axisalignedbb.g(1.0E-7D);
|
|
- Stream stream = this.getEntities(entity, axisalignedbb1).stream().filter((entity1) -> {
|
|
+ Stream<AxisAlignedBB> stream = this.getEntities(entity, axisalignedbb1).stream().filter((entity1) -> { // Paper - decompile fix
|
|
return !set.contains(entity1);
|
|
}).filter((entity1) -> {
|
|
return entity == null || !entity.isSameVehicle(entity1);
|
|
@@ -0,0 +0,0 @@ public interface IEntityAccess {
|
|
return Stream.of(entity1.au(), entity == null ? null : entity.j(entity1));
|
|
}).filter(Objects::nonNull);
|
|
|
|
- axisalignedbb1.getClass();
|
|
return stream.filter(axisalignedbb1::c).map(VoxelShapes::a);
|
|
}
|
|
}
|
|
@@ -0,0 +0,0 @@ public interface IEntityAccess {
|
|
|
|
@Nullable
|
|
default <T extends EntityLiving> T a(Class<? extends T> oclass, PathfinderTargetCondition pathfindertargetcondition, @Nullable EntityLiving entityliving, double d0, double d1, double d2, AxisAlignedBB axisalignedbb) {
|
|
- return this.a(this.a(oclass, axisalignedbb, (Predicate) null), pathfindertargetcondition, entityliving, d0, d1, d2);
|
|
+ return this.a(this.a(oclass, axisalignedbb, null), pathfindertargetcondition, entityliving, d0, d1, d2); // Paper - decompile fix
|
|
}
|
|
|
|
@Nullable
|
|
default <T extends EntityLiving> T b(Class<? extends T> oclass, PathfinderTargetCondition pathfindertargetcondition, @Nullable EntityLiving entityliving, double d0, double d1, double d2, AxisAlignedBB axisalignedbb) {
|
|
- return this.a(this.b(oclass, axisalignedbb, (Predicate) null), pathfindertargetcondition, entityliving, d0, d1, d2);
|
|
+ return this.a(this.b(oclass, axisalignedbb, null), pathfindertargetcondition, entityliving, d0, d1, d2); // Paper - decompile fix
|
|
}
|
|
|
|
@Nullable
|
|
default <T extends EntityLiving> T a(List<? extends T> list, PathfinderTargetCondition pathfindertargetcondition, @Nullable EntityLiving entityliving, double d0, double d1, double d2) {
|
|
double d3 = -1.0D;
|
|
T t0 = null;
|
|
- Iterator iterator = list.iterator();
|
|
+ Iterator<? extends T> iterator = list.iterator(); // Paper - decompile fix
|
|
|
|
while (iterator.hasNext()) {
|
|
- T t1 = (EntityLiving) iterator.next();
|
|
+ T t1 = iterator.next(); // Paper - decompile fix
|
|
|
|
if (pathfindertargetcondition.a(entityliving, t1)) {
|
|
double d4 = t1.g(d0, d1, d2);
|
|
@@ -0,0 +0,0 @@ public interface IEntityAccess {
|
|
default <T extends EntityLiving> List<T> a(Class<? extends T> oclass, PathfinderTargetCondition pathfindertargetcondition, EntityLiving entityliving, AxisAlignedBB axisalignedbb) {
|
|
List<T> list = this.a(oclass, axisalignedbb, (Predicate) null);
|
|
List<T> list1 = Lists.newArrayList();
|
|
- Iterator iterator = list.iterator();
|
|
+ Iterator<T> iterator = list.iterator(); // Paper - decompile fix
|
|
|
|
while (iterator.hasNext()) {
|
|
- T t0 = (EntityLiving) iterator.next();
|
|
+ T t0 = iterator.next(); // Paper - decompile fix
|
|
|
|
if (pathfindertargetcondition.a(entityliving, t0)) {
|
|
list1.add(t0);
|
|
diff --git a/src/main/java/net/minecraft/server/IOWorker.java b/src/main/java/net/minecraft/server/IOWorker.java
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/net/minecraft/server/IOWorker.java
|
|
+++ b/src/main/java/net/minecraft/server/IOWorker.java
|
|
@@ -0,0 +0,0 @@ public class IOWorker implements AutoCloseable {
|
|
if (throwable != null) {
|
|
completablefuture.completeExceptionally(throwable);
|
|
} else {
|
|
- completablefuture.complete((Object) null);
|
|
+ completablefuture.complete(null); // Paper - Decompile fix
|
|
}
|
|
|
|
});
|
|
@@ -0,0 +0,0 @@ public class IOWorker implements AutoCloseable {
|
|
}));
|
|
|
|
completablefuture1.whenComplete((object, throwable) -> {
|
|
- completablefuture.complete((Object) null);
|
|
+ completablefuture.complete(null); // Paper - decompile fix
|
|
});
|
|
};
|
|
});
|
|
@@ -0,0 +0,0 @@ public class IOWorker implements AutoCloseable {
|
|
private void a(ChunkCoordIntPair chunkcoordintpair, IOWorker.a ioworker_a) {
|
|
try {
|
|
this.e.write(chunkcoordintpair, ioworker_a.a);
|
|
- ioworker_a.b.complete((Object) null);
|
|
+ ioworker_a.b.complete(null); // Paper - decompile fix
|
|
} catch (Exception exception) {
|
|
IOWorker.LOGGER.error("Failed to store chunk {}", chunkcoordintpair, exception);
|
|
ioworker_a.b.completeExceptionally(exception);
|
|
@@ -0,0 +0,0 @@ public class IOWorker implements AutoCloseable {
|
|
private void g() {
|
|
try {
|
|
this.e.close();
|
|
- this.h.complete((Object) null);
|
|
+ this.h.complete(null); // Paper - decompile fix
|
|
} catch (Exception exception) {
|
|
IOWorker.LOGGER.error("Failed to close storage", exception);
|
|
this.h.completeExceptionally(exception);
|
|
diff --git a/src/main/java/net/minecraft/server/LightEngineStorageSky.java b/src/main/java/net/minecraft/server/LightEngineStorageSky.java
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/net/minecraft/server/LightEngineStorageSky.java
|
|
+++ b/src/main/java/net/minecraft/server/LightEngineStorageSky.java
|
|
@@ -0,0 +0,0 @@ public class LightEngineStorageSky extends LightEngineStorage<LightEngineStorage
|
|
int l = lightenginestoragesky_a.c.get(SectionPosition.f(j));
|
|
|
|
if (l != lightenginestoragesky_a.b && k < l) {
|
|
- NibbleArray nibblearray = this.a((LightEngineStorageArray) lightenginestoragesky_a, j);
|
|
+ NibbleArray nibblearray = this.a(lightenginestoragesky_a, j); // Paper - decompile fix
|
|
|
|
if (nibblearray == null) {
|
|
- for (i = BlockPosition.f(i); nibblearray == null; nibblearray = this.a((LightEngineStorageArray) lightenginestoragesky_a, j)) {
|
|
+ for (i = BlockPosition.f(i); nibblearray == null; nibblearray = this.a(lightenginestoragesky_a, j)) { // Paper - decompile fix
|
|
j = SectionPosition.a(j, EnumDirection.UP);
|
|
++k;
|
|
if (k >= l) {
|
|
diff --git a/src/main/java/net/minecraft/server/LightEngineThreaded.java b/src/main/java/net/minecraft/server/LightEngineThreaded.java
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/net/minecraft/server/LightEngineThreaded.java
|
|
+++ b/src/main/java/net/minecraft/server/LightEngineThreaded.java
|
|
@@ -0,0 +0,0 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable {
|
|
}
|
|
|
|
private void a(int i, int j, IntSupplier intsupplier, LightEngineThreaded.Update lightenginethreaded_update, Runnable runnable) {
|
|
- this.e.a((Object) ChunkTaskQueueSorter.a(() -> {
|
|
+ this.e.a(ChunkTaskQueueSorter.a(() -> { // Paper - decompile error
|
|
this.c.add(Pair.of(lightenginethreaded_update, runnable));
|
|
if (this.c.size() >= this.f) {
|
|
this.b();
|
|
@@ -0,0 +0,0 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable {
|
|
|
|
public void queueUpdate() {
|
|
if ((!this.c.isEmpty() || super.a()) && this.g.compareAndSet(false, true)) {
|
|
- this.b.a((Object) (() -> {
|
|
+ this.b.a((() -> { // Paper - decompile error
|
|
this.b();
|
|
this.g.set(false);
|
|
}));
|
|
diff --git a/src/main/java/net/minecraft/server/LootSelectorEntry.java b/src/main/java/net/minecraft/server/LootSelectorEntry.java
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/net/minecraft/server/LootSelectorEntry.java
|
|
+++ b/src/main/java/net/minecraft/server/LootSelectorEntry.java
|
|
@@ -0,0 +0,0 @@ public abstract class LootSelectorEntry extends LootEntryAbstract {
|
|
@Override
|
|
public T b(LootItemFunction.a lootitemfunction_a) {
|
|
this.c.add(lootitemfunction_a.b());
|
|
- return (LootSelectorEntry.a) this.d();
|
|
+ return this.d(); // Paper - decompile fix
|
|
}
|
|
|
|
protected LootItemFunction[] a() {
|
|
@@ -0,0 +0,0 @@ public abstract class LootSelectorEntry extends LootEntryAbstract {
|
|
|
|
public T a(int i) {
|
|
this.a = i;
|
|
- return (LootSelectorEntry.a) this.d();
|
|
+ return this.d(); // Paper - decompile fix
|
|
}
|
|
|
|
public T b(int i) {
|
|
this.b = i;
|
|
- return (LootSelectorEntry.a) this.d();
|
|
+ return this.d(); // Paper - decompile fix
|
|
}
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/NBTBase.java b/src/main/java/net/minecraft/server/NBTBase.java
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/net/minecraft/server/NBTBase.java
|
|
+++ b/src/main/java/net/minecraft/server/NBTBase.java
|
|
@@ -0,0 +0,0 @@ public interface NBTBase {
|
|
|
|
NBTTagType<?> b();
|
|
|
|
- NBTBase clone();
|
|
+ public NBTBase clone(); // Paper - decompile fix
|
|
|
|
default String asString() {
|
|
return this.toString();
|
|
diff --git a/src/main/java/net/minecraft/server/NBTTagList.java b/src/main/java/net/minecraft/server/NBTTagList.java
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/net/minecraft/server/NBTTagList.java
|
|
+++ b/src/main/java/net/minecraft/server/NBTTagList.java
|
|
@@ -0,0 +0,0 @@ public class NBTTagList extends NBTList<NBTBase> {
|
|
return "TAG_List";
|
|
}
|
|
};
|
|
- private static final ByteSet b = new ByteOpenHashSet(Arrays.asList(1, 2, 3, 4, 5, 6));
|
|
+ private static final ByteSet b = new ByteOpenHashSet(Arrays.asList((byte) 1, (byte) 2, (byte) 3, (byte) 4, (byte) 5, (byte) 6)); // Paper - decompiler fix
|
|
private final List<NBTBase> list;
|
|
private byte type;
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/NextTickListEntry.java b/src/main/java/net/minecraft/server/NextTickListEntry.java
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/net/minecraft/server/NextTickListEntry.java
|
|
+++ b/src/main/java/net/minecraft/server/NextTickListEntry.java
|
|
@@ -0,0 +0,0 @@ public class NextTickListEntry<T> {
|
|
return this.a.hashCode();
|
|
}
|
|
|
|
- public static <T> Comparator<NextTickListEntry<T>> a() {
|
|
+ public static <T> Comparator<Object> a() { // Paper - decompile fix
|
|
return Comparator.comparingLong((nextticklistentry) -> {
|
|
- return nextticklistentry.b;
|
|
+ return ((NextTickListEntry<T>) nextticklistentry).b; // Paper - decompile fix
|
|
}).thenComparing((nextticklistentry) -> {
|
|
- return nextticklistentry.c;
|
|
+ return ((NextTickListEntry<T>) nextticklistentry).c; // Paper - decompile fix
|
|
}).thenComparingLong((nextticklistentry) -> {
|
|
- return nextticklistentry.f;
|
|
+ return ((NextTickListEntry<T>) nextticklistentry).f; // Paper - decompile fix
|
|
});
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/RegionFileSection.java b/src/main/java/net/minecraft/server/RegionFileSection.java
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/net/minecraft/server/RegionFileSection.java
|
|
+++ b/src/main/java/net/minecraft/server/RegionFileSection.java
|
|
@@ -0,0 +0,0 @@ public class RegionFileSection<R extends MinecraftSerializable> implements AutoC
|
|
Optional<R> optional = this.d(i);
|
|
|
|
if (optional.isPresent()) {
|
|
- return (MinecraftSerializable) optional.get();
|
|
+ return optional.get(); // Paper - decompile fix
|
|
} else {
|
|
- R r0 = (MinecraftSerializable) this.f.apply(() -> {
|
|
+ R r0 = this.f.apply(() -> { // Paper - decompile fix
|
|
this.a(i);
|
|
});
|
|
|
|
@@ -0,0 +0,0 @@ public class RegionFileSection<R extends MinecraftSerializable> implements AutoC
|
|
for (int l = 0; l < 16; ++l) {
|
|
long i1 = SectionPosition.a(chunkcoordintpair, l).v();
|
|
Optional<R> optional = optionaldynamic.get(Integer.toString(l)).get().map((dynamic2) -> {
|
|
- return (MinecraftSerializable) this.e.apply(() -> {
|
|
+ return this.e.apply(() -> { // Paper - decompile fix
|
|
this.a(i1);
|
|
}, dynamic2);
|
|
});
|
|
diff --git a/src/main/java/net/minecraft/server/RegistryBlockID.java b/src/main/java/net/minecraft/server/RegistryBlockID.java
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/net/minecraft/server/RegistryBlockID.java
|
|
+++ b/src/main/java/net/minecraft/server/RegistryBlockID.java
|
|
@@ -0,0 +0,0 @@ public class RegistryBlockID<T> implements Registry<T> {
|
|
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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/net/minecraft/server/RegistryID.java
|
|
+++ b/src/main/java/net/minecraft/server/RegistryID.java
|
|
@@ -0,0 +0,0 @@ public class RegistryID<K> implements Registry<K> {
|
|
|
|
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) {
|
|
@@ -0,0 +0,0 @@ public class RegistryID<K> implements Registry<K> {
|
|
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/SystemUtils.java b/src/main/java/net/minecraft/server/SystemUtils.java
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/net/minecraft/server/SystemUtils.java
|
|
+++ b/src/main/java/net/minecraft/server/SystemUtils.java
|
|
@@ -0,0 +0,0 @@ public class SystemUtils {
|
|
return Collectors.toMap(Entry::getKey, Entry::getValue);
|
|
}
|
|
|
|
- public static <T extends Comparable<T>> String a(IBlockState<T> iblockstate, Object object) {
|
|
- return iblockstate.a((Comparable) object);
|
|
+ public static <T extends Comparable<T>> String a(IBlockState<T> iblockstate, T object) { // Paper - decompile fix
|
|
+ return iblockstate.a(object); // Paper - decompile fix
|
|
}
|
|
|
|
public static String a(String s, @Nullable MinecraftKey minecraftkey) {
|
|
@@ -0,0 +0,0 @@ public class SystemUtils {
|
|
public static <T> T b(Iterable<T> iterable, @Nullable T t0) {
|
|
Iterator<T> iterator = iterable.iterator();
|
|
|
|
- Object object;
|
|
- Object object1;
|
|
+ T object; // Paper - decompile fix
|
|
+ T object1; // Paper - decompile fix
|
|
|
|
for (object1 = null; iterator.hasNext(); object1 = object) {
|
|
object = iterator.next();
|
|
@@ -0,0 +0,0 @@ public class SystemUtils {
|
|
}
|
|
|
|
public static <K> Strategy<K> i() {
|
|
- return SystemUtils.IdentityHashingStrategy.INSTANCE;
|
|
+ return (Strategy<K>) SystemUtils.IdentityHashingStrategy.INSTANCE; // Paper - decompile fix
|
|
}
|
|
|
|
public static <V> CompletableFuture<List<V>> b(List<? extends CompletableFuture<? extends V>> list) {
|
|
@@ -0,0 +0,0 @@ public class SystemUtils {
|
|
list.forEach((completablefuture1) -> {
|
|
int i = list1.size();
|
|
|
|
- list1.add((Object) null);
|
|
+ list1.add(null); // Paper - decompile fix
|
|
acompletablefuture[i] = completablefuture1.whenComplete((object, throwable) -> {
|
|
if (throwable != null) {
|
|
completablefuture.completeExceptionally(throwable);
|
|
diff --git a/src/main/java/net/minecraft/server/ThreadedMailbox.java b/src/main/java/net/minecraft/server/ThreadedMailbox.java
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/net/minecraft/server/ThreadedMailbox.java
|
|
+++ b/src/main/java/net/minecraft/server/ThreadedMailbox.java
|
|
@@ -0,0 +0,0 @@ public class ThreadedMailbox<T> implements Mailbox<T>, AutoCloseable, Runnable {
|
|
|
|
public void run() {
|
|
try {
|
|
- this.a((i) -> {
|
|
+ this.a((int i) -> { // Paper - decompile fix
|
|
return i == 0;
|
|
});
|
|
} finally {
|
|
diff --git a/src/main/java/net/minecraft/server/Ticket.java b/src/main/java/net/minecraft/server/Ticket.java
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/net/minecraft/server/Ticket.java
|
|
+++ b/src/main/java/net/minecraft/server/Ticket.java
|
|
@@ -0,0 +0,0 @@ public final class Ticket<T> implements Comparable<Ticket<?>> {
|
|
} else {
|
|
int j = Integer.compare(System.identityHashCode(this.a), System.identityHashCode(ticket.a));
|
|
|
|
- return j != 0 ? j : this.a.a().compare(this.identifier, ticket.identifier);
|
|
+ return j != 0 ? j : this.a.a().compare(this.identifier, (T)ticket.identifier); // Paper - decompile fix
|
|
}
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/VillagePlace.java b/src/main/java/net/minecraft/server/VillagePlace.java
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/net/minecraft/server/VillagePlace.java
|
|
+++ b/src/main/java/net/minecraft/server/VillagePlace.java
|
|
@@ -0,0 +0,0 @@ public class VillagePlace extends RegionFileSection<VillagePlaceSection> {
|
|
}
|
|
|
|
private static boolean a(ChunkSection chunksection) {
|
|
- Stream stream = VillagePlaceType.e();
|
|
+ Stream<IBlockData> stream = VillagePlaceType.e(); // Paper - decompile fix
|
|
|
|
chunksection.getClass();
|
|
return stream.anyMatch(chunksection::a);
|
|
@@ -0,0 +0,0 @@ public class VillagePlace extends RegionFileSection<VillagePlaceSection> {
|
|
SectionPosition.b(new ChunkCoordIntPair(blockposition), Math.floorDiv(i, 16)).map((sectionposition) -> {
|
|
return Pair.of(sectionposition, this.d(sectionposition.v()));
|
|
}).filter((pair) -> {
|
|
- return !(Boolean) ((Optional) pair.getSecond()).map(VillagePlaceSection::a).orElse(false);
|
|
+ return !(Boolean) (pair.getSecond()).map(VillagePlaceSection::a).orElse(false); // Paper - decompile fix
|
|
}).map((pair) -> {
|
|
return ((SectionPosition) pair.getFirst()).u();
|
|
}).filter((chunkcoordintpair) -> {
|
|
@@ -0,0 +0,0 @@ public class VillagePlace extends RegionFileSection<VillagePlaceSection> {
|
|
|
|
private final Predicate<? super VillagePlaceRecord> d;
|
|
|
|
- private Occupancy(Predicate predicate) {
|
|
+ private Occupancy(Predicate<? super VillagePlaceRecord> predicate) { // Paper - decompile fix
|
|
this.d = predicate;
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/VillagerTrades.java b/src/main/java/net/minecraft/server/VillagerTrades.java
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/net/minecraft/server/VillagerTrades.java
|
|
+++ b/src/main/java/net/minecraft/server/VillagerTrades.java
|
|
@@ -0,0 +0,0 @@ import javax.annotation.Nullable;
|
|
|
|
public class VillagerTrades {
|
|
|
|
- public static final Map<VillagerProfession, Int2ObjectMap<VillagerTrades.IMerchantRecipeOption[]>> a = (Map) SystemUtils.a((Object) Maps.newHashMap(), (hashmap) -> {
|
|
+ public static final Map<VillagerProfession, Int2ObjectMap<VillagerTrades.IMerchantRecipeOption[]>> a = SystemUtils.a(Maps.newHashMap(), (hashmap) -> { // Paper - decompile fix
|
|
hashmap.put(VillagerProfession.FARMER, a(ImmutableMap.of(1, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.WHEAT, 20, 16, 2), new VillagerTrades.b(Items.POTATO, 26, 16, 2), new VillagerTrades.b(Items.CARROT, 22, 16, 2), new VillagerTrades.b(Items.BEETROOT, 15, 16, 2), new VillagerTrades.h(Items.BREAD, 1, 6, 16, 1)}, 2, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Blocks.PUMPKIN, 6, 12, 10), new VillagerTrades.h(Items.PUMPKIN_PIE, 1, 4, 5), new VillagerTrades.h(Items.APPLE, 1, 4, 16, 5)}, 3, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.h(Items.COOKIE, 3, 18, 10), new VillagerTrades.b(Blocks.MELON, 4, 12, 20)}, 4, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.h(Blocks.CAKE, 1, 1, 12, 15), new VillagerTrades.i(MobEffects.NIGHT_VISION, 100, 15), new VillagerTrades.i(MobEffects.JUMP, 160, 15), new VillagerTrades.i(MobEffects.WEAKNESS, 140, 15), new VillagerTrades.i(MobEffects.BLINDNESS, 120, 15), new VillagerTrades.i(MobEffects.POISON, 280, 15), new VillagerTrades.i(MobEffects.SATURATION, 7, 15)}, 5, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.h(Items.GOLDEN_CARROT, 3, 3, 30), new VillagerTrades.h(Items.GLISTERING_MELON_SLICE, 4, 3, 30)})));
|
|
- hashmap.put(VillagerProfession.FISHERMAN, a(ImmutableMap.of(1, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.STRING, 20, 16, 2), new VillagerTrades.b(Items.COAL, 10, 16, 2), new VillagerTrades.g(Items.COD, 6, Items.COOKED_COD, 6, 16, 1), new VillagerTrades.h(Items.COD_BUCKET, 3, 1, 16, 1)}, 2, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.COD, 15, 16, 10), new VillagerTrades.g(Items.SALMON, 6, Items.COOKED_SALMON, 6, 16, 5), new VillagerTrades.h(Items.pT, 2, 1, 5)}, 3, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.SALMON, 13, 16, 20), new VillagerTrades.e(Items.FISHING_ROD, 3, 3, 10, 0.2F)}, 4, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.TROPICAL_FISH, 6, 12, 30)}, 5, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.PUFFERFISH, 4, 12, 30), new VillagerTrades.c(1, 12, 30, ImmutableMap.builder().put(VillagerType.PLAINS, Items.OAK_BOAT).put(VillagerType.TAIGA, Items.SPRUCE_BOAT).put(VillagerType.SNOW, Items.SPRUCE_BOAT).put(VillagerType.DESERT, Items.JUNGLE_BOAT).put(VillagerType.JUNGLE, Items.JUNGLE_BOAT).put(VillagerType.SAVANNA, Items.ACACIA_BOAT).put(VillagerType.SWAMP, Items.DARK_OAK_BOAT).build())})));
|
|
+ hashmap.put(VillagerProfession.FISHERMAN, a(ImmutableMap.of(1, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.STRING, 20, 16, 2), new VillagerTrades.b(Items.COAL, 10, 16, 2), new VillagerTrades.g(Items.COD, 6, Items.COOKED_COD, 6, 16, 1), new VillagerTrades.h(Items.COD_BUCKET, 3, 1, 16, 1)}, 2, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.COD, 15, 16, 10), new VillagerTrades.g(Items.SALMON, 6, Items.COOKED_SALMON, 6, 16, 5), new VillagerTrades.h(Items.pT, 2, 1, 5)}, 3, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.SALMON, 13, 16, 20), new VillagerTrades.e(Items.FISHING_ROD, 3, 3, 10, 0.2F)}, 4, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.TROPICAL_FISH, 6, 12, 30)}, 5, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.PUFFERFISH, 4, 12, 30), new VillagerTrades.c(1, 12, 30, ImmutableMap.<VillagerType, Item>builder().put(VillagerType.PLAINS, Items.OAK_BOAT).put(VillagerType.TAIGA, Items.SPRUCE_BOAT).put(VillagerType.SNOW, Items.SPRUCE_BOAT).put(VillagerType.DESERT, Items.JUNGLE_BOAT).put(VillagerType.JUNGLE, Items.JUNGLE_BOAT).put(VillagerType.SAVANNA, Items.ACACIA_BOAT).put(VillagerType.SWAMP, Items.DARK_OAK_BOAT).build())}))); // Paper - decompile fix
|
|
hashmap.put(VillagerProfession.SHEPHERD, a(ImmutableMap.of(1, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Blocks.WHITE_WOOL, 18, 16, 2), new VillagerTrades.b(Blocks.BROWN_WOOL, 18, 16, 2), new VillagerTrades.b(Blocks.BLACK_WOOL, 18, 16, 2), new VillagerTrades.b(Blocks.GRAY_WOOL, 18, 16, 2), new VillagerTrades.h(Items.SHEARS, 2, 1, 1)}, 2, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.WHITE_DYE, 12, 16, 10), new VillagerTrades.b(Items.GRAY_DYE, 12, 16, 10), new VillagerTrades.b(Items.BLACK_DYE, 12, 16, 10), new VillagerTrades.b(Items.LIGHT_BLUE_DYE, 12, 16, 10), new VillagerTrades.b(Items.LIME_DYE, 12, 16, 10), new VillagerTrades.h(Blocks.WHITE_WOOL, 1, 1, 16, 5), new VillagerTrades.h(Blocks.ORANGE_WOOL, 1, 1, 16, 5), new VillagerTrades.h(Blocks.MAGENTA_WOOL, 1, 1, 16, 5), new VillagerTrades.h(Blocks.LIGHT_BLUE_WOOL, 1, 1, 16, 5), new VillagerTrades.h(Blocks.YELLOW_WOOL, 1, 1, 16, 5), new VillagerTrades.h(Blocks.LIME_WOOL, 1, 1, 16, 5), new VillagerTrades.h(Blocks.PINK_WOOL, 1, 1, 16, 5), new VillagerTrades.h(Blocks.GRAY_WOOL, 1, 1, 16, 5), new VillagerTrades.h(Blocks.LIGHT_GRAY_WOOL, 1, 1, 16, 5), new VillagerTrades.h(Blocks.CYAN_WOOL, 1, 1, 16, 5), new VillagerTrades.h(Blocks.PURPLE_WOOL, 1, 1, 16, 5), new VillagerTrades.h(Blocks.BLUE_WOOL, 1, 1, 16, 5), new VillagerTrades.h(Blocks.BROWN_WOOL, 1, 1, 16, 5), new VillagerTrades.h(Blocks.GREEN_WOOL, 1, 1, 16, 5), new VillagerTrades.h(Blocks.RED_WOOL, 1, 1, 16, 5), new VillagerTrades.h(Blocks.BLACK_WOOL, 1, 1, 16, 5), new VillagerTrades.h(Blocks.WHITE_CARPET, 1, 4, 16, 5), new VillagerTrades.h(Blocks.ORANGE_CARPET, 1, 4, 16, 5), new VillagerTrades.h(Blocks.MAGENTA_CARPET, 1, 4, 16, 5), new VillagerTrades.h(Blocks.LIGHT_BLUE_CARPET, 1, 4, 16, 5), new VillagerTrades.h(Blocks.YELLOW_CARPET, 1, 4, 16, 5), new VillagerTrades.h(Blocks.LIME_CARPET, 1, 4, 16, 5), new VillagerTrades.h(Blocks.PINK_CARPET, 1, 4, 16, 5), new VillagerTrades.h(Blocks.GRAY_CARPET, 1, 4, 16, 5), new VillagerTrades.h(Blocks.LIGHT_GRAY_CARPET, 1, 4, 16, 5), new VillagerTrades.h(Blocks.CYAN_CARPET, 1, 4, 16, 5), new VillagerTrades.h(Blocks.PURPLE_CARPET, 1, 4, 16, 5), new VillagerTrades.h(Blocks.BLUE_CARPET, 1, 4, 16, 5), new VillagerTrades.h(Blocks.BROWN_CARPET, 1, 4, 16, 5), new VillagerTrades.h(Blocks.GREEN_CARPET, 1, 4, 16, 5), new VillagerTrades.h(Blocks.RED_CARPET, 1, 4, 16, 5), new VillagerTrades.h(Blocks.BLACK_CARPET, 1, 4, 16, 5)}, 3, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.YELLOW_DYE, 12, 16, 20), new VillagerTrades.b(Items.LIGHT_GRAY_DYE, 12, 16, 20), new VillagerTrades.b(Items.ORANGE_DYE, 12, 16, 20), new VillagerTrades.b(Items.RED_DYE, 12, 16, 20), new VillagerTrades.b(Items.PINK_DYE, 12, 16, 20), new VillagerTrades.h(Blocks.WHITE_BED, 3, 1, 12, 10), new VillagerTrades.h(Blocks.YELLOW_BED, 3, 1, 12, 10), new VillagerTrades.h(Blocks.RED_BED, 3, 1, 12, 10), new VillagerTrades.h(Blocks.BLACK_BED, 3, 1, 12, 10), new VillagerTrades.h(Blocks.BLUE_BED, 3, 1, 12, 10), new VillagerTrades.h(Blocks.BROWN_BED, 3, 1, 12, 10), new VillagerTrades.h(Blocks.CYAN_BED, 3, 1, 12, 10), new VillagerTrades.h(Blocks.GRAY_BED, 3, 1, 12, 10), new VillagerTrades.h(Blocks.GREEN_BED, 3, 1, 12, 10), new VillagerTrades.h(Blocks.LIGHT_BLUE_BED, 3, 1, 12, 10), new VillagerTrades.h(Blocks.LIGHT_GRAY_BED, 3, 1, 12, 10), new VillagerTrades.h(Blocks.LIME_BED, 3, 1, 12, 10), new VillagerTrades.h(Blocks.MAGENTA_BED, 3, 1, 12, 10), new VillagerTrades.h(Blocks.ORANGE_BED, 3, 1, 12, 10), new VillagerTrades.h(Blocks.PINK_BED, 3, 1, 12, 10), new VillagerTrades.h(Blocks.PURPLE_BED, 3, 1, 12, 10)}, 4, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.BROWN_DYE, 12, 16, 30), new VillagerTrades.b(Items.PURPLE_DYE, 12, 16, 30), new VillagerTrades.b(Items.BLUE_DYE, 12, 16, 30), new VillagerTrades.b(Items.GREEN_DYE, 12, 16, 30), new VillagerTrades.b(Items.MAGENTA_DYE, 12, 16, 30), new VillagerTrades.b(Items.CYAN_DYE, 12, 16, 30), new VillagerTrades.h(Items.WHITE_BANNER, 3, 1, 12, 15), new VillagerTrades.h(Items.BLUE_BANNER, 3, 1, 12, 15), new VillagerTrades.h(Items.LIGHT_BLUE_BANNER, 3, 1, 12, 15), new VillagerTrades.h(Items.RED_BANNER, 3, 1, 12, 15), new VillagerTrades.h(Items.PINK_BANNER, 3, 1, 12, 15), new VillagerTrades.h(Items.GREEN_BANNER, 3, 1, 12, 15), new VillagerTrades.h(Items.LIME_BANNER, 3, 1, 12, 15), new VillagerTrades.h(Items.GRAY_BANNER, 3, 1, 12, 15), new VillagerTrades.h(Items.BLACK_BANNER, 3, 1, 12, 15), new VillagerTrades.h(Items.PURPLE_BANNER, 3, 1, 12, 15), new VillagerTrades.h(Items.MAGENTA_BANNER, 3, 1, 12, 15), new VillagerTrades.h(Items.CYAN_BANNER, 3, 1, 12, 15), new VillagerTrades.h(Items.BROWN_BANNER, 3, 1, 12, 15), new VillagerTrades.h(Items.YELLOW_BANNER, 3, 1, 12, 15), new VillagerTrades.h(Items.ORANGE_BANNER, 3, 1, 12, 15), new VillagerTrades.h(Items.LIGHT_GRAY_BANNER, 3, 1, 12, 15)}, 5, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.h(Items.PAINTING, 2, 3, 30)})));
|
|
hashmap.put(VillagerProfession.FLETCHER, a(ImmutableMap.of(1, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.STICK, 32, 16, 2), new VillagerTrades.h(Items.ARROW, 1, 16, 1), new VillagerTrades.g(Blocks.GRAVEL, 10, Items.FLINT, 10, 12, 1)}, 2, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.FLINT, 26, 12, 10), new VillagerTrades.h(Items.BOW, 2, 1, 5)}, 3, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.STRING, 14, 16, 20), new VillagerTrades.h(Items.CROSSBOW, 3, 1, 10)}, 4, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.FEATHER, 24, 16, 30), new VillagerTrades.e(Items.BOW, 2, 3, 15)}, 5, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.dE, 8, 12, 30), new VillagerTrades.e(Items.CROSSBOW, 3, 3, 15), new VillagerTrades.j(Items.ARROW, 5, Items.TIPPED_ARROW, 5, 2, 12, 30)})));
|
|
- hashmap.put(VillagerProfession.LIBRARIAN, a(ImmutableMap.builder().put(1, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.PAPER, 24, 16, 2), new VillagerTrades.d(1), new VillagerTrades.h(Blocks.BOOKSHELF, 9, 1, 12, 1)}).put(2, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.BOOK, 4, 12, 10), new VillagerTrades.d(5), new VillagerTrades.h(Items.pR, 1, 1, 5)}).put(3, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.INK_SAC, 5, 12, 20), new VillagerTrades.d(10), new VillagerTrades.h(Items.am, 1, 4, 10)}).put(4, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.WRITABLE_BOOK, 2, 12, 30), new VillagerTrades.d(15), new VillagerTrades.h(Items.CLOCK, 5, 1, 15), new VillagerTrades.h(Items.COMPASS, 4, 1, 15)}).put(5, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.h(Items.NAME_TAG, 20, 1, 30)}).build()));
|
|
+ hashmap.put(VillagerProfession.LIBRARIAN, a(ImmutableMap.<Integer, VillagerTrades.IMerchantRecipeOption[]>builder().put(1, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.PAPER, 24, 16, 2), new VillagerTrades.d(1), new VillagerTrades.h(Blocks.BOOKSHELF, 9, 1, 12, 1)}).put(2, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.BOOK, 4, 12, 10), new VillagerTrades.d(5), new VillagerTrades.h(Items.pR, 1, 1, 5)}).put(3, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.INK_SAC, 5, 12, 20), new VillagerTrades.d(10), new VillagerTrades.h(Items.am, 1, 4, 10)}).put(4, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.WRITABLE_BOOK, 2, 12, 30), new VillagerTrades.d(15), new VillagerTrades.h(Items.CLOCK, 5, 1, 15), new VillagerTrades.h(Items.COMPASS, 4, 1, 15)}).put(5, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.h(Items.NAME_TAG, 20, 1, 30)}).build())); // Paper - decompile fix
|
|
hashmap.put(VillagerProfession.CARTOGRAPHER, a(ImmutableMap.of(1, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.PAPER, 24, 16, 2), new VillagerTrades.h(Items.MAP, 7, 1, 1)}, 2, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.df, 11, 16, 10), new VillagerTrades.k(13, "Monument", MapIcon.Type.MONUMENT, 12, 5)}, 3, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.COMPASS, 1, 12, 20), new VillagerTrades.k(14, "Mansion", MapIcon.Type.MANSION, 12, 10)}, 4, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.h(Items.ITEM_FRAME, 7, 1, 15), new VillagerTrades.h(Items.WHITE_BANNER, 3, 1, 15), new VillagerTrades.h(Items.BLUE_BANNER, 3, 1, 15), new VillagerTrades.h(Items.LIGHT_BLUE_BANNER, 3, 1, 15), new VillagerTrades.h(Items.RED_BANNER, 3, 1, 15), new VillagerTrades.h(Items.PINK_BANNER, 3, 1, 15), new VillagerTrades.h(Items.GREEN_BANNER, 3, 1, 15), new VillagerTrades.h(Items.LIME_BANNER, 3, 1, 15), new VillagerTrades.h(Items.GRAY_BANNER, 3, 1, 15), new VillagerTrades.h(Items.BLACK_BANNER, 3, 1, 15), new VillagerTrades.h(Items.PURPLE_BANNER, 3, 1, 15), new VillagerTrades.h(Items.MAGENTA_BANNER, 3, 1, 15), new VillagerTrades.h(Items.CYAN_BANNER, 3, 1, 15), new VillagerTrades.h(Items.BROWN_BANNER, 3, 1, 15), new VillagerTrades.h(Items.YELLOW_BANNER, 3, 1, 15), new VillagerTrades.h(Items.ORANGE_BANNER, 3, 1, 15), new VillagerTrades.h(Items.LIGHT_GRAY_BANNER, 3, 1, 15)}, 5, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.h(Items.GLOBE_BANNER_PATTERN, 8, 1, 30)})));
|
|
hashmap.put(VillagerProfession.CLERIC, a(ImmutableMap.of(1, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.ROTTEN_FLESH, 32, 16, 2), new VillagerTrades.h(Items.REDSTONE, 1, 2, 1)}, 2, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.GOLD_INGOT, 3, 12, 10), new VillagerTrades.h(Items.LAPIS_LAZULI, 1, 1, 5)}, 3, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.RABBIT_FOOT, 2, 12, 20), new VillagerTrades.h(Blocks.GLOWSTONE, 4, 1, 12, 10)}, 4, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.SCUTE, 4, 12, 30), new VillagerTrades.b(Items.GLASS_BOTTLE, 9, 12, 30), new VillagerTrades.h(Items.ENDER_PEARL, 5, 1, 15)}, 5, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.NETHER_WART, 22, 12, 30), new VillagerTrades.h(Items.EXPERIENCE_BOTTLE, 3, 1, 30)})));
|
|
hashmap.put(VillagerProfession.ARMORER, a(ImmutableMap.of(1, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.COAL, 15, 16, 2), new VillagerTrades.h(new ItemStack(Items.IRON_LEGGINGS), 7, 1, 12, 1, 0.2F), new VillagerTrades.h(new ItemStack(Items.IRON_BOOTS), 4, 1, 12, 1, 0.2F), new VillagerTrades.h(new ItemStack(Items.IRON_HELMET), 5, 1, 12, 1, 0.2F), new VillagerTrades.h(new ItemStack(Items.IRON_CHESTPLATE), 9, 1, 12, 1, 0.2F)}, 2, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.IRON_INGOT, 4, 12, 10), new VillagerTrades.h(new ItemStack(Items.pQ), 36, 1, 12, 5, 0.2F), new VillagerTrades.h(new ItemStack(Items.CHAINMAIL_BOOTS), 1, 1, 12, 5, 0.2F), new VillagerTrades.h(new ItemStack(Items.CHAINMAIL_LEGGINGS), 3, 1, 12, 5, 0.2F)}, 3, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.LAVA_BUCKET, 1, 12, 20), new VillagerTrades.b(Items.DIAMOND, 1, 12, 20), new VillagerTrades.h(new ItemStack(Items.CHAINMAIL_HELMET), 1, 1, 12, 10, 0.2F), new VillagerTrades.h(new ItemStack(Items.CHAINMAIL_CHESTPLATE), 4, 1, 12, 10, 0.2F), new VillagerTrades.h(new ItemStack(Items.SHIELD), 5, 1, 12, 10, 0.2F)}, 4, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.e(Items.DIAMOND_LEGGINGS, 14, 3, 15, 0.2F), new VillagerTrades.e(Items.DIAMOND_BOOTS, 8, 3, 15, 0.2F)}, 5, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.e(Items.DIAMOND_HELMET, 8, 3, 30, 0.2F), new VillagerTrades.e(Items.DIAMOND_CHESTPLATE, 16, 3, 30, 0.2F)})));
|
|
diff --git a/src/main/java/net/minecraft/server/VoxelShapeMergerList.java b/src/main/java/net/minecraft/server/VoxelShapeMergerList.java
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/net/minecraft/server/VoxelShapeMergerList.java
|
|
+++ b/src/main/java/net/minecraft/server/VoxelShapeMergerList.java
|
|
@@ -0,0 +0,0 @@ public final class VoxelShapeMergerList implements VoxelShapeMerger {
|
|
double d1 = flag4 ? doublelist.getDouble(i++) : doublelist1.getDouble(j++);
|
|
|
|
if ((i != 0 && flag2 || flag4 || flag1) && (j != 0 && flag3 || !flag4 || flag)) {
|
|
- if (d0 < d1 - 1.0E-7D) {
|
|
+ if (!(d0 >= d1 - 1.0E-7D)) { // Paper - decompile error - welcome to hell
|
|
this.b.add(i - 1);
|
|
this.c.add(j - 1);
|
|
this.a.add(d1);
|
|
diff --git a/src/main/java/net/minecraft/server/WorldGenFeatureStateProviderWeighted.java b/src/main/java/net/minecraft/server/WorldGenFeatureStateProviderWeighted.java
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/net/minecraft/server/WorldGenFeatureStateProviderWeighted.java
|
|
+++ b/src/main/java/net/minecraft/server/WorldGenFeatureStateProviderWeighted.java
|
|
@@ -0,0 +0,0 @@ public class WorldGenFeatureStateProviderWeighted extends WorldGenFeatureStatePr
|
|
builder.put(dynamicops.createString("type"), dynamicops.createString(IRegistry.t.getKey(this.a).toString())).put(dynamicops.createString("entries"), this.b.a(dynamicops, (iblockdata) -> {
|
|
return IBlockData.a(dynamicops, iblockdata);
|
|
}));
|
|
- return (new Dynamic(dynamicops, dynamicops.createMap(builder.build()))).getValue();
|
|
+ return (new Dynamic<T>(dynamicops, dynamicops.createMap(builder.build()))).getValue(); // Paper - decompile fix
|
|
}
|
|
}
|
|
diff --git a/src/main/java/net/minecraft/server/WorldPersistentData.java b/src/main/java/net/minecraft/server/WorldPersistentData.java
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/net/minecraft/server/WorldPersistentData.java
|
|
+++ b/src/main/java/net/minecraft/server/WorldPersistentData.java
|
|
@@ -0,0 +0,0 @@ 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;
|
|
@@ -0,0 +0,0 @@ public class WorldPersistentData {
|
|
|
|
@Nullable
|
|
public <T extends PersistentBase> T b(Supplier<T> supplier, String s) {
|
|
- PersistentBase persistentbase = (PersistentBase) this.data.get(s);
|
|
+ T persistentbase = (T) this.data.get(s); // Paper - decompile fix
|
|
|
|
if (persistentbase == null && !this.data.containsKey(s)) {
|
|
persistentbase = this.c(supplier, s);
|
|
@@ -0,0 +0,0 @@ public class WorldPersistentData {
|
|
File file = this.a(s);
|
|
|
|
if (file.exists()) {
|
|
- T t0 = (PersistentBase) supplier.get();
|
|
+ T t0 = supplier.get(); // Paper - decompile fix
|
|
NBTTagCompound nbttagcompound = this.a(s, SharedConstants.getGameVersion().getWorldVersion());
|
|
|
|
t0.a(nbttagcompound.getCompound("data"));
|