-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #80 from FTBTeam/dev
Dev
- Loading branch information
Showing
4 changed files
with
17 additions
and
3 deletions.
There are no files selected for viewing
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
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
9 changes: 8 additions & 1 deletion
9
.../src/main/java/dev/ftb/mods/ftbessentials/util/neoforge/WarmupCooldownTeleporterImpl.java
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 |
---|---|---|
@@ -1,14 +1,21 @@ | ||
package dev.ftb.mods.ftbessentials.util.neoforge; | ||
|
||
import net.minecraft.server.level.ServerPlayer; | ||
import net.minecraft.world.entity.Entity; | ||
import net.minecraft.world.phys.Vec3; | ||
import net.neoforged.neoforge.common.NeoForge; | ||
import net.neoforged.neoforge.event.entity.EntityTeleportEvent; | ||
|
||
public class WarmupCooldownTeleporterImpl { | ||
public static boolean firePlatformTeleportEvent(ServerPlayer player, Vec3 pos) { | ||
EntityTeleportEvent.TeleportCommand event = new EntityTeleportEvent.TeleportCommand(player, pos.x, pos.y, pos.z); | ||
EssentialsTeleport event = new EssentialsTeleport(player, pos.x, pos.y, pos.z); | ||
NeoForge.EVENT_BUS.post(event); | ||
return !event.isCanceled(); | ||
} | ||
|
||
public static class EssentialsTeleport extends EntityTeleportEvent.TeleportCommand { | ||
public EssentialsTeleport(Entity entity, double targetX, double targetY, double targetZ) { | ||
super(entity, targetX, targetY, targetZ); | ||
} | ||
} | ||
} |