Update Paper

This commit is contained in:
Spottedleaf 2025-02-16 11:56:09 -08:00
parent 2dac12e8c8
commit 710d77e354
7 changed files with 46 additions and 55 deletions

View File

@ -1,6 +1,6 @@
--- a/net/minecraft/world/damagesource/DamageSource.java --- a/net/minecraft/world/damagesource/DamageSource.java
+++ b/net/minecraft/world/damagesource/DamageSource.java +++ b/net/minecraft/world/damagesource/DamageSource.java
@@ -178,12 +_,12 @@ @@ -163,12 +_,12 @@
if (this.causingEntity == null && this.directEntity == null) { if (this.causingEntity == null && this.directEntity == null) {
LivingEntity killCredit = livingEntity.getKillCredit(); LivingEntity killCredit = livingEntity.getKillCredit();
String string1 = string + ".player"; String string1 = string + ".player";

View File

@ -13,8 +13,8 @@
public org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason spawnReason; // Paper - Entity#getEntitySpawnReason public org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason spawnReason; // Paper - Entity#getEntitySpawnReason
public boolean collisionLoadChunks = false; // Paper public boolean collisionLoadChunks = false; // Paper
- private org.bukkit.craftbukkit.entity.CraftEntity bukkitEntity; - private @Nullable org.bukkit.craftbukkit.entity.CraftEntity bukkitEntity;
+ private volatile org.bukkit.craftbukkit.entity.CraftEntity bukkitEntity; // Folia - region threading + private volatile @Nullable org.bukkit.craftbukkit.entity.CraftEntity bukkitEntity; // Folia - region threading
public org.bukkit.craftbukkit.entity.CraftEntity getBukkitEntity() { public org.bukkit.craftbukkit.entity.CraftEntity getBukkitEntity() {
if (this.bukkitEntity == null) { if (this.bukkitEntity == null) {

View File

@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/player/Player.java --- a/net/minecraft/world/entity/player/Player.java
+++ b/net/minecraft/world/entity/player/Player.java +++ b/net/minecraft/world/entity/player/Player.java
@@ -1504,6 +_,14 @@ @@ -1506,6 +_,14 @@
} }
} }

View File

@ -82,7 +82,7 @@
+ // damage player + // damage player
+ teleported.resetFallDistance(); + teleported.resetFallDistance();
+ player.resetCurrentImpulseContext(); + player.resetCurrentImpulseContext();
+ player.hurtServer(player.serverLevel(), player.damageSources().enderPearl().customEventDamager(player), 5.0F); // CraftBukkit // Paper - fix DamageSource API + player.hurtServer(player.serverLevel(), player.damageSources().enderPearl().eventEntityDamager(player), 5.0F); // CraftBukkit // Paper - fix DamageSource API
+ playSound(teleported.level(), to); + playSound(teleported.level(), to);
+ } else { + } else {
+ // reset fall damage so that if the entity was falling they do not instantly die + // reset fall damage so that if the entity was falling they do not instantly die

View File

@ -48,16 +48,7 @@
if (!this.isChunkLoaded(x, z)) { if (!this.isChunkLoaded(x, z)) {
return true; return true;
} }
@@ -472,7 +_,7 @@ @@ -472,6 +_,7 @@
@Override
public boolean regenerateChunk(int x, int z) {
- org.spigotmc.AsyncCatcher.catchOp("chunk regenerate"); // Spigot
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.world, x, z, "Cannot regenerate chunk asynchronously"); // Folia - region threading
throw new UnsupportedOperationException("Not supported in this Minecraft version! Unless you can fix it, this is not a bug :)");
/*
if (!unloadChunk0(x, z, false)) {
@@ -499,6 +_,7 @@
@Override @Override
public boolean refreshChunk(int x, int z) { public boolean refreshChunk(int x, int z) {
@ -65,7 +56,7 @@
ChunkHolder playerChunk = this.world.getChunkSource().chunkMap.getVisibleChunkIfPresent(ChunkPos.asLong(x, z)); ChunkHolder playerChunk = this.world.getChunkSource().chunkMap.getVisibleChunkIfPresent(ChunkPos.asLong(x, z));
if (playerChunk == null) return false; if (playerChunk == null) return false;
@@ -549,7 +_,7 @@ @@ -522,7 +_,7 @@
@Override @Override
public boolean loadChunk(int x, int z, boolean generate) { public boolean loadChunk(int x, int z, boolean generate) {
@ -74,7 +65,7 @@
warnUnsafeChunk("loading a faraway chunk", x, z); // Paper warnUnsafeChunk("loading a faraway chunk", x, z); // Paper
ChunkAccess chunk = this.world.getChunkSource().getChunk(x, z, generate || isChunkGenerated(x, z) ? ChunkStatus.FULL : ChunkStatus.EMPTY, true); // Paper ChunkAccess chunk = this.world.getChunkSource().getChunk(x, z, generate || isChunkGenerated(x, z) ? ChunkStatus.FULL : ChunkStatus.EMPTY, true); // Paper
@@ -589,7 +_,7 @@ @@ -562,7 +_,7 @@
final DistanceManager distanceManager = this.world.getChunkSource().chunkMap.distanceManager; final DistanceManager distanceManager = this.world.getChunkSource().chunkMap.distanceManager;
if (distanceManager.addPluginRegionTicket(new ChunkPos(x, z), plugin)) { if (distanceManager.addPluginRegionTicket(new ChunkPos(x, z), plugin)) {
@ -83,7 +74,7 @@
return true; return true;
} }
@@ -643,21 +_,24 @@ @@ -616,21 +_,24 @@
@Override @Override
public boolean isChunkForceLoaded(int x, int z) { public boolean isChunkForceLoaded(int x, int z) {
@ -109,7 +100,7 @@
} }
return Collections.unmodifiableCollection(chunks); return Collections.unmodifiableCollection(chunks);
@@ -777,13 +_,15 @@ @@ -750,13 +_,15 @@
@Override @Override
public boolean generateTree(Location loc, TreeType type, BlockChangeDelegate delegate) { public boolean generateTree(Location loc, TreeType type, BlockChangeDelegate delegate) {
@ -130,7 +121,7 @@
BlockPos position = ((CraftBlockState) blockstate).getPosition(); BlockPos position = ((CraftBlockState) blockstate).getPosition();
net.minecraft.world.level.block.state.BlockState oldBlock = this.world.getBlockState(position); net.minecraft.world.level.block.state.BlockState oldBlock = this.world.getBlockState(position);
int flag = ((CraftBlockState) blockstate).getFlag(); int flag = ((CraftBlockState) blockstate).getFlag();
@@ -791,10 +_,10 @@ @@ -764,10 +_,10 @@
net.minecraft.world.level.block.state.BlockState newBlock = this.world.getBlockState(position); net.minecraft.world.level.block.state.BlockState newBlock = this.world.getBlockState(position);
this.world.notifyAndUpdatePhysics(position, null, oldBlock, newBlock, newBlock, flag, 512); this.world.notifyAndUpdatePhysics(position, null, oldBlock, newBlock, newBlock, flag, 512);
} }
@ -143,7 +134,7 @@
return false; return false;
} }
} }
@@ -828,6 +_,7 @@ @@ -801,6 +_,7 @@
@Override @Override
public void setTime(long time) { public void setTime(long time) {
@ -151,7 +142,7 @@
long margin = (time - this.getFullTime()) % 24000; long margin = (time - this.getFullTime()) % 24000;
if (margin < 0) margin += 24000; if (margin < 0) margin += 24000;
this.setFullTime(this.getFullTime() + margin); this.setFullTime(this.getFullTime() + margin);
@@ -840,6 +_,7 @@ @@ -813,6 +_,7 @@
@Override @Override
public void setFullTime(long time) { public void setFullTime(long time) {
@ -159,7 +150,7 @@
// Notify anyone who's listening // Notify anyone who's listening
TimeSkipEvent event = new TimeSkipEvent(this, TimeSkipEvent.SkipReason.CUSTOM, time - this.world.getDayTime()); TimeSkipEvent event = new TimeSkipEvent(this, TimeSkipEvent.SkipReason.CUSTOM, time - this.world.getDayTime());
this.server.getPluginManager().callEvent(event); this.server.getPluginManager().callEvent(event);
@@ -867,7 +_,7 @@ @@ -840,7 +_,7 @@
@Override @Override
public long getGameTime() { public long getGameTime() {
@ -168,7 +159,7 @@
} }
@Override @Override
@@ -892,6 +_,7 @@ @@ -865,6 +_,7 @@
} }
public boolean createExplosion(double x, double y, double z, float power, boolean setFire, boolean breakBlocks, Entity source, Consumer<net.minecraft.world.level.ServerExplosion> configurator) { public boolean createExplosion(double x, double y, double z, float power, boolean setFire, boolean breakBlocks, Entity source, Consumer<net.minecraft.world.level.ServerExplosion> configurator) {
// Paper end - expand explosion API // Paper end - expand explosion API
@ -176,7 +167,7 @@
net.minecraft.world.level.Level.ExplosionInteraction explosionType; net.minecraft.world.level.Level.ExplosionInteraction explosionType;
if (!breakBlocks) { if (!breakBlocks) {
explosionType = net.minecraft.world.level.Level.ExplosionInteraction.NONE; // Don't break blocks explosionType = net.minecraft.world.level.Level.ExplosionInteraction.NONE; // Don't break blocks
@@ -901,6 +_,7 @@ @@ -874,6 +_,7 @@
explosionType = net.minecraft.world.level.Level.ExplosionInteraction.MOB; // Respect mobGriefing gamerule explosionType = net.minecraft.world.level.Level.ExplosionInteraction.MOB; // Respect mobGriefing gamerule
} }
@ -184,7 +175,7 @@
net.minecraft.world.entity.Entity entity = (source == null) ? null : ((CraftEntity) source).getHandle(); net.minecraft.world.entity.Entity entity = (source == null) ? null : ((CraftEntity) source).getHandle();
return !this.world.explode0(entity, Explosion.getDefaultDamageSource(this.world, entity), null, x, y, z, power, setFire, explosionType, ParticleTypes.EXPLOSION, ParticleTypes.EXPLOSION_EMITTER, SoundEvents.GENERIC_EXPLODE, configurator).wasCanceled; // Paper - expand explosion API return !this.world.explode0(entity, Explosion.getDefaultDamageSource(this.world, entity), null, x, y, z, power, setFire, explosionType, ParticleTypes.EXPLOSION, ParticleTypes.EXPLOSION_EMITTER, SoundEvents.GENERIC_EXPLODE, configurator).wasCanceled; // Paper - expand explosion API
} }
@@ -983,6 +_,7 @@ @@ -956,6 +_,7 @@
@Override @Override
public int getHighestBlockYAt(int x, int z, org.bukkit.HeightMap heightMap) { public int getHighestBlockYAt(int x, int z, org.bukkit.HeightMap heightMap) {
@ -192,7 +183,7 @@
warnUnsafeChunk("getting a faraway chunk", x >> 4, z >> 4); // Paper warnUnsafeChunk("getting a faraway chunk", x >> 4, z >> 4); // Paper
// Transient load for this tick // Transient load for this tick
return this.world.getChunk(x >> 4, z >> 4).getHeight(CraftHeightMap.toNMS(heightMap), x, z); return this.world.getChunk(x >> 4, z >> 4).getHeight(CraftHeightMap.toNMS(heightMap), x, z);
@@ -1013,6 +_,7 @@ @@ -986,6 +_,7 @@
@Override @Override
public void setBiome(int x, int y, int z, Holder<net.minecraft.world.level.biome.Biome> bb) { public void setBiome(int x, int y, int z, Holder<net.minecraft.world.level.biome.Biome> bb) {
BlockPos pos = new BlockPos(x, 0, z); BlockPos pos = new BlockPos(x, 0, z);
@ -200,7 +191,7 @@
if (this.world.hasChunkAt(pos)) { if (this.world.hasChunkAt(pos)) {
net.minecraft.world.level.chunk.LevelChunk chunk = this.world.getChunkAt(pos); net.minecraft.world.level.chunk.LevelChunk chunk = this.world.getChunkAt(pos);
@@ -1343,6 +_,7 @@ @@ -1316,6 +_,7 @@
@Override @Override
public void setStorm(boolean hasStorm) { public void setStorm(boolean hasStorm) {
@ -208,7 +199,7 @@
this.world.serverLevelData.setRaining(hasStorm, org.bukkit.event.weather.WeatherChangeEvent.Cause.PLUGIN); // Paper - Add cause to Weather/ThunderChangeEvents this.world.serverLevelData.setRaining(hasStorm, org.bukkit.event.weather.WeatherChangeEvent.Cause.PLUGIN); // Paper - Add cause to Weather/ThunderChangeEvents
this.setWeatherDuration(0); // Reset weather duration (legacy behaviour) this.setWeatherDuration(0); // Reset weather duration (legacy behaviour)
this.setClearWeatherDuration(0); // Reset clear weather duration (reset "/weather clear" commands) this.setClearWeatherDuration(0); // Reset clear weather duration (reset "/weather clear" commands)
@@ -1355,6 +_,7 @@ @@ -1328,6 +_,7 @@
@Override @Override
public void setWeatherDuration(int duration) { public void setWeatherDuration(int duration) {
@ -216,7 +207,7 @@
this.world.serverLevelData.setRainTime(duration); this.world.serverLevelData.setRainTime(duration);
} }
@@ -1365,6 +_,7 @@ @@ -1338,6 +_,7 @@
@Override @Override
public void setThundering(boolean thundering) { public void setThundering(boolean thundering) {
@ -224,7 +215,7 @@
this.world.serverLevelData.setThundering(thundering, org.bukkit.event.weather.ThunderChangeEvent.Cause.PLUGIN); // Paper - Add cause to Weather/ThunderChangeEvents this.world.serverLevelData.setThundering(thundering, org.bukkit.event.weather.ThunderChangeEvent.Cause.PLUGIN); // Paper - Add cause to Weather/ThunderChangeEvents
this.setThunderDuration(0); // Reset weather duration (legacy behaviour) this.setThunderDuration(0); // Reset weather duration (legacy behaviour)
this.setClearWeatherDuration(0); // Reset clear weather duration (reset "/weather clear" commands) this.setClearWeatherDuration(0); // Reset clear weather duration (reset "/weather clear" commands)
@@ -1377,6 +_,7 @@ @@ -1350,6 +_,7 @@
@Override @Override
public void setThunderDuration(int duration) { public void setThunderDuration(int duration) {
@ -232,7 +223,7 @@
this.world.serverLevelData.setThunderTime(duration); this.world.serverLevelData.setThunderTime(duration);
} }
@@ -1387,6 +_,7 @@ @@ -1360,6 +_,7 @@
@Override @Override
public void setClearWeatherDuration(int duration) { public void setClearWeatherDuration(int duration) {
@ -240,7 +231,7 @@
this.world.serverLevelData.setClearWeatherTime(duration); this.world.serverLevelData.setClearWeatherTime(duration);
} }
@@ -1585,6 +_,7 @@ @@ -1558,6 +_,7 @@
@Override @Override
public void setKeepSpawnInMemory(boolean keepLoaded) { public void setKeepSpawnInMemory(boolean keepLoaded) {
@ -248,7 +239,7 @@
if (keepLoaded) { if (keepLoaded) {
this.setGameRule(GameRule.SPAWN_CHUNK_RADIUS, this.getGameRuleDefault(GameRule.SPAWN_CHUNK_RADIUS)); this.setGameRule(GameRule.SPAWN_CHUNK_RADIUS, this.getGameRuleDefault(GameRule.SPAWN_CHUNK_RADIUS));
} else { } else {
@@ -1653,6 +_,7 @@ @@ -1626,6 +_,7 @@
@Override @Override
public void setHardcore(boolean hardcore) { public void setHardcore(boolean hardcore) {
@ -256,7 +247,7 @@
this.world.serverLevelData.settings.hardcore = hardcore; this.world.serverLevelData.settings.hardcore = hardcore;
} }
@@ -1665,6 +_,7 @@ @@ -1638,6 +_,7 @@
@Override @Override
@Deprecated @Deprecated
public void setTicksPerAnimalSpawns(int ticksPerAnimalSpawns) { public void setTicksPerAnimalSpawns(int ticksPerAnimalSpawns) {
@ -264,7 +255,7 @@
this.setTicksPerSpawns(SpawnCategory.ANIMAL, ticksPerAnimalSpawns); this.setTicksPerSpawns(SpawnCategory.ANIMAL, ticksPerAnimalSpawns);
} }
@@ -1677,6 +_,7 @@ @@ -1650,6 +_,7 @@
@Override @Override
@Deprecated @Deprecated
public void setTicksPerMonsterSpawns(int ticksPerMonsterSpawns) { public void setTicksPerMonsterSpawns(int ticksPerMonsterSpawns) {
@ -272,7 +263,7 @@
this.setTicksPerSpawns(SpawnCategory.MONSTER, ticksPerMonsterSpawns); this.setTicksPerSpawns(SpawnCategory.MONSTER, ticksPerMonsterSpawns);
} }
@@ -1689,6 +_,7 @@ @@ -1662,6 +_,7 @@
@Override @Override
@Deprecated @Deprecated
public void setTicksPerWaterSpawns(int ticksPerWaterSpawns) { public void setTicksPerWaterSpawns(int ticksPerWaterSpawns) {
@ -280,7 +271,7 @@
this.setTicksPerSpawns(SpawnCategory.WATER_ANIMAL, ticksPerWaterSpawns); this.setTicksPerSpawns(SpawnCategory.WATER_ANIMAL, ticksPerWaterSpawns);
} }
@@ -1701,6 +_,7 @@ @@ -1674,6 +_,7 @@
@Override @Override
@Deprecated @Deprecated
public void setTicksPerWaterAmbientSpawns(int ticksPerWaterAmbientSpawns) { public void setTicksPerWaterAmbientSpawns(int ticksPerWaterAmbientSpawns) {
@ -288,7 +279,7 @@
this.setTicksPerSpawns(SpawnCategory.WATER_AMBIENT, ticksPerWaterAmbientSpawns); this.setTicksPerSpawns(SpawnCategory.WATER_AMBIENT, ticksPerWaterAmbientSpawns);
} }
@@ -1713,6 +_,7 @@ @@ -1686,6 +_,7 @@
@Override @Override
@Deprecated @Deprecated
public void setTicksPerWaterUndergroundCreatureSpawns(int ticksPerWaterUndergroundCreatureSpawns) { public void setTicksPerWaterUndergroundCreatureSpawns(int ticksPerWaterUndergroundCreatureSpawns) {
@ -296,7 +287,7 @@
this.setTicksPerSpawns(SpawnCategory.WATER_UNDERGROUND_CREATURE, ticksPerWaterUndergroundCreatureSpawns); this.setTicksPerSpawns(SpawnCategory.WATER_UNDERGROUND_CREATURE, ticksPerWaterUndergroundCreatureSpawns);
} }
@@ -1725,11 +_,13 @@ @@ -1698,11 +_,13 @@
@Override @Override
@Deprecated @Deprecated
public void setTicksPerAmbientSpawns(int ticksPerAmbientSpawns) { public void setTicksPerAmbientSpawns(int ticksPerAmbientSpawns) {
@ -310,7 +301,7 @@
Preconditions.checkArgument(spawnCategory != null, "SpawnCategory cannot be null"); Preconditions.checkArgument(spawnCategory != null, "SpawnCategory cannot be null");
Preconditions.checkArgument(CraftSpawnCategory.isValidForLimits(spawnCategory), "SpawnCategory.%s are not supported", spawnCategory); Preconditions.checkArgument(CraftSpawnCategory.isValidForLimits(spawnCategory), "SpawnCategory.%s are not supported", spawnCategory);
@@ -1746,21 +_,25 @@ @@ -1719,21 +_,25 @@
@Override @Override
public void setMetadata(String metadataKey, MetadataValue newMetadataValue) { public void setMetadata(String metadataKey, MetadataValue newMetadataValue) {
@ -336,7 +327,7 @@
this.server.getWorldMetadata().removeMetadata(this, metadataKey, owningPlugin); this.server.getWorldMetadata().removeMetadata(this, metadataKey, owningPlugin);
} }
@@ -1773,6 +_,7 @@ @@ -1746,6 +_,7 @@
@Override @Override
@Deprecated @Deprecated
public void setMonsterSpawnLimit(int limit) { public void setMonsterSpawnLimit(int limit) {
@ -344,7 +335,7 @@
this.setSpawnLimit(SpawnCategory.MONSTER, limit); this.setSpawnLimit(SpawnCategory.MONSTER, limit);
} }
@@ -1785,6 +_,7 @@ @@ -1758,6 +_,7 @@
@Override @Override
@Deprecated @Deprecated
public void setAnimalSpawnLimit(int limit) { public void setAnimalSpawnLimit(int limit) {
@ -352,7 +343,7 @@
this.setSpawnLimit(SpawnCategory.ANIMAL, limit); this.setSpawnLimit(SpawnCategory.ANIMAL, limit);
} }
@@ -1797,6 +_,7 @@ @@ -1770,6 +_,7 @@
@Override @Override
@Deprecated @Deprecated
public void setWaterAnimalSpawnLimit(int limit) { public void setWaterAnimalSpawnLimit(int limit) {
@ -360,7 +351,7 @@
this.setSpawnLimit(SpawnCategory.WATER_ANIMAL, limit); this.setSpawnLimit(SpawnCategory.WATER_ANIMAL, limit);
} }
@@ -1809,6 +_,7 @@ @@ -1782,6 +_,7 @@
@Override @Override
@Deprecated @Deprecated
public void setWaterAmbientSpawnLimit(int limit) { public void setWaterAmbientSpawnLimit(int limit) {
@ -368,7 +359,7 @@
this.setSpawnLimit(SpawnCategory.WATER_AMBIENT, limit); this.setSpawnLimit(SpawnCategory.WATER_AMBIENT, limit);
} }
@@ -1821,6 +_,7 @@ @@ -1794,6 +_,7 @@
@Override @Override
@Deprecated @Deprecated
public void setWaterUndergroundCreatureSpawnLimit(int limit) { public void setWaterUndergroundCreatureSpawnLimit(int limit) {
@ -376,7 +367,7 @@
this.setSpawnLimit(SpawnCategory.WATER_UNDERGROUND_CREATURE, limit); this.setSpawnLimit(SpawnCategory.WATER_UNDERGROUND_CREATURE, limit);
} }
@@ -1833,6 +_,7 @@ @@ -1806,6 +_,7 @@
@Override @Override
@Deprecated @Deprecated
public void setAmbientSpawnLimit(int limit) { public void setAmbientSpawnLimit(int limit) {
@ -384,7 +375,7 @@
this.setSpawnLimit(SpawnCategory.AMBIENT, limit); this.setSpawnLimit(SpawnCategory.AMBIENT, limit);
} }
@@ -1855,6 +_,7 @@ @@ -1828,6 +_,7 @@
@Override @Override
public void setSpawnLimit(SpawnCategory spawnCategory, int limit) { public void setSpawnLimit(SpawnCategory spawnCategory, int limit) {
@ -392,7 +383,7 @@
Preconditions.checkArgument(spawnCategory != null, "SpawnCategory cannot be null"); Preconditions.checkArgument(spawnCategory != null, "SpawnCategory cannot be null");
Preconditions.checkArgument(CraftSpawnCategory.isValidForLimits(spawnCategory), "SpawnCategory.%s are not supported", spawnCategory); Preconditions.checkArgument(CraftSpawnCategory.isValidForLimits(spawnCategory), "SpawnCategory.%s are not supported", spawnCategory);
@@ -1937,7 +_,7 @@ @@ -1910,7 +_,7 @@
if (!(entity instanceof CraftEntity craftEntity) || entity.getWorld() != this || sound == null || category == null) return; if (!(entity instanceof CraftEntity craftEntity) || entity.getWorld() != this || sound == null || category == null) return;
ClientboundSoundEntityPacket packet = new ClientboundSoundEntityPacket(CraftSound.bukkitToMinecraftHolder(sound), net.minecraft.sounds.SoundSource.valueOf(category.name()), craftEntity.getHandle(), volume, pitch, seed); ClientboundSoundEntityPacket packet = new ClientboundSoundEntityPacket(CraftSound.bukkitToMinecraftHolder(sound), net.minecraft.sounds.SoundSource.valueOf(category.name()), craftEntity.getHandle(), volume, pitch, seed);
@ -401,7 +392,7 @@
if (entityTracker != null) { if (entityTracker != null) {
entityTracker.broadcastAndSend(packet); entityTracker.broadcastAndSend(packet);
} }
@@ -1958,7 +_,7 @@ @@ -1931,7 +_,7 @@
if (!(entity instanceof CraftEntity craftEntity) || entity.getWorld() != this || sound == null || category == null) return; if (!(entity instanceof CraftEntity craftEntity) || entity.getWorld() != this || sound == null || category == null) return;
ClientboundSoundEntityPacket packet = new ClientboundSoundEntityPacket(Holder.direct(SoundEvent.createVariableRangeEvent(ResourceLocation.parse(sound))), net.minecraft.sounds.SoundSource.valueOf(category.name()), craftEntity.getHandle(), volume, pitch, seed); ClientboundSoundEntityPacket packet = new ClientboundSoundEntityPacket(Holder.direct(SoundEvent.createVariableRangeEvent(ResourceLocation.parse(sound))), net.minecraft.sounds.SoundSource.valueOf(category.name()), craftEntity.getHandle(), volume, pitch, seed);
@ -410,7 +401,7 @@
if (entityTracker != null) { if (entityTracker != null) {
entityTracker.broadcastAndSend(packet); entityTracker.broadcastAndSend(packet);
} }
@@ -2041,6 +_,7 @@ @@ -2014,6 +_,7 @@
@Override @Override
public boolean setGameRuleValue(String rule, String value) { public boolean setGameRuleValue(String rule, String value) {
@ -418,7 +409,7 @@
// No null values allowed // No null values allowed
if (rule == null || value == null) return false; if (rule == null || value == null) return false;
@@ -2089,6 +_,7 @@ @@ -2062,6 +_,7 @@
@Override @Override
public <T> boolean setGameRule(GameRule<T> rule, T newValue) { public <T> boolean setGameRule(GameRule<T> rule, T newValue) {
@ -426,7 +417,7 @@
Preconditions.checkArgument(rule != null, "GameRule cannot be null"); Preconditions.checkArgument(rule != null, "GameRule cannot be null");
Preconditions.checkArgument(newValue != null, "GameRule value cannot be null"); Preconditions.checkArgument(newValue != null, "GameRule value cannot be null");
@@ -2316,6 +_,12 @@ @@ -2289,6 +_,12 @@
@Override @Override
public void sendGameEvent(Entity sourceEntity, org.bukkit.GameEvent gameEvent, Vector position) { public void sendGameEvent(Entity sourceEntity, org.bukkit.GameEvent gameEvent, Vector position) {

View File

@ -18,7 +18,7 @@
Bukkit.getPluginManager().callEvent(event); Bukkit.getPluginManager().callEvent(event);
if (!event.isCancelled()) { if (!event.isCancelled()) {
@@ -2230,7 +_,7 @@ @@ -2232,7 +_,7 @@
CraftItemStack craftItem = CraftItemStack.asCraftMirror(itemStack.copyWithCount(1)); CraftItemStack craftItem = CraftItemStack.asCraftMirror(itemStack.copyWithCount(1));
org.bukkit.event.block.BlockDispenseEvent event = new org.bukkit.event.block.BlockDispenseEvent(bukkitBlock, craftItem.clone(), CraftVector.toBukkit(to)); org.bukkit.event.block.BlockDispenseEvent event = new org.bukkit.event.block.BlockDispenseEvent(bukkitBlock, craftItem.clone(), CraftVector.toBukkit(to));

View File

@ -2,7 +2,7 @@ group=dev.folia
version=1.21.4-R0.1-SNAPSHOT version=1.21.4-R0.1-SNAPSHOT
mcVersion=1.21.4 mcVersion=1.21.4
paperRef=46f4fdaae3661941ac86f2157e625d907fdd8e81 paperRef=b9023b5dc3dbc2f9d19898f73e503bddde364bcf
org.gradle.configuration-cache=true org.gradle.configuration-cache=true
org.gradle.caching=true org.gradle.caching=true