Class ScreenParticleHandler
java.lang.Object
team.lodestar.lodestone.handlers.screenparticle.ScreenParticleHandler
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(HashMap, ScreenParticleOptions, double, double, double, double) to create a screen particle, which will then be ticked.-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic booleanstatic intstatic intstatic final HashMap<LodestoneScreenParticleRenderType,ArrayList<ScreenParticle>> Earliest Screen Particles are rendered before nearly every piece of user interface.static final HashMap<LodestoneScreenParticleRenderType,ArrayList<ScreenParticle>> Early Screen Particles are rendered after other UI elements, but before things like tooltips or other overlays.static final HashMap<com.mojang.datafixers.util.Pair<Boolean,net.minecraft.world.item.ItemStack>, HashMap<LodestoneScreenParticleRenderType, ArrayList<ScreenParticle>>> Item Stack Bound Particles are rendered just after an item stack in the inventory.static final HashMap<com.mojang.datafixers.util.Pair<Boolean,com.mojang.datafixers.util.Pair<Integer, Integer>>, net.minecraft.world.item.ItemStack> static final HashMap<LodestoneScreenParticleRenderType,ArrayList<ScreenParticle>> Late Screen Particles are rendered after everything else.static booleanstatic final com.mojang.blaze3d.vertex.Tesselator -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends ScreenParticleOptions>
ScreenParticleaddParticle(HashMap<LodestoneScreenParticleRenderType, ArrayList<ScreenParticle>> screenParticleTarget, T options, double x, double y, double xMotion, double yMotion) static voidstatic voidclearParticles(HashMap<LodestoneScreenParticleRenderType, ArrayList<ScreenParticle>> screenParticleTarget) static voidpullFromParticleVault(net.minecraft.world.item.ItemStack currentStack, HashMap<LodestoneScreenParticleRenderType, ArrayList<ScreenParticle>> target) static voidstatic voidstatic voidrenderItemStackEarly(net.minecraft.world.item.ItemStack stack, int x, int y) static voidstatic voidstatic voidrenderParticles(net.minecraftforge.event.TickEvent.RenderTickEvent event) static voidstatic voidtickParticles(HashMap<LodestoneScreenParticleRenderType, ArrayList<ScreenParticle>> screenParticleTarget)
-
Field Details
-
EARLIEST_PARTICLES
public static final HashMap<LodestoneScreenParticleRenderType,ArrayList<ScreenParticle>> EARLIEST_PARTICLESEarliest Screen Particles are rendered before nearly every piece of user interface. -
EARLY_PARTICLES
public static final HashMap<LodestoneScreenParticleRenderType,ArrayList<ScreenParticle>> EARLY_PARTICLESEarly Screen Particles are rendered after other UI elements, but before things like tooltips or other overlays. -
LATE_PARTICLES
public static final HashMap<LodestoneScreenParticleRenderType,ArrayList<ScreenParticle>> LATE_PARTICLESLate Screen Particles are rendered after everything else. -
ITEM_PARTICLES
public static final HashMap<com.mojang.datafixers.util.Pair<Boolean,net.minecraft.world.item.ItemStack>, ITEM_PARTICLESHashMap<LodestoneScreenParticleRenderType, ArrayList<ScreenParticle>>> 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
-
cachedItemTarget
-
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() -
tickParticles
public static void tickParticles(HashMap<LodestoneScreenParticleRenderType, ArrayList<ScreenParticle>> screenParticleTarget) -
renderItemStackEarly
public static void renderItemStackEarly(net.minecraft.world.item.ItemStack stack, int x, int y) -
pullFromParticleVault
public static void pullFromParticleVault(net.minecraft.world.item.ItemStack currentStack, HashMap<LodestoneScreenParticleRenderType, ArrayList<ScreenParticle>> target) -
renderItemStackLate
public static void renderItemStackLate() -
renderParticles
public static void renderParticles(net.minecraftforge.event.TickEvent.RenderTickEvent event) -
renderEarliestParticles
public static void renderEarliestParticles() -
renderEarlyParticles
public static void renderEarlyParticles() -
renderLateParticles
public static void renderLateParticles() -
clearParticles
public static void clearParticles() -
clearParticles
public static void clearParticles(HashMap<LodestoneScreenParticleRenderType, ArrayList<ScreenParticle>> screenParticleTarget) -
addParticle
public static <T extends ScreenParticleOptions> ScreenParticle addParticle(HashMap<LodestoneScreenParticleRenderType, ArrayList<ScreenParticle>> screenParticleTarget, T options, double x, double y, double xMotion, double yMotion)
-