9
0
mirror of https://github.com/LeavesMC/Leaves.git synced 2026-01-04 15:41:31 +00:00

Update Paper \o/ ~~

This commit is contained in:
violetc
2024-03-04 13:29:48 +08:00
parent 5a586cb317
commit 11d2d7002c
17 changed files with 55 additions and 86 deletions

View File

@@ -5,7 +5,7 @@ Subject: [PATCH] Fix gravity block duper
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index e44178458aee648ce088c0a10f05b9f9eed91820..87b0eead81c06afa276b74bf1c7fce573027702f 100644
index dcd8ab90212237764cc64a71321d739bd857a34a..87b0eead81c06afa276b74bf1c7fce573027702f 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -441,6 +441,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -28,70 +28,39 @@ index e44178458aee648ce088c0a10f05b9f9eed91820..87b0eead81c06afa276b74bf1c7fce57
}
this.processPortalCooldown();
- this.tickEndPortal(); // Paper - make end portalling safe
- if (!io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.allowUnsafeEndPortalTeleportation) this.tickEndPortal(); // Paper - make end portalling safe
+ // Leaves - fix gravity block duper
}
}
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 0aef6a8d51cb1351daaea16022f5cbb27ceaff0d..265c2b3abaa47548c4318c86a1de83d673d09fff 100644
--- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
+++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
@@ -133,11 +133,7 @@ public class FallingBlockEntity extends Entity {
@Override
public void tick() {
- // Paper start - fix sand duping
- if (this.isRemoved()) {
- return;
- }
- // Paper end - fix sand duping
+ // Leaves - fix gravity block duper
if (this.blockState.isAir()) {
this.discard(EntityRemoveEvent.Cause.DESPAWN); // CraftBukkit - add Bukkit remove cause
} else {
@@ -149,12 +145,14 @@ public class FallingBlockEntity extends Entity {
}
this.move(MoverType.SELF, this.getDeltaMovement());
+ /* // Leaves - fix gravity block duper
// Paper start - fix sand duping
if (this.isRemoved()) {
return;
}
// Paper end - fix sand duping
- // Paper start - Configurable falling blocks height nerf
+ */
+ // 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)) {
this.spawnAtLocation(block);
diff --git a/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java b/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java
index a0c1db8cfebaa0344012cc0af18d6231cdcdcbb8..6482c2456d9dc9b4983f691f388b7ec045d2cab6 100644
index 4ba24bced9a2de4616a0418857d3738e0e322ea0..6482c2456d9dc9b4983f691f388b7ec045d2cab6 100644
--- a/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java
@@ -61,12 +61,19 @@ public class EndPortalBlock extends BaseEntityBlock {
@@ -61,15 +61,19 @@ public class EndPortalBlock extends BaseEntityBlock {
// return; // CraftBukkit - always fire event in case plugins wish to change it
}
- // Paper start - move all of this logic into portal tick
- entity.portalWorld = ((ServerLevel)world);
- entity.portalBlock = pos.immutable();
- // Paper end - move all of this logic into portal tick
- }
- if (io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.allowUnsafeEndPortalTeleportation) {
- entity.tickEndPortal();
+ // Leaves start - fix gravity block duper
+ // CraftBukkit start - Entity in portal
+ EntityPortalEnterEvent event = new EntityPortalEnterEvent(entity.getBukkitEntity(), new org.bukkit.Location(world.getWorld(), pos.getX(), pos.getY(), pos.getZ()));
+ world.getCraftServer().getPluginManager().callEvent(event);
+
+ if (entity instanceof ServerPlayer) {
+ ((ServerPlayer) entity).changeDimension(worldserver, PlayerTeleportEvent.TeleportCause.END_PORTAL);
+ return;
+ }
}
- // Paper end - move all of this logic into portal tick
+ // CraftBukkit end
+ entity.changeDimension(worldserver);
+ // Leaves end - fix gravity block duper
+ }
}
-
}
@Override