-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Kaiiju Vanilla end portal teleportation
- Loading branch information
Showing
34 changed files
with
87 additions
and
21 deletions.
There are no files selected for viewing
66 changes: 66 additions & 0 deletions
66
patches/server/0022-Kaiiju-Vanilla-end-portal-teleportation.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: MrHua269 <wangxyper@163.com> | ||
Date: Mon, 5 Aug 2024 14:48:18 +0800 | ||
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 | ||
--- 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; | ||
import net.minecraft.world.level.block.SoundType; | ||
import net.minecraft.world.level.block.state.BlockState; | ||
import net.minecraft.world.level.border.WorldBorder; | ||
+import net.minecraft.world.level.dimension.LevelStem; | ||
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 | ||
targetPos, 16, // load 16 blocks to be safe from block physics | ||
ca.spottedleaf.concurrentutil.executor.standard.PrioritisedExecutor.Priority.HIGH, | ||
(chunks) -> { | ||
- net.minecraft.world.level.levelgen.feature.EndPlatformFeature.createEndPlatform(destination, targetPos.below(), true, null); | ||
+ //net.minecraft.world.level.levelgen.feature.EndPlatformFeature.createEndPlatform(destination, targetPos.below(), true, null); // Kaiiju - Vanilla end teleportation - moved down | ||
|
||
+ // Kaiiju start - Vanilla end teleportation | ||
+ Vec3 finalPos; | ||
+ if (this instanceof Player) finalPos = Vec3.atBottomCenterOf(targetPos.below()); | ||
+ else finalPos = Vec3.atBottomCenterOf(targetPos); | ||
+ // Kaiiju end | ||
// the portal obsidian is placed at targetPos.y - 2, so if we want to place the entity | ||
// on the obsidian, we need to spawn at targetPos.y - 1 | ||
portalInfoCompletable.complete( | ||
new net.minecraft.world.level.portal.DimensionTransition( | ||
- destination, Vec3.atBottomCenterOf(targetPos.below()), Vec3.ZERO, 90.0f, 0.0f, | ||
+ destination, Vec3.atBottomCenterOf(targetPos.below()), this.getDeltaMovement(), 90.0f, 0.0f, // Kaiiju - Vanilla end teleportation | ||
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 | ||
if (!this.canPortalAsync(destination, takePassengers)) { | ||
return false; | ||
} | ||
+ // Kaiiju start - sync end platform spawning & entity teleportation | ||
+ final java.util.function.Consumer<Entity> tpComplete = type == PortalType.END && destination.getTypeKey() == LevelStem.END ? | ||
+ e -> net.minecraft.world.level.levelgen.feature.EndPlatformFeature.createEndPlatform(destination, ServerLevel.END_SPAWN_POINT.below(), true, null) : teleportComplete; | ||
+ // Kaiiju end | ||
|
||
Vec3 initialPosition = this.position(); | ||
ChunkPos initialPositionChunk = new ChunkPos( | ||
@@ -4496,9 +4506,14 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess | ||
info.postDimensionTransition().onTransition(teleported); | ||
} | ||
|
||
- if (teleportComplete != null) { | ||
+ // Kaiiju start - vanilla end teleportation | ||
+ /*if (teleportComplete != null) { | ||
teleportComplete.accept(teleported); | ||
+ }*/ | ||
+ if (tpComplete != null){ | ||
+ tpComplete.accept(teleported); | ||
} | ||
+ // Kaiiju end | ||
} | ||
); | ||
}); |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.