Update to Minecraft 1.17

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2021-06-11 15:00:00 +10:00
parent 75faba7fde
commit b3a8254758
619 changed files with 10708 additions and 8451 deletions

View File

@@ -10,8 +10,8 @@
+
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
- private static final Map<String, String> CURRENT_TO_LEGACY_MAP = (Map) SystemUtils.a((Object) Maps.newHashMap(), (hashmap) -> {
+ private static final Map<String, String> CURRENT_TO_LEGACY_MAP = (Map) SystemUtils.a(Maps.newHashMap(), (hashmap) -> { // CraftBukkit - decompile error
hashmap.put("Village", "Village");
hashmap.put("Mineshaft", "Mineshaft");
hashmap.put("Mansion", "Mansion");
@@ -19,29 +19,29 @@
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
- private static final Map<String, String> LEGACY_TO_CURRENT_MAP = (Map) SystemUtils.a((Object) Maps.newHashMap(), (hashmap) -> {
+ private static final Map<String, String> LEGACY_TO_CURRENT_MAP = (Map) SystemUtils.a(Maps.newHashMap(), (hashmap) -> { // CraftBukkit - decompile error
hashmap.put("Iglu", "Igloo");
hashmap.put("TeDP", "Desert_Pyramid");
hashmap.put("TeJP", "Jungle_Pyramid");
@@ -236,16 +240,16 @@
@@ -234,16 +238,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
+ if (resourcekey == DimensionManager.OVERWORLD_LOCATION) { // 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
- if (resourcekey == World.NETHER) {
+ if (resourcekey == DimensionManager.NETHER_LOCATION) { // CraftBukkit
immutablelist = ImmutableList.of("Fortress");
return new PersistentStructureLegacy(worldpersistentdata, immutablelist, immutablelist);
- } else if (resourcekey == World.THE_END) {
+ } else if (resourcekey == DimensionManager.THE_END) { // CraftBukkit
- } else if (resourcekey == World.END) {
+ } else if (resourcekey == DimensionManager.END_LOCATION) { // CraftBukkit
immutablelist = ImmutableList.of("EndCity");
return new PersistentStructureLegacy(worldpersistentdata, immutablelist, immutablelist);
} else {

View File

@@ -1,18 +1,18 @@
--- a/net/minecraft/world/level/levelgen/structure/WorldGenWitchHut.java
+++ b/net/minecraft/world/level/levelgen/structure/WorldGenWitchHut.java
@@ -106,7 +106,7 @@
@@ -101,7 +101,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);
entitywitch.setPositionRotation((double) blockposition_mutableblockposition.getX() + 0.5D, (double) blockposition_mutableblockposition.getY(), (double) blockposition_mutableblockposition.getZ() + 0.5D, 0.0F, 0.0F);
entitywitch.prepare(generatoraccessseed, generatoraccessseed.getDamageScaler(blockposition_mutableblockposition), EnumMobSpawn.STRUCTURE, (GroupDataEntity) null, (NBTTagCompound) null);
- generatoraccessseed.addAllEntities(entitywitch);
+ generatoraccessseed.addAllEntities(entitywitch, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.CHUNK_GEN); // CraftBukkit - add SpawnReason
}
}
@@ -128,7 +128,7 @@
@@ -121,7 +121,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);
entitycat.setPositionRotation((double) blockposition_mutableblockposition.getX() + 0.5D, (double) blockposition_mutableblockposition.getY(), (double) blockposition_mutableblockposition.getZ() + 0.5D, 0.0F, 0.0F);
entitycat.prepare(worldaccess, worldaccess.getDamageScaler(blockposition_mutableblockposition), 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

@@ -1,15 +1,15 @@
--- a/net/minecraft/world/level/levelgen/structure/templatesystem/DefinedStructure.java
+++ b/net/minecraft/world/level/levelgen/structure/templatesystem/DefinedStructure.java
@@ -134,7 +134,7 @@
@@ -147,7 +147,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();
return definedstructure_blockinfo.pos.getY();
}).thenComparingInt((definedstructure_blockinfo) -> {
return definedstructure_blockinfo.a.getX();
@@ -154,7 +154,7 @@
return definedstructure_blockinfo.pos.getX();
@@ -167,7 +167,7 @@
}
private void a(World world, BlockPosition blockposition, BlockPosition blockposition1) {
@@ -18,14 +18,14 @@
return !(entity instanceof EntityHuman);
});
@@ -466,11 +466,13 @@
@@ -471,11 +471,13 @@
}
private static Optional<Entity> a(WorldAccess worldaccess, NBTTagCompound nbttagcompound) {
- try {
+ // CraftBukkit start
+ // try {
return EntityTypes.a(nbttagcompound, (World) worldaccess.getMinecraftWorld());
return EntityTypes.a(nbttagcompound, (World) worldaccess.getLevel());
- } catch (Exception exception) {
- return Optional.empty();
- }
@@ -35,13 +35,13 @@
+ // CraftBukkit end
}
public BlockPosition a(EnumBlockRotation enumblockrotation) {
@@ -905,7 +907,7 @@
public BaseBlockPosition a(EnumBlockRotation enumblockrotation) {
@@ -868,7 +870,7 @@
public IBlockData a(int i) {
IBlockData iblockdata = (IBlockData) this.b.fromId(i);
IBlockData iblockdata = (IBlockData) this.ids.fromId(i);
- return iblockdata == null ? DefinedStructure.b.a : iblockdata;
+ return iblockdata == null ? a : iblockdata; // CraftBukkit - decompile error
- return iblockdata == null ? DefinedStructure.b.DEFAULT_BLOCK_STATE : iblockdata;
+ return iblockdata == null ? DEFAULT_BLOCK_STATE : iblockdata; // CraftBukkit - decompile error
}
public Iterator<IBlockData> iterator() {

View File

@@ -1,11 +0,0 @@
--- a/net/minecraft/world/level/levelgen/structure/templatesystem/DefinedStructureManager.java
+++ b/net/minecraft/world/level/levelgen/structure/templatesystem/DefinedStructureManager.java
@@ -31,7 +31,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 Path e;