Class ScreenParticleHandler

java.lang.Object
team.lodestar.lodestone.handlers.screenparticle.ScreenParticleHandler

public class ScreenParticleHandler extends Object
A handler for screen particles. Particles are spawned during rendering once per tick. We also track all present ItemStacks on the screen to allow our particles to more optimally follow a given ItemStacks position Use addParticle(ScreenParticleHolder, ScreenParticleOptions, double, double, double, double) to create a screen particle, which will then be ticked.
  • Field Details

    • ITEM_PARTICLES

      public static final Map<ScreenParticleItemStackKey,ScreenParticleHolder> ITEM_PARTICLES
      Item Stack Bound Particles are rendered just after an item stack in the inventory. They are ticked the same as other particles. We use a pair of a boolean and the ItemStack as a key. The boolean sorts item particles based on if the ItemStack in question is in the hotbar or not.
    • ITEM_STACK_CACHE

      public static final Map<ScreenParticleItemStackRetrievalKey,net.minecraft.world.item.ItemStack> ITEM_STACK_CACHE
    • ACTIVELY_ACCESSED_KEYS

      public static final Collection<ScreenParticleItemStackRetrievalKey> ACTIVELY_ACCESSED_KEYS
    • cachedItemParticles

      public static ScreenParticleHolder cachedItemParticles
    • currentItemX

      public static int currentItemX
    • currentItemY

      public static int currentItemY
    • TESSELATOR

      public static final com.mojang.blaze3d.vertex.Tesselator TESSELATOR
    • canSpawnParticles

      public static boolean canSpawnParticles
    • renderingHotbar

      public static boolean renderingHotbar
  • Constructor Details

    • ScreenParticleHandler

      public ScreenParticleHandler()
  • Method Details

    • tickParticles

      public static void tickParticles()
    • renderTick

      public static void renderTick(net.minecraftforge.event.TickEvent.RenderTickEvent event)
    • renderItemStackEarly

      public static void renderItemStackEarly(com.mojang.blaze3d.vertex.PoseStack poseStack, net.minecraft.world.item.ItemStack stack, int x, int y)
    • spawnAndPullParticles

      public static ScreenParticleHolder spawnAndPullParticles(net.minecraft.client.multiplayer.ClientLevel level, ParticleEmitterHandler.ItemParticleSupplier emitter, net.minecraft.world.item.ItemStack stack, boolean isRenderedAfterItem)
    • pullFromParticleVault

      public static void pullFromParticleVault(ScreenParticleItemStackRetrievalKey cacheKey, net.minecraft.world.item.ItemStack currentStack, ScreenParticleHolder target, boolean isRenderedAfterItem)
    • renderItemStackLate

      public static void renderItemStackLate()
    • renderParticles

      public static void renderParticles(ScreenParticleHolder screenParticleTarget)
    • clearParticles

      public static void clearParticles()
    • clearParticles

      public static void clearParticles(ScreenParticleHolder screenParticleTarget)
    • addParticle

      public static <T extends ScreenParticleOptions> ScreenParticle addParticle(ScreenParticleHolder screenParticleTarget, T options, double x, double y, double xMotion, double yMotion)