@@ -0,0 +1,32 @@
|
||||
--- a/net/minecraft/server/ChunkGeneratorAbstract.java
|
||||
+++ b/net/minecraft/server/ChunkGeneratorAbstract.java
|
||||
@@ -24,7 +24,7 @@
|
||||
return chunkgeneratorabstract.h;
|
||||
})).apply(instance, instance.stable(ChunkGeneratorAbstract::new));
|
||||
});
|
||||
- private static final float[] i = (float[]) SystemUtils.a((Object) (new float[13824]), (afloat) -> {
|
||||
+ private static final float[] i = (float[]) SystemUtils.a((new float[13824]), (afloat) -> { // CraftBukkit - decompile error
|
||||
for (int i = 0; i < 24; ++i) {
|
||||
for (int j = 0; j < 24; ++j) {
|
||||
for (int k = 0; k < 24; ++k) {
|
||||
@@ -34,7 +34,7 @@
|
||||
}
|
||||
|
||||
});
|
||||
- private static final float[] j = (float[]) SystemUtils.a((Object) (new float[25]), (afloat) -> {
|
||||
+ private static final float[] j = (float[]) SystemUtils.a((new float[25]), (afloat) -> { // CraftBukkit - decompile error
|
||||
for (int i = -2; i <= 2; ++i) {
|
||||
for (int j = -2; j <= 2; ++j) {
|
||||
float f = 10.0F / MathHelper.c((float) (i * i + j * j) + 0.2F);
|
||||
@@ -193,6 +193,11 @@
|
||||
f6 = f4;
|
||||
f7 = f5;
|
||||
}
|
||||
+ // CraftBukkit start - fix MC-54738
|
||||
+ if (f6 < -1.8F) {
|
||||
+ f6 = -1.8F;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
|
||||
float f8 = f4 > f3 ? 0.5F : 1.0F;
|
||||
float f9 = f8 * ChunkGeneratorAbstract.j[l + 2 + (i1 + 2) * 5] / (f6 + 2.0F);
|
||||
@@ -0,0 +1,11 @@
|
||||
--- a/net/minecraft/server/MobSpawnerPatrol.java
|
||||
+++ b/net/minecraft/server/MobSpawnerPatrol.java
|
||||
@@ -102,7 +102,7 @@
|
||||
|
||||
entitymonsterpatrolling.setPosition((double) blockposition.getX(), (double) blockposition.getY(), (double) blockposition.getZ());
|
||||
entitymonsterpatrolling.prepare(worldserver, worldserver.getDamageScaler(blockposition), EnumMobSpawn.PATROL, (GroupDataEntity) null, (NBTTagCompound) null);
|
||||
- worldserver.addAllEntities(entitymonsterpatrolling);
|
||||
+ worldserver.addAllEntities(entitymonsterpatrolling, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.PATROL); // CraftBukkit
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
@@ -0,0 +1,11 @@
|
||||
--- a/net/minecraft/server/MobSpawnerPhantom.java
|
||||
+++ b/net/minecraft/server/MobSpawnerPhantom.java
|
||||
@@ -57,7 +57,7 @@
|
||||
|
||||
entityphantom.setPositionRotation(blockposition1, 0.0F, 0.0F);
|
||||
groupdataentity = entityphantom.prepare(worldserver, difficultydamagescaler, EnumMobSpawn.NATURAL, groupdataentity, (NBTTagCompound) null);
|
||||
- worldserver.addAllEntities(entityphantom);
|
||||
+ worldserver.addAllEntities(entityphantom, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.NATURAL); // CraftBukkit
|
||||
}
|
||||
|
||||
i += k;
|
||||
@@ -0,0 +1,41 @@
|
||||
--- a/net/minecraft/server/PersistentStructureLegacy.java
|
||||
+++ b/net/minecraft/server/PersistentStructureLegacy.java
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
public class PersistentStructureLegacy {
|
||||
|
||||
- private static final Map<String, String> a = (Map) SystemUtils.a((Object) Maps.newHashMap(), (hashmap) -> {
|
||||
+ private static final Map<String, String> a = (Map) SystemUtils.a(Maps.newHashMap(), (hashmap) -> { // CraftBukkit - decompile error
|
||||
hashmap.put("Village", "Village");
|
||||
hashmap.put("Mineshaft", "Mineshaft");
|
||||
hashmap.put("Mansion", "Mansion");
|
||||
@@ -27,7 +27,7 @@
|
||||
hashmap.put("Fortress", "Fortress");
|
||||
hashmap.put("EndCity", "EndCity");
|
||||
});
|
||||
- private static final Map<String, String> b = (Map) SystemUtils.a((Object) Maps.newHashMap(), (hashmap) -> {
|
||||
+ private static final Map<String, String> b = (Map) SystemUtils.a(Maps.newHashMap(), (hashmap) -> { // CraftBukkit - decompile error
|
||||
hashmap.put("Iglu", "Igloo");
|
||||
hashmap.put("TeDP", "Desert_Pyramid");
|
||||
hashmap.put("TeJP", "Jungle_Pyramid");
|
||||
@@ -228,16 +228,16 @@
|
||||
}
|
||||
}
|
||||
|
||||
- public static PersistentStructureLegacy a(ResourceKey<World> resourcekey, @Nullable WorldPersistentData worldpersistentdata) {
|
||||
- if (resourcekey == World.OVERWORLD) {
|
||||
+ public static PersistentStructureLegacy a(ResourceKey<DimensionManager> resourcekey, @Nullable WorldPersistentData worldpersistentdata) { // CraftBukkit
|
||||
+ if (resourcekey == DimensionManager.OVERWORLD) { // CraftBukkit
|
||||
return new PersistentStructureLegacy(worldpersistentdata, ImmutableList.of("Monument", "Stronghold", "Village", "Mineshaft", "Temple", "Mansion"), ImmutableList.of("Village", "Mineshaft", "Mansion", "Igloo", "Desert_Pyramid", "Jungle_Pyramid", "Swamp_Hut", "Stronghold", "Monument"));
|
||||
} else {
|
||||
ImmutableList immutablelist;
|
||||
|
||||
- if (resourcekey == World.THE_NETHER) {
|
||||
+ if (resourcekey == DimensionManager.THE_NETHER) { // CraftBukkit
|
||||
immutablelist = ImmutableList.of("Fortress");
|
||||
return new PersistentStructureLegacy(worldpersistentdata, immutablelist, immutablelist);
|
||||
- } else if (resourcekey == World.THE_END) {
|
||||
+ } else if (resourcekey == DimensionManager.THE_END) { // CraftBukkit
|
||||
immutablelist = ImmutableList.of("EndCity");
|
||||
return new PersistentStructureLegacy(worldpersistentdata, immutablelist, immutablelist);
|
||||
} else {
|
||||
@@ -0,0 +1,20 @@
|
||||
--- a/net/minecraft/server/WorldGenWitchHut.java
|
||||
+++ b/net/minecraft/server/WorldGenWitchHut.java
|
||||
@@ -85,7 +85,7 @@
|
||||
entitywitch.setPersistent();
|
||||
entitywitch.setPositionRotation((double) j + 0.5D, (double) i, (double) k + 0.5D, 0.0F, 0.0F);
|
||||
entitywitch.prepare(generatoraccessseed, generatoraccessseed.getDamageScaler(new BlockPosition(j, i, k)), EnumMobSpawn.STRUCTURE, (GroupDataEntity) null, (NBTTagCompound) null);
|
||||
- generatoraccessseed.addAllEntities(entitywitch);
|
||||
+ generatoraccessseed.addAllEntities(entitywitch, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.CHUNK_GEN); // CraftBukkit - add SpawnReason
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,7 +107,7 @@
|
||||
entitycat.setPersistent();
|
||||
entitycat.setPositionRotation((double) i + 0.5D, (double) j, (double) k + 0.5D, 0.0F, 0.0F);
|
||||
entitycat.prepare(worldaccess, worldaccess.getDamageScaler(new BlockPosition(i, j, k)), EnumMobSpawn.STRUCTURE, (GroupDataEntity) null, (NBTTagCompound) null);
|
||||
- worldaccess.addAllEntities(entitycat);
|
||||
+ worldaccess.addAllEntities(entitycat, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.CHUNK_GEN); // CraftBukkit - add SpawnReason
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
--- a/net/minecraft/server/DefinedStructure.java
|
||||
+++ b/net/minecraft/server/DefinedStructure.java
|
||||
@@ -98,7 +98,7 @@
|
||||
}
|
||||
|
||||
private static List<DefinedStructure.BlockInfo> a(List<DefinedStructure.BlockInfo> list, List<DefinedStructure.BlockInfo> list1, List<DefinedStructure.BlockInfo> list2) {
|
||||
- Comparator<DefinedStructure.BlockInfo> comparator = Comparator.comparingInt((definedstructure_blockinfo) -> {
|
||||
+ Comparator<DefinedStructure.BlockInfo> comparator = Comparator.<DefinedStructure.BlockInfo>comparingInt((definedstructure_blockinfo) -> { // CraftBukkit - decompile error
|
||||
return definedstructure_blockinfo.a.getY();
|
||||
}).thenComparingInt((definedstructure_blockinfo) -> {
|
||||
return definedstructure_blockinfo.a.getX();
|
||||
@@ -118,7 +118,7 @@
|
||||
}
|
||||
|
||||
private void a(World world, BlockPosition blockposition, BlockPosition blockposition1) {
|
||||
- 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) (entity) -> { // CraftBukkit - decompile error
|
||||
return !(entity instanceof EntityHuman);
|
||||
});
|
||||
|
||||
@@ -430,11 +430,13 @@
|
||||
}
|
||||
|
||||
private static Optional<Entity> a(WorldAccess worldaccess, NBTTagCompound nbttagcompound) {
|
||||
- try {
|
||||
+ // CraftBukkit start
|
||||
+ // try {
|
||||
return EntityTypes.a(nbttagcompound, (World) worldaccess.getMinecraftWorld());
|
||||
- } catch (Exception exception) {
|
||||
- return Optional.empty();
|
||||
- }
|
||||
+ // } catch (Exception exception) {
|
||||
+ // return Optional.empty();
|
||||
+ // }
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
|
||||
public BlockPosition a(EnumBlockRotation enumblockrotation) {
|
||||
@@ -869,7 +871,7 @@
|
||||
public IBlockData a(int i) {
|
||||
IBlockData iblockdata = (IBlockData) this.b.fromId(i);
|
||||
|
||||
- return iblockdata == null ? DefinedStructure.b.a : iblockdata;
|
||||
+ return iblockdata == null ? a : iblockdata; // CraftBukkit - decompile error
|
||||
}
|
||||
|
||||
public Iterator<IBlockData> iterator() {
|
||||
@@ -0,0 +1,11 @@
|
||||
--- a/net/minecraft/server/DefinedStructureManager.java
|
||||
+++ b/net/minecraft/server/DefinedStructureManager.java
|
||||
@@ -19,7 +19,7 @@
|
||||
public class DefinedStructureManager {
|
||||
|
||||
private static final Logger LOGGER = LogManager.getLogger();
|
||||
- private final Map<MinecraftKey, DefinedStructure> b = Maps.newHashMap();
|
||||
+ private final Map<MinecraftKey, DefinedStructure> b = Maps.newConcurrentMap(); // SPIGOT-5287
|
||||
private final DataFixer c;
|
||||
private IResourceManager d;
|
||||
private final java.nio.file.Path e;
|
||||
Reference in New Issue
Block a user