Class ScreenEffectControl
java.lang.Object
net.ixdarklord.coolcatcanvas.api.effect.ScreenEffectControl
Drives a player's client-side screen effects from the server, by the id they were registered under with
ScreenEffects.register. Clients without that effect ignore the command.
Server state isn't kept: a client that relogs starts with its effects off, so resend what should persist (on join, for instance).
-
Method Summary
Modifier and TypeMethodDescriptionstatic voiddisable(net.minecraft.server.level.ServerPlayer player, net.minecraft.resources.ResourceLocation effect) static voiddisableInstantly(net.minecraft.server.level.ServerPlayer player, net.minecraft.resources.ResourceLocation effect) static voidenable(net.minecraft.server.level.ServerPlayer player, net.minecraft.resources.ResourceLocation effect) static voidenableFor(net.minecraft.server.level.ServerPlayer player, net.minecraft.resources.ResourceLocation effect, int ticks) Fades in, stays forticks, then fades out.static voidenableInstantly(net.minecraft.server.level.ServerPlayer player, net.minecraft.resources.ResourceLocation effect) static voidresetUniforms(net.minecraft.server.level.ServerPlayer player, net.minecraft.resources.ResourceLocation effect) static voidsetStrength(net.minecraft.server.level.ServerPlayer player, net.minecraft.resources.ResourceLocation effect, float strength, int ticks) Moves the effect's manual strength tostrengthoverticks, 0 for instantly.static voidsetUniform(net.minecraft.server.level.ServerPlayer player, net.minecraft.resources.ResourceLocation effect, String uniform, int ticks, float... values) Moves a uniform tovalues(at most 16) overticks, 0 for instantly.static voidtint(net.minecraft.server.level.ServerPlayer player, net.minecraft.resources.ResourceLocation tint, int argb) Tints the player's screen untildisable(net.minecraft.server.level.ServerPlayer, net.minecraft.resources.ResourceLocation): the client makes the tint undertintif it has none yet (seeScreenEffects.tint), so nothing needs registering on either side.static voidtint(net.minecraft.server.level.ServerPlayer player, net.minecraft.resources.ResourceLocation tint, int argb, int ticks) Tints the player's screen forticks, fading in and out: a flash.
-
Method Details
-
enable
public static void enable(net.minecraft.server.level.ServerPlayer player, net.minecraft.resources.ResourceLocation effect) -
disable
public static void disable(net.minecraft.server.level.ServerPlayer player, net.minecraft.resources.ResourceLocation effect) -
enableFor
public static void enableFor(net.minecraft.server.level.ServerPlayer player, net.minecraft.resources.ResourceLocation effect, int ticks) Fades in, stays forticks, then fades out. -
enableInstantly
public static void enableInstantly(net.minecraft.server.level.ServerPlayer player, net.minecraft.resources.ResourceLocation effect) -
disableInstantly
public static void disableInstantly(net.minecraft.server.level.ServerPlayer player, net.minecraft.resources.ResourceLocation effect) -
setStrength
public static void setStrength(net.minecraft.server.level.ServerPlayer player, net.minecraft.resources.ResourceLocation effect, float strength, int ticks) Moves the effect's manual strength tostrengthoverticks, 0 for instantly. -
setUniform
public static void setUniform(net.minecraft.server.level.ServerPlayer player, net.minecraft.resources.ResourceLocation effect, String uniform, int ticks, float... values) Moves a uniform tovalues(at most 16) overticks, 0 for instantly. -
resetUniforms
public static void resetUniforms(net.minecraft.server.level.ServerPlayer player, net.minecraft.resources.ResourceLocation effect) -
tint
public static void tint(net.minecraft.server.level.ServerPlayer player, net.minecraft.resources.ResourceLocation tint, int argb) Tints the player's screen untildisable(net.minecraft.server.level.ServerPlayer, net.minecraft.resources.ResourceLocation): the client makes the tint undertintif it has none yet (seeScreenEffects.tint), so nothing needs registering on either side.- Parameters:
argb- the color; its alpha is how strong the tint is
-
tint
public static void tint(net.minecraft.server.level.ServerPlayer player, net.minecraft.resources.ResourceLocation tint, int argb, int ticks) Tints the player's screen forticks, fading in and out: a flash. 0 keeps it untildisable(net.minecraft.server.level.ServerPlayer, net.minecraft.resources.ResourceLocation).
-