Class RiftControl

java.lang.Object
net.ixdarklord.coolcatcanvas.api.vfx.RiftControl

public final class RiftControl extends Object
Rifts from the server (the client side is WorldRifts). The server names a rift the clients registered; each client runs its three acts, sounds included, on its own.

 RiftControl.open(level, RiftControl.DEFAULT, pos, 100);            // closes by itself after five seconds open

 UUID rift = RiftControl.open(level, MyMod.id("ember_rift"), pos);  // stays...
 RiftControl.close(level, rift);                                    // ...until closed
 
A rift is not an entity and is not saved: a player who comes into range, or logs in, after it opened does not see it. For one that must last, open it again for them, or give it to something that already syncs.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final net.minecraft.resources.ResourceLocation
    The rift every client has: a violet tear with vanilla's portal sounds.
    static final double
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    close(net.minecraft.server.level.ServerLevel level, UUID rift)
    Closes a rift for everyone in the level who has it.
    static UUID
    open(net.minecraft.server.level.ServerLevel level, net.minecraft.resources.ResourceLocation spec, net.minecraft.world.phys.Vec3 position)
    static UUID
    open(net.minecraft.server.level.ServerLevel level, net.minecraft.resources.ResourceLocation spec, net.minecraft.world.phys.Vec3 position, int openTicks)
    Opens a rift for everyone within DEFAULT_RANGE of it.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • DEFAULT

      public static final net.minecraft.resources.ResourceLocation DEFAULT
      The rift every client has: a violet tear with vanilla's portal sounds.
    • DEFAULT_RANGE

      public static final double DEFAULT_RANGE
      See Also:
  • Method Details

    • open

      public static UUID open(net.minecraft.server.level.ServerLevel level, net.minecraft.resources.ResourceLocation spec, net.minecraft.world.phys.Vec3 position)
      Opens a rift that stays until close(net.minecraft.server.level.ServerLevel, java.util.UUID). Returns the id to close it with.
    • open

      public static UUID open(net.minecraft.server.level.ServerLevel level, net.minecraft.resources.ResourceLocation spec, net.minecraft.world.phys.Vec3 position, int openTicks)
      Opens a rift for everyone within DEFAULT_RANGE of it.
      Parameters:
      openTicks - how long it stays fully open before closing by itself; negative for until close(net.minecraft.server.level.ServerLevel, java.util.UUID)
    • close

      public static void close(net.minecraft.server.level.ServerLevel level, UUID rift)
      Closes a rift for everyone in the level who has it.