Hook up the teleport handler for the LibZ teleport event
This commit is contained in:
parent
2fa969e6b8
commit
751262258b
3 changed files with 25 additions and 2 deletions
|
@ -3,7 +3,7 @@
|
|||
org.gradle.jvmargs=-Xmx3G
|
||||
org.gradle.daemon=false
|
||||
|
||||
libzontreck=1201.11.021824.0409
|
||||
libzontreck=1201.11.021824.0838
|
||||
|
||||
## Environment Properties
|
||||
|
||||
|
@ -48,7 +48,7 @@ mod_name=Aria's Essentials
|
|||
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
|
||||
mod_license=GPLv3
|
||||
# The mod version. See https://semver.org/
|
||||
mod_version=1201.2.021824.0354
|
||||
mod_version=1201.2.021824.0840
|
||||
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
|
||||
# This should match the base package used for the mod sources.
|
||||
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html
|
||||
|
|
|
@ -15,6 +15,7 @@ import dev.zontreck.essentials.configs.server.AEServerConfig;
|
|||
import dev.zontreck.essentials.entities.ModEntities;
|
||||
import dev.zontreck.essentials.events.TeleportEvent;
|
||||
import dev.zontreck.essentials.client.renderer.HeartsRenderer;
|
||||
import dev.zontreck.essentials.imc.Events;
|
||||
import dev.zontreck.essentials.items.CreativeModeTabs;
|
||||
import dev.zontreck.essentials.items.ModItems;
|
||||
import dev.zontreck.essentials.networking.ModMessages;
|
||||
|
@ -81,6 +82,7 @@ public class AriasEssentials {
|
|||
MinecraftForge.EVENT_BUS.register(new RTPCachesEventHandlers());
|
||||
MinecraftForge.EVENT_BUS.register(new CommandCooldowns());
|
||||
MinecraftForge.EVENT_BUS.register(RTPCachesEventHandlers.class);
|
||||
MinecraftForge.EVENT_BUS.register(Events.class);
|
||||
|
||||
ModItems.register(bus);
|
||||
ModEntities.register(bus);
|
||||
|
|
21
src/main/java/dev/zontreck/essentials/imc/Events.java
Normal file
21
src/main/java/dev/zontreck/essentials/imc/Events.java
Normal file
|
@ -0,0 +1,21 @@
|
|||
package dev.zontreck.essentials.imc;
|
||||
|
||||
import dev.zontreck.essentials.commands.teleport.TeleportActioner;
|
||||
import dev.zontreck.essentials.commands.teleport.TeleportContainer;
|
||||
import dev.zontreck.libzontreck.events.TeleportEvent;
|
||||
import net.minecraft.world.phys.Vec2;
|
||||
|
||||
public class Events
|
||||
{
|
||||
public static void onTeleportRequest(TeleportEvent ev)
|
||||
{
|
||||
ev.setCanceled(true);
|
||||
|
||||
TeleportActioner.ApplyTeleportEffect(ev.getPlayer());
|
||||
|
||||
TeleportContainer container = new TeleportContainer(ev.getPlayer(), ev.getPosition().Position.asMinecraftVector(), Vec2.ZERO, ev.getPosition().getActualDimension());
|
||||
|
||||
TeleportActioner.PerformTeleport(container, false);
|
||||
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue