Update to Minecraft 1.16.5

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot 2021-01-16 12:00:00 +11:00
parent 789c080552
commit 78ff16111e
27 changed files with 76 additions and 114 deletions

View file

@ -1,14 +1,5 @@
--- a/net/minecraft/server/BiomeStorage.java --- a/net/minecraft/server/BiomeStorage.java
+++ b/net/minecraft/server/BiomeStorage.java +++ b/net/minecraft/server/BiomeStorage.java
@@ -12,7 +12,7 @@
public static final int a = 1 << BiomeStorage.e + BiomeStorage.e + BiomeStorage.f;
public static final int b = (1 << BiomeStorage.e) - 1;
public static final int c = (1 << BiomeStorage.f) - 1;
- private final Registry<BiomeBase> g;
+ public final Registry<BiomeBase> g; // PAIL
private final BiomeBase[] h;
public BiomeStorage(Registry<BiomeBase> registry, BiomeBase[] abiomebase) {
@@ -87,4 +87,14 @@ @@ -87,4 +87,14 @@
return this.h[i1 << BiomeStorage.e + BiomeStorage.e | j1 << BiomeStorage.e | l]; return this.h[i1 << BiomeStorage.e + BiomeStorage.e | j1 << BiomeStorage.e | l];

View file

@ -1,7 +1,7 @@
--- a/net/minecraft/server/BlockCampfire.java --- a/net/minecraft/server/BlockCampfire.java
+++ b/net/minecraft/server/BlockCampfire.java +++ b/net/minecraft/server/BlockCampfire.java
@@ -144,6 +144,11 @@ @@ -144,6 +144,11 @@
if (flag && !(Boolean) iblockdata.get(BlockCampfire.b) && !(Boolean) iblockdata.get(BlockCampfire.d)) { if (flag && !(Boolean) iblockdata.get(BlockCampfire.LIT) && !(Boolean) iblockdata.get(BlockCampfire.d)) {
BlockPosition blockposition = movingobjectpositionblock.getBlockPosition(); BlockPosition blockposition = movingobjectpositionblock.getBlockPosition();
+ // CraftBukkit start + // CraftBukkit start

View file

@ -33,21 +33,8 @@
} }
@Override @Override
@@ -83,6 +90,12 @@ @@ -109,4 +116,12 @@
} }
private static boolean b(World world, BlockPosition blockposition, EnumDirection enumdirection) {
+ // CraftBukkit start - SPIGOT-6311: Do not calculate portals for up/down directions
+ if (enumdirection == EnumDirection.UP || enumdirection == EnumDirection.DOWN) {
+ return false;
+ }
+ // CraftBukkit end
+
if (!a(world)) {
return false;
} else {
@@ -103,4 +116,12 @@
return flag && BlockPortalShape.a((GeneratorAccess) world, blockposition, enumdirection.h().n()).isPresent();
} }
} }
+ +

View file

@ -698,8 +698,8 @@
+ final WorldServer worldserverFinal = worldserver = ((CraftWorld) event.getTo().getWorld()).getHandle(); + final WorldServer worldserverFinal = worldserver = ((CraftWorld) event.getTo().getWorld()).getHandle();
+ blockposition = new BlockPosition(event.getTo().getX(), event.getTo().getY(), event.getTo().getZ()); + blockposition = new BlockPosition(event.getTo().getX(), event.getTo().getY(), event.getTo().getZ());
- return (ShapeDetectorShape) this.a(worldserver, blockposition, flag2).map((blockutil_rectangle) -> { - return (ShapeDetectorShape) this.findOrCreatePortal(worldserver, blockposition, flag2).map((blockutil_rectangle) -> {
+ return (ShapeDetectorShape) this.a(worldserver, blockposition, flag2, event.getSearchRadius(), event.getCanCreatePortal(), event.getCreationRadius()).map((blockutil_rectangle) -> { + return (ShapeDetectorShape) this.findOrCreatePortal(worldserver, blockposition, flag2, event.getSearchRadius(), event.getCanCreatePortal(), event.getCreationRadius()).map((blockutil_rectangle) -> {
+ // CraftBukkit end + // CraftBukkit end
IBlockData iblockdata = this.world.getType(this.ac); IBlockData iblockdata = this.world.getType(this.ac);
EnumDirection.EnumAxis enumdirection_enumaxis; EnumDirection.EnumAxis enumdirection_enumaxis;
@ -736,7 +736,7 @@
return BlockPortalShape.a(blockutil_rectangle, enumdirection_enumaxis, this.getPositionVector(), this.a(this.getPose())); return BlockPortalShape.a(blockutil_rectangle, enumdirection_enumaxis, this.getPositionVector(), this.a(this.getPose()));
} }
- protected Optional<BlockUtil.Rectangle> a(WorldServer worldserver, BlockPosition blockposition, boolean flag) { - protected Optional<BlockUtil.Rectangle> findOrCreatePortal(WorldServer worldserver, BlockPosition blockposition, boolean flag) {
- return worldserver.getTravelAgent().findPortal(blockposition, flag); - return worldserver.getTravelAgent().findPortal(blockposition, flag);
+ // CraftBukkit start + // CraftBukkit start
+ protected CraftPortalEvent callPortalEvent(Entity entity, WorldServer exitWorldServer, BlockPosition exitPosition, PlayerTeleportEvent.TeleportCause cause, int searchRadius, int creationRadius) { + protected CraftPortalEvent callPortalEvent(Entity entity, WorldServer exitWorldServer, BlockPosition exitPosition, PlayerTeleportEvent.TeleportCause cause, int searchRadius, int creationRadius) {
@ -752,7 +752,7 @@
+ return new CraftPortalEvent(event); + return new CraftPortalEvent(event);
+ } + }
+ +
+ protected Optional<BlockUtil.Rectangle> a(WorldServer worldserver, BlockPosition blockposition, boolean flag, int searchRadius, boolean canCreatePortal, int createRadius) { // PAIL rename findOrCreatePortal + protected Optional<BlockUtil.Rectangle> findOrCreatePortal(WorldServer worldserver, BlockPosition blockposition, boolean flag, int searchRadius, boolean canCreatePortal, int createRadius) {
+ return worldserver.getTravelAgent().findPortal(blockposition, searchRadius); + return worldserver.getTravelAgent().findPortal(blockposition, searchRadius);
+ // CraftBukkit end + // CraftBukkit end
} }

View file

@ -43,13 +43,13 @@
+ // CraftBukkit end + // CraftBukkit end
switch (enumitemslot.a()) { switch (enumitemslot.a()) {
case HAND: case HAND:
- this.b(itemstack); - this.playEquipSound(itemstack);
+ this.b(itemstack, silent); // CraftBukkit + this.playEquipSound(itemstack, silent); // CraftBukkit
this.handItems.set(enumitemslot.b(), itemstack); this.handItems.set(enumitemslot.b(), itemstack);
break; break;
case ARMOR: case ARMOR:
- this.b(itemstack); - this.playEquipSound(itemstack);
+ this.b(itemstack, silent); // CraftBukkit + this.playEquipSound(itemstack, silent); // CraftBukkit
this.armorItems.set(enumitemslot.b(), itemstack); this.armorItems.set(enumitemslot.b(), itemstack);
} }

View file

@ -14,7 +14,7 @@
@@ -25,6 +30,12 @@ @@ -25,6 +30,12 @@
private final int an; private final int an;
private final int ao; private final int lureLevel;
+ // CraftBukkit start - Extra variables to enable modification of fishing wait time, values are minecraft defaults + // CraftBukkit start - Extra variables to enable modification of fishing wait time, values are minecraft defaults
+ public int minWaitTime = 100; + public int minWaitTime = 100;
@ -26,7 +26,7 @@
super(EntityTypes.FISHING_BOBBER, world); super(EntityTypes.FISHING_BOBBER, world);
this.b = new Random(); this.b = new Random();
@@ -253,6 +264,10 @@ @@ -253,6 +264,10 @@
this.ah = 0; this.waitTime = 0;
this.ai = 0; this.ai = 0;
this.getDataWatcher().set(EntityFishingHook.f, false); this.getDataWatcher().set(EntityFishingHook.f, false);
+ // CraftBukkit start + // CraftBukkit start
@ -54,11 +54,11 @@
this.ai = MathHelper.nextInt(this.random, 20, 80); this.ai = MathHelper.nextInt(this.random, 20, 80);
} }
} else { } else {
- this.ah = MathHelper.nextInt(this.random, 100, 600); - this.waitTime = MathHelper.nextInt(this.random, 100, 600);
- this.ah -= this.ao * 20 * 5; - this.waitTime -= this.lureLevel * 20 * 5;
+ // CraftBukkit start - logic to modify fishing wait time + // CraftBukkit start - logic to modify fishing wait time
+ this.ah = MathHelper.nextInt(this.random, this.minWaitTime, this.maxWaitTime); // PAIL rename waitTime + this.waitTime = MathHelper.nextInt(this.random, this.minWaitTime, this.maxWaitTime);
+ this.ah -= (this.applyLure) ? this.ao * 20 * 5 : 0; // PAIL rename waitTime, lureLevel + this.waitTime -= (this.applyLure) ? this.lureLevel * 20 * 5 : 0;
+ // CraftBukkit end + // CraftBukkit end
} }
} }

View file

@ -384,16 +384,16 @@
+ public void setSlot(EnumItemSlot enumitemslot, ItemStack itemstack, boolean silent) { + public void setSlot(EnumItemSlot enumitemslot, ItemStack itemstack, boolean silent) {
+ // CraftBukkit end + // CraftBukkit end
if (enumitemslot == EnumItemSlot.MAINHAND) { if (enumitemslot == EnumItemSlot.MAINHAND) {
- this.b(itemstack); - this.playEquipSound(itemstack);
+ this.b(itemstack, silent); // CraftBukkit + this.playEquipSound(itemstack, silent); // CraftBukkit
this.inventory.items.set(this.inventory.itemInHandIndex, itemstack); this.inventory.items.set(this.inventory.itemInHandIndex, itemstack);
} else if (enumitemslot == EnumItemSlot.OFFHAND) { } else if (enumitemslot == EnumItemSlot.OFFHAND) {
- this.b(itemstack); - this.playEquipSound(itemstack);
+ this.b(itemstack, silent); // CraftBukkit + this.playEquipSound(itemstack, silent); // CraftBukkit
this.inventory.extraSlots.set(0, itemstack); this.inventory.extraSlots.set(0, itemstack);
} else if (enumitemslot.a() == EnumItemSlot.Function.ARMOR) { } else if (enumitemslot.a() == EnumItemSlot.Function.ARMOR) {
- this.b(itemstack); - this.playEquipSound(itemstack);
+ this.b(itemstack, silent); // CraftBukkit + this.playEquipSound(itemstack, silent); // CraftBukkit
this.inventory.armor.set(enumitemslot.b(), itemstack); this.inventory.armor.set(enumitemslot.b(), itemstack);
} }

View file

@ -1,14 +1,5 @@
--- a/net/minecraft/server/EntityItemFrame.java --- a/net/minecraft/server/EntityItemFrame.java
+++ b/net/minecraft/server/EntityItemFrame.java +++ b/net/minecraft/server/EntityItemFrame.java
@@ -10,7 +10,7 @@
private static final Logger LOGGER = LogManager.getLogger();
private static final DataWatcherObject<ItemStack> ITEM = DataWatcher.a(EntityItemFrame.class, DataWatcherRegistry.g);
private static final DataWatcherObject<Integer> g = DataWatcher.a(EntityItemFrame.class, DataWatcherRegistry.b);
- private float ag = 1.0F;
+ public float ag = 1.0F; // PAIL itemDropChance
public boolean fixed;
public EntityItemFrame(EntityTypes<? extends EntityItemFrame> entitytypes, World world) {
@@ -53,16 +53,27 @@ @@ -53,16 +53,27 @@
@Override @Override
protected void updateBoundingBox() { protected void updateBoundingBox() {

View file

@ -88,13 +88,13 @@
@@ -497,7 +541,13 @@ @@ -497,7 +541,13 @@
} }
protected void b(ItemStack itemstack) { protected void playEquipSound(ItemStack itemstack) {
- if (!itemstack.isEmpty()) { - if (!itemstack.isEmpty()) {
+ // CraftBukkit start + // CraftBukkit start
+ this.b(itemstack, false); + this.playEquipSound(itemstack, false);
+ } + }
+ +
+ protected void b(ItemStack itemstack, boolean silent) { + protected void playEquipSound(ItemStack itemstack, boolean silent) {
+ if (!itemstack.isEmpty() && !silent) { + if (!itemstack.isEmpty() && !silent) {
+ // CraftBukkit end + // CraftBukkit end
SoundEffect soundeffect = SoundEffects.ITEM_ARMOR_EQUIP_GENERIC; SoundEffect soundeffect = SoundEffects.ITEM_ARMOR_EQUIP_GENERIC;

View file

@ -503,10 +503,10 @@
} }
@Override @Override
- protected Optional<BlockUtil.Rectangle> a(WorldServer worldserver, BlockPosition blockposition, boolean flag) { - protected Optional<BlockUtil.Rectangle> findOrCreatePortal(WorldServer worldserver, BlockPosition blockposition, boolean flag) {
- Optional<BlockUtil.Rectangle> optional = super.a(worldserver, blockposition, flag); - Optional<BlockUtil.Rectangle> optional = super.findOrCreatePortal(worldserver, blockposition, flag);
+ protected Optional<BlockUtil.Rectangle> a(WorldServer worldserver, BlockPosition blockposition, boolean flag, int searchRadius, boolean canCreatePortal, int createRadius) { // CraftBukkit // PAIL rename findOrCreatePortal + protected Optional<BlockUtil.Rectangle> findOrCreatePortal(WorldServer worldserver, BlockPosition blockposition, boolean flag, int searchRadius, boolean canCreatePortal, int createRadius) { // CraftBukkit
+ Optional<BlockUtil.Rectangle> optional = super.a(worldserver, blockposition, flag, searchRadius, canCreatePortal, createRadius); // CraftBukkit + Optional<BlockUtil.Rectangle> optional = super.findOrCreatePortal(worldserver, blockposition, flag, searchRadius, canCreatePortal, createRadius); // CraftBukkit
- if (optional.isPresent()) { - if (optional.isPresent()) {
+ if (optional.isPresent() || !canCreatePortal) { // CraftBukkit + if (optional.isPresent() || !canCreatePortal) { // CraftBukkit

View file

@ -121,12 +121,12 @@
} else if (BlockCampfire.g(iblockdata)) { } else if (BlockCampfire.g(iblockdata)) {
- this.world.a((EntityHuman) null, 1009, blockposition, 0); - this.world.a((EntityHuman) null, 1009, blockposition, 0);
- BlockCampfire.c((GeneratorAccess) this.world, blockposition, iblockdata); - BlockCampfire.c((GeneratorAccess) this.world, blockposition, iblockdata);
- this.world.setTypeUpdate(blockposition, (IBlockData) iblockdata.set(BlockCampfire.b, false)); - this.world.setTypeUpdate(blockposition, (IBlockData) iblockdata.set(BlockCampfire.LIT, false));
+ // CraftBukkit start + // CraftBukkit start
+ if (!CraftEventFactory.callEntityChangeBlockEvent(this, blockposition, iblockdata.set(BlockCampfire.b, false)).isCancelled()) { // PAIL rename LIT + if (!CraftEventFactory.callEntityChangeBlockEvent(this, blockposition, iblockdata.set(BlockCampfire.LIT, false)).isCancelled()) {
+ this.world.a((EntityHuman) null, 1009, blockposition, 0); + this.world.a((EntityHuman) null, 1009, blockposition, 0);
+ BlockCampfire.c((GeneratorAccess) this.world, blockposition, iblockdata); + BlockCampfire.c((GeneratorAccess) this.world, blockposition, iblockdata);
+ this.world.setTypeUpdate(blockposition, (IBlockData) iblockdata.set(BlockCampfire.b, false)); + this.world.setTypeUpdate(blockposition, (IBlockData) iblockdata.set(BlockCampfire.LIT, false));
+ } + }
+ // CraftBukkit end + // CraftBukkit end
} }

View file

@ -45,9 +45,9 @@
SoundEffectType soundeffecttype = iblockdata1.getStepSound(); SoundEffectType soundeffecttype = iblockdata1.getStepSound();
- world.playSound(entityhuman, blockposition, this.a(iblockdata1), SoundCategory.BLOCKS, (soundeffecttype.a() + 1.0F) / 2.0F, soundeffecttype.b() * 0.8F); - world.playSound(entityhuman, blockposition, this.a(iblockdata1), SoundCategory.BLOCKS, (soundeffecttype.getVolume() + 1.0F) / 2.0F, soundeffecttype.getPitch() * 0.8F);
- if (entityhuman == null || !entityhuman.abilities.canInstantlyBuild) { - if (entityhuman == null || !entityhuman.abilities.canInstantlyBuild) {
+ // world.playSound(entityhuman, blockposition, this.a(iblockdata1), SoundCategory.BLOCKS, (soundeffecttype.a() + 1.0F) / 2.0F, soundeffecttype.b() * 0.8F); + // world.playSound(entityhuman, blockposition, this.a(iblockdata1), SoundCategory.BLOCKS, (soundeffecttype.getVolume() + 1.0F) / 2.0F, soundeffecttype.getPitch() * 0.8F);
+ if ((entityhuman == null || !entityhuman.abilities.canInstantlyBuild) && itemstack != ItemStack.b) { // CraftBukkit + if ((entityhuman == null || !entityhuman.abilities.canInstantlyBuild) && itemstack != ItemStack.b) { // CraftBukkit
itemstack.subtract(1); itemstack.subtract(1);
} }

View file

@ -13,7 +13,7 @@
+ } + }
+ // CraftBukkit end + // CraftBukkit end
this.a(world, blockposition); this.a(world, blockposition);
world.setTypeUpdate(blockposition, (IBlockData) iblockdata.set(BlockCampfire.b, true)); world.setTypeUpdate(blockposition, (IBlockData) iblockdata.set(BlockCampfire.LIT, true));
flag = true; flag = true;
} else { } else {
blockposition = blockposition.shift(itemactioncontext.getClickedFace()); blockposition = blockposition.shift(itemactioncontext.getClickedFace());

View file

@ -232,7 +232,7 @@
+ // SPIGOT-1288 - play sound stripped from ItemBlock + // SPIGOT-1288 - play sound stripped from ItemBlock
+ if (this.item instanceof ItemBlock) { + if (this.item instanceof ItemBlock) {
+ SoundEffectType soundeffecttype = ((ItemBlock) this.item).getBlock().stepSound; + SoundEffectType soundeffecttype = ((ItemBlock) this.item).getBlock().stepSound;
+ world.playSound(entityhuman, blockposition, soundeffecttype.e(), SoundCategory.BLOCKS, (soundeffecttype.a() + 1.0F) / 2.0F, soundeffecttype.b() * 0.8F); + world.playSound(entityhuman, blockposition, soundeffecttype.getPlaceSound(), SoundCategory.BLOCKS, (soundeffecttype.getVolume() + 1.0F) / 2.0F, soundeffecttype.getPitch() * 0.8F);
+ } + }
+ +
+ entityhuman.b(StatisticList.ITEM_USED.b(item)); + entityhuman.b(StatisticList.ITEM_USED.b(item));

View file

@ -3,7 +3,7 @@
@@ -15,6 +15,7 @@ @@ -15,6 +15,7 @@
private static final Logger LOGGER = LogManager.getLogger(); private static final Logger LOGGER = LogManager.getLogger();
private static final Gson b = LootSerialization.c().create(); private static final Gson b = LootSerialization.c().create();
private Map<MinecraftKey, LootTable> c = ImmutableMap.of(); private Map<MinecraftKey, LootTable> keyToLootTable = ImmutableMap.of();
+ public Map<LootTable, MinecraftKey> lootTableToKey = ImmutableMap.of(); // CraftBukkit + public Map<LootTable, MinecraftKey> lootTableToKey = ImmutableMap.of(); // CraftBukkit
private final LootPredicateManager d; private final LootPredicateManager d;
@ -20,10 +20,10 @@
@@ -62,6 +63,11 @@ @@ -62,6 +63,11 @@
LootTableRegistry.LOGGER.warn("Found validation problem in " + s + ": " + s1); LootTableRegistry.LOGGER.warn("Found validation problem in " + s + ": " + s1);
}); });
this.c = immutablemap; this.keyToLootTable = immutablemap;
+ // CraftBukkit start - build a reversed registry map + // CraftBukkit start - build a reversed registry map
+ ImmutableMap.Builder<LootTable, MinecraftKey> lootTableToKeyBuilder = ImmutableMap.builder(); + ImmutableMap.Builder<LootTable, MinecraftKey> lootTableToKeyBuilder = ImmutableMap.builder();
+ this.c.forEach((lootTable, key) -> lootTableToKeyBuilder.put(key, lootTable)); // PAIL rename keyToLootTable + this.keyToLootTable.forEach((lootTable, key) -> lootTableToKeyBuilder.put(key, lootTable)); // PAIL rename keyToLootTable
+ this.lootTableToKey = lootTableToKeyBuilder.build(); + this.lootTableToKey = lootTableToKeyBuilder.build();
+ // CraftBukkit end + // CraftBukkit end
} }

View file

@ -447,9 +447,9 @@
+ // CraftBukkit end + // CraftBukkit end
worldloadlistener.b(); worldloadlistener.b();
chunkproviderserver.getLightEngine().a(5); chunkproviderserver.getLightEngine().a(5);
- this.bc(); - this.updateSpawnFlags();
+ // CraftBukkit start + // CraftBukkit start
+ // this.bc(); + // this.updateSpawnFlags();
+ worldserver.setSpawnFlags(this.getSpawnMonsters(), this.getSpawnAnimals()); + worldserver.setSpawnFlags(this.getSpawnMonsters(), this.getSpawnAnimals());
+ +
+ this.forceTicks = false; + this.forceTicks = false;

View file

@ -1,15 +0,0 @@
--- a/net/minecraft/server/SoundEffectType.java
+++ b/net/minecraft/server/SoundEffectType.java
@@ -51,10 +51,10 @@
public static final SoundEffectType U = new SoundEffectType(1.0F, 1.0F, SoundEffects.BLOCK_GILDED_BLACKSTONE_BREAK, SoundEffects.BLOCK_GILDED_BLACKSTONE_STEP, SoundEffects.BLOCK_GILDED_BLACKSTONE_PLACE, SoundEffects.BLOCK_GILDED_BLACKSTONE_HIT, SoundEffects.BLOCK_GILDED_BLACKSTONE_FALL);
public final float V;
public final float W;
- private final SoundEffect X;
+ public final SoundEffect X; // PAIL private -> public, rename breakSound
private final SoundEffect Y;
private final SoundEffect Z;
- private final SoundEffect aa;
+ public final SoundEffect aa; // PAIL private -> public, rename hitSound
private final SoundEffect ab;
public SoundEffectType(float f, float f1, SoundEffect soundeffect, SoundEffect soundeffect1, SoundEffect soundeffect2, SoundEffect soundeffect3, SoundEffect soundeffect4) {

View file

@ -4,13 +4,13 @@
WorldServer getMinecraftWorld(); WorldServer getMinecraftWorld();
default void addAllEntities(Entity entity) { default void addAllEntities(Entity entity) {
- entity.cp().forEach(this::addEntity); - entity.recursiveStream().forEach(this::addEntity);
+ // CraftBukkit start + // CraftBukkit start
+ this.addAllEntities(entity, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.DEFAULT); + this.addAllEntities(entity, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.DEFAULT);
} }
+ +
+ default void addAllEntities(Entity entity, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason reason) { + default void addAllEntities(Entity entity, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason reason) {
+ entity.cp().forEach((e) -> this.addEntity(e, reason)); + entity.recursiveStream().forEach((e) -> this.addEntity(e, reason));
+ } + }
+ // CraftBukkit end + // CraftBukkit end
} }

View file

@ -123,7 +123,7 @@
+ // CraftBukkit end + // CraftBukkit end
public void a(int i, int j, boolean flag, boolean flag1) { public void a(int i, int j, boolean flag, boolean flag1) {
this.worldDataServer.a(i); this.worldDataServer.setClearWeatherTime(i);
@@ -193,6 +261,7 @@ @@ -193,6 +261,7 @@
this.rainLevel = MathHelper.a(this.rainLevel, 0.0F, 1.0F); this.rainLevel = MathHelper.a(this.rainLevel, 0.0F, 1.0F);
} }
@ -405,7 +405,7 @@
+ +
+ public boolean addAllEntitiesSafely(Entity entity, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason reason) { + public boolean addAllEntitiesSafely(Entity entity, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason reason) {
+ // CraftBukkit end + // CraftBukkit end
if (entity.cp().anyMatch(this::isUUIDTaken)) { if (entity.recursiveStream().anyMatch(this::isUUIDTaken)) {
return false; return false;
} else { } else {
- this.addAllEntities(entity); - this.addAllEntities(entity);

View file

@ -4,7 +4,7 @@
<groupId>org.bukkit</groupId> <groupId>org.bukkit</groupId>
<artifactId>craftbukkit</artifactId> <artifactId>craftbukkit</artifactId>
<packaging>jar</packaging> <packaging>jar</packaging>
<version>1.16.4-R0.1-SNAPSHOT</version> <version>1.16.5-R0.1-SNAPSHOT</version>
<name>CraftBukkit</name> <name>CraftBukkit</name>
<url>https://www.spigotmc.org/</url> <url>https://www.spigotmc.org/</url>
@ -12,7 +12,8 @@
<skipTests>true</skipTests> <skipTests>true</skipTests>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<api.version>unknown</api.version> <api.version>unknown</api.version>
<minecraft.version>1.16.4</minecraft.version> <bt.name>git</bt.name>
<minecraft.version>1.16.5</minecraft.version>
<minecraft_version>1_16_R3</minecraft_version> <minecraft_version>1_16_R3</minecraft_version>
<maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target> <maven.compiler.target>1.8</maven.compiler.target>
@ -42,11 +43,18 @@
<artifactId>log4j-iostreams</artifactId> <artifactId>log4j-iostreams</artifactId>
<version>2.8.1</version> <version>2.8.1</version>
<scope>compile</scope> <scope>compile</scope>
<exclusions>
<!-- included in minecraft-server -->
<exclusion>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
</exclusion>
</exclusions>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.ow2.asm</groupId> <groupId>org.ow2.asm</groupId>
<artifactId>asm</artifactId> <artifactId>asm</artifactId>
<version>8.0.1</version> <version>9.0</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<!-- deprecated API depend --> <!-- deprecated API depend -->
@ -111,7 +119,7 @@
<artifactId>scriptus</artifactId> <artifactId>scriptus</artifactId>
<version>0.4.1</version> <version>0.4.1</version>
<configuration> <configuration>
<format>git-Bukkit-%s</format> <format>${bt.name}-Bukkit-%s</format>
</configuration> </configuration>
<executions> <executions>
<execution> <execution>
@ -256,7 +264,7 @@
<dependency> <dependency>
<groupId>org.eclipse.jdt</groupId> <groupId>org.eclipse.jdt</groupId>
<artifactId>ecj</artifactId> <artifactId>ecj</artifactId>
<version>3.22.0</version> <version>3.24.0</version>
</dependency> </dependency>
</dependencies> </dependencies>
</plugin> </plugin>
@ -309,7 +317,7 @@
<dependency> <dependency>
<groupId>com.puppycrawl.tools</groupId> <groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId> <artifactId>checkstyle</artifactId>
<version>8.36.2</version> <version>8.39</version>
</dependency> </dependency>
</dependencies> </dependencies>
</plugin> </plugin>

View file

@ -130,7 +130,7 @@ public class CraftChunkSnapshot implements ChunkSnapshot {
Preconditions.checkState(biome != null, "ChunkSnapshot created without biome. Please call getSnapshot with includeBiome=true"); Preconditions.checkState(biome != null, "ChunkSnapshot created without biome. Please call getSnapshot with includeBiome=true");
CraftChunk.validateChunkCoordinates(x, y, z); CraftChunk.validateChunkCoordinates(x, y, z);
return CraftBlock.biomeBaseToBiome((IRegistry<BiomeBase>) biome.g, biome.getBiome(x >> 2, y >> 2, z >> 2)); return CraftBlock.biomeBaseToBiome((IRegistry<BiomeBase>) biome.registry, biome.getBiome(x >> 2, y >> 2, z >> 2));
} }
@Override @Override

View file

@ -24,36 +24,36 @@ public class CraftSoundGroup implements SoundGroup {
@Override @Override
public float getVolume() { public float getVolume() {
return getHandle().V; // PAIL rename volume return getHandle().getVolume();
} }
@Override @Override
public float getPitch() { public float getPitch() {
return getHandle().W; // PAIL rename pitch return getHandle().getPitch();
} }
@Override @Override
public Sound getBreakSound() { public Sound getBreakSound() {
return CraftSound.getBukkit(getHandle().X); return CraftSound.getBukkit(getHandle().breakSound);
} }
@Override @Override
public Sound getStepSound() { public Sound getStepSound() {
return CraftSound.getBukkit(getHandle().d()); // PAIL rename getStepSound return CraftSound.getBukkit(getHandle().getStepSound());
} }
@Override @Override
public Sound getPlaceSound() { public Sound getPlaceSound() {
return CraftSound.getBukkit(getHandle().e()); // PAIL rename getPlaceSound return CraftSound.getBukkit(getHandle().getPlaceSound());
} }
@Override @Override
public Sound getHitSound() { public Sound getHitSound() {
return CraftSound.getBukkit(getHandle().aa); return CraftSound.getBukkit(getHandle().hitSound);
} }
@Override @Override
public Sound getFallSound() { public Sound getFallSound() {
return CraftSound.getBukkit(getHandle().g()); // PAIL rename getFallSound return CraftSound.getBukkit(getHandle().getFallSound());
} }
} }

View file

@ -1325,12 +1325,12 @@ public class CraftWorld implements World {
@Override @Override
public void setClearWeatherDuration(int duration) { public void setClearWeatherDuration(int duration) {
world.worldDataServer.a(duration); // PAIL rename setClearWeatherDuration world.worldDataServer.setClearWeatherTime(duration);
} }
@Override @Override
public int getClearWeatherDuration() { public int getClearWeatherDuration() {
return world.worldDataServer.h(); // PAIL rename getClearWeatherDuration return world.worldDataServer.getClearWeatherTime();
} }
@Override @Override

View file

@ -177,7 +177,7 @@ public class Main {
useConsole = false; useConsole = false;
} }
if (false && Main.class.getPackage().getImplementationVendor() != null && System.getProperty("IReallyKnowWhatIAmDoingISwear") == null) { if (Main.class.getPackage().getImplementationVendor() != null && System.getProperty("IReallyKnowWhatIAmDoingISwear") == null) {
Date buildDate = new Date(Integer.parseInt(Main.class.getPackage().getImplementationVendor()) * 1000L); Date buildDate = new Date(Integer.parseInt(Main.class.getPackage().getImplementationVendor()) * 1000L);
Calendar deadline = Calendar.getInstance(); Calendar deadline = Calendar.getInstance();

View file

@ -72,13 +72,13 @@ public class CraftItemFrame extends CraftHanging implements ItemFrame {
@Override @Override
public float getItemDropChance() { public float getItemDropChance() {
return getHandle().ag; return getHandle().itemDropChance;
} }
@Override @Override
public void setItemDropChance(float chance) { public void setItemDropChance(float chance) {
Preconditions.checkArgument(0.0 <= chance && chance <= 1.0, "Chance outside range [0, 1]"); Preconditions.checkArgument(0.0 <= chance && chance <= 1.0, "Chance outside range [0, 1]");
getHandle().ag = chance; getHandle().itemDropChance = chance;
} }
@Override @Override

View file

@ -67,12 +67,12 @@ public class CustomChunkGenerator extends InternalChunkGenerator {
@Override @Override
public Biome getBiome(int x, int y, int z) { public Biome getBiome(int x, int y, int z) {
return CraftBlock.biomeBaseToBiome((IRegistry<BiomeBase>) biome.g, biome.getBiome(x >> 2, y >> 2, z >> 2)); return CraftBlock.biomeBaseToBiome((IRegistry<BiomeBase>) biome.registry, biome.getBiome(x >> 2, y >> 2, z >> 2));
} }
@Override @Override
public void setBiome(int x, int y, int z, Biome bio) { public void setBiome(int x, int y, int z, Biome bio) {
biome.setBiome(x >> 2, y >> 2, z >> 2, CraftBlock.biomeToBiomeBase((IRegistry<BiomeBase>) biome.g, bio)); biome.setBiome(x >> 2, y >> 2, z >> 2, CraftBlock.biomeToBiomeBase((IRegistry<BiomeBase>) biome.registry, bio));
} }
} }

View file

@ -224,7 +224,7 @@ public final class CraftMagicNumbers implements UnsafeValues {
* @return string * @return string
*/ */
public String getMappingsVersion() { public String getMappingsVersion() {
return "da85101b34b252659e3ddf10c0c57cc9"; return "54e89c47309b53737f894f1bf1b0edbe";
} }
@Override @Override