mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-20 14:53:49 -07:00
More more more more more more more patches
This commit is contained in:
patches/server
API-for-creating-command-sender-which-forwards-feedb.patchAdd-API-for-item-entity-health.patchAdd-GameEvent-tags.patchAdd-PlayerItemFrameChangeEvent.patchAdd-TameableDeathMessageEvent.patchAdd-Wandering-Trader-spawn-rate-config-options.patchAdd-config-option-for-logging-player-ip-addresses.patchAdd-config-option-for-worlds-affected-by-time-cmd.patchAdd-configurable-height-for-slime-spawn.patchAdd-missing-Validate-calls-to-CraftServer-getSpawnLi.patchAdd-missing-block-data-mins-and-maxes.patchAdd-missing-structure-set-seed-configs.patchAdd-more-Campfire-API.patchAdd-new-overload-to-PersistentDataContainer-has.patchAdd-packet-limiter-config.patchAdd-player-health-update-API.patchAdd-root-admin-user-detection.patchAdded-getHostname-to-AsyncPlayerPreLoginEvent.patchAllow-delegation-to-vanilla-chunk-gen.patchAllow-to-change-the-podium-for-the-EnderDragon.patchAlways-allow-item-changing-in-Fireball.patchAlways-parse-protochunk-light-sources-unless-it-is-m.patchAsync-catch-modifications-to-critical-entity-state.patchAttempt-to-recalculate-regionfile-header-if-it-is-co.patchBucketable-API.patchBuffer-OOB-setBlock-calls.patchCheck-requirement-before-suggesting-root-nodes.patchConfigurable-feature-seeds.patchConfigurable-max-block-light-for-monster-spawning.patchConfigurable-sculk-sensor-listener-range.patchConsolidate-flush-calls-for-entity-tracker-packets.patchCustom-Potion-Mixes.patchCustom-table-implementation-for-blockstate-state-loo.patchDetail-more-information-in-watchdog-dumps.patchDistance-manager-tick-timings.patchDo-not-run-raytrace-logic-for-AIR.patchDolphin-API.patchDon-t-allow-vehicle-movement-from-players-while-tele.patchDon-t-log-debug-logging-being-disabled.patchDon-t-lookup-fluid-state-when-raytracing.patchDon-t-read-neighbour-chunk-data-off-disk-when-conver.patchDon-t-respond-to-ServerboundCommandSuggestionPacket-.patchEnsure-entity-passenger-world-matches-ridden-entity.patchEnsure-valid-vehicle-status.patchEntity-powdered-snow-API.patchExecute-chunk-tasks-fairly-for-worlds-while-waiting-.patchExecute-chunk-tasks-mid-tick.patchExpose-furnace-minecart-push-values.patchExpose-isFuel-and-canSmelt-methods-to-FurnaceInvento.patchExpose-vanilla-BiomeProvider-from-WorldInfo.patchFix-Bukkit-NamespacedKey-shenanigans.patchFix-ChunkSnapshot-isSectionEmpty-int-and-optimize-Pa.patchFix-CocaoDecorator-causing-a-crash-when-trying-to-ge.patchFix-CraftCriteria-defaults-map.patchFix-Entity-Position-Desync.patchFix-NBT-pieces-overriding-a-block-entity-during-worl.patchFix-NotePlayEvent.patchFix-Spigot-growth-modifiers.patchFix-StructureGrowEvent-species-for-RED_MUSHROOM.patchFix-bees-aging-inside-hives.patchFix-cancelled-powdered-snow-bucket-placement.patchFix-cancelling-ProjectileHitEvent-for-piercing-arrow.patchFix-entity-type-tags-suggestions-in-selectors.patchFix-falling-block-spawn-methods.patchFix-merchant-inventory-not-closing-on-entity-removal.patchFix-new-block-data-for-EntityChangeBlockEvent.patchFix-removing-recipes-from-RecipeIterator.patchFix-saving-in-unloadWorld.patchFix-setPatternColor-on-tropical-fish-bucket-meta.patchFix-sticky-pistons-and-BlockPistonRetractEvent.patchFix-swamp-hut-cat-generation-deadlock.patchFix-tripwire-state-inconsistency.patchFix-upstreams-block-state-factories.patchFix-xp-reward-for-baby-zombies.patchForce-close-world-loading-screen.patchForward-CraftEntity-in-teleport-command.patchFreeze-Tick-Lock-API.patchFurnace-RecipesUsed-API.patchGuard-against-invalid-entity-positions.patchHide-unnecessary-itemmeta-from-clients.patchHighly-optimise-single-and-multi-AABB-VoxelShapes-an.patchImplement-enchantWithLevels-API.patchImplement-getComputedBiome-API.patchImplement-regenerateChunk.patchImprove-scoreboard-entries.patchKick-on-main-for-illegal-chat.patchLoad-effect-amplifiers-greater-than-127-correctly.patchMake-some-itemstacks-nonnull.patchMake-sure-inlined-getChunkAt-has-inlined-logic-for-l.patchMake-water-animal-spawn-height-configurable.patchManually-inline-methods-in-BlockPosition.patchMore-PotionEffectType-API.patchMore-Projectile-API.patchMulti-Block-Change-API-Implementation.patchMultiple-Entries-with-Scoreboards.patchName-craft-scheduler-threads-according-to-the-plugin.patchOnly-write-chunk-data-to-disk-if-it-serializes-witho.patchOprimise-map-impl-for-tracked-players.patchOptimise-BlockSoil-nearby-water-lookup.patchOptimise-chunk-tick-iteration.patchOptimise-collision-checking-in-player-move-packet-ha.patchOptimise-general-POI-access.patchOptimise-nearby-player-lookups.patchOptimise-non-flush-packet-sending.patchOptimise-random-block-ticking.patchOptimize-HashMapPalette.patchOption-to-have-default-CustomSpawners-in-custom-worl.patchPreserve-overstacked-loot.patchPrevent-ContainerOpenersCounter-openCount-from-going.patchPrevent-excessive-velocity-through-repeated-crits.patchPrevent-sending-oversized-item-data-in-equipment-and.patchPrevent-softlocked-end-exit-portal-generation.patchPrevent-tile-entity-copies-loading-chunks.patchPut-world-into-worldlist-before-initing-the-world.patchReduce-worldgen-thread-worker-count-for-low-core-cou.patchRemove-client-side-code-using-deprecated-for-removal.patchRemove-streams-for-villager-AI.patchReset-placed-block-on-exception.patchSend-full-pos-packets-for-hard-colliding-entities.patchTime-scoreboard-search.patchUpdate-head-rotation-in-missing-places.patchUse-Velocity-compression-and-cipher-natives.patchUse-a-CHM-for-StructureTemplate.Pallete-cache.patchUse-username-instead-of-display-name-in-PlayerList-g.patchValidate-usernames.patchVanillaCommandWrapper-didnt-account-for-entity-sende.patchcache-resource-keys.patchdon-t-attempt-to-teleport-dead-entities.patchfix-player-loottables-running-when-mob-loot-gamerule.patchfix-various-menus-with-empty-level-accesses.patchprevent-unintended-light-block-manipulation.patch
@@ -28,30 +28,33 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ }
|
||||
+ // Paper end
|
||||
this.dropItem(source.getEntity(), false);
|
||||
this.gameEvent(GameEvent.BLOCK_CHANGE, source.getEntity());
|
||||
this.playSound(this.getRemoveItemSound(), 1.0F, 1.0F);
|
||||
}
|
||||
@@ -0,0 +0,0 @@ public class ItemFrame extends HangingEntity {
|
||||
return InteractionResult.FAIL;
|
||||
}
|
||||
}
|
||||
-
|
||||
|
||||
- this.setItem(itemstack);
|
||||
+ // Paper start - call PlayerItemFrameChangeEvent
|
||||
+ var event = new PlayerItemFrameChangeEvent((org.bukkit.entity.Player) player.getBukkitEntity(), (org.bukkit.entity.ItemFrame) this.getBukkitEntity(), itemstack.asBukkitCopy(), PlayerItemFrameChangeEvent.ItemFrameChangeAction.PLACE);
|
||||
+ if (!event.callEvent()) return InteractionResult.FAIL;
|
||||
+ PlayerItemFrameChangeEvent event = new PlayerItemFrameChangeEvent((org.bukkit.entity.Player) player.getBukkitEntity(), (org.bukkit.entity.ItemFrame) this.getBukkitEntity(), itemstack.asBukkitCopy(), PlayerItemFrameChangeEvent.ItemFrameChangeAction.PLACE);
|
||||
+ if (!event.callEvent()) {
|
||||
+ return InteractionResult.FAIL;
|
||||
+ }
|
||||
+ this.setItem(ItemStack.fromBukkitCopy(event.getItemStack()));
|
||||
+ // this.setItem(itemstack);
|
||||
+ // Paper end
|
||||
this.gameEvent(GameEvent.BLOCK_CHANGE, player);
|
||||
if (!player.getAbilities().instabuild) {
|
||||
itemstack.shrink(1);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
+ // Paper start - call PlayerItemFrameChangeEvent
|
||||
+ var event = new PlayerItemFrameChangeEvent((org.bukkit.entity.Player) player.getBukkitEntity(), (org.bukkit.entity.ItemFrame) this.getBukkitEntity(), this.getItem().asBukkitCopy(), PlayerItemFrameChangeEvent.ItemFrameChangeAction.ROTATE);
|
||||
+ if (!event.callEvent()) return InteractionResult.FAIL;
|
||||
+ PlayerItemFrameChangeEvent event = new PlayerItemFrameChangeEvent((org.bukkit.entity.Player) player.getBukkitEntity(), (org.bukkit.entity.ItemFrame) this.getBukkitEntity(), this.getItem().asBukkitCopy(), PlayerItemFrameChangeEvent.ItemFrameChangeAction.ROTATE);
|
||||
+ if (!event.callEvent()) {
|
||||
+ return InteractionResult.FAIL;
|
||||
+ }
|
||||
+ setItem(ItemStack.fromBukkitCopy(event.getItemStack()), false, false);
|
||||
+ // Paper end
|
||||
this.playSound(this.getRotateItemSound(), 1.0F, 1.0F);
|
||||
this.setRotation(this.getRotation() + 1);
|
||||
}
|
||||
this.gameEvent(GameEvent.BLOCK_CHANGE, player);
|
@@ -70,9 +70,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
if (!world.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING)) {
|
||||
return 0;
|
||||
} else {
|
||||
@@ -0,0 +0,0 @@ public class WanderingTraderSpawner implements CustomSpawner {
|
||||
int i = this.spawnChance;
|
||||
|
||||
this.spawnChance = Mth.clamp(this.spawnChance + 25, 25, 75);
|
||||
- this.spawnChance = Mth.clamp(this.spawnChance + 25, 25, 75);
|
||||
this.serverLevelData.setWanderingTraderSpawnChance(this.spawnChance);
|
||||
+ this.spawnChance = Mth.clamp(i + world.paperConfig().entities.spawning.wanderingTrader.spawnChanceFailureIncrement, world.paperConfig().entities.spawning.wanderingTrader.spawnChanceMin, world.paperConfig().entities.spawning.wanderingTrader.spawnChanceMax);
|
||||
+ //this.serverLevelData.setWanderingTraderSpawnChance(this.spawnChance); // Paper - We don't need to save this value to disk if it gets set back to a hardcoded value anyways
|
||||
|
@@ -11,7 +11,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
@@ -0,0 +0,0 @@ public class EnderDragon extends Mob implements Enemy {
|
||||
private final int[] nodeAdjacency = new int[24];
|
||||
private final BinaryHeap openSet = new BinaryHeap();
|
||||
private Explosion explosionSource = new Explosion(null, this, null, null, Double.NaN, Double.NaN, Double.NaN, Float.NaN, true, Explosion.BlockInteraction.DESTROY); // CraftBukkit - reusable source for CraftTNTPrimed.getSource()
|
||||
private final Explosion explosionSource; // CraftBukkit - reusable source for CraftTNTPrimed.getSource()
|
||||
+ // Paper start - add var for save custom podium
|
||||
+ @Nullable
|
||||
+ private BlockPos podium;
|
@@ -60,7 +60,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ packetProcessing.push(listener); // Paper - detailed watchdog information
|
||||
+ try { // Paper - detailed watchdog information
|
||||
if (MinecraftServer.getServer().hasStopped() || (listener instanceof ServerGamePacketListenerImpl && ((ServerGamePacketListenerImpl) listener).processedDisconnect)) return; // CraftBukkit, MC-142590
|
||||
if (listener.getConnection().isConnected()) {
|
||||
if (listener.isAcceptingMessages()) {
|
||||
co.aikar.timings.Timing timing = co.aikar.timings.MinecraftTimings.getPacketTiming(packet); // Paper - timings
|
||||
@@ -0,0 +0,0 @@ public class PacketUtils {
|
||||
} else {
|
@@ -13,8 +13,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
@@ -0,0 +0,0 @@ public class ServerEntity {
|
||||
boolean flag2 = flag1 || this.tickCount % 60 == 0;
|
||||
boolean flag3 = Math.abs(i - this.yRotp) >= 1 || Math.abs(j - this.xRotp) >= 1;
|
||||
boolean flag4 = false;
|
||||
boolean flag5 = false;
|
||||
|
||||
- if (this.tickCount > 0 || this.entity instanceof AbstractArrow) {
|
||||
+ if (!(this.entity instanceof net.minecraft.world.entity.decoration.HangingEntity) || this.tickCount > 0 || this.entity instanceof AbstractArrow) { // Paper - Always update position
|
@@ -18,7 +18,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
|
||||
@Override
|
||||
protected BlockState getGrowIntoState(BlockState state, RandomSource random) {
|
||||
- return (BlockState) super.getGrowIntoState(state, random).setValue(CaveVinesBlock.BERRIES, random.nextFloat() < 0.11F);
|
||||
- return super.getGrowIntoState(state, random).setValue(BERRIES, Boolean.valueOf(random.nextFloat() < 0.11F));
|
||||
+ // Paper start
|
||||
+ return this.getGrowIntoState(state, random, null);
|
||||
}
|
@@ -17,7 +17,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
@@ -0,0 +0,0 @@ public abstract class CraftRegionAccessor implements RegionAccessor {
|
||||
// Paper end
|
||||
} else if (FallingBlock.class.isAssignableFrom(clazz)) {
|
||||
BlockPos pos = new BlockPos(x, y, z);
|
||||
BlockPos pos = BlockPos.containing(x, y, z);
|
||||
- entity = FallingBlockEntity.fall(world, pos, this.getHandle().getBlockState(pos));
|
||||
+ entity = new FallingBlockEntity(world, x, y, z, this.getHandle().getBlockState(pos)); // Paper
|
||||
} else if (Projectile.class.isAssignableFrom(clazz)) {
|
||||
@@ -31,7 +31,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
Validate.notNull(material, "Material cannot be null");
|
||||
Validate.isTrue(material.isBlock(), "Material must be a block");
|
||||
|
||||
- FallingBlockEntity entity = FallingBlockEntity.fall(world, new BlockPos(location.getX(), location.getY(), location.getZ()), CraftMagicNumbers.getBlock(material).defaultBlockState(), SpawnReason.CUSTOM);
|
||||
- FallingBlockEntity entity = FallingBlockEntity.fall(world, BlockPos.containing(location.getX(), location.getY(), location.getZ()), CraftMagicNumbers.getBlock(material).defaultBlockState(), SpawnReason.CUSTOM);
|
||||
+ // Paper start - restore API behavior for spawning falling blocks
|
||||
+ FallingBlockEntity entity = new FallingBlockEntity(this.world, location.getX(), location.getY(), location.getZ(), CraftMagicNumbers.getBlock(material).defaultBlockState()); // Paper
|
||||
+ entity.time = 1;
|
||||
@@ -45,7 +45,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
Validate.notNull(location, "Location cannot be null");
|
||||
Validate.notNull(data, "BlockData cannot be null");
|
||||
|
||||
- FallingBlockEntity entity = FallingBlockEntity.fall(world, new BlockPos(location.getX(), location.getY(), location.getZ()), ((CraftBlockData) data).getState(), SpawnReason.CUSTOM);
|
||||
- FallingBlockEntity entity = FallingBlockEntity.fall(world, BlockPos.containing(location.getX(), location.getY(), location.getZ()), ((CraftBlockData) data).getState(), SpawnReason.CUSTOM);
|
||||
+ // Paper start - restore API behavior for spawning falling blocks
|
||||
+ FallingBlockEntity entity = new FallingBlockEntity(this.world, location.getX(), location.getY(), location.getZ(), ((CraftBlockData) data).getState());
|
||||
+ entity.time = 1;
|
@@ -80,6 +80,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
- Material.BAMBOO_WALL_SIGN,
|
||||
- Material.BIRCH_SIGN,
|
||||
- Material.BIRCH_WALL_SIGN,
|
||||
- Material.CHERRY_SIGN,
|
||||
- Material.CHERRY_WALL_SIGN,
|
||||
- Material.CRIMSON_SIGN,
|
||||
- Material.CRIMSON_WALL_SIGN,
|
||||
- Material.DARK_OAK_SIGN,
|
||||
@@ -105,6 +107,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
- Material.BAMBOO_WALL_HANGING_SIGN,
|
||||
- Material.BIRCH_HANGING_SIGN,
|
||||
- Material.BIRCH_WALL_HANGING_SIGN,
|
||||
- Material.CHERRY_HANGING_SIGN,
|
||||
- Material.CHERRY_WALL_HANGING_SIGN,
|
||||
- Material.CRIMSON_HANGING_SIGN,
|
||||
- Material.CRIMSON_WALL_HANGING_SIGN,
|
||||
- Material.DARK_OAK_HANGING_SIGN,
|
||||
@@ -253,6 +257,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
- register(Material.COMPARATOR, CraftComparator.class, CraftComparator::new, ComparatorBlockEntity::new);
|
||||
- register(Material.CONDUIT, CraftConduit.class, CraftConduit::new, ConduitBlockEntity::new);
|
||||
- register(Material.DAYLIGHT_DETECTOR, CraftDaylightDetector.class, CraftDaylightDetector::new, DaylightDetectorBlockEntity::new);
|
||||
- register(Material.DECORATED_POT, CraftDecoratedPot.class, CraftDecoratedPot::new, DecoratedPotBlockEntity::new);
|
||||
- register(Material.DISPENSER, CraftDispenser.class, CraftDispenser::new, DispenserBlockEntity::new);
|
||||
- register(Material.DROPPER, CraftDropper.class, CraftDropper::new, DropperBlockEntity::new);
|
||||
- register(Material.ENCHANTING_TABLE, CraftEnchantingTable.class, CraftEnchantingTable::new, EnchantmentTableBlockEntity::new);
|
||||
@@ -271,6 +276,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
- register(Material.SMOKER, CraftSmoker.class, CraftSmoker::new, SmokerBlockEntity::new);
|
||||
- register(Material.SPAWNER, CraftCreatureSpawner.class, CraftCreatureSpawner::new, SpawnerBlockEntity::new);
|
||||
- register(Material.STRUCTURE_BLOCK, CraftStructureBlock.class, CraftStructureBlock::new, StructureBlockEntity::new);
|
||||
- register(Material.SUSPICIOUS_SAND, CraftSuspiciousSand.class, CraftSuspiciousSand::new, SuspiciousSandBlockEntity::new);
|
||||
- register(Material.TRAPPED_CHEST, CraftChest.class, CraftChest::new, TrappedChestBlockEntity::new);
|
||||
+ // Paper start - simplify
|
||||
+ register(BlockEntityType.SIGN, CraftSign.class, CraftSign::new);
|
||||
@@ -292,6 +298,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ register(BlockEntityType.COMPARATOR, CraftComparator.class, CraftComparator::new);
|
||||
+ register(BlockEntityType.CONDUIT, CraftConduit.class, CraftConduit::new);
|
||||
+ register(BlockEntityType.DAYLIGHT_DETECTOR, CraftDaylightDetector.class, CraftDaylightDetector::new);
|
||||
+ register(BlockEntityType.DECORATED_POT, CraftDecoratedPot.class, CraftDecoratedPot::new);
|
||||
+ register(BlockEntityType.DISPENSER, CraftDispenser.class, CraftDispenser::new);
|
||||
+ register(BlockEntityType.DROPPER, CraftDropper.class, CraftDropper::new);
|
||||
+ register(BlockEntityType.ENCHANTING_TABLE, CraftEnchantingTable.class, CraftEnchantingTable::new);
|
||||
@@ -310,6 +317,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ register(BlockEntityType.SMOKER, CraftSmoker.class, CraftSmoker::new);
|
||||
+ register(BlockEntityType.MOB_SPAWNER, CraftCreatureSpawner.class, CraftCreatureSpawner::new);
|
||||
+ register(BlockEntityType.STRUCTURE_BLOCK, CraftStructureBlock.class, CraftStructureBlock::new);
|
||||
+ register(BlockEntityType.SUSPICIOUS_SAND, CraftSuspiciousSand.class, CraftSuspiciousSand::new);
|
||||
+ register(BlockEntityType.TRAPPED_CHEST, CraftChest.class, CraftChest::new);
|
||||
+ // Paper end
|
||||
}
|
@@ -49,15 +49,15 @@ diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/ma
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity {
|
||||
boolean flag1 = this.getType().is(EntityTypeTags.FREEZE_HURTS_EXTRA_TYPES);
|
||||
int i;
|
||||
@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
|
||||
this.level.getProfiler().pop();
|
||||
this.level.getProfiler().push("freezing");
|
||||
- if (!this.level.isClientSide && !this.isDeadOrDying()) {
|
||||
+ if (!this.level.isClientSide && !this.isDeadOrDying() && !freezeLocked) { // Paper - Freeze Tick Lock API
|
||||
i = this.getTicksFrozen();
|
||||
int i = this.getTicksFrozen();
|
||||
|
||||
if (this.isInPowderSnow && this.canFreeze()) {
|
||||
this.setTicksFrozen(Math.min(this.getTicksRequiredToFreeze(), i + 1));
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
@@ -36,7 +36,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/ma
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity {
|
||||
@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
|
||||
// Paper start - prevent oversized data
|
||||
ItemStack toSend = sanitizeItemStack(itemstack1, true);
|
||||
@@ -45,7 +45,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
// Paper end
|
||||
switch (enumitemslot.getType()) {
|
||||
case HAND:
|
||||
@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity {
|
||||
@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
((ServerLevel) this.level).getChunkSource().broadcast(this, new ClientboundSetEquipmentPacket(this.getId(), list));
|
||||
}
|
||||
|
@@ -1278,11 +1278,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
- boolean flag2 = movement.z != vec3d1.z;
|
||||
- boolean flag3 = this.onGround || flag1 && movement.y < 0.0D;
|
||||
-
|
||||
- if (this.maxUpStep > 0.0F && flag3 && (flag || flag2)) {
|
||||
- Vec3 vec3d2 = Entity.collideBoundingBox(this, new Vec3(movement.x, (double) this.maxUpStep, movement.z), axisalignedbb, this.level, list);
|
||||
- Vec3 vec3d3 = Entity.collideBoundingBox(this, new Vec3(0.0D, (double) this.maxUpStep, 0.0D), axisalignedbb.expandTowards(movement.x, 0.0D, movement.z), this.level, list);
|
||||
- if (this.maxUpStep() > 0.0F && flag3 && (flag || flag2)) {
|
||||
- Vec3 vec3d2 = Entity.collideBoundingBox(this, new Vec3(movement.x, (double) this.maxUpStep(), movement.z), axisalignedbb, this.level, list);
|
||||
- Vec3 vec3d3 = Entity.collideBoundingBox(this, new Vec3(0.0D, (double) this.maxUpStep(), 0.0D), axisalignedbb.expandTowards(movement.x, 0.0D, movement.z), this.level, list);
|
||||
-
|
||||
- if (vec3d3.y < (double) this.maxUpStep) {
|
||||
- if (vec3d3.y < (double) this.maxUpStep()) {
|
||||
- Vec3 vec3d4 = Entity.collideBoundingBox(this, new Vec3(movement.x, 0.0D, movement.z), axisalignedbb.move(vec3d3), this.level, list).add(vec3d3);
|
||||
-
|
||||
- if (vec3d4.horizontalDistanceSqr() > vec3d2.horizontalDistanceSqr()) {
|
||||
@@ -1302,7 +1302,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+
|
||||
+ final List<AABB> potentialCollisions = io.papermc.paper.util.CachedLists.getTempCollisionList();
|
||||
+ try {
|
||||
+ final double stepHeight = (double)this.maxUpStep;
|
||||
+ final double stepHeight = (double)this.maxUpStep();
|
||||
+ final AABB collisionBox;
|
||||
+
|
||||
+ if (movement.x == 0.0 && movement.z == 0.0 && movement.y != 0.0) {
|
@@ -38,5 +38,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
this.disconnect(Component.translatable("multiplayer.disconnect.out_of_order_chat"), org.bukkit.event.player.PlayerKickEvent.Cause.OUT_OF_ORDER_CHAT); // Paper - kick event ca
|
||||
+ }); // Paper - push to main
|
||||
return Optional.empty();
|
||||
} else if (this.player.isRemoved() || this.player.getChatVisibility() == ChatVisiblity.HIDDEN) { // CraftBukkit - dead men tell no tales
|
||||
this.send(new ClientboundSystemChatPacket(PaperAdventure.asAdventure(Component.translatable("chat.disabled.options").withStyle(ChatFormatting.RED)), false)); // Paper - Adventure
|
||||
} else {
|
||||
Optional<LastSeenMessages> optional = this.unpackAndApplyLastSeen(acknowledgment);
|
@@ -59,5 +59,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ protected int y; // Paper - protected
|
||||
+ protected int z; // Paper - protected
|
||||
|
||||
private static Function<Vec3i, DataResult<Vec3i>> checkOffsetAxes(int maxAbsValue) {
|
||||
return (vec) -> {
|
||||
public static Codec<Vec3i> offsetCodec(int maxAbsValue) {
|
||||
return ExtraCodecs.validate(CODEC, (vec) -> {
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user