Paper/Spigot-Server-Patches/0003-MC-Dev-fixes.patch
2019-05-22 05:14:56 +01:00

433 lines
37 KiB
Diff

From 921ea44be515f7dd627904bfa4d047ba879b981c 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/BiomeBase.java b/src/main/java/net/minecraft/server/BiomeBase.java
index 26fa6e7b64..9a839d6540 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 <C extends WorldGenCarverConfiguration> WorldGenCarverWrapper<C> a(WorldGenCarverAbstract<C> worldgencarverabstract, C c0) {
@@ -202,7 +202,7 @@ 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<?>> e() {
diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java
index f0ff70980d..dd47e9cbe4 100644
--- a/src/main/java/net/minecraft/server/BlockPosition.java
+++ b/src/main/java/net/minecraft/server/BlockPosition.java
@@ -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<? 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 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<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/ChunkSection.java b/src/main/java/net/minecraft/server/ChunkSection.java
index c973ab6076..30701fd7f3 100644
--- a/src/main/java/net/minecraft/server/ChunkSection.java
+++ b/src/main/java/net/minecraft/server/ChunkSection.java
@@ -148,6 +148,6 @@ public class ChunkSection {
}
public boolean a(IBlockData iblockdata) {
- return this.blockIds.a((Object) iblockdata);
+ return this.blockIds.a(iblockdata); // Paper - decompile fix
}
}
diff --git a/src/main/java/net/minecraft/server/EntityFox.java b/src/main/java/net/minecraft/server/EntityFox.java
index 199f674905..c7a744355a 100644
--- a/src/main/java/net/minecraft/server/EntityFox.java
+++ b/src/main/java/net/minecraft/server/EntityFox.java
@@ -97,7 +97,7 @@ public class EntityFox extends EntityAnimal {
this.goalSelector.a(11, new EntityFox.j(this, EntityHuman.class, 24.0F));
this.goalSelector.a(12, new EntityFox.r());
this.targetSelector.a(3, new EntityFox.a(EntityLiving.class, false, false, (entityliving) -> {
- return EntityFox.bF.test(entityliving) && !this.c(entityliving.getUniqueID());
+ return EntityFox.bF.test((EntityLiving) entityliving) && !this.c(((EntityLiving) entityliving).getUniqueID()); // Paper - decompile fix
}));
}
diff --git a/src/main/java/net/minecraft/server/EntityVindicator.java b/src/main/java/net/minecraft/server/EntityVindicator.java
index 1692e6b47e..dbd189afe6 100644
--- a/src/main/java/net/minecraft/server/EntityVindicator.java
+++ b/src/main/java/net/minecraft/server/EntityVindicator.java
@@ -25,7 +25,7 @@ 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/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<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;
}
diff --git a/src/main/java/net/minecraft/server/IAsyncTaskHandler.java b/src/main/java/net/minecraft/server/IAsyncTaskHandler.java
index 053d408d36..4510018d6f 100644
--- a/src/main/java/net/minecraft/server/IAsyncTaskHandler.java
+++ b/src/main/java/net/minecraft/server/IAsyncTaskHandler.java
@@ -51,7 +51,7 @@ 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
}
}
@@ -86,14 +86,14 @@ 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/IBlockAccess.java b/src/main/java/net/minecraft/server/IBlockAccess.java
index 2ed6119804..6e365f402c 100644
--- a/src/main/java/net/minecraft/server/IBlockAccess.java
+++ b/src/main/java/net/minecraft/server/IBlockAccess.java
@@ -96,7 +96,7 @@ public interface IBlockAccess {
double d13 = d10 * (i1 > 0 ? 1.0D - MathHelper.h(d4) : MathHelper.h(d4));
double d14 = d11 * (j1 > 0 ? 1.0D - MathHelper.h(d5) : MathHelper.h(d5));
- Object object;
+ T object; // Paper - decompile fix
do {
if (d12 > 1.0D && d13 > 1.0D && d14 > 1.0D) {
diff --git a/src/main/java/net/minecraft/server/IBlockData.java b/src/main/java/net/minecraft/server/IBlockData.java
index e8ae4b5e44..0f4aa698aa 100644
--- a/src/main/java/net/minecraft/server/IBlockData.java
+++ b/src/main/java/net/minecraft/server/IBlockData.java
@@ -265,12 +265,12 @@ 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)))));
}
@@ -329,9 +329,9 @@ 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 = block.h(iblockdata, BlockAccessAir.INSTANCE, BlockPosition.ZERO);
- EnumDirection[] aenumdirection = IBlockData.a.a;
+ EnumDirection[] aenumdirection = a; // Paper - decompile fix
int i = aenumdirection.length;
for (int j = 0; j < i; ++j) {
@@ -342,8 +342,9 @@ public class IBlockData extends BlockDataAbstract<Block, IBlockData> implements
}
voxelshape = block.b(iblockdata, BlockAccessAir.INSTANCE, BlockPosition.ZERO, VoxelShapeCollision.a());
+ final VoxelShape final_voxelshape = voxelshape; // Paper - decompile fix
this.g = Arrays.stream(EnumDirection.EnumAxis.values()).anyMatch((enumdirection_enumaxis) -> {
- return voxelshape.b(enumdirection_enumaxis) < 0.0D || voxelshape.c(enumdirection_enumaxis) > 1.0D;
+ return final_voxelshape.b(enumdirection_enumaxis) < 0.0D || final_voxelshape.c(enumdirection_enumaxis) > 1.0D; // Paper - decompile fix
});
}
}
diff --git a/src/main/java/net/minecraft/server/IEntityAccess.java b/src/main/java/net/minecraft/server/IEntityAccess.java
index bf7e0d17ef..ee22bb0387 100644
--- a/src/main/java/net/minecraft/server/IEntityAccess.java
+++ b/src/main/java/net/minecraft/server/IEntityAccess.java
@@ -147,17 +147,17 @@ 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 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.e(d0, d1, d2);
@@ -190,10 +190,10 @@ 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/LootSelectorEntry.java b/src/main/java/net/minecraft/server/LootSelectorEntry.java
index 9290534917..1016325bd7 100644
--- a/src/main/java/net/minecraft/server/LootSelectorEntry.java
+++ b/src/main/java/net/minecraft/server/LootSelectorEntry.java
@@ -127,7 +127,7 @@ 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() {
@@ -136,12 +136,12 @@ 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 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/PacketPlayOutMapChunk.java b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java
index 0dda7aaf69..4e20cfba41 100644
--- a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java
+++ b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java
@@ -134,7 +134,7 @@ public class PacketPlayOutMapChunk implements Packet<PacketListenerPlayOut> {
BiomeBase[] abiomebase = chunk.getBiomeIndex();
for (l = 0; l < abiomebase.length; ++l) {
- packetdataserializer.writeInt(IRegistry.BIOME.a((Object) abiomebase[l]));
+ packetdataserializer.writeInt(IRegistry.BIOME.a(abiomebase[l])); // Paper - decompile fix
}
}
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<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 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<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) {
@@ -55,9 +55,9 @@ 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 41a5d1dc29..b3799ab564 100644
--- a/src/main/java/net/minecraft/server/SystemUtils.java
+++ b/src/main/java/net/minecraft/server/SystemUtils.java
@@ -45,8 +45,8 @@ 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) {
@@ -154,8 +154,8 @@ 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();
@@ -180,7 +180,7 @@ 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) {
@@ -191,7 +191,7 @@ 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/VillagerTrades.java b/src/main/java/net/minecraft/server/VillagerTrades.java
index b0d44e3778..ff3f15eac0 100644
--- a/src/main/java/net/minecraft/server/VillagerTrades.java
+++ b/src/main/java/net/minecraft/server/VillagerTrades.java
@@ -15,12 +15,12 @@ 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, 8, 2), new VillagerTrades.b(Items.POTATO, 26, 8, 2), new VillagerTrades.b(Items.CARROT, 22, 8, 2), new VillagerTrades.b(Items.BEETROOT, 15, 8, 2), new VillagerTrades.h(Items.BREAD, 1, 6, 8, 1)}, 2, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Blocks.PUMPKIN, 6, 6, 10), new VillagerTrades.h(Items.PUMPKIN_PIE, 1, 4, 5), new VillagerTrades.h(Items.APPLE, 1, 4, 8, 5)}, 3, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.h(Items.COOKIE, 3, 18, 10), new VillagerTrades.b(Blocks.MELON, 4, 6, 20)}, 4, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.h(Blocks.CAKE, 1, 1, 6, 15), new VillagerTrades.i(MobEffects.FASTER_MOVEMENT, 160, 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, 8, 2), new VillagerTrades.b(Items.COAL, 10, 8, 2), new VillagerTrades.g(Items.COD, 6, Items.COOKED_COD, 6, 8, 1), new VillagerTrades.h(Items.COD_BUCKET, 3, 1, 8, 1)}, 2, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.COD, 15, 8, 10), new VillagerTrades.g(Items.SALMON, 6, Items.COOKED_SALMON, 6, 8, 5), new VillagerTrades.h(Items.pS, 2, 1, 5)}, 3, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.SALMON, 13, 8, 20), new VillagerTrades.e(Items.FISHING_ROD, 3, 2, 10, 0.2F)}, 4, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.TROPICAL_FISH, 6, 6, 30)}, 5, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.PUFFERFISH, 4, 6, 30), new VillagerTrades.c(1, 6, 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, 8, 2), new VillagerTrades.b(Items.COAL, 10, 8, 2), new VillagerTrades.g(Items.COD, 6, Items.COOKED_COD, 6, 8, 1), new VillagerTrades.h(Items.COD_BUCKET, 3, 1, 8, 1)}, 2, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.COD, 15, 8, 10), new VillagerTrades.g(Items.SALMON, 6, Items.COOKED_SALMON, 6, 8, 5), new VillagerTrades.h(Items.pS, 2, 1, 5)}, 3, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.SALMON, 13, 8, 20), new VillagerTrades.e(Items.FISHING_ROD, 3, 2, 10, 0.2F)}, 4, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.TROPICAL_FISH, 6, 6, 30)}, 5, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.PUFFERFISH, 4, 6, 30), new VillagerTrades.c(1, 6, 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, 8, 2), new VillagerTrades.b(Blocks.BROWN_WOOL, 18, 8, 2), new VillagerTrades.b(Blocks.BLACK_WOOL, 18, 8, 2), new VillagerTrades.b(Blocks.GRAY_WOOL, 18, 8, 2), new VillagerTrades.h(Items.SHEARS, 2, 1, 1)}, 2, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.WHITE_DYE, 12, 8, 10), new VillagerTrades.b(Items.GRAY_DYE, 12, 8, 10), new VillagerTrades.b(Items.BLACK_DYE, 12, 8, 10), new VillagerTrades.b(Items.LIGHT_BLUE_DYE, 12, 8, 10), new VillagerTrades.b(Items.LIME_DYE, 12, 8, 10), new VillagerTrades.h(Blocks.WHITE_WOOL, 1, 1, 8, 5), new VillagerTrades.h(Blocks.ORANGE_WOOL, 1, 1, 8, 5), new VillagerTrades.h(Blocks.MAGENTA_WOOL, 1, 1, 8, 5), new VillagerTrades.h(Blocks.LIGHT_BLUE_WOOL, 1, 1, 8, 5), new VillagerTrades.h(Blocks.YELLOW_WOOL, 1, 1, 8, 5), new VillagerTrades.h(Blocks.LIME_WOOL, 1, 1, 8, 5), new VillagerTrades.h(Blocks.PINK_WOOL, 1, 1, 8, 5), new VillagerTrades.h(Blocks.GRAY_WOOL, 1, 1, 8, 5), new VillagerTrades.h(Blocks.LIGHT_GRAY_WOOL, 1, 1, 8, 5), new VillagerTrades.h(Blocks.CYAN_WOOL, 1, 1, 8, 5), new VillagerTrades.h(Blocks.PURPLE_WOOL, 1, 1, 8, 5), new VillagerTrades.h(Blocks.BLUE_WOOL, 1, 1, 8, 5), new VillagerTrades.h(Blocks.BROWN_WOOL, 1, 1, 8, 5), new VillagerTrades.h(Blocks.GREEN_WOOL, 1, 1, 8, 5), new VillagerTrades.h(Blocks.RED_WOOL, 1, 1, 8, 5), new VillagerTrades.h(Blocks.BLACK_WOOL, 1, 1, 8, 5), new VillagerTrades.h(Blocks.WHITE_CARPET, 1, 4, 8, 5), new VillagerTrades.h(Blocks.ORANGE_CARPET, 1, 4, 8, 5), new VillagerTrades.h(Blocks.MAGENTA_CARPET, 1, 4, 8, 5), new VillagerTrades.h(Blocks.LIGHT_BLUE_CARPET, 1, 4, 8, 5), new VillagerTrades.h(Blocks.YELLOW_CARPET, 1, 4, 8, 5), new VillagerTrades.h(Blocks.LIME_CARPET, 1, 4, 8, 5), new VillagerTrades.h(Blocks.PINK_CARPET, 1, 4, 8, 5), new VillagerTrades.h(Blocks.GRAY_CARPET, 1, 4, 8, 5), new VillagerTrades.h(Blocks.LIGHT_GRAY_CARPET, 1, 4, 8, 5), new VillagerTrades.h(Blocks.CYAN_CARPET, 1, 4, 8, 5), new VillagerTrades.h(Blocks.PURPLE_CARPET, 1, 4, 8, 5), new VillagerTrades.h(Blocks.BLUE_CARPET, 1, 4, 8, 5), new VillagerTrades.h(Blocks.BROWN_CARPET, 1, 4, 8, 5), new VillagerTrades.h(Blocks.GREEN_CARPET, 1, 4, 8, 5), new VillagerTrades.h(Blocks.RED_CARPET, 1, 4, 8, 5), new VillagerTrades.h(Blocks.BLACK_CARPET, 1, 4, 8, 5)}, 3, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.YELLOW_DYE, 12, 8, 20), new VillagerTrades.b(Items.LIGHT_GRAY_DYE, 12, 8, 20), new VillagerTrades.b(Items.ORANGE_DYE, 12, 8, 20), new VillagerTrades.b(Items.RED_DYE, 12, 8, 20), new VillagerTrades.b(Items.PINK_DYE, 12, 8, 20), new VillagerTrades.h(Blocks.WHITE_BED, 3, 1, 6, 10), new VillagerTrades.h(Blocks.YELLOW_BED, 3, 1, 6, 10), new VillagerTrades.h(Blocks.RED_BED, 3, 1, 6, 10), new VillagerTrades.h(Blocks.BLACK_BED, 3, 1, 6, 10), new VillagerTrades.h(Blocks.BLUE_BED, 3, 1, 6, 10), new VillagerTrades.h(Blocks.BROWN_BED, 3, 1, 6, 10), new VillagerTrades.h(Blocks.CYAN_BED, 3, 1, 6, 10), new VillagerTrades.h(Blocks.GRAY_BED, 3, 1, 6, 10), new VillagerTrades.h(Blocks.GREEN_BED, 3, 1, 6, 10), new VillagerTrades.h(Blocks.LIGHT_BLUE_BED, 3, 1, 6, 10), new VillagerTrades.h(Blocks.LIGHT_GRAY_BED, 3, 1, 6, 10), new VillagerTrades.h(Blocks.LIME_BED, 3, 1, 6, 10), new VillagerTrades.h(Blocks.MAGENTA_BED, 3, 1, 6, 10), new VillagerTrades.h(Blocks.ORANGE_BED, 3, 1, 6, 10), new VillagerTrades.h(Blocks.PINK_BED, 3, 1, 6, 10), new VillagerTrades.h(Blocks.PURPLE_BED, 3, 1, 6, 10)}, 4, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.BROWN_DYE, 12, 8, 30), new VillagerTrades.b(Items.PURPLE_DYE, 12, 8, 30), new VillagerTrades.b(Items.BLUE_DYE, 12, 8, 30), new VillagerTrades.b(Items.GREEN_DYE, 12, 8, 30), new VillagerTrades.b(Items.MAGENTA_DYE, 12, 8, 30), new VillagerTrades.b(Items.CYAN_DYE, 12, 8, 30), new VillagerTrades.h(Items.WHITE_BANNER, 3, 1, 6, 15), new VillagerTrades.h(Items.BLUE_BANNER, 3, 1, 6, 15), new VillagerTrades.h(Items.LIGHT_BLUE_BANNER, 3, 1, 6, 15), new VillagerTrades.h(Items.RED_BANNER, 3, 1, 6, 15), new VillagerTrades.h(Items.PINK_BANNER, 3, 1, 6, 15), new VillagerTrades.h(Items.GREEN_BANNER, 3, 1, 6, 15), new VillagerTrades.h(Items.LIME_BANNER, 3, 1, 6, 15), new VillagerTrades.h(Items.GRAY_BANNER, 3, 1, 6, 15), new VillagerTrades.h(Items.BLACK_BANNER, 3, 1, 6, 15), new VillagerTrades.h(Items.PURPLE_BANNER, 3, 1, 6, 15), new VillagerTrades.h(Items.MAGENTA_BANNER, 3, 1, 6, 15), new VillagerTrades.h(Items.CYAN_BANNER, 3, 1, 6, 15), new VillagerTrades.h(Items.BROWN_BANNER, 3, 1, 6, 15), new VillagerTrades.h(Items.YELLOW_BANNER, 3, 1, 6, 15), new VillagerTrades.h(Items.ORANGE_BANNER, 3, 1, 6, 15), new VillagerTrades.h(Items.LIGHT_GRAY_BANNER, 3, 1, 6, 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, 8, 2), new VillagerTrades.h(Items.ARROW, 1, 16, 1), new VillagerTrades.g(Blocks.GRAVEL, 10, Items.FLINT, 10, 6, 1)}, 2, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.FLINT, 26, 6, 10), new VillagerTrades.h(Items.BOW, 2, 1, 5)}, 3, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.STRING, 14, 8, 20), new VillagerTrades.h(Items.CROSSBOW, 3, 1, 10)}, 4, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.FEATHER, 24, 8, 30), new VillagerTrades.e(Items.BOW, 2, 2, 15)}, 5, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.dE, 8, 6, 30), new VillagerTrades.e(Items.CROSSBOW, 3, 2, 15), new VillagerTrades.j(Items.ARROW, 5, Items.TIPPED_ARROW, 5, 2, 6, 30)})));
- hashmap.put(VillagerProfession.LIBRARIAN, a(ImmutableMap.builder().put(1, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.PAPER, 24, 8, 2), new VillagerTrades.d(1), new VillagerTrades.h(Blocks.BOOKSHELF, 6, 3, 6, 1)}).put(2, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.BOOK, 4, 6, 10), new VillagerTrades.d(5), new VillagerTrades.h(Items.pQ, 1, 1, 5)}).put(3, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.INK_SAC, 5, 6, 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, 6, 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, 8, 2), new VillagerTrades.d(1), new VillagerTrades.h(Blocks.BOOKSHELF, 6, 3, 6, 1)}).put(2, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.BOOK, 4, 6, 10), new VillagerTrades.d(5), new VillagerTrades.h(Items.pQ, 1, 1, 5)}).put(3, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.INK_SAC, 5, 6, 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, 6, 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, 8, 2), new VillagerTrades.h(Items.MAP, 7, 1, 1)}, 2, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.df, 11, 8, 10), new VillagerTrades.k(13, "Monument", MapIcon.Type.MONUMENT, 6, 5)}, 3, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.COMPASS, 1, 6, 20), new VillagerTrades.k(14, "Mansion", MapIcon.Type.MANSION, 6, 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, 8, 2), new VillagerTrades.h(Items.REDSTONE, 1, 2, 1)}, 2, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.GOLD_INGOT, 3, 6, 10), new VillagerTrades.h(Items.LAPIS_LAZULI, 1, 1, 5)}, 3, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.RABBIT_FOOT, 2, 6, 20), new VillagerTrades.h(Blocks.GLOWSTONE, 4, 1, 6, 10)}, 4, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.SCUTE, 4, 6, 30), new VillagerTrades.b(Items.GLASS_BOTTLE, 9, 6, 30), new VillagerTrades.h(Items.ENDER_PEARL, 5, 1, 15)}, 5, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.NETHER_WART, 22, 6, 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, 8, 2), new VillagerTrades.h(new ItemStack(Items.IRON_LEGGINGS), 7, 1, 6, 1, 0.2F), new VillagerTrades.h(new ItemStack(Items.IRON_BOOTS), 4, 1, 6, 1, 0.2F), new VillagerTrades.h(new ItemStack(Items.IRON_HELMET), 5, 1, 6, 1, 0.2F), new VillagerTrades.h(new ItemStack(Items.IRON_CHESTPLATE), 9, 1, 6, 1, 0.2F)}, 2, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.IRON_INGOT, 4, 6, 10), new VillagerTrades.h(new ItemStack(Items.pP), 36, 1, 6, 5, 0.2F), new VillagerTrades.h(new ItemStack(Items.CHAINMAIL_BOOTS), 1, 1, 6, 5, 0.2F), new VillagerTrades.h(new ItemStack(Items.CHAINMAIL_LEGGINGS), 3, 1, 6, 5, 0.2F)}, 3, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.LAVA_BUCKET, 1, 6, 20), new VillagerTrades.b(Items.DIAMOND, 1, 6, 20), new VillagerTrades.h(new ItemStack(Items.CHAINMAIL_HELMET), 1, 1, 6, 10, 0.2F), new VillagerTrades.h(new ItemStack(Items.CHAINMAIL_CHESTPLATE), 4, 1, 6, 10, 0.2F), new VillagerTrades.h(new ItemStack(Items.SHIELD), 5, 1, 6, 10, 0.2F)}, 4, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.e(Items.DIAMOND_LEGGINGS, 14, 2, 15, 0.2F), new VillagerTrades.e(Items.DIAMOND_BOOTS, 8, 2, 15, 0.2F)}, 5, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.e(Items.DIAMOND_HELMET, 8, 2, 30, 0.2F), new VillagerTrades.e(Items.DIAMOND_CHESTPLATE, 16, 2, 30, 0.2F)})));
diff --git a/src/main/java/net/minecraft/server/WorldPersistentData.java b/src/main/java/net/minecraft/server/WorldPersistentData.java
index b251a1d7d9..3c5b3fe101 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