mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-06 08:17:44 +01:00
MOOOOORE
This commit is contained in:
parent
57a91fb883
commit
d523c6211b
@ -22,4 +22,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ // Paper end - Add EntityPortalReadyEvent
|
+ // Paper end - Add EntityPortalReadyEvent
|
||||||
|
|
||||||
if (worldserver1 == null) {
|
if (worldserver1 == null) {
|
||||||
return new DimensionTransition(PlayerTeleportEvent.TeleportCause.NETHER_PORTAL); // always fire event in case plugins wish to change it
|
return new TeleportTransition(PlayerTeleportEvent.TeleportCause.NETHER_PORTAL); // always fire event in case plugins wish to change it
|
@ -68,4 +68,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ // Paper end - Call BlockFadeEvent
|
+ // Paper end - Call BlockFadeEvent
|
||||||
world.playSound(null, pos, SoundEvents.SNIFFER_EGG_HATCH, SoundSource.BLOCKS, 0.7F, 0.9F + random.nextFloat() * 0.2F);
|
world.playSound(null, pos, SoundEvents.SNIFFER_EGG_HATCH, SoundSource.BLOCKS, 0.7F, 0.9F + random.nextFloat() * 0.2F);
|
||||||
world.destroyBlock(pos, false);
|
world.destroyBlock(pos, false);
|
||||||
Sniffer sniffer = EntityType.SNIFFER.create(world);
|
Sniffer sniffer = EntityType.SNIFFER.create(world, EntitySpawnReason.BREEDING);
|
@ -27,7 +27,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/animal/Dolphin.java b/src/
|
|||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/animal/Dolphin.java
|
--- a/src/main/java/net/minecraft/world/entity/animal/Dolphin.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/animal/Dolphin.java
|
+++ b/src/main/java/net/minecraft/world/entity/animal/Dolphin.java
|
||||||
@@ -0,0 +0,0 @@ public class Dolphin extends WaterAnimal {
|
@@ -0,0 +0,0 @@ public class Dolphin extends AgeableWaterCreature {
|
||||||
float f2 = 0.02F * Dolphin.this.random.nextFloat();
|
float f2 = 0.02F * Dolphin.this.random.nextFloat();
|
||||||
|
|
||||||
entityitem.setDeltaMovement((double) (0.3F * -Mth.sin(Dolphin.this.getYRot() * 0.017453292F) * Mth.cos(Dolphin.this.getXRot() * 0.017453292F) + Mth.cos(f1) * f2), (double) (0.3F * Mth.sin(Dolphin.this.getXRot() * 0.017453292F) * 1.5F), (double) (0.3F * Mth.cos(Dolphin.this.getYRot() * 0.017453292F) * Mth.cos(Dolphin.this.getXRot() * 0.017453292F) + Mth.sin(f1) * f2));
|
entityitem.setDeltaMovement((double) (0.3F * -Mth.sin(Dolphin.this.getYRot() * 0.017453292F) * Mth.cos(Dolphin.this.getXRot() * 0.017453292F) + Mth.cos(f1) * f2), (double) (0.3F * Mth.sin(Dolphin.this.getXRot() * 0.017453292F) * 1.5F), (double) (0.3F * Mth.cos(Dolphin.this.getYRot() * 0.017453292F) * Mth.cos(Dolphin.this.getXRot() * 0.017453292F) + Mth.sin(f1) * f2));
|
||||||
@ -40,7 +40,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/animal/Fox.java b/src/main
|
|||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/animal/Fox.java
|
--- a/src/main/java/net/minecraft/world/entity/animal/Fox.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/animal/Fox.java
|
+++ b/src/main/java/net/minecraft/world/entity/animal/Fox.java
|
||||||
@@ -0,0 +0,0 @@ public class Fox extends Animal implements VariantHolder<Fox.Type> {
|
@@ -0,0 +0,0 @@ public class Fox extends Animal implements VariantHolder<Fox.Variant> {
|
||||||
entityitem.setPickUpDelay(40);
|
entityitem.setPickUpDelay(40);
|
||||||
entityitem.setThrower(this);
|
entityitem.setThrower(this);
|
||||||
this.playSound(SoundEvents.FOX_SPIT, 1.0F, 1.0F);
|
this.playSound(SoundEvents.FOX_SPIT, 1.0F, 1.0F);
|
@ -26,7 +26,7 @@ diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/mai
|
|||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
@@ -0,0 +0,0 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
@@ -0,0 +0,0 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onTickingStart(Entity entity) {
|
public void onTickingStart(Entity entity) {
|
@ -25,14 +25,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
public FallingBlockEntity(EntityType<? extends FallingBlockEntity> type, Level world) {
|
public FallingBlockEntity(EntityType<? extends FallingBlockEntity> type, Level world) {
|
||||||
super(type, world);
|
super(type, world);
|
||||||
@@ -0,0 +0,0 @@ public class FallingBlockEntity extends Entity {
|
@@ -0,0 +0,0 @@ public class FallingBlockEntity extends Entity {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.onGround() && !flag1) {
|
if (!this.onGround() && !flag1) {
|
||||||
- if (!this.level().isClientSide && (this.time > 100 && (blockposition.getY() <= this.level().getMinBuildHeight() || blockposition.getY() > this.level().getMaxBuildHeight()) || this.time > 600)) {
|
- if (this.time > 100 && (blockposition.getY() <= this.level().getMinY() || blockposition.getY() > this.level().getMaxY()) || this.time > 600) {
|
||||||
+ if (!this.level().isClientSide && ((this.time > 100 && autoExpire) && (blockposition.getY() <= this.level().getMinBuildHeight() || blockposition.getY() > this.level().getMaxBuildHeight()) || (this.time > 600 && autoExpire))) { // Paper - Expand FallingBlock API
|
+ if ((this.time > 100 && autoExpire) && (blockposition.getY() <= this.level().getMinY() || blockposition.getY() > this.level().getMaxY()) || (this.time > 600 && autoExpire)) { // Paper - Expand FallingBlock API
|
||||||
if (this.dropItem && this.level().getGameRules().getBoolean(GameRules.RULE_DOENTITYDROPS)) {
|
if (this.dropItem && worldserver.getGameRules().getBoolean(GameRules.RULE_DOENTITYDROPS)) {
|
||||||
this.spawnAtLocation((ItemLike) block);
|
this.spawnAtLocation(worldserver, (ItemLike) block);
|
||||||
}
|
}
|
||||||
@@ -0,0 +0,0 @@ public class FallingBlockEntity extends Entity {
|
@@ -0,0 +0,0 @@ public class FallingBlockEntity extends Entity {
|
||||||
}
|
}
|
||||||
|
|
@ -16,7 +16,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
- if (!LayeredCauldronBlock.changeLevel(iblockdata, world, blockposition, Blocks.WATER_CAULDRON.defaultBlockState(), entityhuman, CauldronLevelChangeEvent.ChangeReason.BOTTLE_EMPTY)) {
|
- if (!LayeredCauldronBlock.changeLevel(iblockdata, world, blockposition, Blocks.WATER_CAULDRON.defaultBlockState(), entityhuman, CauldronLevelChangeEvent.ChangeReason.BOTTLE_EMPTY)) {
|
||||||
+ if (!LayeredCauldronBlock.changeLevel(iblockdata, world, blockposition, Blocks.WATER_CAULDRON.defaultBlockState(), entityhuman, CauldronLevelChangeEvent.ChangeReason.BOTTLE_EMPTY, false)) { // Paper - Call CauldronLevelChangeEvent
|
+ if (!LayeredCauldronBlock.changeLevel(iblockdata, world, blockposition, Blocks.WATER_CAULDRON.defaultBlockState(), entityhuman, CauldronLevelChangeEvent.ChangeReason.BOTTLE_EMPTY, false)) { // Paper - Call CauldronLevelChangeEvent
|
||||||
return ItemInteractionResult.SUCCESS;
|
return InteractionResult.SUCCESS;
|
||||||
}
|
}
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
@@ -0,0 +0,0 @@ public interface CauldronInteraction {
|
@@ -0,0 +0,0 @@ public interface CauldronInteraction {
|
||||||
@ -25,7 +25,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
- if (!LayeredCauldronBlock.changeLevel(iblockdata, world, blockposition, iblockdata.cycle(LayeredCauldronBlock.LEVEL), entityhuman, CauldronLevelChangeEvent.ChangeReason.BOTTLE_EMPTY)) {
|
- if (!LayeredCauldronBlock.changeLevel(iblockdata, world, blockposition, iblockdata.cycle(LayeredCauldronBlock.LEVEL), entityhuman, CauldronLevelChangeEvent.ChangeReason.BOTTLE_EMPTY)) {
|
||||||
+ if (!LayeredCauldronBlock.changeLevel(iblockdata, world, blockposition, iblockdata.cycle(LayeredCauldronBlock.LEVEL), entityhuman, CauldronLevelChangeEvent.ChangeReason.BOTTLE_EMPTY, false)) { // Paper - Call CauldronLevelChangeEvent
|
+ if (!LayeredCauldronBlock.changeLevel(iblockdata, world, blockposition, iblockdata.cycle(LayeredCauldronBlock.LEVEL), entityhuman, CauldronLevelChangeEvent.ChangeReason.BOTTLE_EMPTY, false)) { // Paper - Call CauldronLevelChangeEvent
|
||||||
return ItemInteractionResult.SUCCESS;
|
return InteractionResult.SUCCESS;
|
||||||
}
|
}
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
@@ -0,0 +0,0 @@ public interface CauldronInteraction {
|
@@ -0,0 +0,0 @@ public interface CauldronInteraction {
|
||||||
@ -34,16 +34,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
- if (!LayeredCauldronBlock.changeLevel(state, world, pos, Blocks.CAULDRON.defaultBlockState(), player, CauldronLevelChangeEvent.ChangeReason.BUCKET_FILL)) {
|
- if (!LayeredCauldronBlock.changeLevel(state, world, pos, Blocks.CAULDRON.defaultBlockState(), player, CauldronLevelChangeEvent.ChangeReason.BUCKET_FILL)) {
|
||||||
+ if (!LayeredCauldronBlock.changeLevel(state, world, pos, Blocks.CAULDRON.defaultBlockState(), player, CauldronLevelChangeEvent.ChangeReason.BUCKET_FILL, false)) { // Paper - Call CauldronLevelChangeEvent
|
+ if (!LayeredCauldronBlock.changeLevel(state, world, pos, Blocks.CAULDRON.defaultBlockState(), player, CauldronLevelChangeEvent.ChangeReason.BUCKET_FILL, false)) { // Paper - Call CauldronLevelChangeEvent
|
||||||
return ItemInteractionResult.SUCCESS;
|
return InteractionResult.SUCCESS;
|
||||||
}
|
}
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
@@ -0,0 +0,0 @@ public interface CauldronInteraction {
|
@@ -0,0 +0,0 @@ public interface CauldronInteraction {
|
||||||
static ItemInteractionResult emptyBucket(Level world, BlockPos pos, Player player, InteractionHand hand, ItemStack stack, BlockState state, SoundEvent soundEvent) {
|
static InteractionResult emptyBucket(Level world, BlockPos pos, Player player, InteractionHand hand, ItemStack stack, BlockState state, SoundEvent soundEvent) {
|
||||||
if (!world.isClientSide) {
|
if (!world.isClientSide) {
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
- if (!LayeredCauldronBlock.changeLevel(state, world, pos, state, player, CauldronLevelChangeEvent.ChangeReason.BUCKET_EMPTY)) {
|
- if (!LayeredCauldronBlock.changeLevel(state, world, pos, state, player, CauldronLevelChangeEvent.ChangeReason.BUCKET_EMPTY)) {
|
||||||
+ if (!LayeredCauldronBlock.changeLevel(state, world, pos, state, player, CauldronLevelChangeEvent.ChangeReason.BUCKET_EMPTY, false)) { // Paper - Call CauldronLevelChangeEvent
|
+ if (!LayeredCauldronBlock.changeLevel(state, world, pos, state, player, CauldronLevelChangeEvent.ChangeReason.BUCKET_EMPTY, false)) { // Paper - Call CauldronLevelChangeEvent
|
||||||
return ItemInteractionResult.SUCCESS;
|
return InteractionResult.SUCCESS;
|
||||||
}
|
}
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/block/CauldronBlock.java b/src/main/java/net/minecraft/world/level/block/CauldronBlock.java
|
diff --git a/src/main/java/net/minecraft/world/level/block/CauldronBlock.java b/src/main/java/net/minecraft/world/level/block/CauldronBlock.java
|
@ -9,11 +9,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
--- a/src/main/java/net/minecraft/world/entity/animal/Bee.java
|
--- a/src/main/java/net/minecraft/world/entity/animal/Bee.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/animal/Bee.java
|
+++ b/src/main/java/net/minecraft/world/entity/animal/Bee.java
|
||||||
@@ -0,0 +0,0 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
|
@@ -0,0 +0,0 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
|
||||||
++this.pollinatingTicks;
|
Bee.this.dropFlower();
|
||||||
if (this.pollinatingTicks > 600) {
|
this.pollinating = false;
|
||||||
Bee.this.savedFlowerPos = null;
|
Bee.this.remainingCooldownBeforeLocatingNewFlower = 200;
|
||||||
- } else {
|
- } else {
|
||||||
+ } else if (Bee.this.savedFlowerPos != null) { // Paper - add null check since API can manipulate this
|
+ } else if (Bee.this.savedFlowerPos != null) { // Paper - add null check since API can manipulate this
|
||||||
Vec3 vec3d = Vec3.atBottomCenterOf(Bee.this.savedFlowerPos).add(0.0D, 0.6000000238418579D, 0.0D);
|
Vec3 vec3d = Vec3.atBottomCenterOf(Bee.this.savedFlowerPos).add(0.0D, 0.6000000238418579D, 0.0D);
|
||||||
|
|
||||||
if (vec3d.distanceTo(Bee.this.position()) > 1.0D) {
|
if (vec3d.distanceTo(Bee.this.position()) > 1.0D) {
|
@ -11,9 +11,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||||
}
|
}
|
||||||
// Spigot end
|
// Spigot end
|
||||||
// this.chatSpamTickCount += 20;
|
// this.chatSpamThrottler.increment();
|
||||||
- if (this.chatSpamTickCount.addAndGet(20) > 200 && !this.server.getPlayerList().isOp(this.player.getGameProfile()) && !this.server.isSingleplayerOwner(this.player.getGameProfile())) {
|
- if (!this.chatSpamThrottler.isIncrementAndUnderThreshold() && !this.server.getPlayerList().isOp(this.player.getGameProfile()) && !this.server.isSingleplayerOwner(this.player.getGameProfile())) {
|
||||||
+ if (counted && this.chatSpamTickCount.addAndGet(20) > 200 && !this.server.getPlayerList().isOp(this.player.getGameProfile()) && !this.server.isSingleplayerOwner(this.player.getGameProfile())) { // Paper - exclude from SpigotConfig.spamExclusions
|
+ if (counted && !this.chatSpamThrottler.isIncrementAndUnderThreshold() && !this.server.getPlayerList().isOp(this.player.getGameProfile()) && !this.server.isSingleplayerOwner(this.player.getGameProfile())) { // Paper - exclude from SpigotConfig.spamExclusions
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
this.disconnect((Component) Component.translatable("disconnect.spam"), org.bukkit.event.player.PlayerKickEvent.Cause.SPAM); // Paper - kick event cause
|
this.disconnect((Component) Component.translatable("disconnect.spam"), org.bukkit.event.player.PlayerKickEvent.Cause.SPAM); // Paper - kick event cause
|
||||||
}
|
}
|
@ -25,7 +25,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
if (blocks.size() > 1) {
|
if (blocks.size() > 1) {
|
||||||
placeEvent = org.bukkit.craftbukkit.event.CraftEventFactory.callBlockMultiPlaceEvent(world, entityhuman, enumhand, blocks, blockposition.getX(), blockposition.getY(), blockposition.getZ());
|
placeEvent = org.bukkit.craftbukkit.event.CraftEventFactory.callBlockMultiPlaceEvent(world, entityhuman, enumhand, blocks, blockposition.getX(), blockposition.getY(), blockposition.getZ());
|
||||||
- } else if (blocks.size() == 1) {
|
- } else if (blocks.size() == 1) {
|
||||||
+ } else if (blocks.size() == 1 && item != Items.POWDER_SNOW_BUCKET) { // Paper - Fix cancelled powdered snow bucket placement
|
+ } else if (blocks.size() == 1 && item != Items.POWDER_SNOW_BUCKET) { // Paper - Fix cancelled powdered snow bucket placement
|
||||||
placeEvent = org.bukkit.craftbukkit.event.CraftEventFactory.callBlockPlaceEvent(world, entityhuman, enumhand, blocks.get(0), blockposition.getX(), blockposition.getY(), blockposition.getZ());
|
placeEvent = org.bukkit.craftbukkit.event.CraftEventFactory.callBlockPlaceEvent(world, entityhuman, enumhand, blocks.get(0), blockposition.getX(), blockposition.getY(), blockposition.getZ());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,19 +14,19 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||||
@@ -0,0 +0,0 @@ public abstract class PlayerList {
|
@@ -0,0 +0,0 @@ public abstract class PlayerList {
|
||||||
this.registries = registryManager;
|
}
|
||||||
this.maxPlayers = maxPlayers;
|
// Paper end - Configurable player collision
|
||||||
this.playerIo = saveHandler;
|
PlayerList.LOGGER.info("{}[{}] logged in with entity id {} at ([{}]{}, {}, {})", player.getName().getString(), s1, player.getId(), worldserver1.serverLevelData.getLevelName(), player.getX(), player.getY(), player.getZ());
|
||||||
+ // Paper start - Send empty chunk, so players aren't stuck in the world loading screen with our chunk system not sending chunks when dead
|
+ // Paper start - Send empty chunk, so players aren't stuck in the world loading screen with our chunk system not sending chunks when dead
|
||||||
+ if (player.isDeadOrDying()) {
|
+ if (player.isDeadOrDying()) {
|
||||||
+ net.minecraft.core.Holder<net.minecraft.world.level.biome.Biome> plains = worldserver1.registryAccess().registryOrThrow(net.minecraft.core.registries.Registries.BIOME)
|
+ net.minecraft.core.Holder<net.minecraft.world.level.biome.Biome> plains = worldserver1.registryAccess().lookupOrThrow(net.minecraft.core.registries.Registries.BIOME)
|
||||||
+ .getHolderOrThrow(net.minecraft.world.level.biome.Biomes.PLAINS);
|
+ .getHolderOrThrow(net.minecraft.world.level.biome.Biomes.PLAINS);
|
||||||
+ player.connection.send(new net.minecraft.network.protocol.game.ClientboundLevelChunkWithLightPacket(
|
+ player.connection.send(new net.minecraft.network.protocol.game.ClientboundLevelChunkWithLightPacket(
|
||||||
+ new net.minecraft.world.level.chunk.EmptyLevelChunk(worldserver1, player.chunkPosition(), plains),
|
+ new net.minecraft.world.level.chunk.EmptyLevelChunk(worldserver1, player.chunkPosition(), plains),
|
||||||
+ worldserver1.getLightEngine(), (java.util.BitSet)null, (java.util.BitSet) null)
|
+ worldserver1.getLightEngine(), (java.util.BitSet)null, (java.util.BitSet) null)
|
||||||
+ );
|
+ );
|
||||||
+ }
|
+ }
|
||||||
+ // Paper end - Send empty chunk
|
+ // Paper end - Send empty chunk
|
||||||
}
|
}
|
||||||
abstract public void loadAndSaveFiles(); // Paper - fix converting txt to json file; moved from DedicatedPlayerList constructor
|
|
||||||
|
|
||||||
|
public void updateEntireScoreboard(ServerScoreboard scoreboard, ServerPlayer player) {
|
||||||
|
@ -26,8 +26,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
- set = Collections.emptySet(); // Can't relative teleport
|
- set = Collections.emptySet(); // Can't relative teleport
|
||||||
+ // set = Collections.emptySet(); // Can't relative teleport // Paper - Teleport API; Now you can!
|
+ // set = Collections.emptySet(); // Can't relative teleport // Paper - Teleport API; Now you can!
|
||||||
to = event.isCancelled() ? event.getFrom() : event.getTo();
|
to = event.isCancelled() ? event.getFrom() : event.getTo();
|
||||||
d0 = to.getX();
|
positionmoverotation = new PositionMoveRotation(CraftLocation.toVec3D(to), Vec3.ZERO, to.getYaw(), to.getPitch());
|
||||||
d1 = to.getY();
|
}
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
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
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
@ -10,7 +10,7 @@ diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/mai
|
|||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
@@ -0,0 +0,0 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
@@ -0,0 +0,0 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||||
// WorldServer.LOGGER.warn("Tried to add entity {} but it was marked as removed already", EntityTypes.getKey(entity.getType())); // CraftBukkit
|
// WorldServer.LOGGER.warn("Tried to add entity {} but it was marked as removed already", EntityTypes.getKey(entity.getType())); // CraftBukkit
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
@ -9,9 +9,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
@@ -0,0 +0,0 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
@@ -0,0 +0,0 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||||
|
ProfilerFiller gameprofilerfiller = Profiler.get();
|
||||||
|
|
||||||
public void baseTick() {
|
gameprofilerfiller.push("entityBaseTick");
|
||||||
this.level().getProfiler().push("entityBaseTick");
|
|
||||||
+ if (firstTick && this instanceof net.minecraft.world.entity.NeutralMob neutralMob) neutralMob.tickInitialPersistentAnger(level); // Paper - Prevent entity loading causing async lookups
|
+ if (firstTick && this instanceof net.minecraft.world.entity.NeutralMob neutralMob) neutralMob.tickInitialPersistentAnger(level); // Paper - Prevent entity loading causing async lookups
|
||||||
this.inBlockState = null;
|
this.inBlockState = null;
|
||||||
if (this.isPassenger() && this.getVehicle().isRemoved()) {
|
if (this.isPassenger() && this.getVehicle().isRemoved()) {
|
@ -68,7 +68,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ this.player.gameMode.capturedBlockEntity = false;
|
+ this.player.gameMode.capturedBlockEntity = false;
|
||||||
+ this.player.gameMode.captureSentBlockEntities = true;
|
+ this.player.gameMode.captureSentBlockEntities = true;
|
||||||
+ // Paper end - Send block entities after destroy prediction
|
+ // Paper end - Send block entities after destroy prediction
|
||||||
this.player.gameMode.handleBlockBreakAction(blockposition, packetplayinblockdig_enumplayerdigtype, packet.getDirection(), this.player.level().getMaxBuildHeight(), packet.getSequence());
|
this.player.gameMode.handleBlockBreakAction(blockposition, packetplayinblockdig_enumplayerdigtype, packet.getDirection(), this.player.level().getMaxY(), packet.getSequence());
|
||||||
this.player.connection.ackBlockChangesUpTo(packet.getSequence());
|
this.player.connection.ackBlockChangesUpTo(packet.getSequence());
|
||||||
+ // Paper start - Send block entities after destroy prediction
|
+ // Paper start - Send block entities after destroy prediction
|
||||||
+ this.player.gameMode.captureSentBlockEntities = false;
|
+ this.player.gameMode.captureSentBlockEntities = false;
|
@ -21,7 +21,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
this.getFunctions().tick();
|
this.getFunctions().tick();
|
||||||
MinecraftTimings.commandFunctionsTimer.stopTiming(); // Spigot // Paper
|
MinecraftTimings.commandFunctionsTimer.stopTiming(); // Spigot // Paper
|
||||||
this.profiler.popPush("levels");
|
gameprofilerfiller.popPush("levels");
|
||||||
- Iterator iterator = this.getAllLevels().iterator();
|
- Iterator iterator = this.getAllLevels().iterator();
|
||||||
+ //Iterator iterator = this.getAllLevels().iterator(); // Paper - Throw exception on world create while being ticked; moved down
|
+ //Iterator iterator = this.getAllLevels().iterator(); // Paper - Throw exception on world create while being ticked; moved down
|
||||||
|
|
||||||
@ -37,12 +37,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
ServerLevel worldserver = (ServerLevel) iterator.next();
|
ServerLevel worldserver = (ServerLevel) iterator.next();
|
||||||
worldserver.hasPhysicsEvent = org.bukkit.event.block.BlockPhysicsEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper - BlockPhysicsEvent
|
worldserver.hasPhysicsEvent = org.bukkit.event.block.BlockPhysicsEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper - BlockPhysicsEvent
|
||||||
@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
this.profiler.pop();
|
gameprofilerfiller.pop();
|
||||||
worldserver.explosionDensityCache.clear(); // Paper - Optimize explosions
|
gameprofilerfiller.pop();
|
||||||
}
|
}
|
||||||
+ this.isIteratingOverLevels = false; // Paper - Throw exception on world create while being ticked
|
+ this.isIteratingOverLevels = false; // Paper - Throw exception on world create while being ticked
|
||||||
|
|
||||||
this.profiler.popPush("connection");
|
gameprofilerfiller.popPush("connection");
|
||||||
MinecraftTimings.connectionTimer.startTiming(); // Spigot // Paper
|
MinecraftTimings.connectionTimer.startTiming(); // Spigot // Paper
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
@ -11,22 +11,22 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
--- a/src/main/java/net/minecraft/world/level/block/LayeredCauldronBlock.java
|
--- a/src/main/java/net/minecraft/world/level/block/LayeredCauldronBlock.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/block/LayeredCauldronBlock.java
|
+++ b/src/main/java/net/minecraft/world/level/block/LayeredCauldronBlock.java
|
||||||
@@ -0,0 +0,0 @@ public class LayeredCauldronBlock extends AbstractCauldronBlock {
|
@@ -0,0 +0,0 @@ public class LayeredCauldronBlock extends AbstractCauldronBlock {
|
||||||
if (!world.isClientSide && entity.isOnFire() && this.isEntityInsideContent(state, pos, entity)) {
|
// CraftBukkit start - moved down
|
||||||
// CraftBukkit start
|
// entity.clearFire();
|
||||||
if (entity.mayInteract(world, pos)) {
|
if (entity.mayInteract(worldserver, pos)) {
|
||||||
- if (!LayeredCauldronBlock.lowerFillLevel(state, world, pos, entity, CauldronLevelChangeEvent.ChangeReason.EXTINGUISH)) {
|
- if (this.handleEntityOnFireInside(state, world, pos, entity)) {
|
||||||
+ if (!this.handleEntityOnFireInsideWithEvent(state, world, pos, entity)) { // Paper - fix powdered snow cauldron extinguishing entities
|
+ if (this.handleEntityOnFireInsideWithEvent(state, world, pos, entity)) { // Paper - fix powdered snow cauldron extinguishing entities
|
||||||
return;
|
entity.clearFire();
|
||||||
}
|
}
|
||||||
}
|
// CraftBukkit end
|
||||||
@@ -0,0 +0,0 @@ public class LayeredCauldronBlock extends AbstractCauldronBlock {
|
@@ -0,0 +0,0 @@ public class LayeredCauldronBlock extends AbstractCauldronBlock {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// CraftBukkit start
|
||||||
+ @io.papermc.paper.annotation.DoNotUse @Deprecated // Paper - fix powdered snow cauldron extinguishing entities; use #handleEntityOnFireInsideWithEvent
|
+ @io.papermc.paper.annotation.DoNotUse @Deprecated // Paper - fix powdered snow cauldron extinguishing entities; use #handleEntityOnFireInsideWithEvent
|
||||||
private void handleEntityOnFireInside(BlockState state, Level world, BlockPos pos) {
|
private boolean handleEntityOnFireInside(BlockState iblockdata, Level world, BlockPos blockposition, Entity entity) {
|
||||||
if (this.precipitationType == Biome.Precipitation.SNOW) {
|
if (this.precipitationType == Biome.Precipitation.SNOW) {
|
||||||
LayeredCauldronBlock.lowerFillLevel((BlockState) Blocks.WATER_CAULDRON.defaultBlockState().setValue(LayeredCauldronBlock.LEVEL, (Integer) state.getValue(LayeredCauldronBlock.LEVEL)), world, pos);
|
return LayeredCauldronBlock.lowerFillLevel((BlockState) Blocks.WATER_CAULDRON.defaultBlockState().setValue(LayeredCauldronBlock.LEVEL, (Integer) iblockdata.getValue(LayeredCauldronBlock.LEVEL)), world, blockposition, entity, CauldronLevelChangeEvent.ChangeReason.EXTINGUISH);
|
||||||
@@ -0,0 +0,0 @@ public class LayeredCauldronBlock extends AbstractCauldronBlock {
|
@@ -0,0 +0,0 @@ public class LayeredCauldronBlock extends AbstractCauldronBlock {
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user