Skip to content

Commit

Permalink
Try fixing unsafe teleportation
Browse files Browse the repository at this point in the history
  • Loading branch information
MrHua269 committed Aug 6, 2024
1 parent 892dfcd commit fb55d3e
Show file tree
Hide file tree
Showing 26 changed files with 12 additions and 24 deletions.
12 changes: 0 additions & 12 deletions patches/server/0005-Add-config-for-unsafe-teleportation.patch
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,6 @@ index 0000000000000000000000000000000000000000..ea374875f529b30db17e8b8cb07b99a6
+ return "allow_unsafe_teleportation";
+ }
+}
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 7a102b4e90fbc09b8653e5b566299efe24a04cf6..2a5db8f4ad54b772a0a8bce429fff8b539db81ed 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -4142,6 +4142,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess

public boolean endPortalLogicAsync(BlockPos portalPos) {
ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this, "Cannot portal entity async");
+ if (me.earthme.luminol.config.modules.fixes.UnsafeTeleportationConfig.enabled && !(this instanceof Player)) return false; // Luminol - Unsafe teleportation

ServerLevel destination = this.getServer().getLevel(this.level().getTypeKey() == net.minecraft.world.level.dimension.LevelStem.END ? Level.OVERWORLD : Level.END);
if (destination == null) {
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 5d6b1a63a2a213f8a4e81c5e574847007a82007b..77ff2a526a1d2b9307dfc696f9862bfda7407475 100644
--- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Subject: [PATCH] Kaiiju Vanilla end portal teleportation


diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 39e96b21e77607782da13b4c74c65d8a68af2433..3958bc6d5172698af88555352a5321083c2367d3 100644
index a90820a672379639e89c5bb71abcd9aa69227473..794f08a815672b18d22416fc5787f886f895f7be 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -109,6 +109,7 @@ import net.minecraft.world.level.block.Rotation;
Expand All @@ -16,7 +16,7 @@ index 39e96b21e77607782da13b4c74c65d8a68af2433..3958bc6d5172698af88555352a532108
import net.minecraft.world.level.entity.EntityAccess;
import net.minecraft.world.level.entity.EntityInLevelCallback;
import net.minecraft.world.level.gameevent.DynamicGameEventListener;
@@ -4229,13 +4230,18 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@@ -4228,13 +4229,18 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
targetPos, 16, // load 16 blocks to be safe from block physics
ca.spottedleaf.concurrentutil.executor.standard.PrioritisedExecutor.Priority.HIGH,
(chunks) -> {
Expand All @@ -37,7 +37,7 @@ index 39e96b21e77607782da13b4c74c65d8a68af2433..3958bc6d5172698af88555352a532108
DimensionTransition.PLAY_PORTAL_SOUND.then(DimensionTransition.PLACE_PORTAL_TICKET),
org.bukkit.event.player.PlayerTeleportEvent.TeleportCause.END_PORTAL
)
@@ -4432,6 +4438,10 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@@ -4431,6 +4437,10 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
if (!this.canPortalAsync(destination, takePassengers)) {
return false;
}
Expand All @@ -48,7 +48,7 @@ index 39e96b21e77607782da13b4c74c65d8a68af2433..3958bc6d5172698af88555352a532108

Vec3 initialPosition = this.position();
ChunkPos initialPositionChunk = new ChunkPos(
@@ -4496,9 +4506,14 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@@ -4495,9 +4505,14 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
info.postDimensionTransition().onTransition(teleported);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ index 0000000000000000000000000000000000000000..15697d69659b6e1e776acf5094684b5f
+ }
+}
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 44a08cc2e94d52747ba6a66e4b57543dfa5f66c2..d5ad15b95a4f1a0145821ca8a6362e4d5722bf7b 100644
index 794f08a815672b18d22416fc5787f886f895f7be..8a8ad0952ac5f128aeabc0856426227bfb7b9893 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -858,6 +858,12 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ index b5cb700e2cd1de2f78ad582245208c056fa6fa79..80123dd30328336b02a5e2e3414ece44
if (false && this.shouldDiscardEntity(entity)) { // CraftBukkit - We prevent spawning in general, so this butchering is not needed
entity.discard();
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index d5ad15b95a4f1a0145821ca8a6362e4d5722bf7b..577a194e9d9828520560e3546dba8532ca18782a 100644
index 8a8ad0952ac5f128aeabc0856426227bfb7b9893..229c3d25a5999b0304b06a57819a5108c823784d 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -430,6 +430,8 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Subject: [PATCH] Gale Optimize sun burn tick


diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 577a194e9d9828520560e3546dba8532ca18782a..6870db1f03e44e8023e173a0d7a6a7f09f41e989 100644
index 229c3d25a5999b0304b06a57819a5108c823784d..9994b61afcaa9cb93bda9f1e1db17708d95277fa 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -315,7 +315,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Subject: [PATCH] Gale Skip entity move if movement is zero


diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 928f53951b2c47fb0a5dbae4dc6b8b97f78f4555..ceb0bf3071865c85dfa5a270150ff487c2c02c4c 100644
index 9994b61afcaa9cb93bda9f1e1db17708d95277fa..45871e846223dc78aee8a8ffb087b0f0763dca67 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -324,6 +324,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
Expand All @@ -28,7 +28,7 @@ index 928f53951b2c47fb0a5dbae4dc6b8b97f78f4555..ceb0bf3071865c85dfa5a270150ff487
final Vec3 originalMovement = movement; // Paper - Expose pre-collision velocity
// Paper start - detailed watchdog information
ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread("Cannot move an entity off-main");
@@ -4978,6 +4984,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@@ -4977,6 +4983,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
}

public final void setBoundingBox(AABB boundingBox) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -332,10 +332,10 @@ index 1859477e96709368683fe5707327e92f56fbfc8e..4c4814094552fa4382b1cbe649f24f47
+ // KioCG end
}
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index ceb0bf3071865c85dfa5a270150ff487c2c02c4c..ae39e58170085f83303d53eb6b7eb72f0a961be3 100644
index 45871e846223dc78aee8a8ffb087b0f0763dca67..d860f32f507cc4d642213a6da8227314660c4ca0 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -5999,4 +5999,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@@ -5856,4 +5856,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
return ((net.minecraft.server.level.ServerChunkCache) level.getChunkSource()).isPositionTicking(this);
}
// Paper end - Expose entity id counter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Subject: [PATCH] Fix-MC-2025


diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index ae39e58170085f83303d53eb6b7eb72f0a961be3..133fd4c50df80420015d0c32f487f0176ad07393 100644
index d860f32f507cc4d642213a6da8227314660c4ca0..8e64056ed83a08037e9c5a06a03233600671637b 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -2623,6 +2623,16 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
Expand Down

0 comments on commit fb55d3e

Please sign in to comment.