Skip to content

Commit

Permalink
Update particle IDs
Browse files Browse the repository at this point in the history
  • Loading branch information
PetteriM1 authored Feb 11, 2024
1 parent 05f93b1 commit 995bf29
Showing 1 changed file with 75 additions and 72 deletions.
147 changes: 75 additions & 72 deletions src/main/java/cn/nukkit/level/particle/Particle.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,80 +28,83 @@ public abstract class Particle extends Vector3 {
public static final int TYPE_SNOWBALL_POOF = 15;
public static final int TYPE_HUGE_EXPLODE = 16;
public static final int TYPE_HUGE_EXPLODE_SEED = 17;
public static final int TYPE_MOB_FLAME = 18;
public static final int TYPE_HEART = 19;
public static final int TYPE_TERRAIN = 20;
public static final int TYPE_SUSPENDED_TOWN = 21, TYPE_TOWN_AURA = 21;
public static final int TYPE_PORTAL = 22;
// 22 same as 21
public static final int TYPE_SPLASH = 24, TYPE_WATER_SPLASH = 24;
public static final int TYPE_WATER_SPLASH_MANUAL = 25;
public static final int TYPE_WATER_WAKE = 26;
public static final int TYPE_DRIP_WATER = 27;
public static final int TYPE_DRIP_LAVA = 28;
public static final int TYPE_DRIP_HONEY = 29;
public static final int TYPE_STALACTITE_DRIP_WATER = 30;
public static final int TYPE_STALACTITE_DRIP_LAVA = 31;
public static final int TYPE_FALLING_DUST = 32, TYPE_DUST = 32;
public static final int TYPE_MOB_SPELL = 33;
public static final int TYPE_MOB_SPELL_AMBIENT = 34;
public static final int TYPE_MOB_SPELL_INSTANTANEOUS = 35;
public static final int TYPE_INK = 36;
public static final int TYPE_SLIME = 37;
public static final int TYPE_RAIN_SPLASH = 38;
public static final int TYPE_VILLAGER_ANGRY = 39;
public static final int TYPE_VILLAGER_HAPPY = 40;
public static final int TYPE_ENCHANTMENT_TABLE = 41;
public static final int TYPE_TRACKING_EMITTER = 42;
public static final int TYPE_NOTE = 43;
public static final int TYPE_WITCH_SPELL = 44;
public static final int TYPE_CARROT = 45;
public static final int TYPE_MOB_APPEARANCE = 46;
public static final int TYPE_END_ROD = 47;
public static final int TYPE_RISING_DRAGONS_BREATH = 48;
public static final int TYPE_SPIT = 49;
public static final int TYPE_TOTEM = 50;
public static final int TYPE_FOOD = 51;
public static final int TYPE_FIREWORKS_STARTER = 52;
public static final int TYPE_FIREWORKS_SPARK = 53;
public static final int TYPE_FIREWORKS_OVERLAY = 54;
public static final int TYPE_BALLOON_GAS = 55;
public static final int TYPE_COLORED_FLAME = 56;
public static final int TYPE_SPARKLER = 57;
public static final int TYPE_CONDUIT = 58;
public static final int TYPE_BUBBLE_COLUMN_UP = 59;
public static final int TYPE_BUBBLE_COLUMN_DOWN = 60;
public static final int TYPE_SNEEZE = 61;
public static final int TYPE_SHULKER_BULLET = 62;
public static final int TYPE_BLEACH = 63;
public static final int TYPE_LARGE_EXPLOSION = 64;
public static final int TYPE_MYCELIUM_DUST = 65;
public static final int TYPE_FALLING_RED_DUST = 66;
public static final int TYPE_CAMPFIRE_SMOKE = 67;
public static final int TYPE_TALL_CAMPFIRE_SMOKE = 68;
public static final int TYPE_FALLING_DRAGONS_BREATH = 69;
public static final int TYPE_DRAGONS_BREATH = 70;
public static final int TYPE_BLUE_FLAME = 71;
public static final int TYPE_SOUL = 72;
public static final int TYPE_OBSIDIAN_TEAR = 73;
public static final int TYPE_PORTAL_REVERSE = 74;
public static final int TYPE_SNOWFLAKE = 75;
public static final int TYPE_VIBRATION_SIGNAL = 76;
public static final int TYPE_SCULK_SENSOR_REDSTONE = 77;
public static final int TYPE_SPORE_BLOSSOM_SHOWER = 78;
public static final int TYPE_SPORE_BLOSSOM_AMBIENT = 79;
public static final int TYPE_WAX = 80;
public static final int TYPE_ELECTRIC_SPARK = 81;
public static final int TYPE_SHRIEK = 82;
public static final int TYPE_SCULK_SOUL = 83;
public static final int TYPE_SONIC_EXPLOSION = 84;
public static final int TYPE_BRUSH_DUST = 85;
public static final int TYPE_WIND_EXPLOSION = 18;
public static final int TYPE_MOB_FLAME = 19;
public static final int TYPE_HEART = 20;
public static final int TYPE_TERRAIN = 21;
public static final int TYPE_SUSPENDED_TOWN = 22, TYPE_TOWN_AURA = 22;
public static final int TYPE_PORTAL = 23;
public static final int TYPE_SPLASH = 25, TYPE_WATER_SPLASH = 25;
public static final int TYPE_WATER_SPLASH_MANUAL = 26;
public static final int TYPE_WATER_WAKE = 27;
public static final int TYPE_DRIP_WATER = 28;
public static final int TYPE_DRIP_LAVA = 29;
public static final int TYPE_DRIP_HONEY = 30;
public static final int TYPE_STALACTITE_DRIP_WATER = 31;
public static final int TYPE_STALACTITE_DRIP_LAVA = 32;
public static final int TYPE_FALLING_DUST = 33, TYPE_DUST = 33;
public static final int TYPE_MOB_SPELL = 34;
public static final int TYPE_MOB_SPELL_AMBIENT = 35;
public static final int TYPE_MOB_SPELL_INSTANTANEOUS = 36;
public static final int TYPE_INK = 37;
public static final int TYPE_SLIME = 38;
public static final int TYPE_RAIN_SPLASH = 39;
public static final int TYPE_VILLAGER_ANGRY = 40;
public static final int TYPE_VILLAGER_HAPPY = 41;
public static final int TYPE_ENCHANTMENT_TABLE = 42;
public static final int TYPE_TRACKING_EMITTER = 43;
public static final int TYPE_NOTE = 44;
public static final int TYPE_WITCH_SPELL = 45;
public static final int TYPE_CARROT = 46;
public static final int TYPE_MOB_APPEARANCE = 47;
public static final int TYPE_END_ROD = 48;
public static final int TYPE_DRAGON_BREATH = 49;
public static final int TYPE_SPIT = 50;
public static final int TYPE_TOTEM = 51;
public static final int TYPE_FOOD = 52;
public static final int TYPE_FIREWORKS_STARTER = 53;
public static final int TYPE_FIREWORKS_SPARK = 54;
public static final int TYPE_FIREWORKS_OVERLAY = 55;
public static final int TYPE_BALLOON_GAS = 56;
public static final int TYPE_COLORED_FLAME = 57;
public static final int TYPE_SPARKLER = 58;
public static final int TYPE_CONDUIT = 59;
public static final int TYPE_BUBBLE_COLUMN_UP = 60;
public static final int TYPE_BUBBLE_COLUMN_DOWN = 61;
public static final int TYPE_SNEEZE = 62;
public static final int TYPE_SHULKER_BULLET = 63;
public static final int TYPE_BLEACH = 64;
public static final int TYPE_DRAGON_DESTROY_BLOCK = 65;
public static final int TYPE_MYCELIUM_DUST = 66;
public static final int TYPE_FALLING_RED_DUST = 67;
public static final int TYPE_CAMPFIRE_SMOKE = 68;
public static final int TYPE_TALL_CAMPFIRE_SMOKE = 69;
public static final int TYPE_DRAGON_BREATH_FIRE = 70;
public static final int TYPE_DRAGON_BREATH_TRAIL = 71;
public static final int TYPE_BLUE_FLAME = 72;
public static final int TYPE_SOUL = 73;
public static final int TYPE_OBSIDIAN_TEAR = 74;
public static final int TYPE_PORTAL_REVERSE = 75;
public static final int TYPE_SNOWFLAKE = 76;
public static final int TYPE_VIBRATION_SIGNAL = 77;
public static final int TYPE_SCULK_SENSOR_REDSTONE = 78;
public static final int TYPE_SPORE_BLOSSOM_SHOWER = 79;
public static final int TYPE_SPORE_BLOSSOM_AMBIENT = 80;
public static final int TYPE_WAX = 81;
public static final int TYPE_ELECTRIC_SPARK = 82;
public static final int TYPE_SHRIEK = 83;
public static final int TYPE_SCULK_SOUL = 84;
public static final int TYPE_SONIC_EXPLOSION = 85;
public static final int TYPE_BRUSH_DUST = 86;
public static final int TYPE_CHERRY_LEAVES = 87;
public static final int TYPE_DUST_PLUME = 88;
public static final int TYPE_WHITE_SMOKE = 89;

public static final Integer getParticleIdByName(String name) {
public static Integer getParticleIdByName(String name) {
name = name.toUpperCase();

try {
Field field = Particle.class.getField((name.startsWith("TYPE_") == true ? name : ("TYPE_" + name)));
Field field = Particle.class.getField((name.startsWith("TYPE_") ? name : ("TYPE_" + name)));

Class<?> type = field.getType();

Expand All @@ -114,8 +117,8 @@ public static final Integer getParticleIdByName(String name) {
return null;
}

public static final boolean particleExists(String name) {
return getParticleIdByName(name) != null;
public static boolean particleExists(String name) {
return getParticleIdByName(name) != null;
}

public Particle() {
Expand Down

0 comments on commit 995bf29

Please sign in to comment.