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 Classes
    Modifier and Type
    Class
    Description
    static class 
    This event will only fire when ships are moving from planet to space
    static class 
    This event will only fire when ships are moving from space to planet

    Nested classes/interfaces inherited from class net.minecraftforge.eventbus.api.Event

    net.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result
  • Constructor Summary

    Constructors
    Constructor
    Description
    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 Summary

    Modifier and Type
    Method
    Description
    final net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level>
     
    final org.joml.Vector3dc
    Get the new position the ship cluster will move to.
    final net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level>
     
    final org.joml.Vector3dc
     
    final org.joml.Quaterniondc
    Get relative rotation the ship cluster will apply when teleporting.
    final void
    setNewPosition(org.joml.Vector3dc newPos)
     
    final void
    setRelativeRotation(org.joml.Quaterniondc rotation)
     

    Methods inherited from class net.minecraftforge.eventbus.api.Event

    getListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 after setNewPosition(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 after setRelativeRotation(org.joml.Quaterniondc) is invoked.
      Returns:
      relative rotation the ship cluster will apply when teleporting
    • setRelativeRotation

      public final void setRelativeRotation(org.joml.Quaterniondc rotation)