org.spongepowered.api.effect.particle.ParticleOptions Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spongeapi Show documentation
Show all versions of spongeapi Show documentation
A plugin API for Minecraft: Java Edition
The newest version!
/*
* This file is part of SpongeAPI, licensed under the MIT License (MIT).
*
* Copyright (c) SpongePowered
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package org.spongepowered.api.effect.particle;
import org.spongepowered.api.ResourceKey;
import org.spongepowered.api.Sponge;
import org.spongepowered.api.block.BlockState;
import org.spongepowered.api.item.inventory.ItemStackSnapshot;
import org.spongepowered.api.registry.DefaultedRegistryReference;
import org.spongepowered.api.registry.Registry;
import org.spongepowered.api.registry.RegistryKey;
import org.spongepowered.api.registry.RegistryScope;
import org.spongepowered.api.registry.RegistryScopes;
import org.spongepowered.api.registry.RegistryTypes;
import org.spongepowered.api.util.Color;
import org.spongepowered.api.util.Ticks;
import org.spongepowered.api.world.PositionSource;
import org.spongepowered.math.vector.Vector3d;
/**
* An enumeration of all possible {@link ParticleOption}s in vanilla minecraft.
*/
@SuppressWarnings("unused")
@RegistryScopes(scopes = RegistryScope.GAME)
public final class ParticleOptions {
// @formatter:off
// SORTFIELDS:ON
/**
* This option will affect the appearance of a particle. The only vanilla
* {@link ParticleType}s that this option is applicable to are:
*
*
* - {@link ParticleTypes#BLOCK}
* - {@link ParticleTypes#BLOCK_MARKER}
* - {@link ParticleTypes#DUST_PILLAR}
* - {@link ParticleTypes#FALLING_DUST}
*
*/
public static final DefaultedRegistryReference> BLOCK_STATE = ParticleOptions.key(ResourceKey.sponge("block_state"));
/**
* This option will modify the color of a particle. The only vanilla
* {@link ParticleType}s this option is applicable to are:
*
*
* - {@link ParticleTypes#ENTITY_EFFECT}
* - {@link ParticleTypes#DUST}
* - {@link ParticleTypes#DUST_COLOR_TRANSITION}
*
*/
public static final DefaultedRegistryReference> COLOR = ParticleOptions.key(ResourceKey.sponge("color"));
/**
* This option will affect the delay of particles that are spawned.
* The only vanilla {@link ParticleType} this option is applicable to is:
*
*
* - {@link ParticleTypes#SHRIEK}
*
*/
public static final DefaultedRegistryReference> DELAY = ParticleOptions.key(ResourceKey.sponge("delay"));
/**
* This option will affect the destination of a particle.
* The only vanilla {@link ParticleType} this option is applicable to is:
*
*
* - {@link ParticleTypes#VIBRATION}
*
*/
public static final DefaultedRegistryReference> DESTINATION = ParticleOptions.key(ResourceKey.sponge("destination"));
/**
* This option will affect the appearance of a particle. The only vanilla
* {@link ParticleType} this option is applicable to is:
*
*
* - {@link ParticleTypes#ITEM}
*
*
* The item stack snapshot may never be empty, or a {@link IllegalArgumentException}
* will be thrown when applying
*/
public static final DefaultedRegistryReference> ITEM_STACK_SNAPSHOT = ParticleOptions.key(ResourceKey.sponge("item_stack_snapshot"));
/**
* This option will affect how all the particles are spread.
*/
public static final DefaultedRegistryReference> OFFSET = ParticleOptions.key(ResourceKey.sponge("offset"));
/**
* This option will affect the opacity of a particle.
* The only vanilla {@link ParticleType} this option is applicable to is:
*
*
* - {@link ParticleTypes#ENTITY_EFFECT}
*
*
* The opacity must be between 0 and 1, or a {@link IllegalArgumentException}
* will be thrown when applying.
*/
public static final DefaultedRegistryReference> OPACITY = ParticleOptions.key(ResourceKey.sponge("opacity"));
/**
* This option will affect the amount of particles that are spawned.
*
* The quantity must be at least 1, or a {@link IllegalArgumentException}
* will be thrown when applying.
*/
public static final DefaultedRegistryReference> QUANTITY = ParticleOptions.key(ResourceKey.sponge("quantity"));
/**
* This option will change the roll of a particle. The only
* vanilla {@link ParticleType} this option is applicable to is:
*
*
* - {@link ParticleTypes#SCULK_CHARGE}
*
*/
public static final DefaultedRegistryReference> ROLL = ParticleOptions.key(ResourceKey.sponge("roll"));
/**
* This option will change the scale of a particle. The only
* vanilla {@link ParticleType}s this option is applicable to are:
*
*
* - {@link ParticleTypes#DUST}
* - {@link ParticleTypes#DUST_COLOR_TRANSITION}
*
*
* The scale may never be negative, or a {@link IllegalArgumentException}
* will be thrown when applying.
*/
public static final DefaultedRegistryReference> SCALE = ParticleOptions.key(ResourceKey.sponge("scale"));
/**
* This option will change the color the transition particle will change to.
* The only vanilla {@link ParticleType} this option is applicable to is:
*
*
* - {@link ParticleTypes#DUST_COLOR_TRANSITION}
*
*/
public static final DefaultedRegistryReference> TO_COLOR = ParticleOptions.key(ResourceKey.sponge("to_color"));
/**
* This option will change the travel time of a particle.
* The only vanilla {@link ParticleType} this option is applicable to is:
*
*
* - {@link ParticleTypes#VIBRATION}
*
*/
public static final DefaultedRegistryReference> TRAVEL_TIME = ParticleOptions.key(ResourceKey.sponge("travel_time"));
/**
* This option will affect how most particles are moving.
*/
public static final DefaultedRegistryReference> VELOCITY = ParticleOptions.key(ResourceKey.sponge("velocity"));
// SORTFIELDS:OFF
// @formatter:on
private ParticleOptions() {
}
public static Registry> registry() {
return Sponge.game().registry(RegistryTypes.PARTICLE_OPTION);
}
private static DefaultedRegistryReference> key(final ResourceKey location) {
return RegistryKey.of(RegistryTypes.PARTICLE_OPTION, location).asDefaultedReference(Sponge::game);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy