Class WorldRifts
java.lang.Object
net.ixdarklord.coolcatcanvas.api.client.vfx.WorldRifts
Rifts: tears in the air, drawn by a shader (
VfxMaterial.RIFT_SHADER) and run through three acts. A rift
opens (a flash, a jagged slit that widens, its opening sound, a shake of the camera nearby), stays open
(its edge crawls and pulses, motes are drawn into it, its ambient sound loops), and closes (it narrows to a
line and snaps shut with a last flash and its closing sound). It turns to face whoever looks at it, unless it is held
facing one way (Rift.facing(net.minecraft.world.phys.Vec3)), as a portal set in a wall is.
Rift rift = WorldRifts.open(RiftSpec.DEFAULT, pos); // stays until closed
rift.close();
WorldRifts.open(RiftSpec.DEFAULT, pos).facing(new Vec3(0, 0, 1)); // a fixed face, looking south
WorldRifts.open(RiftSpec.DEFAULT, pos, 100); // closes by itself after five seconds open
RiftSpec ember = RiftSpec.builder().size(3, 5).color(0xFF7030).timing(30, 12)
.sounds(MySounds.TEAR, MySounds.HUM, MySounds.SNAP).build();
WorldRifts.register(MyMod.id("ember_rift"), ember); // so the server can open it by name
From the server, RiftControl.open(level, MyMod.id("ember_rift"), pos, ticks) opens a registered rift for
everyone in range and hands back the id to close it with.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final net.minecraft.resources.ResourceLocationThe spec the server can always ask for:RiftSpec.DEFAULT. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidclear()Closes every rift at once, without their closing act.The rift the server opened under an id, if it is still there.static RiftOpens a rift that stays until it is closed.static RiftOpens a rift that closes by itself.static voidNames a spec, so the server can open it.spec(net.minecraft.resources.ResourceLocation id)
-
Field Details
-
DEFAULT
public static final net.minecraft.resources.ResourceLocation DEFAULTThe spec the server can always ask for:RiftSpec.DEFAULT.
-
-
Method Details
-
register
Names a spec, so the server can open it. Client code only. -
spec
-
open
Opens a rift that stays until it is closed. -
open
Opens a rift that closes by itself.- Parameters:
openTicks- how long it stays fully open before it begins to close
-
get
The rift the server opened under an id, if it is still there. -
clear
public static void clear()Closes every rift at once, without their closing act.
-