Skip to content
This repository was archived by the owner on Nov 11, 2025. It is now read-only.

Commit 8cc76b9

Browse files
committed
Yes moar tp for yuo
1 parent d88d57e commit 8cc76b9

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

src/main/java/io/github/addoncommunity/galactifun/api/items/Rocket.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,8 @@ public void run() {
243243
if (entity instanceof Player) {
244244
entity.setMetadata("CanTpAlienWorld", new FixedMetadataValue(Galactifun.instance(), true));
245245
}
246-
PaperLib.teleportAsync(entity, destBlock.getLocation().add(0, 1, 0));
246+
PaperLib.teleportAsync(entity, destBlock.getLocation().add(0, 1, 0))
247+
.thenRun(() -> entity.removeMetadata("CanTpAlienWorld", Galactifun.instance()));
247248
if (KnowledgeLevel.get(p, destination) == KnowledgeLevel.NONE) {
248249
KnowledgeLevel.BASIC.set(p, destination);
249250
}

src/main/java/io/github/addoncommunity/galactifun/core/managers/WorldManager.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,12 +232,16 @@ private void onPlayerTeleport(@Nonnull PlayerTeleportEvent e) {
232232
if (e.getTo().getWorld() != null && e.getFrom().getWorld() != e.getTo().getWorld()) {
233233
PlanetaryWorld world = getWorld(e.getTo().getWorld());
234234
PlanetaryWorld world2 = getWorld(e.getFrom().getWorld());
235-
if (world != null || world2 != null) {
235+
if (
236+
(world != null || world2 != null)
237+
&& !BaseUniverse.EARTH.equals(world)
238+
&& !BaseUniverse.EARTH.equals(world2)
239+
) {
236240
boolean canTp = false;
237241
for (MetadataValue value : e.getPlayer().getMetadata("CanTpAlienWorld")) {
238-
canTp = value.asBoolean();
242+
canTp |= value.asBoolean();
239243
}
240-
if (canTp || e.getFrom().getWorld().equals(e.getTo().getWorld())) {
244+
if (canTp) {
241245
e.getPlayer().removeMetadata("CanTpAlienWorld", Galactifun.instance());
242246
} else {
243247
e.setCancelled(true);

0 commit comments

Comments
 (0)