Package net.jcm.vsch.api.event
Class PreTravelEvent
java.lang.Object
net.minecraftforge.eventbus.api.Event
net.jcm.vsch.api.event.PreTravelEvent
- Direct Known Subclasses:
PreTravelEvent.PlanetToSpace,PreTravelEvent.SpaceToPlanet
public class PreTravelEvent
extends net.minecraftforge.eventbus.api.Event
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classThis event will only fire when ships are moving from planet to spacestatic classThis event will only fire when ships are moving from space to planetNested classes/interfaces inherited from class net.minecraftforge.eventbus.api.Event
net.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result -
Constructor Summary
ConstructorsConstructorDescriptionPreTravelEvent(net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> oldLevel, org.joml.Vector3dc oldPos, net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> newLevel, org.joml.Vector3d newPos, org.joml.Quaterniond rotation) -
Method Summary
Modifier and TypeMethodDescriptionfinal net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level>final org.joml.Vector3dcGet the new position the ship cluster will move to.final net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level>final org.joml.Vector3dcfinal org.joml.QuaterniondcGet relative rotation the ship cluster will apply when teleporting.final voidsetNewPosition(org.joml.Vector3dc newPos) final voidsetRelativeRotation(org.joml.Quaterniondc rotation) Methods inherited from class net.minecraftforge.eventbus.api.Event
getListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult
-
Constructor Details
-
PreTravelEvent
public PreTravelEvent(net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> oldLevel, org.joml.Vector3dc oldPos, net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> newLevel, org.joml.Vector3d newPos, org.joml.Quaterniond rotation)
-
-
Method Details
-
getOldLevel
public final net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> getOldLevel()- Returns:
- original level for the ship cluster
-
getOldPosition
public final org.joml.Vector3dc getOldPosition()- Returns:
- original position for the ship cluster
-
getNewLevel
public final net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> getNewLevel()- Returns:
- target level the ship cluster is moving to
-
getNewPosition
public final org.joml.Vector3dc getNewPosition()Get the new position the ship cluster will move to. The returned vector may change its value aftersetNewPosition(org.joml.Vector3dc)is invoked.- Returns:
- new position the ship cluster will move to
-
setNewPosition
public final void setNewPosition(org.joml.Vector3dc newPos) -
getRelativeRotation
public final org.joml.Quaterniondc getRelativeRotation()Get relative rotation the ship cluster will apply when teleporting. The returned quaternion may change its value aftersetRelativeRotation(org.joml.Quaterniondc)is invoked.- Returns:
- relative rotation the ship cluster will apply when teleporting
-
setRelativeRotation
public final void setRelativeRotation(org.joml.Quaterniondc rotation)
-