@Environment(value=CLIENT) public class ParticleManager extends Object implements ResourceReloadListener
Modifier and Type | Class and Description |
---|---|
(package private) class |
ParticleManager.SimpleSpriteProvider |
(package private) static interface |
ParticleManager.SpriteAwareFactory<T extends ParticleEffect> |
ResourceReloadListener.Synchronizer
Modifier and Type | Field and Description |
---|---|
private it.unimi.dsi.fastutil.ints.Int2ObjectMap<ParticleFactory<?>> |
factories |
private Queue<EmitterParticle> |
newEmitterParticles |
private Queue<Particle> |
newParticles |
private static List<ParticleTextureSheet> |
PARTICLE_TEXTURE_SHEETS |
private SpriteAtlasTexture |
particleAtlasTexture |
private Map<ParticleTextureSheet,Queue<Particle>> |
particles |
private Random |
random |
private Map<Identifier,ParticleManager.SimpleSpriteProvider> |
spriteAwareFactories |
private TextureManager |
textureManager |
protected World |
world |
Constructor and Description |
---|
ParticleManager(World world,
TextureManager textureManager) |
Modifier and Type | Method and Description |
---|---|
void |
addBlockBreakingParticles(BlockPos blockPos,
Direction direction) |
void |
addBlockBreakParticles(BlockPos pos,
BlockState state) |
void |
addEmitter(Entity entity,
ParticleEffect parameters) |
void |
addEmitter(Entity entity,
ParticleEffect parameters,
int maxAge) |
void |
addParticle(Particle particle) |
Particle |
addParticle(ParticleEffect parameters,
double x,
double y,
double z,
double velocityX,
double velocityY,
double velocityZ) |
void |
clearAtlas() |
private <T extends ParticleEffect> |
createParticle(T parameters,
double x,
double y,
double z,
double velocityX,
double velocityY,
double velocityZ) |
String |
getDebugString() |
private void |
loadTextureList(ResourceManager resourceManager,
Identifier id,
Map<Identifier,List<Identifier>> result) |
private void |
registerDefaultFactories() |
private <T extends ParticleEffect> |
registerFactory(ParticleType<T> type,
ParticleFactory<T> factory) |
private <T extends ParticleEffect> |
registerFactory(ParticleType<T> particleType,
ParticleManager.SpriteAwareFactory<T> spriteAwareFactory) |
CompletableFuture<Void> |
reload(ResourceReloadListener.Synchronizer synchronizer,
ResourceManager manager,
Profiler prepareProfiler,
Profiler applyProfiler,
Executor prepareExecutor,
Executor applyExecutor) |
void |
renderParticles(MatrixStack matrixStack,
VertexConsumerProvider.Immediate immediate,
LightmapTextureManager lightmapTextureManager,
Camera camera,
float float2) |
void |
setWorld(World world) |
void |
tick() |
private void |
tickParticle(Particle particle) |
private void |
tickParticles(Collection<Particle> collection) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getName
private static final List<ParticleTextureSheet> PARTICLE_TEXTURE_SHEETS
protected World world
private final Map<ParticleTextureSheet,Queue<Particle>> particles
private final Queue<EmitterParticle> newEmitterParticles
private final TextureManager textureManager
private final Random random
private final it.unimi.dsi.fastutil.ints.Int2ObjectMap<ParticleFactory<?>> factories
private final Map<Identifier,ParticleManager.SimpleSpriteProvider> spriteAwareFactories
private final SpriteAtlasTexture particleAtlasTexture
public ParticleManager(World world, TextureManager textureManager)
private void registerDefaultFactories()
private <T extends ParticleEffect> void registerFactory(ParticleType<T> type, ParticleFactory<T> factory)
private <T extends ParticleEffect> void registerFactory(ParticleType<T> particleType, ParticleManager.SpriteAwareFactory<T> spriteAwareFactory)
public CompletableFuture<Void> reload(ResourceReloadListener.Synchronizer synchronizer, ResourceManager manager, Profiler prepareProfiler, Profiler applyProfiler, Executor prepareExecutor, Executor applyExecutor)
reload
in interface ResourceReloadListener
public void clearAtlas()
private void loadTextureList(ResourceManager resourceManager, Identifier id, Map<Identifier,List<Identifier>> result)
public void addEmitter(Entity entity, ParticleEffect parameters)
public void addEmitter(Entity entity, ParticleEffect parameters, int maxAge)
@Nullable public Particle addParticle(ParticleEffect parameters, double x, double y, double z, double velocityX, double velocityY, double velocityZ)
@Nullable private <T extends ParticleEffect> Particle createParticle(T parameters, double x, double y, double z, double velocityX, double velocityY, double velocityZ)
public void addParticle(Particle particle)
public void tick()
private void tickParticles(Collection<Particle> collection)
private void tickParticle(Particle particle)
public void renderParticles(MatrixStack matrixStack, VertexConsumerProvider.Immediate immediate, LightmapTextureManager lightmapTextureManager, Camera camera, float float2)
public void addBlockBreakParticles(BlockPos pos, BlockState state)
public void addBlockBreakingParticles(BlockPos blockPos, Direction direction)
public String getDebugString()