Repackage patches

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2021-03-16 09:00:00 +11:00
parent 2777f7b780
commit 18496e998f
433 changed files with 0 additions and 0 deletions

View File

@@ -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 {

View File

@@ -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
}
}

View File

@@ -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() {

View File

@@ -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;