Finish fixing RTP
This commit is contained in:
parent
516f067fb9
commit
a58cc55a5e
10 changed files with 89 additions and 59 deletions
|
@ -7,9 +7,18 @@ import java.nio.file.Path;
|
|||
import java.util.UUID;
|
||||
|
||||
import dev.zontreck.essentials.AriasEssentials;
|
||||
import dev.zontreck.essentials.Messages;
|
||||
import dev.zontreck.essentials.commands.teleport.TeleportActioner;
|
||||
import dev.zontreck.essentials.commands.teleport.TeleportContainer;
|
||||
import dev.zontreck.essentials.commands.teleport.TeleportDestination;
|
||||
import dev.zontreck.essentials.events.RTPNotCancelledEvent;
|
||||
import dev.zontreck.essentials.homes.HomesProvider;
|
||||
import dev.zontreck.libzontreck.chat.ChatColor;
|
||||
import dev.zontreck.libzontreck.events.ProfileLoadedEvent;
|
||||
import dev.zontreck.libzontreck.events.ProfileUnloadedEvent;
|
||||
import dev.zontreck.libzontreck.util.ChatHelpers;
|
||||
import dev.zontreck.libzontreck.vectors.WorldPosition;
|
||||
import net.minecraft.network.chat.TextComponent;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
|
||||
|
@ -34,4 +43,15 @@ public class ForgeEventsHandler {
|
|||
AriasEssentials.player_homes.remove(UUID.fromString(ev.user_id));
|
||||
AriasEssentials.LOGGER.info("Homes unloaded");
|
||||
}
|
||||
|
||||
|
||||
@SubscribeEvent
|
||||
public void onRTPNotCancelled(final RTPNotCancelledEvent ev)
|
||||
{
|
||||
final TeleportContainer contain = ev.container.container;
|
||||
|
||||
ChatHelpers.broadcastTo(contain.PlayerInst.getUUID(), new TextComponent(Messages.ESSENTIALS_PREFIX + ChatColor.DARK_PURPLE+" A suitable location has been found. Wormhole opening now!"), contain.PlayerInst.server);
|
||||
TeleportActioner.ApplyTeleportEffect(contain.PlayerInst);
|
||||
TeleportActioner.PerformTeleport(contain);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue