3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-15 19:10:09 +01:00

fix a bunch of compile errors

Dieser Commit ist enthalten in:
Jake Potrebic 2023-06-07 15:28:06 -07:00
Ursprung 8f7a7ec440
Commit 0b8147f68e
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: ECE0B3C133C016C5
16 geänderte Dateien mit 40 neuen und 48 gelöschten Zeilen

Datei anzeigen

@ -2533,7 +2533,7 @@ index 1cb95db25a20d38faacd99a5805630c1598e9db3..d99b2235038eb1aba8cda474c4aa51e2
@Override
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index c48318d9d5882dd87e423aecf27c31994af42bdb..77e5b1725a6b8264c098ab91aaf87ae19aedd145 100644
index c48318d9d5882dd87e423aecf27c31994af42bdb..ae2c702955a60a38c48b5fce43b4edb19284b82c 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -8,6 +8,7 @@ import com.mojang.logging.LogUtils;
@ -2676,7 +2676,7 @@ index c48318d9d5882dd87e423aecf27c31994af42bdb..77e5b1725a6b8264c098ab91aaf87ae1
boolean flag1 = false;
boolean flag2;
+ Packet<?> disguised = sender != null && unsignedFunction == null ? new net.minecraft.network.protocol.game.ClientboundDisguisedChatPacket(outgoingchatmessage.content(), params.toNetwork(sender.level.registryAccess())) : null; // Paper - don't send player chat packets from vanished players
+ Packet<?> disguised = sender != null && unsignedFunction == null ? new net.minecraft.network.protocol.game.ClientboundDisguisedChatPacket(outgoingchatmessage.content(), params.toNetwork(sender.level().registryAccess())) : null; // Paper - don't send player chat packets from vanished players
for (Iterator iterator = this.players.iterator(); iterator.hasNext(); flag1 |= flag2 && message.isFullyFiltered()) {
ServerPlayer entityplayer1 = (ServerPlayer) iterator.next();
@ -2686,7 +2686,7 @@ index c48318d9d5882dd87e423aecf27c31994af42bdb..77e5b1725a6b8264c098ab91aaf87ae1
+ // Paper start - don't send player chat packets from vanished players
+ if (sender != null && !entityplayer1.getBukkitEntity().canSee(sender.getBukkitEntity())) {
+ entityplayer1.connection.send(unsignedFunction != null
+ ? new net.minecraft.network.protocol.game.ClientboundDisguisedChatPacket(unsignedFunction.apply(entityplayer1.getBukkitEntity()), params.toNetwork(sender.level.registryAccess()))
+ ? new net.minecraft.network.protocol.game.ClientboundDisguisedChatPacket(unsignedFunction.apply(entityplayer1.getBukkitEntity()), params.toNetwork(sender.level().registryAccess()))
+ : disguised);
+ continue;
+ }

Datei anzeigen

@ -4502,7 +4502,7 @@ index d8b83c8c89143d78620f812c491a1950e3218eb1..f3c9a3dbb6f0e6f825b7477c89ed72ed
while (objectiterator.hasNext()) {
diff --git a/src/main/java/net/minecraft/server/level/ThreadedLevelLightEngine.java b/src/main/java/net/minecraft/server/level/ThreadedLevelLightEngine.java
index 65d72701b13c25dd701533833055e77c2aff9db8..10c9512be71f1b7eec7e0c74dc0e118d0b51735b 100644
index 65d72701b13c25dd701533833055e77c2aff9db8..481272124b7589cff0aa05b6df5b7e6f1d539414 100644
--- a/src/main/java/net/minecraft/server/level/ThreadedLevelLightEngine.java
+++ b/src/main/java/net/minecraft/server/level/ThreadedLevelLightEngine.java
@@ -23,6 +23,17 @@ import net.minecraft.world.level.chunk.LightChunkGetter;
@ -4586,7 +4586,7 @@ index 65d72701b13c25dd701533833055e77c2aff9db8..10c9512be71f1b7eec7e0c74dc0e118d
+ this.theLightEngine.relightChunks(chunks, (ChunkPos chunkPos) -> {
+ chunkLightCallback.accept(chunkPos);
+ ((java.util.concurrent.Executor)((ServerLevel)this.theLightEngine.getWorld()).getChunkSource().mainThreadProcessor).execute(() -> {
+ ((ServerLevel)this.theLightEngine.getWorld()).getChunkSource().chunkMap.getUpdatingChunkIfPresent(chunkPos.toLong()).broadcast(new net.minecraft.network.protocol.game.ClientboundLightUpdatePacket(chunkPos, ThreadedLevelLightEngine.this, null, null, true), false);
+ ((ServerLevel)this.theLightEngine.getWorld()).getChunkSource().chunkMap.getUpdatingChunkIfPresent(chunkPos.toLong()).broadcast(new net.minecraft.network.protocol.game.ClientboundLightUpdatePacket(chunkPos, ThreadedLevelLightEngine.this, null, null), false);
+ ((ServerLevel)this.theLightEngine.getWorld()).getChunkSource().removeTicketAtLevel(TicketType.CHUNK_RELIGHT, chunkPos, io.papermc.paper.util.MCUtil.getTicketLevelFor(ChunkStatus.LIGHT), ticketIds.get(chunkPos));
+ });
+ }, onComplete);
@ -5037,7 +5037,7 @@ index 6bb508105641b5729572736c5c3f9bd6711e309a..60e760b42dd6471a229dfd45490dcf8c
@Override
public BlockEntity getBlockEntity(BlockPos pos) {
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
index 6e1ace21431f679d55a2580dc23c32cf5f75b2af..9bd0e817cf717fe6257ceb4ace6bf6f5eed9eb82 100644
index 4185d524f61e87a469d563c938f742f63dad3c2f..09999a3f523ce6d652799215d3418284a69042c1 100644
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
@@ -90,6 +90,10 @@ public class LevelChunk extends ChunkAccess {

Datei anzeigen

@ -5,14 +5,14 @@ Subject: [PATCH] Configurable baby zombie movement speed
diff --git a/src/main/java/net/minecraft/world/entity/monster/Zombie.java b/src/main/java/net/minecraft/world/entity/monster/Zombie.java
index 5508dd33111a8206cbda4caf9d5003574d91d371..41e4903b4feb860309510f8f4ff89a4e3710b395 100644
index 5508dd33111a8206cbda4caf9d5003574d91d371..b32e55685d2a3f571828ed3cf69cb985ccaaa931 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Zombie.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Zombie.java
@@ -77,6 +77,7 @@ public class Zombie extends Monster {
private static final UUID SPEED_MODIFIER_BABY_UUID = UUID.fromString("B9766B59-9566-4402-BC1F-2EE2A276D836");
private static final AttributeModifier SPEED_MODIFIER_BABY = new AttributeModifier(Zombie.SPEED_MODIFIER_BABY_UUID, "Baby speed boost", 0.5D, AttributeModifier.Operation.MULTIPLY_BASE);
+ private final AttributeModifier babyModifier = new net.minecraft.world.entity.ai.attributes.AttributeModifier(SPEED_MODIFIER_BABY.getId(), SPEED_MODIFIER_BABY.getName(), this.level.paperConfig().entities.behavior.babyZombieMovementModifier, SPEED_MODIFIER_BABY.getOperation()); // Paper - Make baby speed configurable
+ private final AttributeModifier babyModifier = new net.minecraft.world.entity.ai.attributes.AttributeModifier(SPEED_MODIFIER_BABY.getId(), SPEED_MODIFIER_BABY.getName(), this.level().paperConfig().entities.behavior.babyZombieMovementModifier, SPEED_MODIFIER_BABY.getOperation()); // Paper - Make baby speed configurable
private static final EntityDataAccessor<Boolean> DATA_BABY_ID = SynchedEntityData.defineId(Zombie.class, EntityDataSerializers.BOOLEAN);
private static final EntityDataAccessor<Integer> DATA_SPECIAL_TYPE_ID = SynchedEntityData.defineId(Zombie.class, EntityDataSerializers.INT);
public static final EntityDataAccessor<Boolean> DATA_DROWNED_CONVERSION_ID = SynchedEntityData.defineId(Zombie.class, EntityDataSerializers.BOOLEAN);

Datei anzeigen

@ -6,7 +6,7 @@ Subject: [PATCH] Drop falling block and tnt entities at the specified height
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
diff --git a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
index da6e806288cf3afc2c72228844d1d05eee8324a5..2905556cbb4715b0dcbaab54222e76669ce0e81d 100644
index da6e806288cf3afc2c72228844d1d05eee8324a5..93e5e8294b6571a355432e728f7dd49ddcf70d3e 100644
--- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
+++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
@@ -140,6 +140,16 @@ public class FallingBlockEntity extends Entity {
@ -14,8 +14,8 @@ index da6e806288cf3afc2c72228844d1d05eee8324a5..2905556cbb4715b0dcbaab54222e7666
this.move(MoverType.SELF, this.getDeltaMovement());
+ // Paper start - Configurable EntityFallingBlock height nerf
+ if (this.level.paperConfig().fixes.fallingBlockHeightNerf.test(v -> this.getY() > v)) {
+ if (this.dropItem && this.level.getGameRules().getBoolean(GameRules.RULE_DOENTITYDROPS)) {
+ if (this.level().paperConfig().fixes.fallingBlockHeightNerf.test(v -> this.getY() > v)) {
+ if (this.dropItem && this.level().getGameRules().getBoolean(GameRules.RULE_DOENTITYDROPS)) {
+ this.spawnAtLocation(block);
+ }
+

Datei anzeigen

@ -63,7 +63,7 @@ index 518f47f52105e299e037fe2e7d5870d7555be4bc..71934af2dc4d209a9fbccfd36b5f2815
private int getSurfaceY() {
diff --git a/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java b/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java
index f16e9bcefedb582a4bfe7a0b7ec8a97799f5e5ad..de87f2e7b8a1662767bab4b0c86ee7cf014ed5cf 100644
index f16e9bcefedb582a4bfe7a0b7ec8a97799f5e5ad..1a69a46340eee4f0273c373cc1a40b4d069a89d4 100644
--- a/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java
+++ b/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java
@@ -110,7 +110,13 @@ public abstract class PathNavigation {
@ -115,7 +115,7 @@ index f16e9bcefedb582a4bfe7a0b7ec8a97799f5e5ad..de87f2e7b8a1662767bab4b0c86ee7cf
+ boolean copiedSet = false;
+ for (BlockPos possibleTarget : positions) {
+ if (!new com.destroystokyo.paper.event.entity.EntityPathfindEvent(this.mob.getBukkitEntity(),
+ io.papermc.paper.util.MCUtil.toLocation(this.mob.level, possibleTarget), target == null ? null : target.getBukkitEntity()).callEvent()) {
+ io.papermc.paper.util.MCUtil.toLocation(this.mob.level(), possibleTarget), target == null ? null : target.getBukkitEntity()).callEvent()) {
+ if (!copiedSet) {
+ copiedSet = true;
+ positions = new java.util.HashSet<>(positions);

Datei anzeigen

@ -18,7 +18,7 @@ index 04ff01ba9f1f869f90d39645edb7aba42885725e..5ec480397fb043717c63961651f7c624
public ServerEntity(ServerLevel worldserver, Entity entity, int i, boolean flag, Consumer<Packet<?>> consumer, Set<ServerPlayerConnection> trackedPlayers) {
this.trackedPlayers = trackedPlayers;
diff --git a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
index 223cd451a952addec522711b6d3a0d6c0ab0f797..31473200264e6365fb149b11d0965f509f78218c 100644
index 50fa14b045a1f75d43d90741245cc4506ed666a0..f2d455e1730336f17d667d91416077cb8d5fe86d 100644
--- a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
+++ b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
@@ -95,6 +95,27 @@ public class PrimedTnt extends Entity implements TraceableEntity {
@ -26,13 +26,13 @@ index 223cd451a952addec522711b6d3a0d6c0ab0f797..31473200264e6365fb149b11d0965f50
}
+ // Paper start - Optional prevent TNT from moving in water
+ if (!this.isRemoved() && this.wasTouchingWater && this.level.paperConfig().fixes.preventTntFromMovingInWater) {
+ if (!this.isRemoved() && this.wasTouchingWater && this.level().paperConfig().fixes.preventTntFromMovingInWater) {
+ /*
+ * Author: Jedediah Smith <jedediah@silencegreys.com>
+ */
+ // Send position and velocity updates to nearby players on every tick while the TNT is in water.
+ // This does pretty well at keeping their clients in sync with the server.
+ net.minecraft.server.level.ChunkMap.TrackedEntity ete = ((net.minecraft.server.level.ServerLevel)this.level).getChunkSource().chunkMap.entityMap.get(this.getId());
+ net.minecraft.server.level.ChunkMap.TrackedEntity ete = ((net.minecraft.server.level.ServerLevel)this.level()).getChunkSource().chunkMap.entityMap.get(this.getId());
+ if (ete != null) {
+ net.minecraft.network.protocol.game.ClientboundSetEntityMotionPacket velocityPacket = new net.minecraft.network.protocol.game.ClientboundSetEntityMotionPacket(this);
+ net.minecraft.network.protocol.game.ClientboundTeleportEntityPacket positionPacket = new net.minecraft.network.protocol.game.ClientboundTeleportEntityPacket(this);

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Filter bad tile entity nbt data from falling blocks
diff --git a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
index 4488d112b280a2020712708940adf65b69ca0a3c..d859e01a6cc4225c514c4023b8adc066e73d3bb7 100644
index 26ef917d401eb79466e246d82b5d689c7133c7a2..95bcd8f03a784287c5a6106c784448e54c4b531b 100644
--- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
+++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
@@ -332,7 +332,7 @@ public class FallingBlockEntity extends Entity {
@ -13,7 +13,7 @@ index 4488d112b280a2020712708940adf65b69ca0a3c..d859e01a6cc4225c514c4023b8adc066
}
- if (nbt.contains("TileEntityData", 10)) {
+ if (nbt.contains("TileEntityData", 10) && !(this.level.paperConfig().entities.spawning.filterBadTileEntityNbtFromFallingBlocks && this.blockState.getBlock() instanceof net.minecraft.world.level.block.GameMasterBlock)) {
+ if (nbt.contains("TileEntityData", 10) && !(this.level().paperConfig().entities.spawning.filterBadTileEntityNbtFromFallingBlocks && this.blockState.getBlock() instanceof net.minecraft.world.level.block.GameMasterBlock)) {
this.blockData = nbt.getCompound("TileEntityData");
}

Datei anzeigen

@ -13,7 +13,7 @@ by adding code to all overrides in:
to return BLOCKED if it is outside the world border.
diff --git a/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java b/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java
index de87f2e7b8a1662767bab4b0c86ee7cf014ed5cf..eb10ecb4dde7a3df869307fd96c652eb62a8f83e 100644
index 1a69a46340eee4f0273c373cc1a40b4d069a89d4..03cc97b13b1b8eb591b563c1eb52355b00ea3bf1 100644
--- a/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java
+++ b/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java
@@ -158,7 +158,7 @@ public abstract class PathNavigation {
@ -22,6 +22,6 @@ index de87f2e7b8a1662767bab4b0c86ee7cf014ed5cf..eb10ecb4dde7a3df869307fd96c652eb
for (BlockPos possibleTarget : positions) {
- if (!new com.destroystokyo.paper.event.entity.EntityPathfindEvent(this.mob.getBukkitEntity(),
+ if (!this.mob.getCommandSenderWorld().getWorldBorder().isWithinBounds(possibleTarget) || !new com.destroystokyo.paper.event.entity.EntityPathfindEvent(this.mob.getBukkitEntity(), // Paper - don't path out of world border
io.papermc.paper.util.MCUtil.toLocation(this.mob.level, possibleTarget), target == null ? null : target.getBukkitEntity()).callEvent()) {
io.papermc.paper.util.MCUtil.toLocation(this.mob.level(), possibleTarget), target == null ? null : target.getBukkitEntity()).callEvent()) {
if (!copiedSet) {
copiedSet = true;

Datei anzeigen

@ -48,23 +48,15 @@ index 7582efc69928718a164f704a54bce026ad6f7dd9..9bd6e71ea38bf050832f0f7bbed4a5db
CIRCLE, SWOOP;
diff --git a/src/main/java/net/minecraft/world/level/levelgen/PhantomSpawner.java b/src/main/java/net/minecraft/world/level/levelgen/PhantomSpawner.java
index 61ba99d99cc4e7782450ee6aa8b6c87b1a42cb3a..55b6e16d8a0671c7e897d42bbbe1e02b7e47e736 100644
index 61ba99d99cc4e7782450ee6aa8b6c87b1a42cb3a..a18e6296d1f50c53291d41192a1009605a1b3583 100644
--- a/src/main/java/net/minecraft/world/level/levelgen/PhantomSpawner.java
+++ b/src/main/java/net/minecraft/world/level/levelgen/PhantomSpawner.java
@@ -3,6 +3,7 @@ package net.minecraft.world.level.levelgen;
import java.util.Iterator;
import net.minecraft.core.BlockPos;
import net.minecraft.nbt.CompoundTag;
+import io.papermc.paper.util.MCUtil;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.stats.ServerStatsCounter;
@@ -70,9 +71,19 @@ public class PhantomSpawner implements CustomSpawner {
@@ -70,9 +70,19 @@ public class PhantomSpawner implements CustomSpawner {
int k = 1 + randomsource.nextInt(difficultydamagescaler.getDifficulty().getId() + 1);
for (int l = 0; l < k; ++l) {
+ // Paper start
+ com.destroystokyo.paper.event.entity.PhantomPreSpawnEvent event = new com.destroystokyo.paper.event.entity.PhantomPreSpawnEvent(MCUtil.toLocation(world, blockposition1), ((ServerPlayer) entityhuman).getBukkitEntity(), org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.NATURAL);
+ com.destroystokyo.paper.event.entity.PhantomPreSpawnEvent event = new com.destroystokyo.paper.event.entity.PhantomPreSpawnEvent(io.papermc.paper.util.MCUtil.toLocation(world, blockposition1), entityplayer.getBukkitEntity(), org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.NATURAL);
+ if (!event.callEvent()) {
+ if (event.shouldAbortSpawn()) {
+ break;
@ -75,7 +67,7 @@ index 61ba99d99cc4e7782450ee6aa8b6c87b1a42cb3a..55b6e16d8a0671c7e897d42bbbe1e02b
Phantom entityphantom = (Phantom) EntityType.PHANTOM.create(world);
if (entityphantom != null) {
+ entityphantom.setSpawningEntity(entityhuman.getUUID()); // Paper
+ entityphantom.setSpawningEntity(entityphantom.getUUID()); // Paper
entityphantom.moveTo(blockposition1, 0.0F, 0.0F);
groupdataentity = entityphantom.finalizeSpawn(world, difficultydamagescaler, MobSpawnType.NATURAL, groupdataentity, (CompoundTag) null);
world.addFreshEntityWithPassengers(entityphantom, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.NATURAL); // CraftBukkit

Datei anzeigen

@ -374,7 +374,7 @@ index 51ca4232a00f0b38050967c60aaae22366b1bc8a..fe3f5c4f3f4f5c42e4067e05f0a8bee9
public void injectScaledMaxHealth(Collection<AttributeInstance> collection, boolean force) {
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index b77fefc9cf30fd438f557e5b56efb4c0251cb17a..17a5d568e9ac367917e40c554aa7354088f66114 100644
index b77fefc9cf30fd438f557e5b56efb4c0251cb17a..68b1e24a497c052c8e20b946b5b5dabc59e7f539 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -824,9 +824,16 @@ public class CraftEventFactory {
@ -435,7 +435,7 @@ index b77fefc9cf30fd438f557e5b56efb4c0251cb17a..17a5d568e9ac367917e40c554aa73540
+ double z = event.getEntity().getLocation().getZ();
+ net.minecraft.sounds.SoundEvent soundEffect = org.bukkit.craftbukkit.CraftSound.getSoundEffect(event.getDeathSound());
+ net.minecraft.sounds.SoundSource soundCategory = net.minecraft.sounds.SoundSource.valueOf(event.getDeathSoundCategory().name());
+ victim.level.playSound(source, x, y, z, soundEffect, soundCategory, event.getDeathSoundVolume(), event.getDeathSoundPitch());
+ victim.level().playSound(source, x, y, z, soundEffect, soundCategory, event.getDeathSoundVolume(), event.getDeathSoundPitch());
+ }
+ }
+ // Paper end

Datei anzeigen

@ -6,7 +6,7 @@ Subject: [PATCH] Add option to prevent players from moving into unloaded
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 1aec3ec3debe3adfd5fda424761b559614dfdc84..4736ae957f79871cdd48ea114d77c7707885c122 100644
index 1aec3ec3debe3adfd5fda424761b559614dfdc84..9a9479337e23b8971b9a6d2ab2d4f3c79214a0c9 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -567,9 +567,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@ -57,7 +57,7 @@ index 1aec3ec3debe3adfd5fda424761b559614dfdc84..4736ae957f79871cdd48ea114d77c770
speed = this.player.getAbilities().walkingSpeed * 10f;
}
+ // Paper start - Prevent moving into unloaded chunks
+ if (player.level.paperConfig().chunks.preventMovingIntoUnloadedChunks && (this.player.getX() != toX || this.player.getZ() != toZ) && !worldserver.areChunksLoadedForMove(this.player.getBoundingBox().expandTowards(new Vec3(toX, toY, toZ).subtract(this.player.position())))) {
+ if (this.player.level().paperConfig().chunks.preventMovingIntoUnloadedChunks && (this.player.getX() != toX || this.player.getZ() != toZ) && !worldserver.areChunksLoadedForMove(this.player.getBoundingBox().expandTowards(new Vec3(toX, toY, toZ).subtract(this.player.position())))) {
+ this.internalTeleport(this.player.getX(), this.player.getY(), this.player.getZ(), this.player.getYRot(), this.player.getXRot(), Collections.emptySet());
+ return;
+ }

Datei anzeigen

@ -6,7 +6,7 @@ Subject: [PATCH] Fix SpongeAbsortEvent handling
Only process drops when the block is actually going to be removed
diff --git a/src/main/java/net/minecraft/world/level/block/SpongeBlock.java b/src/main/java/net/minecraft/world/level/block/SpongeBlock.java
index 305803d54058c0bd48808d3b2dec8b474d9c2591..2bf1334ea6414557b099302f9414253ae4dba229 100644
index 305803d54058c0bd48808d3b2dec8b474d9c2591..4bce895268542531598a01a1bccd8ac1ed703b7d 100644
--- a/src/main/java/net/minecraft/world/level/block/SpongeBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/SpongeBlock.java
@@ -124,7 +124,11 @@ public class SpongeBlock extends Block {
@ -14,7 +14,7 @@ index 305803d54058c0bd48808d3b2dec8b474d9c2591..2bf1334ea6414557b099302f9414253a
BlockEntity tileentity = iblockdata.hasBlockEntity() ? world.getBlockEntity(blockposition1) : null;
+ // Paper start
+ if (block.getHandle().getMaterial() == Material.AIR) {
+ if (block.getHandle().isAir()) {
dropResources(iblockdata, world, blockposition1, tileentity);
+ }
+ // Paper end

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] offset item frame ticking
diff --git a/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java b/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java
index 760e9e96cb567861f40a0b3debb58dc867be4026..d19bf87596e574150c7ebd58c9a132363f5f1e54 100644
index 760e9e96cb567861f40a0b3debb58dc867be4026..66cf0a6cd1525ecf2615809210a26d55f445d07d 100644
--- a/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java
@@ -38,7 +38,7 @@ public abstract class HangingEntity extends Entity {
@ -13,7 +13,7 @@ index 760e9e96cb567861f40a0b3debb58dc867be4026..d19bf87596e574150c7ebd58c9a13236
return entity instanceof HangingEntity;
};
- private int checkInterval;
+ private int checkInterval; { this.checkInterval = this.getId() % this.level.spigotConfig.hangingTickFrequency; } // Paper
+ private int checkInterval; { this.checkInterval = this.getId() % this.level().spigotConfig.hangingTickFrequency; } // Paper
public BlockPos pos;
protected Direction direction;

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Bees get gravity in void. Fixes MC-167279
diff --git a/src/main/java/net/minecraft/world/entity/animal/Bee.java b/src/main/java/net/minecraft/world/entity/animal/Bee.java
index b4d5a33bfc5616d69a3570c99ea0af52397f8ffb..6fd1c49ba12fc812ca73492294b2ca66fc94c168 100644
index b4d5a33bfc5616d69a3570c99ea0af52397f8ffb..8feb4192eac41a27e683ad391503a1480c7516de 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Bee.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Bee.java
@@ -142,7 +142,22 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
@ -21,7 +21,7 @@ index b4d5a33bfc5616d69a3570c99ea0af52397f8ffb..6fd1c49ba12fc812ca73492294b2ca66
+
+ @Override
+ public void tick() {
+ if (this.mob.getY() <= Bee.this.level.getMinBuildHeight()) {
+ if (this.mob.getY() <= Bee.this.level().getMinBuildHeight()) {
+ this.mob.setNoGravity(false);
+ }
+ super.tick();

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Add option to allow iron golems to spawn in air
diff --git a/src/main/java/net/minecraft/world/entity/animal/IronGolem.java b/src/main/java/net/minecraft/world/entity/animal/IronGolem.java
index ce83fe0b68fcb229dd37fe07e5f21b52a60c32de..c0a7616b9095a2fc51fe03c28b533bf56bad83dd 100644
index ce83fe0b68fcb229dd37fe07e5f21b52a60c32de..f383928fc5b331ddf128bdcb6a23010d8fe088d3 100644
--- a/src/main/java/net/minecraft/world/entity/animal/IronGolem.java
+++ b/src/main/java/net/minecraft/world/entity/animal/IronGolem.java
@@ -325,7 +325,7 @@ public class IronGolem extends AbstractGolem implements NeutralMob {
@ -13,7 +13,7 @@ index ce83fe0b68fcb229dd37fe07e5f21b52a60c32de..c0a7616b9095a2fc51fe03c28b533bf5
BlockState iblockdata = world.getBlockState(blockposition1);
- if (!iblockdata.entityCanStandOn(world, blockposition1, this)) {
+ if (!iblockdata.entityCanStandOn(world, blockposition1, this) && !level.paperConfig().entities.spawning.ironGolemsCanSpawnInAir) { // Paper
+ if (!iblockdata.entityCanStandOn(world, blockposition1, this) && !this.level().paperConfig().entities.spawning.ironGolemsCanSpawnInAir) { // Paper
return false;
} else {
for (int i = 1; i < 3; ++i) {

Datei anzeigen

@ -8,7 +8,7 @@ This allows you to solve an issue in vanilla behavior where:
* On normal difficulty they will have a 50% of getting infected or dying.
diff --git a/src/main/java/net/minecraft/world/entity/monster/Zombie.java b/src/main/java/net/minecraft/world/entity/monster/Zombie.java
index 69c54b68b364f58a3319154cd984069dd5b6c901..9deb1acbcc334c2e7f9cf16abe02b6128032de90 100644
index fed8b065172f40a2a5c251f46303fc4d72c9653a..fae2c89900db222f7319b5675ef4b470beca251b 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Zombie.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Zombie.java
@@ -451,12 +451,16 @@ public class Zombie extends Monster {
@ -20,11 +20,11 @@ index 69c54b68b364f58a3319154cd984069dd5b6c901..9deb1acbcc334c2e7f9cf16abe02b612
-
- if (world.getDifficulty() != Difficulty.HARD && this.random.nextBoolean()) {
+ // Paper start
+ if (level.paperConfig().entities.behavior.zombieVillagerInfectionChance != 0.0 && (level.paperConfig().entities.behavior.zombieVillagerInfectionChance != -1.0 || world.getDifficulty() == Difficulty.NORMAL || world.getDifficulty() == Difficulty.HARD) && other instanceof Villager) {
+ if (level.paperConfig().entities.behavior.zombieVillagerInfectionChance == -1.0 && world.getDifficulty() != Difficulty.HARD && this.random.nextBoolean()) {
+ if (this.level().paperConfig().entities.behavior.zombieVillagerInfectionChance != 0.0 && (this.level().paperConfig().entities.behavior.zombieVillagerInfectionChance != -1.0 || world.getDifficulty() == Difficulty.NORMAL || world.getDifficulty() == Difficulty.HARD) && other instanceof Villager) {
+ if (this.level().paperConfig().entities.behavior.zombieVillagerInfectionChance == -1.0 && world.getDifficulty() != Difficulty.HARD && this.random.nextBoolean()) {
return flag;
}
+ if (level.paperConfig().entities.behavior.zombieVillagerInfectionChance != -1.0 && (this.random.nextDouble() * 100.0) > level.paperConfig().entities.behavior.zombieVillagerInfectionChance) {
+ if (this.level().paperConfig().entities.behavior.zombieVillagerInfectionChance != -1.0 && (this.random.nextDouble() * 100.0) > this.level().paperConfig().entities.behavior.zombieVillagerInfectionChance) {
+ return flag;
+ } // Paper end
+