Updated Upstream (Paper)

Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@59797420 26.2
PaperMC/Paper@389befc2 drop old ATs
PaperMC/Paper@14bb579b fix bad exhaustion reasons for player movement
PaperMC/Paper@0b4fed78 fix misc issues
PaperMC/Paper@384ff989 fix contract of ItemContainerContents#contents
PaperMC/Paper@af55c9de Fix Geyser particle options waterBlocks precondition (#13961)
PaperMC/Paper@1daadd58 Prevent EnderDragon and Wither from receiving effect of vanilla sources (#13956)
PaperMC/Paper@ca8eb49f Mention MOJIRA issue for correct stacktrace fix in FileFixerUpper [ci/skip] (#13962)
PaperMC/Paper@80d10989 Expose Entity Source for EntityPotionEffectEvent (#13957)
PaperMC/Paper@2c0341f9 Update adventure to 5.1.1
PaperMC/Paper@649002a4 fix IOOB for '..' namespace
PaperMC/Paper@783b6f09 add preconditions to particles
This commit is contained in:
granny
2026-06-17 18:13:32 -07:00
parent 26a1e028a1
commit ee4e8d60b5
32 changed files with 220 additions and 219 deletions

View File

@@ -9,7 +9,7 @@
private final LevelDebugSynchronizers debugSynchronizers = new LevelDebugSynchronizers(this);
// CraftBukkit start
@@ -644,8 +_,25 @@
@@ -646,8 +_,25 @@
// CraftBukkit end
this.tickTime = tickTime;
this.server = server;
@@ -36,7 +36,7 @@
ChunkGenerator generator = levelStem.generator();
// CraftBukkit start
// Paper start - per-world time
@@ -739,6 +_,7 @@
@@ -741,6 +_,7 @@
this.chunkDataController = new ca.spottedleaf.moonrise.patches.chunk_system.io.datacontroller.ChunkDataController((ServerLevel)(Object)this, this.chunkTaskScheduler);
// Paper end - rewrite chunk system
this.getCraftServer().addWorld(this.getWorld()); // CraftBukkit
@@ -44,7 +44,7 @@
}
// Paper start
@@ -807,7 +_,7 @@
@@ -809,7 +_,7 @@
}
int percentage = this.getGameRules().get(GameRules.PLAYERS_SLEEPING_PERCENTAGE);
@@ -53,7 +53,7 @@
Optional<Holder<WorldClock>> defaultClock = this.dimensionType().defaultClock();
org.bukkit.event.world.ClockTimeSkipEvent event = null; // Paper - per-world time
if (this.getGameRules().get(GameRules.ADVANCE_TIME) && defaultClock.isPresent()) {
@@ -1048,9 +_,18 @@
@@ -1050,9 +_,18 @@
&& this.random.nextDouble() < difficulty.getEffectiveDifficulty() * this.paperConfig().entities.spawning.skeletonHorseThunderSpawnChance.or(0.01) // Paper - Configurable spawn chances for skeleton horses
&& !this.getBlockState(pos.below()).is(BlockTags.LIGHTNING_RODS);
if (isTrap) {
@@ -73,7 +73,7 @@
horse.setAge(0);
horse.setPos(pos.getX(), pos.getY(), pos.getZ());
this.addFreshEntity(horse, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.LIGHTNING); // CraftBukkit
@@ -1085,9 +_,35 @@
@@ -1087,9 +_,35 @@
if (state.is(Blocks.SNOW)) {
int currentLayers = state.getValue(SnowLayerBlock.LAYERS);
if (currentLayers < Math.min(maxHeight, 8)) {
@@ -109,7 +109,7 @@
}
} else {
org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFormEvent(this, topPos, Blocks.SNOW.defaultBlockState(), Block.UPDATE_ALL, null); // CraftBukkit
@@ -1108,7 +_,7 @@
@@ -1110,7 +_,7 @@
p -> p.is(PoiTypes.LIGHTNING_ROD),
lightningRodPos -> lightningRodPos.getY() == this.getHeight(Heightmap.Types.WORLD_SURFACE, lightningRodPos.getX(), lightningRodPos.getZ()) - 1,
center,
@@ -118,7 +118,7 @@
PoiManager.Occupancy.ANY
);
return nearbyLightningRod.map(blockPos -> blockPos.above(1));
@@ -1156,8 +_,26 @@
@@ -1158,8 +_,26 @@
int percentage = this.getGameRules().get(GameRules.PLAYERS_SLEEPING_PERCENTAGE);
Component message;
if (this.sleepStatus.areEnoughSleeping(percentage)) {
@@ -145,7 +145,7 @@
message = Component.translatable("sleep.players_sleeping", this.sleepStatus.amountSleeping(), this.sleepStatus.sleepersNeeded(percentage));
}
@@ -1323,6 +_,7 @@
@@ -1325,6 +_,7 @@
public void resetWeatherCycle() {
WeatherData weatherData = this.getWeatherData();
// CraftBukkit start
@@ -153,7 +153,7 @@
weatherData.setRaining(false, org.bukkit.event.weather.WeatherChangeEvent.Cause.SLEEP); // Paper - Add cause to Weather/ThunderChangeEvents
// If we stop due to everyone sleeping we should reset the weather duration to some other random value.
// Not that everyone ever manages to get the whole server to sleep at the same time....
@@ -1330,6 +_,7 @@
@@ -1332,6 +_,7 @@
weatherData.setRainTime(0);
}
// CraftBukkit end
@@ -161,7 +161,7 @@
weatherData.setThundering(false, org.bukkit.event.weather.ThunderChangeEvent.Cause.SLEEP); // Paper - Add cause to Weather/ThunderChangeEvents
// CraftBukkit start
// If we stop due to everyone sleeping we should reset the weather duration to some other random value.
@@ -2001,7 +_,7 @@
@@ -2003,7 +_,7 @@
Explosion.BlockInteraction blockInteraction = switch (interactionType) {
case NONE -> Explosion.BlockInteraction.KEEP;
case BLOCK -> this.getDestroyType(GameRules.BLOCK_EXPLOSION_DROP_DECAY);
@@ -170,7 +170,7 @@
? this.getDestroyType(GameRules.MOB_EXPLOSION_DROP_DECAY)
: Explosion.BlockInteraction.KEEP;
case TNT -> this.getDestroyType(GameRules.TNT_EXPLOSION_DROP_DECAY);
@@ -2920,7 +_,7 @@
@@ -2922,7 +_,7 @@
// Spigot start
if (entity.getBukkitEntity() instanceof org.bukkit.inventory.InventoryHolder && (!(entity instanceof ServerPlayer) || entity.getRemovalReason() != Entity.RemovalReason.KILLED)) { // SPIGOT-6876: closeInventory clears death message
// Paper start - Fix merchant inventory not closing on entity removal

View File

@@ -17,10 +17,10 @@
+ this.tpsBar = input.getBooleanOr("Purpur.TPSBar", false); // Purpur - Implement TPSBar
+ this.compassBar = input.getBooleanOr("Purpur.CompassBar", false); // Purpur - Add compass command
+ this.ramBar = input.getBooleanOr("Purpur.RamBar", false); // Purpur - Implement rambar command
// Paper start - Expand PlayerGameModeChangeEvent
this.loadGameTypes(input);
}
@@ -557,6 +_,9 @@
this.loadGameTypes(input); // Paper - Expand PlayerGameModeChangeEvent
this.setShoulderEntityLeft(input.read("ShoulderEntityLeft", CompoundTag.CODEC).orElseGet(CompoundTag::new));
this.setShoulderEntityRight(input.read("ShoulderEntityRight", CompoundTag.CODEC).orElseGet(CompoundTag::new));
@@ -558,6 +_,9 @@
output.store("ShoulderEntityRight", CompoundTag.CODEC, this.getShoulderEntityRight());
}
this.getBukkitEntity().setExtraData(output); // CraftBukkit
@@ -30,7 +30,7 @@
}
private void saveParentVehicle(final ValueOutput playerOutput) {
@@ -1194,6 +_,7 @@
@@ -1185,6 +_,7 @@
// Paper - moved up to sendClientboundPlayerCombatKillPacket()
this.sendClientboundPlayerCombatKillPacket(event.getShowDeathMessages(), deathScreenMessage); // Paper - Expand PlayerDeathEvent
Team team = this.getTeam();
@@ -38,7 +38,7 @@
if (team == null || team.getDeathMessageVisibility() == Team.Visibility.ALWAYS) {
this.server.getPlayerList().broadcastSystemMessage(deathMessage, false);
} else if (team.getDeathMessageVisibility() == Team.Visibility.HIDE_FOR_OTHER_TEAMS) {
@@ -1303,6 +_,13 @@
@@ -1294,6 +_,13 @@
return false;
}
@@ -52,7 +52,7 @@
Entity entity = source.getEntity();
if (!( // Paper - split the if statement. If below statement is false, hurtServer would not have been evaluated. Return false.
!(entity instanceof Player player && !this.canHarmPlayer(player))
@@ -1544,7 +_,7 @@
@@ -1535,7 +_,7 @@
}
if (newLevel.dimension() == lastDimension) {
@@ -61,7 +61,7 @@
this.connection.resetPosition();
transition.postTeleportTransition().onTransition(this);
return this;
@@ -1567,6 +_,7 @@
@@ -1558,6 +_,7 @@
profiler.pop();
profiler.push("placing");
@@ -69,7 +69,7 @@
this.setServerLevel(newLevel);
this.connection.internalTeleport(PositionMoveRotation.of(transition), transition.relatives()); // CraftBukkit - use internal teleport without event
this.connection.resetPosition();
@@ -1679,7 +_,7 @@
@@ -1670,7 +_,7 @@
new AABB(bedCenter.x() - 8.0, bedCenter.y() - 5.0, bedCenter.z() - 8.0, bedCenter.x() + 8.0, bedCenter.y() + 5.0, bedCenter.z() + 8.0),
monster -> monster.isPreventingPlayerRest(this.level(), this)
);
@@ -78,7 +78,7 @@
return Either.left(Player.BedSleepingProblem.NOT_SAFE);
}
}
@@ -1715,7 +_,17 @@
@@ -1706,7 +_,17 @@
CriteriaTriggers.SLEPT_IN_BED.trigger(this);
});
if (!this.level().canSleepThroughNights()) {
@@ -97,7 +97,7 @@
}
this.level().updateSleepingPlayerList();
@@ -1810,6 +_,7 @@
@@ -1801,6 +_,7 @@
@Override
public void openTextEdit(final SignBlockEntity sign, final boolean isFrontText) {
@@ -105,7 +105,7 @@
this.connection.send(new ClientboundBlockUpdatePacket(this.level(), sign.getBlockPos()));
this.connection.send(new ClientboundOpenSignEditorPacket(sign.getBlockPos(), isFrontText));
}
@@ -2154,6 +_,26 @@
@@ -2145,6 +_,26 @@
this.lastSentExp = -1; // CraftBukkit - Added to reset
}
@@ -132,7 +132,7 @@
@Override
public void completeUsingItem() {
if (!this.useItem.isEmpty() && this.isUsingItem()) {
@@ -2391,6 +_,20 @@
@@ -2382,6 +_,20 @@
);
}
@@ -153,7 +153,7 @@
@Override
public void sendSystemMessage(final Component message) {
this.sendSystemMessage(message, false);
@@ -2542,7 +_,67 @@
@@ -2533,7 +_,67 @@
public void resetLastActionTime() {
this.lastActionTime = Util.getMillis();
@@ -222,7 +222,7 @@
public ServerStatsCounter getStats() {
return this.stats;
@@ -3167,4 +_,65 @@
@@ -3158,4 +_,65 @@
return (org.bukkit.craftbukkit.entity.CraftPlayer) super.getBukkitEntity();
}
// CraftBukkit end

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -357,6 +_,20 @@
@@ -356,6 +_,20 @@
}
// Paper end - configuration phase API
@@ -21,7 +21,7 @@
@Override
public void tick() {
if (this.ackBlockChangesUpTo > -1) {
@@ -375,6 +_,12 @@
@@ -374,6 +_,12 @@
&& this.server.playerIdleTimeout() > 0
&& Util.getMillis() - this.player.getLastActionTime() > TimeUnit.MINUTES.toMillis(this.server.playerIdleTimeout())
&& !this.player.wonGame) {
@@ -34,16 +34,16 @@
this.disconnect(Component.translatable("multiplayer.disconnect.idling"), org.bukkit.event.player.PlayerKickEvent.Cause.IDLING); // Paper - kick event cause
}
}
@@ -696,6 +_,8 @@
this.lastYaw = to.getYaw();
this.lastPitch = to.getPitch();
@@ -695,6 +_,8 @@
this.lastYRot = to.getYaw();
this.lastXRot = to.getPitch();
+ if (!to.getWorld().getUID().equals(from.getWorld().getUID()) || to.getBlockX() != from.getBlockX() || to.getBlockY() != from.getBlockY() || to.getBlockZ() != from.getBlockZ() || to.getYaw() != from.getYaw() || to.getPitch() != from.getPitch()) this.player.resetLastActionTime(); // Purpur - AFK API
+
Location oldTo = to.clone();
PlayerMoveEvent event = new PlayerMoveEvent(player, from, to);
this.cserver.getPluginManager().callEvent(event);
@@ -775,6 +_,7 @@
@@ -774,6 +_,7 @@
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.level());
if (packet.getId() == this.awaitingTeleport) {
if (this.awaitingPositionFromClient == null) {
@@ -51,7 +51,7 @@
this.disconnect(Component.translatable("multiplayer.disconnect.invalid_player_movement"), org.bukkit.event.player.PlayerKickEvent.Cause.INVALID_PLAYER_MOVEMENT); // Paper - kick event cause
return;
}
@@ -1346,6 +_,10 @@
@@ -1345,6 +_,10 @@
final int maxBookPageSize = pageMax.intValue();
final double multiplier = Math.clamp(io.papermc.paper.configuration.GlobalConfiguration.get().itemValidation.bookSize.totalMultiplier, 0.3D, 1D);
long byteAllowed = maxBookPageSize;
@@ -62,7 +62,7 @@
for (final String page : pageList) {
final int byteLength = page.getBytes(java.nio.charset.StandardCharsets.UTF_8).length;
byteTotal += byteLength;
@@ -1370,7 +_,8 @@
@@ -1369,7 +_,8 @@
}
if (byteTotal > byteAllowed) {
@@ -72,7 +72,7 @@
this.disconnectAsync(Component.literal("Book too large!"), org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_ACTION); // Paper - kick event cause // Paper - add proper async disconnect
return;
}
@@ -1389,31 +_,45 @@
@@ -1388,31 +_,45 @@
Optional<String> title = packet.title();
title.ifPresent(contents::add);
contents.addAll(packet.pages());
@@ -122,7 +122,7 @@
writtenBook.set(
DataComponents.WRITTEN_BOOK_CONTENT, new WrittenBookContent(this.filterableFromOutgoing(title), this.player.getPlainTextName(), 0, pages, true)
);
@@ -1426,6 +_,16 @@
@@ -1425,6 +_,16 @@
return this.player.isTextFilteringEnabled() ? Filterable.passThrough(text.filteredOrEmpty()) : Filterable.from(text);
}
@@ -139,7 +139,7 @@
@Override
public void handleEntityTagQuery(final ServerboundEntityTagQueryPacket packet) {
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.level());
@@ -1465,7 +_,15 @@
@@ -1464,7 +_,15 @@
@Override
public void handleMovePlayer(final ServerboundMovePlayerPacket packet) {
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.level());
@@ -156,7 +156,7 @@
this.disconnect(Component.translatable("multiplayer.disconnect.invalid_player_movement"), org.bukkit.event.player.PlayerKickEvent.Cause.INVALID_PLAYER_MOVEMENT); // Paper - kick event cause
} else {
ServerLevel level = this.player.level();
@@ -1650,7 +_,7 @@
@@ -1633,7 +_,7 @@
movedWrongly = true;
if (event.getLogWarning())
// Paper end
@@ -165,16 +165,16 @@
} // Paper
}
@@ -1715,6 +_,8 @@
this.lastYaw = to.getYaw();
this.lastPitch = to.getPitch();
@@ -1685,6 +_,8 @@
this.lastYRot = to.getYaw();
this.lastXRot = to.getPitch();
+ if (!to.getWorld().getUID().equals(from.getWorld().getUID()) || to.getBlockX() != from.getBlockX() || to.getBlockY() != from.getBlockY() || to.getBlockZ() != from.getBlockZ() || to.getYaw() != from.getYaw() || to.getPitch() != from.getPitch()) this.player.resetLastActionTime(); // Purpur - AFK API
+
Location oldTo = to.clone();
PlayerMoveEvent event = new PlayerMoveEvent(player, from, to);
this.cserver.getPluginManager().callEvent(event);
@@ -1770,6 +_,13 @@
@@ -1740,6 +_,13 @@
this.player.tryResetCurrentImpulseContext();
}
@@ -188,7 +188,7 @@
this.player.checkMovementStatistics(this.player.getX() - startX, this.player.getY() - startY, this.player.getZ() - startZ);
this.lastGoodX = this.player.getX();
this.lastGoodY = this.player.getY();
@@ -1790,6 +_,17 @@
@@ -1760,6 +_,17 @@
}
}
@@ -206,7 +206,7 @@
private boolean shouldCheckPlayerMovement(final boolean isFallFlying) {
if (this.isSingleplayerOwner()) {
return false;
@@ -2231,6 +_,7 @@
@@ -2201,6 +_,7 @@
boolean cancelled;
if (hitResult == null || hitResult.getType() != HitResult.Type.BLOCK) {
@@ -214,7 +214,7 @@
org.bukkit.event.player.PlayerInteractEvent event = CraftEventFactory.callPlayerInteractEvent(this.player, Action.RIGHT_CLICK_AIR, itemStack, hand);
cancelled = event.useItemInHand() == Event.Result.DENY;
} else {
@@ -2874,6 +_,7 @@
@@ -2844,6 +_,7 @@
ItemStack mainHandItem = this.player.getMainHandItem();
if (this.player.isWithinAttackRange(mainHandItem, targetBounds, io.papermc.paper.configuration.GlobalConfiguration.get().misc.clientInteractionLeniencyDistance.or(3.0))) { // Paper - configurable lenience
if (!mainHandItem.has(DataComponents.PIERCING_WEAPON)) {
@@ -222,7 +222,7 @@
if (target instanceof ItemEntity
|| target instanceof ExperienceOrb
|| target == this.player
@@ -3656,7 +_,7 @@
@@ -3626,7 +_,7 @@
@Override
public void handleChangeGameMode(final ServerboundChangeGameModePacket packet) {
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.level());

View File

@@ -1,7 +1,7 @@
--- a/net/minecraft/world/effect/SaturationMobEffect.java
+++ b/net/minecraft/world/effect/SaturationMobEffect.java
@@ -16,7 +_,8 @@
int oldFoodLevel = player.getFoodData().foodLevel;
int oldFoodLevel = player.getFoodData().getFoodLevel();
org.bukkit.event.entity.FoodLevelChangeEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callFoodLevelChangeEvent(player, amplification + 1 + oldFoodLevel);
if (!event.isCancelled()) {
- player.getFoodData().eat(event.getFoodLevel() - oldFoodLevel, 1.0F);

View File

@@ -14,14 +14,14 @@
public double zOld;
+ public float maxUpStep; // Purpur - Add option to set armorstand step height
public boolean noPhysics;
- public final RandomSource random = SHARED_RANDOM; // Paper - Share random for entities to make them more random
- protected final RandomSource random = SHARED_RANDOM; // Paper - Share random for entities to make them more random
+ public final RandomSource random; // Paper - Share random for entities to make them more random // Purpur - Add toggle for RNG manipulation
public int tickCount;
private int remainingFireTicks;
private final EntityFluidInteraction fluidInteraction = new EntityFluidInteraction(Set.of(FluidTags.WATER, FluidTags.LAVA));
@@ -331,8 +_,8 @@
public @Nullable PortalProcessor portalProcess;
public int portalCooldown;
private int portalCooldown;
private boolean invulnerable;
- protected UUID uuid = Mth.createInsecureUUID(this.random);
- protected String stringUUID = this.uuid.toString();
@@ -66,7 +66,7 @@
&& this.level.paperConfig().environment.netherCeilingVoidDamageHeight.test(v -> this.getY() >= v)
&& (!(this instanceof Player player) || !player.getAbilities().invulnerable))) {
// Paper end - Configurable nether ceiling damage
+ if (this.level.purpurConfig.teleportOnNetherCeilingDamage && this.level.getWorld().getEnvironment() == org.bukkit.World.Environment.NETHER && this instanceof ServerPlayer player) player.teleport(org.bukkit.craftbukkit.util.CraftLocation.toBukkit(this.level.levelData.getRespawnData().pos(), this.level)); else // Purpur - Add option to teleport to spawn on nether ceiling damage
+ if (this.level.purpurConfig.teleportOnNetherCeilingDamage && this.level.getWorld().getEnvironment() == org.bukkit.World.Environment.NETHER && this instanceof ServerPlayer player) player.teleport(org.bukkit.craftbukkit.util.CraftLocation.toBukkit(this.level.getLevelData().getRespawnData().pos(), this.level)); else // Purpur - Add option to teleport to spawn on nether ceiling damage
this.onBelowWorld();
}
}

View File

@@ -6,7 +6,7 @@
if (damagePerBlock > 0.0) {
+ // Purpur start - Add option to teleport to spawn if outside world border
+ if (this.level().purpurConfig.teleportIfOutsideBorder && this instanceof ServerPlayer serverPlayer) {
+ serverPlayer.teleport(org.bukkit.craftbukkit.util.CraftLocation.toBukkit(this.level().levelData.getRespawnData().pos(), this.level()));
+ serverPlayer.teleport(org.bukkit.craftbukkit.util.CraftLocation.toBukkit(this.level().getLevelData().getRespawnData().pos(), this.level()));
+ return;
+ }
+ // Purpur end - Add option to teleport to spawn if outside world border
@@ -31,7 +31,7 @@
}
@Override
@@ -1070,14 +_,32 @@
@@ -1046,14 +_,32 @@
if (targetingEntity != null) {
ItemStack itemStack = this.getItemBySlot(EquipmentSlot.HEAD);
@@ -72,7 +72,7 @@
return visibilityPercent;
}
@@ -1127,6 +_,7 @@
@@ -1103,6 +_,7 @@
Iterator<MobEffectInstance> iterator = this.activeEffects.values().iterator();
while (iterator.hasNext()) {
MobEffectInstance effect = iterator.next();
@@ -80,7 +80,7 @@
EntityPotionEffectEvent event = CraftEventFactory.callEntityPotionEffectChangeEvent(this, effect, null, cause, EntityPotionEffectEvent.Action.CLEARED);
if (event.isCancelled()) {
continue;
@@ -1459,7 +_,23 @@
@@ -1441,7 +_,23 @@
this.stopSleeping();
}
@@ -105,7 +105,7 @@
if (damage < 0.0F) {
damage = 0.0F;
}
@@ -1722,10 +_,10 @@
@@ -1704,10 +_,10 @@
protected @Nullable Player resolvePlayerResponsibleForDamage(final DamageSource source) {
Entity sourceEntity = source.getEntity();
if (sourceEntity instanceof Player playerSource) {
@@ -118,7 +118,7 @@
} else {
this.lastHurtByPlayer = null;
this.lastHurtByPlayerMemoryTime = 0;
@@ -1777,6 +_,17 @@
@@ -1759,6 +_,17 @@
}
}
@@ -136,7 +136,7 @@
final org.bukkit.inventory.EquipmentSlot handSlot = (usedHand != null) ? org.bukkit.craftbukkit.CraftEquipmentSlot.getHand(usedHand) : null;
final EntityResurrectEvent event = new EntityResurrectEvent((org.bukkit.entity.LivingEntity) this.getBukkitEntity(), handSlot);
event.setCancelled(protectionItem == null);
@@ -1930,8 +_,10 @@
@@ -1912,8 +_,10 @@
protected void dropAllDeathLoot(final ServerLevel level, final DamageSource source) {
boolean playerKilled = this.lastHurtByPlayerMemoryTime > 0;
if (this.shouldDropLoot(level)) {
@@ -147,7 +147,7 @@
}
this.dropEquipment(level);
@@ -3280,6 +_,7 @@
@@ -3262,6 +_,7 @@
float dmg = (float)(diff * 10.0 - 3.0);
if (dmg > 0.0F) {
this.playSound(this.getFallDamageSound((int)dmg), 1.0F, 1.0F);
@@ -155,7 +155,7 @@
this.hurt(this.damageSources().flyIntoWall(), dmg);
}
}
@@ -4773,6 +_,12 @@
@@ -4755,6 +_,12 @@
? slot == EquipmentSlot.MAINHAND && this.canUseSlot(EquipmentSlot.MAINHAND)
: slot == equippable.slot() && this.canUseSlot(equippable.slot()) && equippable.canBeEquippedBy(this.typeHolder());
}

View File

@@ -9,7 +9,7 @@
xpCount = 12000;
}
xpCount = this.expToDrop; // CraftBukkit - SPIGOT-2420: Moved up to #getExpReward method
@@ -960,6 +_,7 @@
@@ -965,6 +_,7 @@
@Override
protected boolean canRide(final Entity vehicle) {

View File

@@ -63,7 +63,7 @@
}
this.bossEvent.setProgress(this.getHealth() / this.getMaxHealth());
@@ -579,6 +_,7 @@
@@ -584,6 +_,7 @@
@Override
protected boolean canRide(final Entity vehicle) {

View File

@@ -2,13 +2,13 @@
+++ b/net/minecraft/world/entity/monster/Creeper.java
@@ -56,6 +_,7 @@
public int explosionRadius = 3;
public boolean droppedSkulls;
private boolean droppedSkulls;
public @Nullable Entity entityIgniter; // CraftBukkit
+ private boolean exploding = false; // Purpur - Config to make Creepers explode on death
public Creeper(final EntityType<? extends Creeper> type, final Level level) {
super(type, level);
@@ -159,6 +_,27 @@
@@ -159,6 +_,26 @@
return false; // CraftBukkit
}
@@ -25,11 +25,10 @@
+
+ // Purpur start - Config to make Creepers explode on death
+ @Override
+ protected org.bukkit.event.entity.EntityDeathEvent dropAllDeathLoot(ServerLevel world, DamageSource damageSource) {
+ if (!this.exploding && this.level().purpurConfig.creeperExplodeWhenKilled && damageSource.getEntity() instanceof net.minecraft.server.level.ServerPlayer) {
+ protected void dropAllDeathLoot(final ServerLevel level, final DamageSource source) {
+ if (!this.exploding && this.level().purpurConfig.creeperExplodeWhenKilled && source.getEntity() instanceof net.minecraft.server.level.ServerPlayer) {
+ this.explodeCreeper();
+ }
+ return super.dropAllDeathLoot(world, damageSource);
+ }
+ // Purpur end - Config to make Creepers explode on death
+

View File

@@ -2,7 +2,7 @@
+++ b/net/minecraft/world/entity/projectile/arrow/AbstractArrow.java
@@ -79,6 +_,7 @@
private @Nullable List<Entity> piercedAndKilledEntities;
public ItemStack pickupItemStack = this.getDefaultPickupItem();
private ItemStack pickupItemStack = this.getDefaultPickupItem();
public @Nullable ItemStack firedFromWeapon = null;
+ public net.minecraft.world.item.enchantment.ItemEnchantments actualEnchantments = net.minecraft.world.item.enchantment.ItemEnchantments.EMPTY; // Purpur - Add an option to fix MC-3304 projectile looting

View File

@@ -3,7 +3,7 @@
@@ -348,6 +_,7 @@
}
public static boolean isBlockedChestByBlock(final BlockGetter level, final BlockPos pos) {
private static boolean isBlockedChestByBlock(final BlockGetter level, final BlockPos pos) {
+ if (level instanceof Level level1 && level1.purpurConfig.chestOpenWithBlockOnTop) return false; // Purpur - Option for chests to open even with a solid block on top
BlockPos above = pos.above();
return level.getBlockState(above).isRedstoneConductor(level, above);