mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-30 12:01:26 +01:00
ItemEnumGenerator converted to Javapoet and re-generation of everything
This commit is contained in:
parent
6577c6070c
commit
48670e8c37
@ -1,140 +1,250 @@
|
|||||||
//==============================
|
|
||||||
// AUTOGENERATED BY EnumGenerator
|
|
||||||
//==============================
|
|
||||||
package net.minestom.server.entity;
|
package net.minestom.server.entity;
|
||||||
|
|
||||||
import net.minestom.server.registry.Registries;
|
import net.minestom.server.registry.Registries;
|
||||||
import net.minestom.server.utils.NamespaceID;
|
import net.minestom.server.utils.NamespaceID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* //==============================
|
||||||
|
* // AUTOGENERATED BY EnumGenerator
|
||||||
|
* //==============================
|
||||||
|
*/
|
||||||
@SuppressWarnings({"deprecation"})
|
@SuppressWarnings({"deprecation"})
|
||||||
|
|
||||||
public enum EntityType {
|
public enum EntityType {
|
||||||
AREA_EFFECT_CLOUD("minecraft:area_effect_cloud"),
|
AREA_EFFECT_CLOUD("minecraft:area_effect_cloud"),
|
||||||
ARMOR_STAND("minecraft:armor_stand"),
|
|
||||||
ARROW("minecraft:arrow"),
|
|
||||||
BAT("minecraft:bat"),
|
|
||||||
BEE("minecraft:bee"),
|
|
||||||
BLAZE("minecraft:blaze"),
|
|
||||||
BOAT("minecraft:boat"),
|
|
||||||
CAT("minecraft:cat"),
|
|
||||||
CAVE_SPIDER("minecraft:cave_spider"),
|
|
||||||
CHICKEN("minecraft:chicken"),
|
|
||||||
COD("minecraft:cod"),
|
|
||||||
COW("minecraft:cow"),
|
|
||||||
CREEPER("minecraft:creeper"),
|
|
||||||
DOLPHIN("minecraft:dolphin"),
|
|
||||||
DONKEY("minecraft:donkey"),
|
|
||||||
DRAGON_FIREBALL("minecraft:dragon_fireball"),
|
|
||||||
DROWNED("minecraft:drowned"),
|
|
||||||
ELDER_GUARDIAN("minecraft:elder_guardian"),
|
|
||||||
END_CRYSTAL("minecraft:end_crystal"),
|
|
||||||
ENDER_DRAGON("minecraft:ender_dragon"),
|
|
||||||
ENDERMAN("minecraft:enderman"),
|
|
||||||
ENDERMITE("minecraft:endermite"),
|
|
||||||
EVOKER("minecraft:evoker"),
|
|
||||||
EVOKER_FANGS("minecraft:evoker_fangs"),
|
|
||||||
EXPERIENCE_ORB("minecraft:experience_orb"),
|
|
||||||
EYE_OF_ENDER("minecraft:eye_of_ender"),
|
|
||||||
FALLING_BLOCK("minecraft:falling_block"),
|
|
||||||
FIREWORK_ROCKET("minecraft:firework_rocket"),
|
|
||||||
FOX("minecraft:fox"),
|
|
||||||
GHAST("minecraft:ghast"),
|
|
||||||
GIANT("minecraft:giant"),
|
|
||||||
GUARDIAN("minecraft:guardian"),
|
|
||||||
HOGLIN("minecraft:hoglin"),
|
|
||||||
HORSE("minecraft:horse"),
|
|
||||||
HUSK("minecraft:husk"),
|
|
||||||
ILLUSIONER("minecraft:illusioner"),
|
|
||||||
IRON_GOLEM("minecraft:iron_golem"),
|
|
||||||
ITEM("minecraft:item"),
|
|
||||||
ITEM_FRAME("minecraft:item_frame"),
|
|
||||||
FIREBALL("minecraft:fireball"),
|
|
||||||
LEASH_KNOT("minecraft:leash_knot"),
|
|
||||||
LIGHTNING_BOLT("minecraft:lightning_bolt"),
|
|
||||||
LLAMA("minecraft:llama"),
|
|
||||||
LLAMA_SPIT("minecraft:llama_spit"),
|
|
||||||
MAGMA_CUBE("minecraft:magma_cube"),
|
|
||||||
MINECART("minecraft:minecart"),
|
|
||||||
CHEST_MINECART("minecraft:chest_minecart"),
|
|
||||||
COMMAND_BLOCK_MINECART("minecraft:command_block_minecart"),
|
|
||||||
FURNACE_MINECART("minecraft:furnace_minecart"),
|
|
||||||
HOPPER_MINECART("minecraft:hopper_minecart"),
|
|
||||||
SPAWNER_MINECART("minecraft:spawner_minecart"),
|
|
||||||
TNT_MINECART("minecraft:tnt_minecart"),
|
|
||||||
MULE("minecraft:mule"),
|
|
||||||
MOOSHROOM("minecraft:mooshroom"),
|
|
||||||
OCELOT("minecraft:ocelot"),
|
|
||||||
PAINTING("minecraft:painting"),
|
|
||||||
PANDA("minecraft:panda"),
|
|
||||||
PARROT("minecraft:parrot"),
|
|
||||||
PHANTOM("minecraft:phantom"),
|
|
||||||
PIG("minecraft:pig"),
|
|
||||||
PIGLIN("minecraft:piglin"),
|
|
||||||
PIGLIN_BRUTE("minecraft:piglin_brute"),
|
|
||||||
PILLAGER("minecraft:pillager"),
|
|
||||||
POLAR_BEAR("minecraft:polar_bear"),
|
|
||||||
TNT("minecraft:tnt"),
|
|
||||||
PUFFERFISH("minecraft:pufferfish"),
|
|
||||||
RABBIT("minecraft:rabbit"),
|
|
||||||
RAVAGER("minecraft:ravager"),
|
|
||||||
SALMON("minecraft:salmon"),
|
|
||||||
SHEEP("minecraft:sheep"),
|
|
||||||
SHULKER("minecraft:shulker"),
|
|
||||||
SHULKER_BULLET("minecraft:shulker_bullet"),
|
|
||||||
SILVERFISH("minecraft:silverfish"),
|
|
||||||
SKELETON("minecraft:skeleton"),
|
|
||||||
SKELETON_HORSE("minecraft:skeleton_horse"),
|
|
||||||
SLIME("minecraft:slime"),
|
|
||||||
SMALL_FIREBALL("minecraft:small_fireball"),
|
|
||||||
SNOW_GOLEM("minecraft:snow_golem"),
|
|
||||||
SNOWBALL("minecraft:snowball"),
|
|
||||||
SPECTRAL_ARROW("minecraft:spectral_arrow"),
|
|
||||||
SPIDER("minecraft:spider"),
|
|
||||||
SQUID("minecraft:squid"),
|
|
||||||
STRAY("minecraft:stray"),
|
|
||||||
STRIDER("minecraft:strider"),
|
|
||||||
EGG("minecraft:egg"),
|
|
||||||
ENDER_PEARL("minecraft:ender_pearl"),
|
|
||||||
EXPERIENCE_BOTTLE("minecraft:experience_bottle"),
|
|
||||||
POTION("minecraft:potion"),
|
|
||||||
TRIDENT("minecraft:trident"),
|
|
||||||
TRADER_LLAMA("minecraft:trader_llama"),
|
|
||||||
TROPICAL_FISH("minecraft:tropical_fish"),
|
|
||||||
TURTLE("minecraft:turtle"),
|
|
||||||
VEX("minecraft:vex"),
|
|
||||||
VILLAGER("minecraft:villager"),
|
|
||||||
VINDICATOR("minecraft:vindicator"),
|
|
||||||
WANDERING_TRADER("minecraft:wandering_trader"),
|
|
||||||
WITCH("minecraft:witch"),
|
|
||||||
WITHER("minecraft:wither"),
|
|
||||||
WITHER_SKELETON("minecraft:wither_skeleton"),
|
|
||||||
WITHER_SKULL("minecraft:wither_skull"),
|
|
||||||
WOLF("minecraft:wolf"),
|
|
||||||
ZOGLIN("minecraft:zoglin"),
|
|
||||||
ZOMBIE("minecraft:zombie"),
|
|
||||||
ZOMBIE_HORSE("minecraft:zombie_horse"),
|
|
||||||
ZOMBIE_VILLAGER("minecraft:zombie_villager"),
|
|
||||||
ZOMBIFIED_PIGLIN("minecraft:zombified_piglin"),
|
|
||||||
PLAYER("minecraft:player"),
|
|
||||||
FISHING_BOBBER("minecraft:fishing_bobber"),
|
|
||||||
;
|
|
||||||
private String namespaceID;
|
|
||||||
|
|
||||||
EntityType(String namespaceID) {
|
ARMOR_STAND("minecraft:armor_stand"),
|
||||||
this.namespaceID = namespaceID;
|
|
||||||
Registries.entityTypes.put(NamespaceID.from(namespaceID), this);
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getId() {
|
ARROW("minecraft:arrow"),
|
||||||
return ordinal();
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getNamespaceID() {
|
BAT("minecraft:bat"),
|
||||||
return namespaceID;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static EntityType fromId(int id) {
|
BEE("minecraft:bee"),
|
||||||
if(id >= 0 && id < values().length) {
|
|
||||||
return values()[id];
|
BLAZE("minecraft:blaze"),
|
||||||
}
|
|
||||||
return PIG;
|
BOAT("minecraft:boat"),
|
||||||
}
|
|
||||||
|
CAT("minecraft:cat"),
|
||||||
|
|
||||||
|
CAVE_SPIDER("minecraft:cave_spider"),
|
||||||
|
|
||||||
|
CHICKEN("minecraft:chicken"),
|
||||||
|
|
||||||
|
COD("minecraft:cod"),
|
||||||
|
|
||||||
|
COW("minecraft:cow"),
|
||||||
|
|
||||||
|
CREEPER("minecraft:creeper"),
|
||||||
|
|
||||||
|
DOLPHIN("minecraft:dolphin"),
|
||||||
|
|
||||||
|
DONKEY("minecraft:donkey"),
|
||||||
|
|
||||||
|
DRAGON_FIREBALL("minecraft:dragon_fireball"),
|
||||||
|
|
||||||
|
DROWNED("minecraft:drowned"),
|
||||||
|
|
||||||
|
ELDER_GUARDIAN("minecraft:elder_guardian"),
|
||||||
|
|
||||||
|
END_CRYSTAL("minecraft:end_crystal"),
|
||||||
|
|
||||||
|
ENDER_DRAGON("minecraft:ender_dragon"),
|
||||||
|
|
||||||
|
ENDERMAN("minecraft:enderman"),
|
||||||
|
|
||||||
|
ENDERMITE("minecraft:endermite"),
|
||||||
|
|
||||||
|
EVOKER("minecraft:evoker"),
|
||||||
|
|
||||||
|
EVOKER_FANGS("minecraft:evoker_fangs"),
|
||||||
|
|
||||||
|
EXPERIENCE_ORB("minecraft:experience_orb"),
|
||||||
|
|
||||||
|
EYE_OF_ENDER("minecraft:eye_of_ender"),
|
||||||
|
|
||||||
|
FALLING_BLOCK("minecraft:falling_block"),
|
||||||
|
|
||||||
|
FIREWORK_ROCKET("minecraft:firework_rocket"),
|
||||||
|
|
||||||
|
FOX("minecraft:fox"),
|
||||||
|
|
||||||
|
GHAST("minecraft:ghast"),
|
||||||
|
|
||||||
|
GIANT("minecraft:giant"),
|
||||||
|
|
||||||
|
GUARDIAN("minecraft:guardian"),
|
||||||
|
|
||||||
|
HOGLIN("minecraft:hoglin"),
|
||||||
|
|
||||||
|
HORSE("minecraft:horse"),
|
||||||
|
|
||||||
|
HUSK("minecraft:husk"),
|
||||||
|
|
||||||
|
ILLUSIONER("minecraft:illusioner"),
|
||||||
|
|
||||||
|
IRON_GOLEM("minecraft:iron_golem"),
|
||||||
|
|
||||||
|
ITEM("minecraft:item"),
|
||||||
|
|
||||||
|
ITEM_FRAME("minecraft:item_frame"),
|
||||||
|
|
||||||
|
FIREBALL("minecraft:fireball"),
|
||||||
|
|
||||||
|
LEASH_KNOT("minecraft:leash_knot"),
|
||||||
|
|
||||||
|
LIGHTNING_BOLT("minecraft:lightning_bolt"),
|
||||||
|
|
||||||
|
LLAMA("minecraft:llama"),
|
||||||
|
|
||||||
|
LLAMA_SPIT("minecraft:llama_spit"),
|
||||||
|
|
||||||
|
MAGMA_CUBE("minecraft:magma_cube"),
|
||||||
|
|
||||||
|
MINECART("minecraft:minecart"),
|
||||||
|
|
||||||
|
CHEST_MINECART("minecraft:chest_minecart"),
|
||||||
|
|
||||||
|
COMMAND_BLOCK_MINECART("minecraft:command_block_minecart"),
|
||||||
|
|
||||||
|
FURNACE_MINECART("minecraft:furnace_minecart"),
|
||||||
|
|
||||||
|
HOPPER_MINECART("minecraft:hopper_minecart"),
|
||||||
|
|
||||||
|
SPAWNER_MINECART("minecraft:spawner_minecart"),
|
||||||
|
|
||||||
|
TNT_MINECART("minecraft:tnt_minecart"),
|
||||||
|
|
||||||
|
MULE("minecraft:mule"),
|
||||||
|
|
||||||
|
MOOSHROOM("minecraft:mooshroom"),
|
||||||
|
|
||||||
|
OCELOT("minecraft:ocelot"),
|
||||||
|
|
||||||
|
PAINTING("minecraft:painting"),
|
||||||
|
|
||||||
|
PANDA("minecraft:panda"),
|
||||||
|
|
||||||
|
PARROT("minecraft:parrot"),
|
||||||
|
|
||||||
|
PHANTOM("minecraft:phantom"),
|
||||||
|
|
||||||
|
PIG("minecraft:pig"),
|
||||||
|
|
||||||
|
PIGLIN("minecraft:piglin"),
|
||||||
|
|
||||||
|
PIGLIN_BRUTE("minecraft:piglin_brute"),
|
||||||
|
|
||||||
|
PILLAGER("minecraft:pillager"),
|
||||||
|
|
||||||
|
POLAR_BEAR("minecraft:polar_bear"),
|
||||||
|
|
||||||
|
TNT("minecraft:tnt"),
|
||||||
|
|
||||||
|
PUFFERFISH("minecraft:pufferfish"),
|
||||||
|
|
||||||
|
RABBIT("minecraft:rabbit"),
|
||||||
|
|
||||||
|
RAVAGER("minecraft:ravager"),
|
||||||
|
|
||||||
|
SALMON("minecraft:salmon"),
|
||||||
|
|
||||||
|
SHEEP("minecraft:sheep"),
|
||||||
|
|
||||||
|
SHULKER("minecraft:shulker"),
|
||||||
|
|
||||||
|
SHULKER_BULLET("minecraft:shulker_bullet"),
|
||||||
|
|
||||||
|
SILVERFISH("minecraft:silverfish"),
|
||||||
|
|
||||||
|
SKELETON("minecraft:skeleton"),
|
||||||
|
|
||||||
|
SKELETON_HORSE("minecraft:skeleton_horse"),
|
||||||
|
|
||||||
|
SLIME("minecraft:slime"),
|
||||||
|
|
||||||
|
SMALL_FIREBALL("minecraft:small_fireball"),
|
||||||
|
|
||||||
|
SNOW_GOLEM("minecraft:snow_golem"),
|
||||||
|
|
||||||
|
SNOWBALL("minecraft:snowball"),
|
||||||
|
|
||||||
|
SPECTRAL_ARROW("minecraft:spectral_arrow"),
|
||||||
|
|
||||||
|
SPIDER("minecraft:spider"),
|
||||||
|
|
||||||
|
SQUID("minecraft:squid"),
|
||||||
|
|
||||||
|
STRAY("minecraft:stray"),
|
||||||
|
|
||||||
|
STRIDER("minecraft:strider"),
|
||||||
|
|
||||||
|
EGG("minecraft:egg"),
|
||||||
|
|
||||||
|
ENDER_PEARL("minecraft:ender_pearl"),
|
||||||
|
|
||||||
|
EXPERIENCE_BOTTLE("minecraft:experience_bottle"),
|
||||||
|
|
||||||
|
POTION("minecraft:potion"),
|
||||||
|
|
||||||
|
TRIDENT("minecraft:trident"),
|
||||||
|
|
||||||
|
TRADER_LLAMA("minecraft:trader_llama"),
|
||||||
|
|
||||||
|
TROPICAL_FISH("minecraft:tropical_fish"),
|
||||||
|
|
||||||
|
TURTLE("minecraft:turtle"),
|
||||||
|
|
||||||
|
VEX("minecraft:vex"),
|
||||||
|
|
||||||
|
VILLAGER("minecraft:villager"),
|
||||||
|
|
||||||
|
VINDICATOR("minecraft:vindicator"),
|
||||||
|
|
||||||
|
WANDERING_TRADER("minecraft:wandering_trader"),
|
||||||
|
|
||||||
|
WITCH("minecraft:witch"),
|
||||||
|
|
||||||
|
WITHER("minecraft:wither"),
|
||||||
|
|
||||||
|
WITHER_SKELETON("minecraft:wither_skeleton"),
|
||||||
|
|
||||||
|
WITHER_SKULL("minecraft:wither_skull"),
|
||||||
|
|
||||||
|
WOLF("minecraft:wolf"),
|
||||||
|
|
||||||
|
ZOGLIN("minecraft:zoglin"),
|
||||||
|
|
||||||
|
ZOMBIE("minecraft:zombie"),
|
||||||
|
|
||||||
|
ZOMBIE_HORSE("minecraft:zombie_horse"),
|
||||||
|
|
||||||
|
ZOMBIE_VILLAGER("minecraft:zombie_villager"),
|
||||||
|
|
||||||
|
ZOMBIFIED_PIGLIN("minecraft:zombified_piglin"),
|
||||||
|
|
||||||
|
PLAYER("minecraft:player"),
|
||||||
|
|
||||||
|
FISHING_BOBBER("minecraft:fishing_bobber");
|
||||||
|
|
||||||
|
private String namespaceID;
|
||||||
|
|
||||||
|
EntityType(String namespaceID) {
|
||||||
|
this.namespaceID = namespaceID;
|
||||||
|
Registries.entityTypes.put(NamespaceID.from(namespaceID), this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getId() {
|
||||||
|
return ordinal();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNamespaceID() {
|
||||||
|
return namespaceID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static EntityType fromId(int id) {
|
||||||
|
if(id >= 0 && id < values().length) {
|
||||||
|
return values()[id];
|
||||||
|
}
|
||||||
|
return PIG;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,37 +1,44 @@
|
|||||||
//==============================
|
|
||||||
// AUTOGENERATED BY EnumGenerator
|
|
||||||
//==============================
|
|
||||||
package net.minestom.server.fluids;
|
package net.minestom.server.fluids;
|
||||||
|
|
||||||
import net.minestom.server.registry.Registries;
|
import net.minestom.server.registry.Registries;
|
||||||
import net.minestom.server.utils.NamespaceID;
|
import net.minestom.server.utils.NamespaceID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* //==============================
|
||||||
|
* // AUTOGENERATED BY EnumGenerator
|
||||||
|
* //==============================
|
||||||
|
*/
|
||||||
@SuppressWarnings({"deprecation"})
|
@SuppressWarnings({"deprecation"})
|
||||||
|
|
||||||
public enum Fluid {
|
public enum Fluid {
|
||||||
EMPTY("minecraft:empty"),
|
EMPTY("minecraft:empty"),
|
||||||
FLOWING_WATER("minecraft:flowing_water"),
|
|
||||||
WATER("minecraft:water"),
|
|
||||||
FLOWING_LAVA("minecraft:flowing_lava"),
|
|
||||||
LAVA("minecraft:lava"),
|
|
||||||
;
|
|
||||||
private String namespaceID;
|
|
||||||
|
|
||||||
Fluid(String namespaceID) {
|
FLOWING_WATER("minecraft:flowing_water"),
|
||||||
this.namespaceID = namespaceID;
|
|
||||||
Registries.fluids.put(NamespaceID.from(namespaceID), this);
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getId() {
|
WATER("minecraft:water"),
|
||||||
return ordinal();
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getNamespaceID() {
|
FLOWING_LAVA("minecraft:flowing_lava"),
|
||||||
return namespaceID;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Fluid fromId(int id) {
|
LAVA("minecraft:lava");
|
||||||
if(id >= 0 && id < values().length) {
|
|
||||||
return values()[id];
|
private String namespaceID;
|
||||||
}
|
|
||||||
return EMPTY;
|
Fluid(String namespaceID) {
|
||||||
}
|
this.namespaceID = namespaceID;
|
||||||
|
Registries.fluids.put(NamespaceID.from(namespaceID), this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getId() {
|
||||||
|
return ordinal();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNamespaceID() {
|
||||||
|
return namespaceID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Fluid fromId(int id) {
|
||||||
|
if(id >= 0 && id < values().length) {
|
||||||
|
return values()[id];
|
||||||
|
}
|
||||||
|
return EMPTY;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,70 +1,110 @@
|
|||||||
//==============================
|
|
||||||
// AUTOGENERATED BY EnumGenerator
|
|
||||||
//==============================
|
|
||||||
package net.minestom.server.item;
|
package net.minestom.server.item;
|
||||||
|
|
||||||
import net.minestom.server.registry.Registries;
|
import net.minestom.server.registry.Registries;
|
||||||
import net.minestom.server.utils.NamespaceID;
|
import net.minestom.server.utils.NamespaceID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* //==============================
|
||||||
|
* // AUTOGENERATED BY EnumGenerator
|
||||||
|
* //==============================
|
||||||
|
*/
|
||||||
@SuppressWarnings({"deprecation"})
|
@SuppressWarnings({"deprecation"})
|
||||||
|
|
||||||
public enum Enchantment {
|
public enum Enchantment {
|
||||||
PROTECTION("minecraft:protection"),
|
PROTECTION("minecraft:protection"),
|
||||||
FIRE_PROTECTION("minecraft:fire_protection"),
|
|
||||||
FEATHER_FALLING("minecraft:feather_falling"),
|
|
||||||
BLAST_PROTECTION("minecraft:blast_protection"),
|
|
||||||
PROJECTILE_PROTECTION("minecraft:projectile_protection"),
|
|
||||||
RESPIRATION("minecraft:respiration"),
|
|
||||||
AQUA_AFFINITY("minecraft:aqua_affinity"),
|
|
||||||
THORNS("minecraft:thorns"),
|
|
||||||
DEPTH_STRIDER("minecraft:depth_strider"),
|
|
||||||
FROST_WALKER("minecraft:frost_walker"),
|
|
||||||
BINDING_CURSE("minecraft:binding_curse"),
|
|
||||||
SOUL_SPEED("minecraft:soul_speed"),
|
|
||||||
SHARPNESS("minecraft:sharpness"),
|
|
||||||
SMITE("minecraft:smite"),
|
|
||||||
BANE_OF_ARTHROPODS("minecraft:bane_of_arthropods"),
|
|
||||||
KNOCKBACK("minecraft:knockback"),
|
|
||||||
FIRE_ASPECT("minecraft:fire_aspect"),
|
|
||||||
LOOTING("minecraft:looting"),
|
|
||||||
SWEEPING("minecraft:sweeping"),
|
|
||||||
EFFICIENCY("minecraft:efficiency"),
|
|
||||||
SILK_TOUCH("minecraft:silk_touch"),
|
|
||||||
UNBREAKING("minecraft:unbreaking"),
|
|
||||||
FORTUNE("minecraft:fortune"),
|
|
||||||
POWER("minecraft:power"),
|
|
||||||
PUNCH("minecraft:punch"),
|
|
||||||
FLAME("minecraft:flame"),
|
|
||||||
INFINITY("minecraft:infinity"),
|
|
||||||
LUCK_OF_THE_SEA("minecraft:luck_of_the_sea"),
|
|
||||||
LURE("minecraft:lure"),
|
|
||||||
LOYALTY("minecraft:loyalty"),
|
|
||||||
IMPALING("minecraft:impaling"),
|
|
||||||
RIPTIDE("minecraft:riptide"),
|
|
||||||
CHANNELING("minecraft:channeling"),
|
|
||||||
MULTISHOT("minecraft:multishot"),
|
|
||||||
QUICK_CHARGE("minecraft:quick_charge"),
|
|
||||||
PIERCING("minecraft:piercing"),
|
|
||||||
MENDING("minecraft:mending"),
|
|
||||||
VANISHING_CURSE("minecraft:vanishing_curse"),
|
|
||||||
;
|
|
||||||
private String namespaceID;
|
|
||||||
|
|
||||||
Enchantment(String namespaceID) {
|
FIRE_PROTECTION("minecraft:fire_protection"),
|
||||||
this.namespaceID = namespaceID;
|
|
||||||
Registries.enchantments.put(NamespaceID.from(namespaceID), this);
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getId() {
|
FEATHER_FALLING("minecraft:feather_falling"),
|
||||||
return ordinal();
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getNamespaceID() {
|
BLAST_PROTECTION("minecraft:blast_protection"),
|
||||||
return namespaceID;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Enchantment fromId(int id) {
|
PROJECTILE_PROTECTION("minecraft:projectile_protection"),
|
||||||
if(id >= 0 && id < values().length) {
|
|
||||||
return values()[id];
|
RESPIRATION("minecraft:respiration"),
|
||||||
}
|
|
||||||
return null;
|
AQUA_AFFINITY("minecraft:aqua_affinity"),
|
||||||
}
|
|
||||||
|
THORNS("minecraft:thorns"),
|
||||||
|
|
||||||
|
DEPTH_STRIDER("minecraft:depth_strider"),
|
||||||
|
|
||||||
|
FROST_WALKER("minecraft:frost_walker"),
|
||||||
|
|
||||||
|
BINDING_CURSE("minecraft:binding_curse"),
|
||||||
|
|
||||||
|
SOUL_SPEED("minecraft:soul_speed"),
|
||||||
|
|
||||||
|
SHARPNESS("minecraft:sharpness"),
|
||||||
|
|
||||||
|
SMITE("minecraft:smite"),
|
||||||
|
|
||||||
|
BANE_OF_ARTHROPODS("minecraft:bane_of_arthropods"),
|
||||||
|
|
||||||
|
KNOCKBACK("minecraft:knockback"),
|
||||||
|
|
||||||
|
FIRE_ASPECT("minecraft:fire_aspect"),
|
||||||
|
|
||||||
|
LOOTING("minecraft:looting"),
|
||||||
|
|
||||||
|
SWEEPING("minecraft:sweeping"),
|
||||||
|
|
||||||
|
EFFICIENCY("minecraft:efficiency"),
|
||||||
|
|
||||||
|
SILK_TOUCH("minecraft:silk_touch"),
|
||||||
|
|
||||||
|
UNBREAKING("minecraft:unbreaking"),
|
||||||
|
|
||||||
|
FORTUNE("minecraft:fortune"),
|
||||||
|
|
||||||
|
POWER("minecraft:power"),
|
||||||
|
|
||||||
|
PUNCH("minecraft:punch"),
|
||||||
|
|
||||||
|
FLAME("minecraft:flame"),
|
||||||
|
|
||||||
|
INFINITY("minecraft:infinity"),
|
||||||
|
|
||||||
|
LUCK_OF_THE_SEA("minecraft:luck_of_the_sea"),
|
||||||
|
|
||||||
|
LURE("minecraft:lure"),
|
||||||
|
|
||||||
|
LOYALTY("minecraft:loyalty"),
|
||||||
|
|
||||||
|
IMPALING("minecraft:impaling"),
|
||||||
|
|
||||||
|
RIPTIDE("minecraft:riptide"),
|
||||||
|
|
||||||
|
CHANNELING("minecraft:channeling"),
|
||||||
|
|
||||||
|
MULTISHOT("minecraft:multishot"),
|
||||||
|
|
||||||
|
QUICK_CHARGE("minecraft:quick_charge"),
|
||||||
|
|
||||||
|
PIERCING("minecraft:piercing"),
|
||||||
|
|
||||||
|
MENDING("minecraft:mending"),
|
||||||
|
|
||||||
|
VANISHING_CURSE("minecraft:vanishing_curse");
|
||||||
|
|
||||||
|
private String namespaceID;
|
||||||
|
|
||||||
|
Enchantment(String namespaceID) {
|
||||||
|
this.namespaceID = namespaceID;
|
||||||
|
Registries.enchantments.put(NamespaceID.from(namespaceID), this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getId() {
|
||||||
|
return ordinal();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNamespaceID() {
|
||||||
|
return namespaceID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Enchantment fromId(int id) {
|
||||||
|
if(id >= 0 && id < values().length) {
|
||||||
|
return values()[id];
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,5 +0,0 @@
|
|||||||
package net.minestom.server.item;
|
|
||||||
import it.unimi.dsi.fastutil.shorts.Short2ObjectOpenHashMap;
|
|
||||||
final class MaterialMap {
|
|
||||||
static final Short2ObjectOpenHashMap<Material> map = new Short2ObjectOpenHashMap<>();
|
|
||||||
}
|
|
@ -1,104 +1,178 @@
|
|||||||
//==============================
|
|
||||||
// AUTOGENERATED BY EnumGenerator
|
|
||||||
//==============================
|
|
||||||
package net.minestom.server.particle;
|
package net.minestom.server.particle;
|
||||||
|
|
||||||
import net.minestom.server.registry.Registries;
|
import net.minestom.server.registry.Registries;
|
||||||
import net.minestom.server.utils.NamespaceID;
|
import net.minestom.server.utils.NamespaceID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* //==============================
|
||||||
|
* // AUTOGENERATED BY EnumGenerator
|
||||||
|
* //==============================
|
||||||
|
*/
|
||||||
@SuppressWarnings({"deprecation"})
|
@SuppressWarnings({"deprecation"})
|
||||||
|
|
||||||
public enum Particle {
|
public enum Particle {
|
||||||
AMBIENT_ENTITY_EFFECT("minecraft:ambient_entity_effect"),
|
AMBIENT_ENTITY_EFFECT("minecraft:ambient_entity_effect"),
|
||||||
ANGRY_VILLAGER("minecraft:angry_villager"),
|
|
||||||
BARRIER("minecraft:barrier"),
|
|
||||||
BLOCK("minecraft:block"),
|
|
||||||
BUBBLE("minecraft:bubble"),
|
|
||||||
CLOUD("minecraft:cloud"),
|
|
||||||
CRIT("minecraft:crit"),
|
|
||||||
DAMAGE_INDICATOR("minecraft:damage_indicator"),
|
|
||||||
DRAGON_BREATH("minecraft:dragon_breath"),
|
|
||||||
DRIPPING_LAVA("minecraft:dripping_lava"),
|
|
||||||
FALLING_LAVA("minecraft:falling_lava"),
|
|
||||||
LANDING_LAVA("minecraft:landing_lava"),
|
|
||||||
DRIPPING_WATER("minecraft:dripping_water"),
|
|
||||||
FALLING_WATER("minecraft:falling_water"),
|
|
||||||
DUST("minecraft:dust"),
|
|
||||||
EFFECT("minecraft:effect"),
|
|
||||||
ELDER_GUARDIAN("minecraft:elder_guardian"),
|
|
||||||
ENCHANTED_HIT("minecraft:enchanted_hit"),
|
|
||||||
ENCHANT("minecraft:enchant"),
|
|
||||||
END_ROD("minecraft:end_rod"),
|
|
||||||
ENTITY_EFFECT("minecraft:entity_effect"),
|
|
||||||
EXPLOSION_EMITTER("minecraft:explosion_emitter"),
|
|
||||||
EXPLOSION("minecraft:explosion"),
|
|
||||||
FALLING_DUST("minecraft:falling_dust"),
|
|
||||||
FIREWORK("minecraft:firework"),
|
|
||||||
FISHING("minecraft:fishing"),
|
|
||||||
FLAME("minecraft:flame"),
|
|
||||||
SOUL_FIRE_FLAME("minecraft:soul_fire_flame"),
|
|
||||||
SOUL("minecraft:soul"),
|
|
||||||
FLASH("minecraft:flash"),
|
|
||||||
HAPPY_VILLAGER("minecraft:happy_villager"),
|
|
||||||
COMPOSTER("minecraft:composter"),
|
|
||||||
HEART("minecraft:heart"),
|
|
||||||
INSTANT_EFFECT("minecraft:instant_effect"),
|
|
||||||
ITEM("minecraft:item"),
|
|
||||||
ITEM_SLIME("minecraft:item_slime"),
|
|
||||||
ITEM_SNOWBALL("minecraft:item_snowball"),
|
|
||||||
LARGE_SMOKE("minecraft:large_smoke"),
|
|
||||||
LAVA("minecraft:lava"),
|
|
||||||
MYCELIUM("minecraft:mycelium"),
|
|
||||||
NOTE("minecraft:note"),
|
|
||||||
POOF("minecraft:poof"),
|
|
||||||
PORTAL("minecraft:portal"),
|
|
||||||
RAIN("minecraft:rain"),
|
|
||||||
SMOKE("minecraft:smoke"),
|
|
||||||
SNEEZE("minecraft:sneeze"),
|
|
||||||
SPIT("minecraft:spit"),
|
|
||||||
SQUID_INK("minecraft:squid_ink"),
|
|
||||||
SWEEP_ATTACK("minecraft:sweep_attack"),
|
|
||||||
TOTEM_OF_UNDYING("minecraft:totem_of_undying"),
|
|
||||||
UNDERWATER("minecraft:underwater"),
|
|
||||||
SPLASH("minecraft:splash"),
|
|
||||||
WITCH("minecraft:witch"),
|
|
||||||
BUBBLE_POP("minecraft:bubble_pop"),
|
|
||||||
CURRENT_DOWN("minecraft:current_down"),
|
|
||||||
BUBBLE_COLUMN_UP("minecraft:bubble_column_up"),
|
|
||||||
NAUTILUS("minecraft:nautilus"),
|
|
||||||
DOLPHIN("minecraft:dolphin"),
|
|
||||||
CAMPFIRE_COSY_SMOKE("minecraft:campfire_cosy_smoke"),
|
|
||||||
CAMPFIRE_SIGNAL_SMOKE("minecraft:campfire_signal_smoke"),
|
|
||||||
DRIPPING_HONEY("minecraft:dripping_honey"),
|
|
||||||
FALLING_HONEY("minecraft:falling_honey"),
|
|
||||||
LANDING_HONEY("minecraft:landing_honey"),
|
|
||||||
FALLING_NECTAR("minecraft:falling_nectar"),
|
|
||||||
ASH("minecraft:ash"),
|
|
||||||
CRIMSON_SPORE("minecraft:crimson_spore"),
|
|
||||||
WARPED_SPORE("minecraft:warped_spore"),
|
|
||||||
DRIPPING_OBSIDIAN_TEAR("minecraft:dripping_obsidian_tear"),
|
|
||||||
FALLING_OBSIDIAN_TEAR("minecraft:falling_obsidian_tear"),
|
|
||||||
LANDING_OBSIDIAN_TEAR("minecraft:landing_obsidian_tear"),
|
|
||||||
REVERSE_PORTAL("minecraft:reverse_portal"),
|
|
||||||
WHITE_ASH("minecraft:white_ash"),
|
|
||||||
;
|
|
||||||
private String namespaceID;
|
|
||||||
|
|
||||||
Particle(String namespaceID) {
|
ANGRY_VILLAGER("minecraft:angry_villager"),
|
||||||
this.namespaceID = namespaceID;
|
|
||||||
Registries.particles.put(NamespaceID.from(namespaceID), this);
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getId() {
|
BARRIER("minecraft:barrier"),
|
||||||
return ordinal();
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getNamespaceID() {
|
BLOCK("minecraft:block"),
|
||||||
return namespaceID;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Particle fromId(int id) {
|
BUBBLE("minecraft:bubble"),
|
||||||
if(id >= 0 && id < values().length) {
|
|
||||||
return values()[id];
|
CLOUD("minecraft:cloud"),
|
||||||
}
|
|
||||||
return null;
|
CRIT("minecraft:crit"),
|
||||||
}
|
|
||||||
|
DAMAGE_INDICATOR("minecraft:damage_indicator"),
|
||||||
|
|
||||||
|
DRAGON_BREATH("minecraft:dragon_breath"),
|
||||||
|
|
||||||
|
DRIPPING_LAVA("minecraft:dripping_lava"),
|
||||||
|
|
||||||
|
FALLING_LAVA("minecraft:falling_lava"),
|
||||||
|
|
||||||
|
LANDING_LAVA("minecraft:landing_lava"),
|
||||||
|
|
||||||
|
DRIPPING_WATER("minecraft:dripping_water"),
|
||||||
|
|
||||||
|
FALLING_WATER("minecraft:falling_water"),
|
||||||
|
|
||||||
|
DUST("minecraft:dust"),
|
||||||
|
|
||||||
|
EFFECT("minecraft:effect"),
|
||||||
|
|
||||||
|
ELDER_GUARDIAN("minecraft:elder_guardian"),
|
||||||
|
|
||||||
|
ENCHANTED_HIT("minecraft:enchanted_hit"),
|
||||||
|
|
||||||
|
ENCHANT("minecraft:enchant"),
|
||||||
|
|
||||||
|
END_ROD("minecraft:end_rod"),
|
||||||
|
|
||||||
|
ENTITY_EFFECT("minecraft:entity_effect"),
|
||||||
|
|
||||||
|
EXPLOSION_EMITTER("minecraft:explosion_emitter"),
|
||||||
|
|
||||||
|
EXPLOSION("minecraft:explosion"),
|
||||||
|
|
||||||
|
FALLING_DUST("minecraft:falling_dust"),
|
||||||
|
|
||||||
|
FIREWORK("minecraft:firework"),
|
||||||
|
|
||||||
|
FISHING("minecraft:fishing"),
|
||||||
|
|
||||||
|
FLAME("minecraft:flame"),
|
||||||
|
|
||||||
|
SOUL_FIRE_FLAME("minecraft:soul_fire_flame"),
|
||||||
|
|
||||||
|
SOUL("minecraft:soul"),
|
||||||
|
|
||||||
|
FLASH("minecraft:flash"),
|
||||||
|
|
||||||
|
HAPPY_VILLAGER("minecraft:happy_villager"),
|
||||||
|
|
||||||
|
COMPOSTER("minecraft:composter"),
|
||||||
|
|
||||||
|
HEART("minecraft:heart"),
|
||||||
|
|
||||||
|
INSTANT_EFFECT("minecraft:instant_effect"),
|
||||||
|
|
||||||
|
ITEM("minecraft:item"),
|
||||||
|
|
||||||
|
ITEM_SLIME("minecraft:item_slime"),
|
||||||
|
|
||||||
|
ITEM_SNOWBALL("minecraft:item_snowball"),
|
||||||
|
|
||||||
|
LARGE_SMOKE("minecraft:large_smoke"),
|
||||||
|
|
||||||
|
LAVA("minecraft:lava"),
|
||||||
|
|
||||||
|
MYCELIUM("minecraft:mycelium"),
|
||||||
|
|
||||||
|
NOTE("minecraft:note"),
|
||||||
|
|
||||||
|
POOF("minecraft:poof"),
|
||||||
|
|
||||||
|
PORTAL("minecraft:portal"),
|
||||||
|
|
||||||
|
RAIN("minecraft:rain"),
|
||||||
|
|
||||||
|
SMOKE("minecraft:smoke"),
|
||||||
|
|
||||||
|
SNEEZE("minecraft:sneeze"),
|
||||||
|
|
||||||
|
SPIT("minecraft:spit"),
|
||||||
|
|
||||||
|
SQUID_INK("minecraft:squid_ink"),
|
||||||
|
|
||||||
|
SWEEP_ATTACK("minecraft:sweep_attack"),
|
||||||
|
|
||||||
|
TOTEM_OF_UNDYING("minecraft:totem_of_undying"),
|
||||||
|
|
||||||
|
UNDERWATER("minecraft:underwater"),
|
||||||
|
|
||||||
|
SPLASH("minecraft:splash"),
|
||||||
|
|
||||||
|
WITCH("minecraft:witch"),
|
||||||
|
|
||||||
|
BUBBLE_POP("minecraft:bubble_pop"),
|
||||||
|
|
||||||
|
CURRENT_DOWN("minecraft:current_down"),
|
||||||
|
|
||||||
|
BUBBLE_COLUMN_UP("minecraft:bubble_column_up"),
|
||||||
|
|
||||||
|
NAUTILUS("minecraft:nautilus"),
|
||||||
|
|
||||||
|
DOLPHIN("minecraft:dolphin"),
|
||||||
|
|
||||||
|
CAMPFIRE_COSY_SMOKE("minecraft:campfire_cosy_smoke"),
|
||||||
|
|
||||||
|
CAMPFIRE_SIGNAL_SMOKE("minecraft:campfire_signal_smoke"),
|
||||||
|
|
||||||
|
DRIPPING_HONEY("minecraft:dripping_honey"),
|
||||||
|
|
||||||
|
FALLING_HONEY("minecraft:falling_honey"),
|
||||||
|
|
||||||
|
LANDING_HONEY("minecraft:landing_honey"),
|
||||||
|
|
||||||
|
FALLING_NECTAR("minecraft:falling_nectar"),
|
||||||
|
|
||||||
|
ASH("minecraft:ash"),
|
||||||
|
|
||||||
|
CRIMSON_SPORE("minecraft:crimson_spore"),
|
||||||
|
|
||||||
|
WARPED_SPORE("minecraft:warped_spore"),
|
||||||
|
|
||||||
|
DRIPPING_OBSIDIAN_TEAR("minecraft:dripping_obsidian_tear"),
|
||||||
|
|
||||||
|
FALLING_OBSIDIAN_TEAR("minecraft:falling_obsidian_tear"),
|
||||||
|
|
||||||
|
LANDING_OBSIDIAN_TEAR("minecraft:landing_obsidian_tear"),
|
||||||
|
|
||||||
|
REVERSE_PORTAL("minecraft:reverse_portal"),
|
||||||
|
|
||||||
|
WHITE_ASH("minecraft:white_ash");
|
||||||
|
|
||||||
|
private String namespaceID;
|
||||||
|
|
||||||
|
Particle(String namespaceID) {
|
||||||
|
this.namespaceID = namespaceID;
|
||||||
|
Registries.particles.put(NamespaceID.from(namespaceID), this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getId() {
|
||||||
|
return ordinal();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNamespaceID() {
|
||||||
|
return namespaceID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Particle fromId(int id) {
|
||||||
|
if(id >= 0 && id < values().length) {
|
||||||
|
return values()[id];
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,47 +1,79 @@
|
|||||||
//==============================
|
|
||||||
// AUTOGENERATED BY EnumGenerator
|
|
||||||
//==============================
|
|
||||||
package net.minestom.server.potion;
|
package net.minestom.server.potion;
|
||||||
|
|
||||||
import net.minestom.server.registry.Registries;
|
import net.minestom.server.registry.Registries;
|
||||||
import net.minestom.server.utils.NamespaceID;
|
import net.minestom.server.utils.NamespaceID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* //==============================
|
||||||
|
* // AUTOGENERATED BY EnumGenerator
|
||||||
|
* //==============================
|
||||||
|
*/
|
||||||
@SuppressWarnings({"deprecation"})
|
@SuppressWarnings({"deprecation"})
|
||||||
|
|
||||||
public enum PotionEffect {
|
public enum PotionEffect {
|
||||||
SPEED("minecraft:speed"),
|
SPEED("minecraft:speed"),
|
||||||
|
|
||||||
SLOWNESS("minecraft:slowness"),
|
SLOWNESS("minecraft:slowness"),
|
||||||
|
|
||||||
HASTE("minecraft:haste"),
|
HASTE("minecraft:haste"),
|
||||||
|
|
||||||
MINING_FATIGUE("minecraft:mining_fatigue"),
|
MINING_FATIGUE("minecraft:mining_fatigue"),
|
||||||
|
|
||||||
STRENGTH("minecraft:strength"),
|
STRENGTH("minecraft:strength"),
|
||||||
|
|
||||||
INSTANT_HEALTH("minecraft:instant_health"),
|
INSTANT_HEALTH("minecraft:instant_health"),
|
||||||
|
|
||||||
INSTANT_DAMAGE("minecraft:instant_damage"),
|
INSTANT_DAMAGE("minecraft:instant_damage"),
|
||||||
|
|
||||||
JUMP_BOOST("minecraft:jump_boost"),
|
JUMP_BOOST("minecraft:jump_boost"),
|
||||||
|
|
||||||
NAUSEA("minecraft:nausea"),
|
NAUSEA("minecraft:nausea"),
|
||||||
|
|
||||||
REGENERATION("minecraft:regeneration"),
|
REGENERATION("minecraft:regeneration"),
|
||||||
|
|
||||||
RESISTANCE("minecraft:resistance"),
|
RESISTANCE("minecraft:resistance"),
|
||||||
|
|
||||||
FIRE_RESISTANCE("minecraft:fire_resistance"),
|
FIRE_RESISTANCE("minecraft:fire_resistance"),
|
||||||
|
|
||||||
WATER_BREATHING("minecraft:water_breathing"),
|
WATER_BREATHING("minecraft:water_breathing"),
|
||||||
|
|
||||||
INVISIBILITY("minecraft:invisibility"),
|
INVISIBILITY("minecraft:invisibility"),
|
||||||
|
|
||||||
BLINDNESS("minecraft:blindness"),
|
BLINDNESS("minecraft:blindness"),
|
||||||
|
|
||||||
NIGHT_VISION("minecraft:night_vision"),
|
NIGHT_VISION("minecraft:night_vision"),
|
||||||
|
|
||||||
HUNGER("minecraft:hunger"),
|
HUNGER("minecraft:hunger"),
|
||||||
|
|
||||||
WEAKNESS("minecraft:weakness"),
|
WEAKNESS("minecraft:weakness"),
|
||||||
|
|
||||||
POISON("minecraft:poison"),
|
POISON("minecraft:poison"),
|
||||||
|
|
||||||
WITHER("minecraft:wither"),
|
WITHER("minecraft:wither"),
|
||||||
|
|
||||||
HEALTH_BOOST("minecraft:health_boost"),
|
HEALTH_BOOST("minecraft:health_boost"),
|
||||||
|
|
||||||
ABSORPTION("minecraft:absorption"),
|
ABSORPTION("minecraft:absorption"),
|
||||||
|
|
||||||
SATURATION("minecraft:saturation"),
|
SATURATION("minecraft:saturation"),
|
||||||
|
|
||||||
GLOWING("minecraft:glowing"),
|
GLOWING("minecraft:glowing"),
|
||||||
|
|
||||||
LEVITATION("minecraft:levitation"),
|
LEVITATION("minecraft:levitation"),
|
||||||
|
|
||||||
LUCK("minecraft:luck"),
|
LUCK("minecraft:luck"),
|
||||||
|
|
||||||
UNLUCK("minecraft:unluck"),
|
UNLUCK("minecraft:unluck"),
|
||||||
|
|
||||||
SLOW_FALLING("minecraft:slow_falling"),
|
SLOW_FALLING("minecraft:slow_falling"),
|
||||||
|
|
||||||
CONDUIT_POWER("minecraft:conduit_power"),
|
CONDUIT_POWER("minecraft:conduit_power"),
|
||||||
|
|
||||||
DOLPHINS_GRACE("minecraft:dolphins_grace"),
|
DOLPHINS_GRACE("minecraft:dolphins_grace"),
|
||||||
|
|
||||||
BAD_OMEN("minecraft:bad_omen"),
|
BAD_OMEN("minecraft:bad_omen"),
|
||||||
HERO_OF_THE_VILLAGE("minecraft:hero_of_the_village"),
|
|
||||||
;
|
HERO_OF_THE_VILLAGE("minecraft:hero_of_the_village");
|
||||||
|
|
||||||
private String namespaceID;
|
private String namespaceID;
|
||||||
|
|
||||||
PotionEffect(String namespaceID) {
|
PotionEffect(String namespaceID) {
|
||||||
@ -58,7 +90,7 @@ public enum PotionEffect {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static PotionEffect fromId(int id) {
|
public static PotionEffect fromId(int id) {
|
||||||
if (id >= 0 && id < values().length) {
|
if(id >= 0 && id < values().length) {
|
||||||
return values()[id];
|
return values()[id];
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
@ -1,75 +1,120 @@
|
|||||||
//==============================
|
|
||||||
// AUTOGENERATED BY EnumGenerator
|
|
||||||
//==============================
|
|
||||||
package net.minestom.server.potion;
|
package net.minestom.server.potion;
|
||||||
|
|
||||||
import net.minestom.server.registry.Registries;
|
import net.minestom.server.registry.Registries;
|
||||||
import net.minestom.server.utils.NamespaceID;
|
import net.minestom.server.utils.NamespaceID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* //==============================
|
||||||
|
* // AUTOGENERATED BY EnumGenerator
|
||||||
|
* //==============================
|
||||||
|
*/
|
||||||
@SuppressWarnings({"deprecation"})
|
@SuppressWarnings({"deprecation"})
|
||||||
|
|
||||||
public enum PotionType {
|
public enum PotionType {
|
||||||
EMPTY("minecraft:empty"),
|
EMPTY("minecraft:empty"),
|
||||||
WATER("minecraft:water"),
|
|
||||||
MUNDANE("minecraft:mundane"),
|
|
||||||
THICK("minecraft:thick"),
|
|
||||||
AWKWARD("minecraft:awkward"),
|
|
||||||
NIGHT_VISION("minecraft:night_vision"),
|
|
||||||
LONG_NIGHT_VISION("minecraft:long_night_vision"),
|
|
||||||
INVISIBILITY("minecraft:invisibility"),
|
|
||||||
LONG_INVISIBILITY("minecraft:long_invisibility"),
|
|
||||||
LEAPING("minecraft:leaping"),
|
|
||||||
LONG_LEAPING("minecraft:long_leaping"),
|
|
||||||
STRONG_LEAPING("minecraft:strong_leaping"),
|
|
||||||
FIRE_RESISTANCE("minecraft:fire_resistance"),
|
|
||||||
LONG_FIRE_RESISTANCE("minecraft:long_fire_resistance"),
|
|
||||||
SWIFTNESS("minecraft:swiftness"),
|
|
||||||
LONG_SWIFTNESS("minecraft:long_swiftness"),
|
|
||||||
STRONG_SWIFTNESS("minecraft:strong_swiftness"),
|
|
||||||
SLOWNESS("minecraft:slowness"),
|
|
||||||
LONG_SLOWNESS("minecraft:long_slowness"),
|
|
||||||
STRONG_SLOWNESS("minecraft:strong_slowness"),
|
|
||||||
TURTLE_MASTER("minecraft:turtle_master"),
|
|
||||||
LONG_TURTLE_MASTER("minecraft:long_turtle_master"),
|
|
||||||
STRONG_TURTLE_MASTER("minecraft:strong_turtle_master"),
|
|
||||||
WATER_BREATHING("minecraft:water_breathing"),
|
|
||||||
LONG_WATER_BREATHING("minecraft:long_water_breathing"),
|
|
||||||
HEALING("minecraft:healing"),
|
|
||||||
STRONG_HEALING("minecraft:strong_healing"),
|
|
||||||
HARMING("minecraft:harming"),
|
|
||||||
STRONG_HARMING("minecraft:strong_harming"),
|
|
||||||
POISON("minecraft:poison"),
|
|
||||||
LONG_POISON("minecraft:long_poison"),
|
|
||||||
STRONG_POISON("minecraft:strong_poison"),
|
|
||||||
REGENERATION("minecraft:regeneration"),
|
|
||||||
LONG_REGENERATION("minecraft:long_regeneration"),
|
|
||||||
STRONG_REGENERATION("minecraft:strong_regeneration"),
|
|
||||||
STRENGTH("minecraft:strength"),
|
|
||||||
LONG_STRENGTH("minecraft:long_strength"),
|
|
||||||
STRONG_STRENGTH("minecraft:strong_strength"),
|
|
||||||
WEAKNESS("minecraft:weakness"),
|
|
||||||
LONG_WEAKNESS("minecraft:long_weakness"),
|
|
||||||
LUCK("minecraft:luck"),
|
|
||||||
SLOW_FALLING("minecraft:slow_falling"),
|
|
||||||
LONG_SLOW_FALLING("minecraft:long_slow_falling"),
|
|
||||||
;
|
|
||||||
private String namespaceID;
|
|
||||||
|
|
||||||
PotionType(String namespaceID) {
|
WATER("minecraft:water"),
|
||||||
this.namespaceID = namespaceID;
|
|
||||||
Registries.potionTypes.put(NamespaceID.from(namespaceID), this);
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getId() {
|
MUNDANE("minecraft:mundane"),
|
||||||
return ordinal();
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getNamespaceID() {
|
THICK("minecraft:thick"),
|
||||||
return namespaceID;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static PotionType fromId(int id) {
|
AWKWARD("minecraft:awkward"),
|
||||||
if(id >= 0 && id < values().length) {
|
|
||||||
return values()[id];
|
NIGHT_VISION("minecraft:night_vision"),
|
||||||
}
|
|
||||||
return EMPTY;
|
LONG_NIGHT_VISION("minecraft:long_night_vision"),
|
||||||
}
|
|
||||||
|
INVISIBILITY("minecraft:invisibility"),
|
||||||
|
|
||||||
|
LONG_INVISIBILITY("minecraft:long_invisibility"),
|
||||||
|
|
||||||
|
LEAPING("minecraft:leaping"),
|
||||||
|
|
||||||
|
LONG_LEAPING("minecraft:long_leaping"),
|
||||||
|
|
||||||
|
STRONG_LEAPING("minecraft:strong_leaping"),
|
||||||
|
|
||||||
|
FIRE_RESISTANCE("minecraft:fire_resistance"),
|
||||||
|
|
||||||
|
LONG_FIRE_RESISTANCE("minecraft:long_fire_resistance"),
|
||||||
|
|
||||||
|
SWIFTNESS("minecraft:swiftness"),
|
||||||
|
|
||||||
|
LONG_SWIFTNESS("minecraft:long_swiftness"),
|
||||||
|
|
||||||
|
STRONG_SWIFTNESS("minecraft:strong_swiftness"),
|
||||||
|
|
||||||
|
SLOWNESS("minecraft:slowness"),
|
||||||
|
|
||||||
|
LONG_SLOWNESS("minecraft:long_slowness"),
|
||||||
|
|
||||||
|
STRONG_SLOWNESS("minecraft:strong_slowness"),
|
||||||
|
|
||||||
|
TURTLE_MASTER("minecraft:turtle_master"),
|
||||||
|
|
||||||
|
LONG_TURTLE_MASTER("minecraft:long_turtle_master"),
|
||||||
|
|
||||||
|
STRONG_TURTLE_MASTER("minecraft:strong_turtle_master"),
|
||||||
|
|
||||||
|
WATER_BREATHING("minecraft:water_breathing"),
|
||||||
|
|
||||||
|
LONG_WATER_BREATHING("minecraft:long_water_breathing"),
|
||||||
|
|
||||||
|
HEALING("minecraft:healing"),
|
||||||
|
|
||||||
|
STRONG_HEALING("minecraft:strong_healing"),
|
||||||
|
|
||||||
|
HARMING("minecraft:harming"),
|
||||||
|
|
||||||
|
STRONG_HARMING("minecraft:strong_harming"),
|
||||||
|
|
||||||
|
POISON("minecraft:poison"),
|
||||||
|
|
||||||
|
LONG_POISON("minecraft:long_poison"),
|
||||||
|
|
||||||
|
STRONG_POISON("minecraft:strong_poison"),
|
||||||
|
|
||||||
|
REGENERATION("minecraft:regeneration"),
|
||||||
|
|
||||||
|
LONG_REGENERATION("minecraft:long_regeneration"),
|
||||||
|
|
||||||
|
STRONG_REGENERATION("minecraft:strong_regeneration"),
|
||||||
|
|
||||||
|
STRENGTH("minecraft:strength"),
|
||||||
|
|
||||||
|
LONG_STRENGTH("minecraft:long_strength"),
|
||||||
|
|
||||||
|
STRONG_STRENGTH("minecraft:strong_strength"),
|
||||||
|
|
||||||
|
WEAKNESS("minecraft:weakness"),
|
||||||
|
|
||||||
|
LONG_WEAKNESS("minecraft:long_weakness"),
|
||||||
|
|
||||||
|
LUCK("minecraft:luck"),
|
||||||
|
|
||||||
|
SLOW_FALLING("minecraft:slow_falling"),
|
||||||
|
|
||||||
|
LONG_SLOW_FALLING("minecraft:long_slow_falling");
|
||||||
|
|
||||||
|
private String namespaceID;
|
||||||
|
|
||||||
|
PotionType(String namespaceID) {
|
||||||
|
this.namespaceID = namespaceID;
|
||||||
|
Registries.potionTypes.put(NamespaceID.from(namespaceID), this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getId() {
|
||||||
|
return ordinal();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNamespaceID() {
|
||||||
|
return namespaceID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static PotionType fromId(int id) {
|
||||||
|
if(id >= 0 && id < values().length) {
|
||||||
|
return values()[id];
|
||||||
|
}
|
||||||
|
return EMPTY;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,106 +1,182 @@
|
|||||||
//==============================
|
|
||||||
// AUTOGENERATED BY EnumGenerator
|
|
||||||
//==============================
|
|
||||||
package net.minestom.server.stat;
|
package net.minestom.server.stat;
|
||||||
|
|
||||||
import net.minestom.server.registry.Registries;
|
import net.minestom.server.registry.Registries;
|
||||||
import net.minestom.server.utils.NamespaceID;
|
import net.minestom.server.utils.NamespaceID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* //==============================
|
||||||
|
* // AUTOGENERATED BY EnumGenerator
|
||||||
|
* //==============================
|
||||||
|
*/
|
||||||
@SuppressWarnings({"deprecation"})
|
@SuppressWarnings({"deprecation"})
|
||||||
|
|
||||||
public enum StatisticType {
|
public enum StatisticType {
|
||||||
LEAVE_GAME("minecraft:leave_game"),
|
LEAVE_GAME("minecraft:leave_game"),
|
||||||
PLAY_ONE_MINUTE("minecraft:play_one_minute"),
|
|
||||||
TIME_SINCE_DEATH("minecraft:time_since_death"),
|
|
||||||
TIME_SINCE_REST("minecraft:time_since_rest"),
|
|
||||||
SNEAK_TIME("minecraft:sneak_time"),
|
|
||||||
WALK_ONE_CM("minecraft:walk_one_cm"),
|
|
||||||
CROUCH_ONE_CM("minecraft:crouch_one_cm"),
|
|
||||||
SPRINT_ONE_CM("minecraft:sprint_one_cm"),
|
|
||||||
WALK_ON_WATER_ONE_CM("minecraft:walk_on_water_one_cm"),
|
|
||||||
FALL_ONE_CM("minecraft:fall_one_cm"),
|
|
||||||
CLIMB_ONE_CM("minecraft:climb_one_cm"),
|
|
||||||
FLY_ONE_CM("minecraft:fly_one_cm"),
|
|
||||||
WALK_UNDER_WATER_ONE_CM("minecraft:walk_under_water_one_cm"),
|
|
||||||
MINECART_ONE_CM("minecraft:minecart_one_cm"),
|
|
||||||
BOAT_ONE_CM("minecraft:boat_one_cm"),
|
|
||||||
PIG_ONE_CM("minecraft:pig_one_cm"),
|
|
||||||
HORSE_ONE_CM("minecraft:horse_one_cm"),
|
|
||||||
AVIATE_ONE_CM("minecraft:aviate_one_cm"),
|
|
||||||
SWIM_ONE_CM("minecraft:swim_one_cm"),
|
|
||||||
STRIDER_ONE_CM("minecraft:strider_one_cm"),
|
|
||||||
JUMP("minecraft:jump"),
|
|
||||||
DROP("minecraft:drop"),
|
|
||||||
DAMAGE_DEALT("minecraft:damage_dealt"),
|
|
||||||
DAMAGE_DEALT_ABSORBED("minecraft:damage_dealt_absorbed"),
|
|
||||||
DAMAGE_DEALT_RESISTED("minecraft:damage_dealt_resisted"),
|
|
||||||
DAMAGE_TAKEN("minecraft:damage_taken"),
|
|
||||||
DAMAGE_BLOCKED_BY_SHIELD("minecraft:damage_blocked_by_shield"),
|
|
||||||
DAMAGE_ABSORBED("minecraft:damage_absorbed"),
|
|
||||||
DAMAGE_RESISTED("minecraft:damage_resisted"),
|
|
||||||
DEATHS("minecraft:deaths"),
|
|
||||||
MOB_KILLS("minecraft:mob_kills"),
|
|
||||||
ANIMALS_BRED("minecraft:animals_bred"),
|
|
||||||
PLAYER_KILLS("minecraft:player_kills"),
|
|
||||||
FISH_CAUGHT("minecraft:fish_caught"),
|
|
||||||
TALKED_TO_VILLAGER("minecraft:talked_to_villager"),
|
|
||||||
TRADED_WITH_VILLAGER("minecraft:traded_with_villager"),
|
|
||||||
EAT_CAKE_SLICE("minecraft:eat_cake_slice"),
|
|
||||||
FILL_CAULDRON("minecraft:fill_cauldron"),
|
|
||||||
USE_CAULDRON("minecraft:use_cauldron"),
|
|
||||||
CLEAN_ARMOR("minecraft:clean_armor"),
|
|
||||||
CLEAN_BANNER("minecraft:clean_banner"),
|
|
||||||
CLEAN_SHULKER_BOX("minecraft:clean_shulker_box"),
|
|
||||||
INTERACT_WITH_BREWINGSTAND("minecraft:interact_with_brewingstand"),
|
|
||||||
INTERACT_WITH_BEACON("minecraft:interact_with_beacon"),
|
|
||||||
INSPECT_DROPPER("minecraft:inspect_dropper"),
|
|
||||||
INSPECT_HOPPER("minecraft:inspect_hopper"),
|
|
||||||
INSPECT_DISPENSER("minecraft:inspect_dispenser"),
|
|
||||||
PLAY_NOTEBLOCK("minecraft:play_noteblock"),
|
|
||||||
TUNE_NOTEBLOCK("minecraft:tune_noteblock"),
|
|
||||||
POT_FLOWER("minecraft:pot_flower"),
|
|
||||||
TRIGGER_TRAPPED_CHEST("minecraft:trigger_trapped_chest"),
|
|
||||||
OPEN_ENDERCHEST("minecraft:open_enderchest"),
|
|
||||||
ENCHANT_ITEM("minecraft:enchant_item"),
|
|
||||||
PLAY_RECORD("minecraft:play_record"),
|
|
||||||
INTERACT_WITH_FURNACE("minecraft:interact_with_furnace"),
|
|
||||||
INTERACT_WITH_CRAFTING_TABLE("minecraft:interact_with_crafting_table"),
|
|
||||||
OPEN_CHEST("minecraft:open_chest"),
|
|
||||||
SLEEP_IN_BED("minecraft:sleep_in_bed"),
|
|
||||||
OPEN_SHULKER_BOX("minecraft:open_shulker_box"),
|
|
||||||
OPEN_BARREL("minecraft:open_barrel"),
|
|
||||||
INTERACT_WITH_BLAST_FURNACE("minecraft:interact_with_blast_furnace"),
|
|
||||||
INTERACT_WITH_SMOKER("minecraft:interact_with_smoker"),
|
|
||||||
INTERACT_WITH_LECTERN("minecraft:interact_with_lectern"),
|
|
||||||
INTERACT_WITH_CAMPFIRE("minecraft:interact_with_campfire"),
|
|
||||||
INTERACT_WITH_CARTOGRAPHY_TABLE("minecraft:interact_with_cartography_table"),
|
|
||||||
INTERACT_WITH_LOOM("minecraft:interact_with_loom"),
|
|
||||||
INTERACT_WITH_STONECUTTER("minecraft:interact_with_stonecutter"),
|
|
||||||
BELL_RING("minecraft:bell_ring"),
|
|
||||||
RAID_TRIGGER("minecraft:raid_trigger"),
|
|
||||||
RAID_WIN("minecraft:raid_win"),
|
|
||||||
INTERACT_WITH_ANVIL("minecraft:interact_with_anvil"),
|
|
||||||
INTERACT_WITH_GRINDSTONE("minecraft:interact_with_grindstone"),
|
|
||||||
TARGET_HIT("minecraft:target_hit"),
|
|
||||||
INTERACT_WITH_SMITHING_TABLE("minecraft:interact_with_smithing_table"),
|
|
||||||
;
|
|
||||||
private String namespaceID;
|
|
||||||
|
|
||||||
StatisticType(String namespaceID) {
|
PLAY_ONE_MINUTE("minecraft:play_one_minute"),
|
||||||
this.namespaceID = namespaceID;
|
|
||||||
Registries.statisticTypes.put(NamespaceID.from(namespaceID), this);
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getId() {
|
TIME_SINCE_DEATH("minecraft:time_since_death"),
|
||||||
return ordinal();
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getNamespaceID() {
|
TIME_SINCE_REST("minecraft:time_since_rest"),
|
||||||
return namespaceID;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static StatisticType fromId(int id) {
|
SNEAK_TIME("minecraft:sneak_time"),
|
||||||
if(id >= 0 && id < values().length) {
|
|
||||||
return values()[id];
|
WALK_ONE_CM("minecraft:walk_one_cm"),
|
||||||
}
|
|
||||||
return null;
|
CROUCH_ONE_CM("minecraft:crouch_one_cm"),
|
||||||
}
|
|
||||||
|
SPRINT_ONE_CM("minecraft:sprint_one_cm"),
|
||||||
|
|
||||||
|
WALK_ON_WATER_ONE_CM("minecraft:walk_on_water_one_cm"),
|
||||||
|
|
||||||
|
FALL_ONE_CM("minecraft:fall_one_cm"),
|
||||||
|
|
||||||
|
CLIMB_ONE_CM("minecraft:climb_one_cm"),
|
||||||
|
|
||||||
|
FLY_ONE_CM("minecraft:fly_one_cm"),
|
||||||
|
|
||||||
|
WALK_UNDER_WATER_ONE_CM("minecraft:walk_under_water_one_cm"),
|
||||||
|
|
||||||
|
MINECART_ONE_CM("minecraft:minecart_one_cm"),
|
||||||
|
|
||||||
|
BOAT_ONE_CM("minecraft:boat_one_cm"),
|
||||||
|
|
||||||
|
PIG_ONE_CM("minecraft:pig_one_cm"),
|
||||||
|
|
||||||
|
HORSE_ONE_CM("minecraft:horse_one_cm"),
|
||||||
|
|
||||||
|
AVIATE_ONE_CM("minecraft:aviate_one_cm"),
|
||||||
|
|
||||||
|
SWIM_ONE_CM("minecraft:swim_one_cm"),
|
||||||
|
|
||||||
|
STRIDER_ONE_CM("minecraft:strider_one_cm"),
|
||||||
|
|
||||||
|
JUMP("minecraft:jump"),
|
||||||
|
|
||||||
|
DROP("minecraft:drop"),
|
||||||
|
|
||||||
|
DAMAGE_DEALT("minecraft:damage_dealt"),
|
||||||
|
|
||||||
|
DAMAGE_DEALT_ABSORBED("minecraft:damage_dealt_absorbed"),
|
||||||
|
|
||||||
|
DAMAGE_DEALT_RESISTED("minecraft:damage_dealt_resisted"),
|
||||||
|
|
||||||
|
DAMAGE_TAKEN("minecraft:damage_taken"),
|
||||||
|
|
||||||
|
DAMAGE_BLOCKED_BY_SHIELD("minecraft:damage_blocked_by_shield"),
|
||||||
|
|
||||||
|
DAMAGE_ABSORBED("minecraft:damage_absorbed"),
|
||||||
|
|
||||||
|
DAMAGE_RESISTED("minecraft:damage_resisted"),
|
||||||
|
|
||||||
|
DEATHS("minecraft:deaths"),
|
||||||
|
|
||||||
|
MOB_KILLS("minecraft:mob_kills"),
|
||||||
|
|
||||||
|
ANIMALS_BRED("minecraft:animals_bred"),
|
||||||
|
|
||||||
|
PLAYER_KILLS("minecraft:player_kills"),
|
||||||
|
|
||||||
|
FISH_CAUGHT("minecraft:fish_caught"),
|
||||||
|
|
||||||
|
TALKED_TO_VILLAGER("minecraft:talked_to_villager"),
|
||||||
|
|
||||||
|
TRADED_WITH_VILLAGER("minecraft:traded_with_villager"),
|
||||||
|
|
||||||
|
EAT_CAKE_SLICE("minecraft:eat_cake_slice"),
|
||||||
|
|
||||||
|
FILL_CAULDRON("minecraft:fill_cauldron"),
|
||||||
|
|
||||||
|
USE_CAULDRON("minecraft:use_cauldron"),
|
||||||
|
|
||||||
|
CLEAN_ARMOR("minecraft:clean_armor"),
|
||||||
|
|
||||||
|
CLEAN_BANNER("minecraft:clean_banner"),
|
||||||
|
|
||||||
|
CLEAN_SHULKER_BOX("minecraft:clean_shulker_box"),
|
||||||
|
|
||||||
|
INTERACT_WITH_BREWINGSTAND("minecraft:interact_with_brewingstand"),
|
||||||
|
|
||||||
|
INTERACT_WITH_BEACON("minecraft:interact_with_beacon"),
|
||||||
|
|
||||||
|
INSPECT_DROPPER("minecraft:inspect_dropper"),
|
||||||
|
|
||||||
|
INSPECT_HOPPER("minecraft:inspect_hopper"),
|
||||||
|
|
||||||
|
INSPECT_DISPENSER("minecraft:inspect_dispenser"),
|
||||||
|
|
||||||
|
PLAY_NOTEBLOCK("minecraft:play_noteblock"),
|
||||||
|
|
||||||
|
TUNE_NOTEBLOCK("minecraft:tune_noteblock"),
|
||||||
|
|
||||||
|
POT_FLOWER("minecraft:pot_flower"),
|
||||||
|
|
||||||
|
TRIGGER_TRAPPED_CHEST("minecraft:trigger_trapped_chest"),
|
||||||
|
|
||||||
|
OPEN_ENDERCHEST("minecraft:open_enderchest"),
|
||||||
|
|
||||||
|
ENCHANT_ITEM("minecraft:enchant_item"),
|
||||||
|
|
||||||
|
PLAY_RECORD("minecraft:play_record"),
|
||||||
|
|
||||||
|
INTERACT_WITH_FURNACE("minecraft:interact_with_furnace"),
|
||||||
|
|
||||||
|
INTERACT_WITH_CRAFTING_TABLE("minecraft:interact_with_crafting_table"),
|
||||||
|
|
||||||
|
OPEN_CHEST("minecraft:open_chest"),
|
||||||
|
|
||||||
|
SLEEP_IN_BED("minecraft:sleep_in_bed"),
|
||||||
|
|
||||||
|
OPEN_SHULKER_BOX("minecraft:open_shulker_box"),
|
||||||
|
|
||||||
|
OPEN_BARREL("minecraft:open_barrel"),
|
||||||
|
|
||||||
|
INTERACT_WITH_BLAST_FURNACE("minecraft:interact_with_blast_furnace"),
|
||||||
|
|
||||||
|
INTERACT_WITH_SMOKER("minecraft:interact_with_smoker"),
|
||||||
|
|
||||||
|
INTERACT_WITH_LECTERN("minecraft:interact_with_lectern"),
|
||||||
|
|
||||||
|
INTERACT_WITH_CAMPFIRE("minecraft:interact_with_campfire"),
|
||||||
|
|
||||||
|
INTERACT_WITH_CARTOGRAPHY_TABLE("minecraft:interact_with_cartography_table"),
|
||||||
|
|
||||||
|
INTERACT_WITH_LOOM("minecraft:interact_with_loom"),
|
||||||
|
|
||||||
|
INTERACT_WITH_STONECUTTER("minecraft:interact_with_stonecutter"),
|
||||||
|
|
||||||
|
BELL_RING("minecraft:bell_ring"),
|
||||||
|
|
||||||
|
RAID_TRIGGER("minecraft:raid_trigger"),
|
||||||
|
|
||||||
|
RAID_WIN("minecraft:raid_win"),
|
||||||
|
|
||||||
|
INTERACT_WITH_ANVIL("minecraft:interact_with_anvil"),
|
||||||
|
|
||||||
|
INTERACT_WITH_GRINDSTONE("minecraft:interact_with_grindstone"),
|
||||||
|
|
||||||
|
TARGET_HIT("minecraft:target_hit"),
|
||||||
|
|
||||||
|
INTERACT_WITH_SMITHING_TABLE("minecraft:interact_with_smithing_table");
|
||||||
|
|
||||||
|
private String namespaceID;
|
||||||
|
|
||||||
|
StatisticType(String namespaceID) {
|
||||||
|
this.namespaceID = namespaceID;
|
||||||
|
Registries.statisticTypes.put(NamespaceID.from(namespaceID), this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getId() {
|
||||||
|
return ordinal();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNamespaceID() {
|
||||||
|
return namespaceID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static StatisticType fromId(int id) {
|
||||||
|
if(id >= 0 && id < values().length) {
|
||||||
|
return values()[id];
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -60,7 +60,7 @@ public abstract class BasicEnumGenerator extends MinestomEnumGenerator<BasicEnum
|
|||||||
ParameterSpec[] signature = new ParameterSpec[]{idParam};
|
ParameterSpec[] signature = new ParameterSpec[]{idParam};
|
||||||
if (linear) {
|
if (linear) {
|
||||||
generator.addStaticMethod("fromId", signature, className, code -> {
|
generator.addStaticMethod("fromId", signature, className, code -> {
|
||||||
code.beginControlFlow("if($N >= 0 && $N < values().length) {", idParam, idParam)
|
code.beginControlFlow("if($N >= 0 && $N < values().length)", idParam, idParam)
|
||||||
.addStatement("return values()[$N]", idParam)
|
.addStatement("return values()[$N]", idParam)
|
||||||
.endControlFlow()
|
.endControlFlow()
|
||||||
.addStatement("return " + (defaultEntry == null ? "null" : identifier(defaultEntry)));
|
.addStatement("return " + (defaultEntry == null ? "null" : identifier(defaultEntry)));
|
||||||
@ -68,8 +68,8 @@ public abstract class BasicEnumGenerator extends MinestomEnumGenerator<BasicEnum
|
|||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
generator.addStaticMethod("fromId", signature, className, code -> {
|
generator.addStaticMethod("fromId", signature, className, code -> {
|
||||||
code.beginControlFlow("for($T o : values()) {")
|
code.beginControlFlow("for($T o : values())")
|
||||||
.beginControlFlow("if(o.getId() == id) {")
|
.beginControlFlow("if(o.getId() == id)")
|
||||||
.addStatement("return o")
|
.addStatement("return o")
|
||||||
.endControlFlow()
|
.endControlFlow()
|
||||||
.endControlFlow()
|
.endControlFlow()
|
||||||
@ -102,7 +102,7 @@ public abstract class BasicEnumGenerator extends MinestomEnumGenerator<BasicEnum
|
|||||||
generator.addMethod("getNamespaceID", new ParameterSpec[0], ClassName.get(String.class), code -> code.addStatement("return $N", "namespaceID"));
|
generator.addMethod("getNamespaceID", new ParameterSpec[0], ClassName.get(String.class), code -> code.addStatement("return $N", "namespaceID"));
|
||||||
|
|
||||||
generator.appendToConstructor(code -> {
|
generator.appendToConstructor(code -> {
|
||||||
code.addStatement("$T." + CodeGenerator.decapitalize(getClassName()) + "s.put(NamespaceID.from($N), this)", registriesClass, "namespaceID");
|
code.addStatement("$T." + CodeGenerator.decapitalize(getClassName()) + "s.put($T.from($N), this)", registriesClass, NamespaceID.class, "namespaceID");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,8 +3,7 @@ package net.minestom.codegen.items;
|
|||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.JsonArray;
|
import com.google.gson.JsonArray;
|
||||||
import com.google.gson.JsonObject;
|
import com.google.gson.JsonObject;
|
||||||
import com.squareup.javapoet.AnnotationSpec;
|
import com.squareup.javapoet.*;
|
||||||
import com.squareup.javapoet.JavaFile;
|
|
||||||
import net.minestom.codegen.EnumGenerator;
|
import net.minestom.codegen.EnumGenerator;
|
||||||
import net.minestom.codegen.MinestomEnumGenerator;
|
import net.minestom.codegen.MinestomEnumGenerator;
|
||||||
import net.minestom.codegen.PrismarinePaths;
|
import net.minestom.codegen.PrismarinePaths;
|
||||||
@ -12,6 +11,8 @@ import net.minestom.server.instance.block.Block;
|
|||||||
import net.minestom.server.registry.Registries;
|
import net.minestom.server.registry.Registries;
|
||||||
import net.minestom.server.registry.ResourceGatherer;
|
import net.minestom.server.registry.ResourceGatherer;
|
||||||
import net.minestom.server.utils.NamespaceID;
|
import net.minestom.server.utils.NamespaceID;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
@ -138,82 +139,87 @@ public class ItemEnumGenerator extends MinestomEnumGenerator<ItemContainer> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void prepare(EnumGenerator generator) {
|
protected void prepare(EnumGenerator generator) {
|
||||||
String className = getClassName();
|
ClassName className = ClassName.get(getPackageName(), getClassName());
|
||||||
generator.addClassAnnotation(AnnotationSpec.builder(SuppressWarnings.class).addMember("value", "{$S}", "deprecation").build());
|
generator.addClassAnnotation(AnnotationSpec.builder(SuppressWarnings.class).addMember("value", "{$S}", "deprecation").build());
|
||||||
/*generator.setParams("String namespaceID", "int maxDefaultStackSize", "Block correspondingBlock");
|
generator.setParams(ParameterSpec.builder(String.class, "namespaceID").addAnnotation(NotNull.class).build(), ParameterSpec.builder(TypeName.INT, "maxDefaultStackSize").build(),
|
||||||
generator.appendToConstructor("Registries.materials.put(NamespaceID.from(namespaceID), this);");
|
ParameterSpec.builder(Block.class, "correspondingBlock").addAnnotation(Nullable.class).build());
|
||||||
|
generator.appendToConstructor(code -> {
|
||||||
|
code.addStatement("$T.$N.put($T.from(namespaceID), this)", Registries.class, "materials", NamespaceID.class);
|
||||||
|
});
|
||||||
|
|
||||||
generator.addMethod("getId", "()", "short", "return (short)ordinal();");
|
generator.addMethod("getId", new ParameterSpec[0], TypeName.SHORT, code -> { code.addStatement("return (short)ordinal()");});
|
||||||
generator.addMethod("getName", "()", "String", "return namespaceID;");
|
generator.addMethod("getName", new ParameterSpec[0], ClassName.get(String.class), code -> { code.addStatement("return namespaceID");});
|
||||||
generator.addMethod("getMaxDefaultStackSize", "()", "int", "return maxDefaultStackSize;");
|
generator.addMethod("getMaxDefaultStackSize", new ParameterSpec[0], TypeName.INT, code -> { code.addStatement("return maxDefaultStackSize");});
|
||||||
generator.addMethod("isBlock", "()", "boolean", "return correspondingBlock != null && this != AIR;");
|
generator.addMethod("isBlock", new ParameterSpec[0], TypeName.BOOLEAN, code -> { code.addStatement("return correspondingBlock != null && this != AIR");});
|
||||||
generator.addMethod("getBlock", "()", "Block", "return correspondingBlock;");
|
generator.addMethod("getBlock", new ParameterSpec[0], ClassName.get(Block.class), code -> { code.addStatement("return correspondingBlock");});
|
||||||
|
|
||||||
generator.addMethod("fromId", "(short id)", "static " + className,
|
generator.addStaticMethod("fromId", new ParameterSpec[]{ParameterSpec.builder(TypeName.SHORT, "id").build()}, className, code -> {
|
||||||
"if(id >= 0 && id < values().length) {",
|
code.beginControlFlow("if(id >= 0 && id < values().length)")
|
||||||
"\treturn values()[id];",
|
.addStatement("return values()[id]")
|
||||||
"}",
|
.endControlFlow()
|
||||||
"return AIR;"
|
.addStatement("return AIR");
|
||||||
);
|
});
|
||||||
|
|
||||||
// hard coded methods
|
// hard coded methods
|
||||||
generator.addMethod("isHelmet", "()", "boolean", "return toString().endsWith(\"HELMET\");");
|
generator.addMethod("isHelmet", new ParameterSpec[0], TypeName.BOOLEAN, code -> { code.addStatement("return toString().endsWith(\"HELMET\")");});
|
||||||
generator.addMethod("isChestplate", "()", "boolean", "return toString().endsWith(\"CHESTPLATE\");");
|
generator.addMethod("isChestplate", new ParameterSpec[0], TypeName.BOOLEAN, code -> { code.addStatement("return toString().endsWith(\"CHESTPLATE\")");});
|
||||||
generator.addMethod("isLeggings", "()", "boolean", "return toString().endsWith(\"LEGGINGS\");");
|
generator.addMethod("isLeggings", new ParameterSpec[0], TypeName.BOOLEAN, code -> { code.addStatement("return toString().endsWith(\"LEGGINGS\")");});
|
||||||
generator.addMethod("isBoots", "()", "boolean", "return toString().endsWith(\"BOOTS\");");
|
generator.addMethod("isBoots", new ParameterSpec[0], TypeName.BOOLEAN, code -> { code.addStatement("return toString().endsWith(\"BOOTS\")");});
|
||||||
generator.addMethod("isArmor", "()", "boolean", "return isChestplate() || isHelmet() || isLeggings() || isBoots();");
|
generator.addMethod("isArmor", new ParameterSpec[0], TypeName.BOOLEAN, code -> { code.addStatement("return isChestplate() || isHelmet() || isLeggings() || isBoots()");});
|
||||||
generator.addMethod("isFood", "()", "boolean", "switch (this) {\n" +
|
generator.addMethod("isFood", new ParameterSpec[0], TypeName.BOOLEAN, code -> {
|
||||||
" case APPLE:\n" +
|
code.beginControlFlow("switch(this)")
|
||||||
" case MUSHROOM_STEW:\n" +
|
.add("case APPLE:\n")
|
||||||
" case BREAD:\n" +
|
.add("case MUSHROOM_STEW:\n")
|
||||||
" case PORKCHOP:\n" +
|
.add("case BREAD:\n")
|
||||||
" case COOKED_PORKCHOP:\n" +
|
.add("case PORKCHOP:\n")
|
||||||
" case GOLDEN_APPLE:\n" +
|
.add("case COOKED_PORKCHOP:\n")
|
||||||
" case ENCHANTED_GOLDEN_APPLE:\n" +
|
.add("case GOLDEN_APPLE:\n")
|
||||||
" case COD:\n" +
|
.add("case ENCHANTED_GOLDEN_APPLE:\n")
|
||||||
" case SALMON:\n" +
|
.add("case COD:\n")
|
||||||
" case TROPICAL_FISH:\n" +
|
.add("case SALMON:\n")
|
||||||
" case PUFFERFISH:\n" +
|
.add("case TROPICAL_FISH:\n")
|
||||||
" case COOKED_COD:\n" +
|
.add("case PUFFERFISH:\n")
|
||||||
" case COOKED_SALMON:\n" +
|
.add("case COOKED_COD:\n")
|
||||||
" case CAKE:\n" +
|
.add("case COOKED_SALMON:\n")
|
||||||
" case COOKIE:\n" +
|
.add("case CAKE:\n")
|
||||||
" case MELON_SLICE:\n" +
|
.add("case COOKIE:\n")
|
||||||
" case DRIED_KELP:\n" +
|
.add("case MELON_SLICE:\n")
|
||||||
" case BEEF:\n" +
|
.add("case DRIED_KELP:\n")
|
||||||
" case COOKED_BEEF:\n" +
|
.add("case BEEF:\n")
|
||||||
" case CHICKEN:\n" +
|
.add("case COOKED_BEEF:\n")
|
||||||
" case COOKED_CHICKEN:\n" +
|
.add("case CHICKEN:\n")
|
||||||
" case ROTTEN_FLESH:\n" +
|
.add("case COOKED_CHICKEN:\n")
|
||||||
" case SPIDER_EYE:\n" +
|
.add("case ROTTEN_FLESH:\n")
|
||||||
" case CARROT:\n" +
|
.add("case SPIDER_EYE:\n")
|
||||||
" case POTATO:\n" +
|
.add("case CARROT:\n")
|
||||||
" case BAKED_POTATO:\n" +
|
.add("case POTATO:\n")
|
||||||
" case POISONOUS_POTATO:\n" +
|
.add("case BAKED_POTATO:\n")
|
||||||
" case PUMPKIN_PIE:\n" +
|
.add("case POISONOUS_POTATO:\n")
|
||||||
" case RABBIT:\n" +
|
.add("case PUMPKIN_PIE:\n")
|
||||||
" case COOKED_RABBIT:\n" +
|
.add("case RABBIT:\n")
|
||||||
" case RABBIT_STEW:\n" +
|
.add("case COOKED_RABBIT:\n")
|
||||||
" case MUTTON:\n" +
|
.add("case RABBIT_STEW:\n")
|
||||||
" case COOKED_MUTTON:\n" +
|
.add("case MUTTON:\n")
|
||||||
" case BEETROOT:\n" +
|
.add("case COOKED_MUTTON:\n")
|
||||||
" case BEETROOT_SOUP:\n" +
|
.add("case BEETROOT:\n")
|
||||||
" case SWEET_BERRIES:\n" +
|
.add("case BEETROOT_SOUP:\n")
|
||||||
" case HONEY_BOTTLE:\n" +
|
.add("case SWEET_BERRIES:\n")
|
||||||
" case CHORUS_FRUIT:\n" +
|
.add("case HONEY_BOTTLE:\n")
|
||||||
" return true;\n" +
|
.add("case CHORUS_FRUIT:\n")
|
||||||
" default:\n" +
|
.addStatement("return true")
|
||||||
" return false;\n" +
|
.endControlFlow()
|
||||||
" }");
|
.addStatement("return false");
|
||||||
generator.addMethod("hasState", "()", "boolean", "switch (this) {\n" +
|
});
|
||||||
" case BOW:\n" +
|
generator.addMethod("hasState", new ParameterSpec[0], TypeName.BOOLEAN, code -> {
|
||||||
" case TRIDENT:\n" +
|
code.beginControlFlow("switch(this)")
|
||||||
" case CROSSBOW:\n" +
|
.add("case BOW:\n")
|
||||||
" case SHIELD:\n" +
|
.add("case TRIDENT:\n")
|
||||||
" return true;\n" +
|
.add("case CROSSBOW:\n")
|
||||||
" }\n" +
|
.add("case SHIELD:\n")
|
||||||
"\n" +
|
.addStatement("return true")
|
||||||
" return isFood();");*/
|
.endControlFlow()
|
||||||
|
.addStatement("return isFood()");
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user