/net/minecraft/world/entity/monster

Some blocks

LayeredCauldronBlock.java.patch has strange diff-- the comment seems to be a red herring.

net/minecraft/network/protocol/login/
This commit is contained in:
Owen1212055
2025-05-29 16:56:28 -04:00
parent d251511d35
commit 62c4dda5f4
10 changed files with 141 additions and 192 deletions

View File

@@ -1,29 +0,0 @@
From 09671551669244ef4f259d8b27547e463d6795d4 Mon Sep 17 00:00:00 2001
From: File <noreply+automated@papermc.io>
Date: Sun, 20 Apr 1997 15:37:42 +0200
Subject: [PATCH] paper File Patches
diff --git a/net/minecraft/network/protocol/login/ClientboundLoginDisconnectPacket.java b/net/minecraft/network/protocol/login/ClientboundLoginDisconnectPacket.java
index f14ca3e8f1bdcec8f8a00f4ca62bc37223764ff2..549ea1ca4824c39bcd32321f4c404c1ff4203777 100644
--- a/net/minecraft/network/protocol/login/ClientboundLoginDisconnectPacket.java
+++ b/net/minecraft/network/protocol/login/ClientboundLoginDisconnectPacket.java
@@ -18,11 +18,16 @@ public class ClientboundLoginDisconnectPacket implements Packet<ClientLoginPacke
}
private ClientboundLoginDisconnectPacket(FriendlyByteBuf buffer) {
- this.reason = Component.Serializer.fromJsonLenient(buffer.readUtf(262144), RegistryAccess.EMPTY);
+ this.reason = Component.Serializer.fromJsonLenient(buffer.readUtf(FriendlyByteBuf.MAX_COMPONENT_STRING_LENGTH), RegistryAccess.EMPTY); // Paper - diff on change
}
private void write(FriendlyByteBuf buffer) {
- buffer.writeUtf(Component.Serializer.toJson(this.reason, RegistryAccess.EMPTY));
+ // Paper start - Adventure
+ // buffer.writeUtf(Component.Serializer.toJson(this.reason, RegistryAccess.EMPTY));
+ // In the login phase, buffer.adventure$locale field is most likely null, but plugins may use internals to set it via the channel attribute
+ java.util.Locale bufLocale = buffer.adventure$locale;
+ buffer.writeJsonWithCodec(net.minecraft.network.chat.ComponentSerialization.localizedCodec(bufLocale == null ? java.util.Locale.US : bufLocale), this.reason, FriendlyByteBuf.MAX_COMPONENT_STRING_LENGTH);
+ // Paper end - Adventure
}
@Override

View File

@@ -1,63 +0,0 @@
From 09671551669244ef4f259d8b27547e463d6795d4 Mon Sep 17 00:00:00 2001
From: File <noreply+automated@papermc.io>
Date: Sun, 20 Apr 1997 15:37:42 +0200
Subject: [PATCH] paper File Patches
diff --git a/net/minecraft/world/entity/monster/Phantom.java b/net/minecraft/world/entity/monster/Phantom.java
index 0d11c55e826fc4b69ba63585dc28be5147d07031..483b0499f1f70b3aa8862e6cd8e512748492bee0 100644
--- a/net/minecraft/world/entity/monster/Phantom.java
+++ b/net/minecraft/world/entity/monster/Phantom.java
@@ -48,6 +48,11 @@ public class Phantom extends FlyingMob implements Enemy {
@Nullable
public BlockPos anchorPoint;
Phantom.AttackPhase attackPhase = Phantom.AttackPhase.CIRCLE;
+ // Paper start
+ @Nullable
+ public java.util.UUID spawningEntity;
+ public boolean shouldBurnInDay = true;
+ // Paper end
public Phantom(EntityType<? extends Phantom> entityType, Level level) {
super(entityType, level);
@@ -142,7 +147,7 @@ public class Phantom extends FlyingMob implements Enemy {
@Override
public void aiStep() {
- if (this.isAlive() && this.isSunBurnTick()) {
+ if (this.isAlive() && this.shouldBurnInDay && this.isSunBurnTick()) { // Paper - shouldBurnInDay API
this.igniteForSeconds(8.0F);
}
@@ -163,6 +168,10 @@ public class Phantom extends FlyingMob implements Enemy {
super.readAdditionalSaveData(compound);
this.anchorPoint = compound.read("anchor_pos", BlockPos.CODEC).orElse(null);
this.setPhantomSize(compound.getIntOr("size", 0));
+ // Paper start
+ this.spawningEntity = compound.read("Paper.SpawningEntity", net.minecraft.core.UUIDUtil.CODEC).orElse(null);
+ this.shouldBurnInDay = compound.getBooleanOr("Paper.ShouldBurnInDay", true);
+ // Paper end
}
@Override
@@ -170,6 +179,10 @@ public class Phantom extends FlyingMob implements Enemy {
super.addAdditionalSaveData(compound);
compound.storeNullable("anchor_pos", BlockPos.CODEC, this.anchorPoint);
compound.putInt("size", this.getPhantomSize());
+ // Paper start
+ compound.storeNullable("Paper.SpawningEntity", net.minecraft.core.UUIDUtil.CODEC, this.spawningEntity);
+ compound.putBoolean("Paper.ShouldBurnInDay", this.shouldBurnInDay);
+ // Paper end
}
@Override
@@ -243,7 +256,8 @@ public class Phantom extends FlyingMob implements Enemy {
for (Player player : nearbyPlayers) {
if (Phantom.this.canAttack(serverLevel, player, TargetingConditions.DEFAULT)) {
- Phantom.this.setTarget(player);
+ if (!level().paperConfig().entities.behavior.phantomsOnlyAttackInsomniacs || EntitySelector.IS_INSOMNIAC.test(player)) // Paper - Add phantom creative and insomniac controls
+ Phantom.this.setTarget(player, org.bukkit.event.entity.EntityTargetEvent.TargetReason.CLOSEST_PLAYER); // CraftBukkit - reason
return true;
}
}

View File

@@ -1,23 +0,0 @@
From 09671551669244ef4f259d8b27547e463d6795d4 Mon Sep 17 00:00:00 2001
From: File <noreply+automated@papermc.io>
Date: Sun, 20 Apr 1997 15:37:42 +0200
Subject: [PATCH] paper File Patches
diff --git a/net/minecraft/world/level/block/LavaCauldronBlock.java b/net/minecraft/world/level/block/LavaCauldronBlock.java
index fc5ef2c2cf2a2a373645ba8b8d8f9c8c6062ef13..81867acc1af474df1b221cbd3854316030032049 100644
--- a/net/minecraft/world/level/block/LavaCauldronBlock.java
+++ b/net/minecraft/world/level/block/LavaCauldronBlock.java
@@ -33,9 +33,10 @@ public class LavaCauldronBlock extends AbstractCauldronBlock {
@Override
protected void entityInside(BlockState state, Level level, BlockPos pos, Entity entity, InsideBlockEffectApplier effectApplier) {
+ if (!new io.papermc.paper.event.entity.EntityInsideBlockEvent(entity.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(level, pos)).callEvent()) { return; } // Paper - Add EntityInsideBlockEvent
if (this.isEntityInsideContent(state, pos, entity)) {
- entity.lavaIgnite();
- entity.lavaHurt();
+ entity.lavaIgnite(pos); // Paper - track lava contact
+ entity.lavaHurt(pos); // Paper - track lava contact
}
}

View File

@@ -0,0 +1,30 @@
--- a/net/minecraft/network/protocol/login/ClientboundLoginDisconnectPacket.java
+++ b/net/minecraft/network/protocol/login/ClientboundLoginDisconnectPacket.java
@@ -14,8 +_,25 @@
public record ClientboundLoginDisconnectPacket(Component reason) implements Packet<ClientLoginPacketListener> {
private static final RegistryOps<JsonElement> OPS = RegistryAccess.EMPTY.createSerializationContext(JsonOps.INSTANCE);
- public static final StreamCodec<ByteBuf, ClientboundLoginDisconnectPacket> STREAM_CODEC = StreamCodec.composite(
- ByteBufCodecs.lenientJson(262144).apply(ByteBufCodecs.fromCodec(OPS, ComponentSerialization.CODEC)),
+ // Paper start - localized codec
+ // In the login phase, buffer.adventure$locale field is most likely null, but plugins may use internals to set it via the channel attribute
+ public static final StreamCodec<net.minecraft.network.FriendlyByteBuf, ClientboundLoginDisconnectPacket> STREAM_CODEC = StreamCodec.composite(
+ new net.minecraft.network.codec.StreamCodec<>() {
+
+ private static final net.minecraft.network.codec.StreamCodec<io.netty.buffer.ByteBuf, com.google.gson.JsonElement> LENIENT_JSON = net.minecraft.network.codec.ByteBufCodecs.lenientJson(net.minecraft.network.FriendlyByteBuf.MAX_COMPONENT_STRING_LENGTH);
+ @Override
+ public net.minecraft.network.chat.Component decode(final net.minecraft.network.FriendlyByteBuf buffer) {
+ java.util.Locale bufLocale = buffer.adventure$locale;
+ return LENIENT_JSON.apply(ByteBufCodecs.fromCodec(OPS, net.minecraft.network.chat.ComponentSerialization.localizedCodec(bufLocale == null ? java.util.Locale.US : bufLocale))).decode(buffer);
+ }
+
+ @Override
+ public void encode(final net.minecraft.network.FriendlyByteBuf buffer, final net.minecraft.network.chat.Component value) {
+ java.util.Locale bufLocale = buffer.adventure$locale;
+ LENIENT_JSON.apply(ByteBufCodecs.fromCodec(OPS, net.minecraft.network.chat.ComponentSerialization.localizedCodec(bufLocale == null ? java.util.Locale.US : bufLocale))).encode(buffer, value);
+ }
+ },
+ // Paper end - localized codec
ClientboundLoginDisconnectPacket::reason,
ClientboundLoginDisconnectPacket::new
);

View File

@@ -0,0 +1,55 @@
--- a/net/minecraft/world/entity/monster/Phantom.java
+++ b/net/minecraft/world/entity/monster/Phantom.java
@@ -49,6 +_,11 @@
@Nullable
public BlockPos anchorPoint;
Phantom.AttackPhase attackPhase = Phantom.AttackPhase.CIRCLE;
+ // Paper start
+ @Nullable
+ public java.util.UUID spawningEntity;
+ public boolean shouldBurnInDay = true;
+ // Paper end
public Phantom(EntityType<? extends Phantom> entityType, Level level) {
super(entityType, level);
@@ -143,7 +_,7 @@
@Override
public void aiStep() {
- if (this.isAlive() && this.isSunBurnTick()) {
+ if (this.isAlive() && this.shouldBurnInDay && this.isSunBurnTick()) { // Paper - shouldBurnInDay API
this.igniteForSeconds(8.0F);
}
@@ -178,6 +_,10 @@
super.readAdditionalSaveData(input);
this.anchorPoint = input.read("anchor_pos", BlockPos.CODEC).orElse(null);
this.setPhantomSize(input.getIntOr("size", 0));
+ // Paper start
+ this.spawningEntity = input.read("Paper.SpawningEntity", net.minecraft.core.UUIDUtil.CODEC).orElse(null);
+ this.shouldBurnInDay = input.getBooleanOr("Paper.ShouldBurnInDay", true);
+ // Paper end
}
@Override
@@ -185,6 +_,10 @@
super.addAdditionalSaveData(output);
output.storeNullable("anchor_pos", BlockPos.CODEC, this.anchorPoint);
output.putInt("size", this.getPhantomSize());
+ // Paper start
+ output.storeNullable("Paper.SpawningEntity", net.minecraft.core.UUIDUtil.CODEC, this.spawningEntity);
+ output.putBoolean("Paper.ShouldBurnInDay", this.shouldBurnInDay);
+ // Paper end
}
@Override
@@ -258,7 +_,8 @@
for (Player player : nearbyPlayers) {
if (Phantom.this.canAttack(serverLevel, player, TargetingConditions.DEFAULT)) {
- Phantom.this.setTarget(player);
+ if (!level().paperConfig().entities.behavior.phantomsOnlyAttackInsomniacs || EntitySelector.IS_INSOMNIAC.test(player)) // Paper - Add phantom creative and insomniac controls
+ Phantom.this.setTarget(player, org.bukkit.event.entity.EntityTargetEvent.TargetReason.CLOSEST_PLAYER); // CraftBukkit - reason
return true;
}
}

View File

@@ -1,14 +1,6 @@
From 09671551669244ef4f259d8b27547e463d6795d4 Mon Sep 17 00:00:00 2001
From: File <noreply+automated@papermc.io>
Date: Sun, 20 Apr 1997 15:37:42 +0200
Subject: [PATCH] paper File Patches
diff --git a/net/minecraft/world/entity/monster/ZombieVillager.java b/net/minecraft/world/entity/monster/ZombieVillager.java
index 39ea7415cb280ae22465e3eb7ab3983e182ebaa7..a8cd7103e636b57be1270d0f3549c709330b5536 100644
--- a/net/minecraft/world/entity/monster/ZombieVillager.java
+++ b/net/minecraft/world/entity/monster/ZombieVillager.java
@@ -160,12 +160,20 @@ public class ZombieVillager extends Zombie implements VillagerDataHolder {
@@ -159,12 +_,20 @@
}
public void startConverting(@Nullable UUID conversionStarter, int villagerConversionTime) {
@@ -32,7 +24,7 @@ index 39ea7415cb280ae22465e3eb7ab3983e182ebaa7..a8cd7103e636b57be1270d0f3549c709
}
@Override
@@ -190,7 +198,7 @@ public class ZombieVillager extends Zombie implements VillagerDataHolder {
@@ -189,7 +_,7 @@
}
private void finishConversion(ServerLevel level) {
@@ -40,21 +32,21 @@ index 39ea7415cb280ae22465e3eb7ab3983e182ebaa7..a8cd7103e636b57be1270d0f3549c709
+ Villager converted = this.convertTo( // CraftBukkit
EntityType.VILLAGER,
ConversionParams.single(this, false, false),
villager -> {
@@ -214,19 +222,24 @@ public class ZombieVillager extends Zombie implements VillagerDataHolder {
villager.finalizeSpawn(level, level.getCurrentDifficultyAt(villager.blockPosition()), EntitySpawnReason.CONVERSION, null);
villager.refreshBrain(level);
mob -> {
@@ -213,19 +_,24 @@
mob.finalizeSpawn(level, level.getCurrentDifficultyAt(mob.blockPosition()), EntitySpawnReason.CONVERSION, null);
mob.refreshBrain(level);
if (this.conversionStarter != null) {
- Player playerByUuid = level.getPlayerByUUID(this.conversionStarter);
+ Player playerByUuid = level.getGlobalPlayerByUUID(this.conversionStarter); // Paper - check global player list where appropriate
if (playerByUuid instanceof ServerPlayer) {
CriteriaTriggers.CURED_ZOMBIE_VILLAGER.trigger((ServerPlayer)playerByUuid, this, villager);
level.onReputationEvent(ReputationEventType.ZOMBIE_VILLAGER_CURED, playerByUuid, villager);
CriteriaTriggers.CURED_ZOMBIE_VILLAGER.trigger((ServerPlayer)playerByUuid, this, mob);
level.onReputationEvent(ReputationEventType.ZOMBIE_VILLAGER_CURED, playerByUuid, mob);
}
}
- villager.addEffect(new MobEffectInstance(MobEffects.NAUSEA, 200, 0));
+ villager.addEffect(new MobEffectInstance(MobEffects.NAUSEA, 200, 0), org.bukkit.event.entity.EntityPotionEffectEvent.Cause.CONVERSION); // CraftBukkit
- mob.addEffect(new MobEffectInstance(MobEffects.NAUSEA, 200, 0));
+ mob.addEffect(new MobEffectInstance(MobEffects.NAUSEA, 200, 0), org.bukkit.event.entity.EntityPotionEffectEvent.Cause.CONVERSION); // CraftBukkit
if (!this.isSilent()) {
level.levelEvent(null, 1027, this.blockPosition(), 0);
}

View File

@@ -0,0 +1,10 @@
--- a/net/minecraft/world/level/block/LavaCauldronBlock.java
+++ b/net/minecraft/world/level/block/LavaCauldronBlock.java
@@ -44,6 +_,7 @@
@Override
protected void entityInside(BlockState state, Level level, BlockPos pos, Entity entity, InsideBlockEffectApplier effectApplier) {
+ if (!new io.papermc.paper.event.entity.EntityInsideBlockEvent(entity.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(level, pos)).callEvent()) { return; } // Paper - Add EntityInsideBlockEvent
effectApplier.apply(InsideBlockEffectType.LAVA_IGNITE);
effectApplier.runAfter(InsideBlockEffectType.LAVA_IGNITE, Entity::lavaHurt);
}

View File

@@ -1,31 +1,23 @@
From 09671551669244ef4f259d8b27547e463d6795d4 Mon Sep 17 00:00:00 2001
From: File <noreply+automated@papermc.io>
Date: Sun, 20 Apr 1997 15:37:42 +0200
Subject: [PATCH] paper File Patches
diff --git a/net/minecraft/world/level/block/LayeredCauldronBlock.java b/net/minecraft/world/level/block/LayeredCauldronBlock.java
index 81c06eb72424cdb8c80337b531ce33fd4f17b785..0dce5f44bf809317ad42d246d1a9555594b272ee 100644
--- a/net/minecraft/world/level/block/LayeredCauldronBlock.java
+++ b/net/minecraft/world/level/block/LayeredCauldronBlock.java
@@ -62,35 +62,67 @@ public class LayeredCauldronBlock extends AbstractCauldronBlock {
@@ -79,39 +_,67 @@
@Override
protected void entityInside(BlockState state, Level level, BlockPos pos, Entity entity, InsideBlockEffectApplier effectApplier) {
+ if (!new io.papermc.paper.event.entity.EntityInsideBlockEvent(entity.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(level, pos)).callEvent()) { return; } // Paper - Add EntityInsideBlockEvent
if (level instanceof ServerLevel serverLevel && entity.isOnFire() && this.isEntityInsideContent(state, pos, entity)) {
- entity.clearFire();
- if (entity.mayInteract(serverLevel, pos)) {
- this.handleEntityOnFireInside(state, level, pos);
+ // CraftBukkit start - moved down
+ // entity.clearFire();
+ if ((entity instanceof net.minecraft.world.entity.player.Player || serverLevel.getGameRules().getBoolean(net.minecraft.world.level.GameRules.RULE_MOBGRIEFING)) && entity.mayInteract(serverLevel, pos)) { // Paper - Fixes MC-248588
+ if (this.handleEntityOnFireInside(state, level, pos, entity)) { // Paper - fix powdered snow cauldron extinguishing entities
+ entity.clearFire();
+ }
+ // CraftBukkit end
}
if (level instanceof ServerLevel serverLevel) {
BlockPos blockPos = pos.immutable();
effectApplier.runBefore(InsideBlockEffectType.EXTINGUISH, entity1 -> {
- if (entity1.isOnFire() && entity1.mayInteract(serverLevel, blockPos)) {
- this.handleEntityOnFireInside(state, level, blockPos);
+ if (entity1.isOnFire() && (entity instanceof net.minecraft.world.entity.player.Player || serverLevel.getGameRules().getBoolean(net.minecraft.world.level.GameRules.RULE_MOBGRIEFING)) && entity1.mayInteract(serverLevel, blockPos)) { // Paper - Fixes MC-248588
+ this.handleEntityOnFireInside(state, level, blockPos, entity); // Paper - Track entity
}
});
}
- effectApplier.apply(InsideBlockEffectType.EXTINGUISH);
+ effectApplier.apply(InsideBlockEffectType.EXTINGUISH); // TODO: THE EVENT ???????????????????????????????????
}
- private void handleEntityOnFireInside(BlockState state, Level level, BlockPos pos) {
@@ -50,14 +42,15 @@ index 81c06eb72424cdb8c80337b531ce33fd4f17b785..0dce5f44bf809317ad42d246d1a95555
BlockState blockState = i == 0 ? Blocks.CAULDRON.defaultBlockState() : state.setValue(LEVEL, i);
- level.setBlockAndUpdate(pos, blockState);
- level.gameEvent(GameEvent.BLOCK_CHANGE, pos, GameEvent.Context.of(blockState));
- }
+ return changeLevel(level, pos, blockState, entity, reason); // Paper
+ }
+ // CraftBukkit start
+ // Paper start - Call CauldronLevelChangeEvent
+ public static boolean changeLevel(Level level, BlockPos pos, BlockState newBlock, @javax.annotation.Nullable Entity entity, org.bukkit.event.block.CauldronLevelChangeEvent.ChangeReason reason) { // Paper - entity is nullable
+ return changeLevel(level, pos, newBlock, entity, reason, true);
}
+ }
+
+ public static boolean changeLevel(Level level, BlockPos pos, BlockState newBlock, @javax.annotation.Nullable Entity entity, org.bukkit.event.block.CauldronLevelChangeEvent.ChangeReason reason, boolean sendGameEvent) { // Paper - entity is nullable
+ // Paper end - Call CauldronLevelChangeEvent
+ org.bukkit.craftbukkit.block.CraftBlockState newState = org.bukkit.craftbukkit.block.CraftBlockStates.getBlockState(level, pos);
@@ -75,7 +68,7 @@ index 81c06eb72424cdb8c80337b531ce33fd4f17b785..0dce5f44bf809317ad42d246d1a95555
+ return true;
+ }
+ // CraftBukkit end
+
@Override
public void handlePrecipitation(BlockState state, Level level, BlockPos pos, Biome.Precipitation precipitation) {
if (CauldronBlock.shouldHandlePrecipitation(level, precipitation) && state.getValue(LEVEL) != 3 && precipitation == this.precipitationType) {
@@ -86,7 +79,7 @@ index 81c06eb72424cdb8c80337b531ce33fd4f17b785..0dce5f44bf809317ad42d246d1a95555
}
}
@@ -108,8 +140,11 @@ public class LayeredCauldronBlock extends AbstractCauldronBlock {
@@ -129,8 +_,11 @@
protected void receiveStalactiteDrip(BlockState state, Level level, BlockPos pos, Fluid fluid) {
if (!this.isFull(state)) {
BlockState blockState = state.setValue(LEVEL, state.getValue(LEVEL) + 1);

View File

@@ -1,14 +1,6 @@
From 09671551669244ef4f259d8b27547e463d6795d4 Mon Sep 17 00:00:00 2001
From: File <noreply+automated@papermc.io>
Date: Sun, 20 Apr 1997 15:37:42 +0200
Subject: [PATCH] paper File Patches
diff --git a/net/minecraft/world/level/block/SculkSpreader.java b/net/minecraft/world/level/block/SculkSpreader.java
index 174592afa95942b2537bd42b0e80ac9028f152f1..416d877c1de1ef57a4f9774767f4d21eb21a33f1 100644
--- a/net/minecraft/world/level/block/SculkSpreader.java
+++ b/net/minecraft/world/level/block/SculkSpreader.java
@@ -45,6 +45,7 @@ public class SculkSpreader {
@@ -46,6 +_,7 @@
private final int chargeDecayRate;
private final int additionalDecayRate;
private List<SculkSpreader.ChargeCursor> cursors = new ArrayList<>();
@@ -16,16 +8,16 @@ index 174592afa95942b2537bd42b0e80ac9028f152f1..416d877c1de1ef57a4f9774767f4d21e
public SculkSpreader(
boolean isWorldGeneration, TagKey<Block> replaceableBlocks, int growthSpawnCoat, int noGrowthRadius, int chargeDecayRate, int additionalDecayRate
@@ -100,7 +101,7 @@ public class SculkSpreader {
@@ -101,7 +_,7 @@
public void load(CompoundTag tag) {
public void load(ValueInput input) {
this.cursors.clear();
- tag.read("cursors", SculkSpreader.ChargeCursor.CODEC.sizeLimitedListOf(32)).orElse(List.of()).forEach(this::addCursor);
+ tag.read("cursors", SculkSpreader.ChargeCursor.CODEC.sizeLimitedListOf(32)).orElse(List.of()).forEach((cursor) -> this.addCursor(cursor, false)); // Paper - don't fire event for block entity loading
- input.read("cursors", SculkSpreader.ChargeCursor.CODEC.sizeLimitedListOf(32)).orElse(List.of()).forEach(this::addCursor);
+ input.read("cursors", SculkSpreader.ChargeCursor.CODEC.sizeLimitedListOf(32)).orElse(List.of()).forEach((cursor) -> this.addCursor(cursor, false)); // Paper - don't fire event for block entity loading
}
public void save(CompoundTag tag) {
@@ -110,13 +111,24 @@ public class SculkSpreader {
public void save(ValueOutput output) {
@@ -111,13 +_,24 @@
public void addCursors(BlockPos pos, int charge) {
while (charge > 0) {
int min = Math.min(charge, 1000);

View File

@@ -1,23 +1,15 @@
From 09671551669244ef4f259d8b27547e463d6795d4 Mon Sep 17 00:00:00 2001
From: File <noreply+automated@papermc.io>
Date: Sun, 20 Apr 1997 15:37:42 +0200
Subject: [PATCH] paper File Patches
diff --git a/net/minecraft/world/level/block/SignBlock.java b/net/minecraft/world/level/block/SignBlock.java
index a953931210d3f970351ce2f09996164bfc1e7d72..a06896de4401f184e8c5cc8bad829e6412eaff22 100644
--- a/net/minecraft/world/level/block/SignBlock.java
+++ b/net/minecraft/world/level/block/SignBlock.java
@@ -133,7 +133,7 @@ public abstract class SignBlock extends BaseEntityBlock implements SimpleWaterlo
} else if (!this.otherPlayerIsEditingSign(player, signBlockEntity)
&& player.mayBuild()
&& this.hasEditableText(player, signBlockEntity, isFacingFrontText)) {
- this.openTextEdit(player, signBlockEntity, isFacingFrontText);
+ this.openTextEdit(player, signBlockEntity, isFacingFrontText, io.papermc.paper.event.player.PlayerOpenSignEvent.Cause.INTERACT); // Paper - Add PlayerOpenSignEvent
return InteractionResult.SUCCESS_SERVER;
} else {
return InteractionResult.PASS;
@@ -175,7 +175,34 @@ public abstract class SignBlock extends BaseEntityBlock implements SimpleWaterlo
@@ -133,7 +_,7 @@
} else if (!this.otherPlayerIsEditingSign(player, signBlockEntity)
&& player.mayBuild()
&& this.hasEditableText(player, signBlockEntity, isFacingFrontText)) {
- this.openTextEdit(player, signBlockEntity, isFacingFrontText);
+ this.openTextEdit(player, signBlockEntity, isFacingFrontText, io.papermc.paper.event.player.PlayerOpenSignEvent.Cause.INTERACT); // Paper - Add PlayerOpenSignEvent
return InteractionResult.SUCCESS_SERVER;
} else {
return InteractionResult.PASS;
@@ -179,7 +_,34 @@
return woodType;
}
@@ -52,7 +44,7 @@ index a953931210d3f970351ce2f09996164bfc1e7d72..a06896de4401f184e8c5cc8bad829e64
signEntity.setAllowedPlayerEditor(player.getUUID());
player.openTextEdit(signEntity, isFrontText);
}
@@ -188,6 +215,6 @@ public abstract class SignBlock extends BaseEntityBlock implements SimpleWaterlo
@@ -192,6 +_,6 @@
@Nullable
@Override
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level level, BlockState state, BlockEntityType<T> blockEntityType) {