mirror of
https://hub.spigotmc.org/stash/scm/spigot/bukkit.git
synced 2025-08-21 05:44:17 +00:00
Merge branch 'master' of https://hub.spigotmc.org/stash/scm/~derfrzocker/bukkit into enums-to-registers
Conflicts: src/main/java/org/bukkit/Material.java src/main/java/org/bukkit/Sound.java src/main/java/org/bukkit/block/Biome.java src/main/java/org/bukkit/potion/PotionEffectType.java src/main/java/org/bukkit/potion/PotionEffectTypeWrapper.java
This commit is contained in:
commit
0988647e06
18 changed files with 287 additions and 126 deletions
14
pom.xml
14
pom.xml
|
@ -5,7 +5,7 @@
|
|||
|
||||
<groupId>org.bukkit</groupId>
|
||||
<artifactId>bukkit</artifactId>
|
||||
<version>1.17.1-R0.1-SNAPSHOT</version>
|
||||
<version>1.18-R0.1-SNAPSHOT</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>Bukkit</name>
|
||||
|
@ -41,14 +41,14 @@
|
|||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
<version>21.0</version>
|
||||
<version>31.0.1-jre</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<!-- bundled with Minecraft, should be kept in sync -->
|
||||
<dependency>
|
||||
<groupId>com.google.code.gson</groupId>
|
||||
<artifactId>gson</artifactId>
|
||||
<version>2.8.0</version>
|
||||
<version>2.8.8</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
@ -142,7 +142,7 @@
|
|||
<dependency>
|
||||
<groupId>org.eclipse.jdt</groupId>
|
||||
<artifactId>ecj</artifactId>
|
||||
<version>3.26.0</version>
|
||||
<version>3.27.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
|
@ -189,10 +189,10 @@
|
|||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<version>3.3.0</version>
|
||||
<version>3.3.1</version>
|
||||
<configuration>
|
||||
<links>
|
||||
<link>https://guava.dev/releases/21.0/api/docs/</link>
|
||||
<link>https://guava.dev/releases/31.0.1-jre/api/docs/</link>
|
||||
<link>https://javadoc.io/doc/org.yaml/snakeyaml/1.28/</link>
|
||||
<link>https://javadoc.io/doc/org.jetbrains/annotations-java5/21.0.1/</link>
|
||||
</links>
|
||||
|
@ -229,7 +229,7 @@
|
|||
<dependency>
|
||||
<groupId>com.puppycrawl.tools</groupId>
|
||||
<artifactId>checkstyle</artifactId>
|
||||
<version>8.44</version>
|
||||
<version>8.45.1</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
|
|
|
@ -178,6 +178,15 @@ public final class Bukkit {
|
|||
return server.getViewDistance();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the simulation distance from this server.
|
||||
*
|
||||
* @return the simulation distance from this server.
|
||||
*/
|
||||
public static int getSimulationDistance() {
|
||||
return server.getSimulationDistance();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the IP that this server is bound to, or empty string if not
|
||||
* specified.
|
||||
|
@ -903,6 +912,15 @@ public final class Bukkit {
|
|||
server.setSpawnRadius(value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets whether the Server hide online players in server status.
|
||||
*
|
||||
* @return true if the server hide online players, false otherwise
|
||||
*/
|
||||
public static boolean getHideOnlinePlayers() {
|
||||
return server.getHideOnlinePlayers();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets whether the Server is in online mode or not.
|
||||
*
|
||||
|
|
|
@ -1044,6 +1044,7 @@ public interface Material extends Keyed, Comparable<Material> {
|
|||
Material MUSIC_DISC_WARD = getMaterial("music_disc_ward");
|
||||
Material MUSIC_DISC_11 = getMaterial("music_disc_11");
|
||||
Material MUSIC_DISC_WAIT = getMaterial("music_disc_wait");
|
||||
Material MUSIC_DISC_OTHERSIDE = getMaterial("music_disc_otherside");
|
||||
Material MUSIC_DISC_PIGSTEP = getMaterial("music_disc_pigstep");
|
||||
Material TRIDENT = getMaterial("trident");
|
||||
Material PHANTOM_MEMBRANE = getMaterial("phantom_membrane");
|
||||
|
|
|
@ -41,7 +41,6 @@ public enum Particle {
|
|||
SNOW_SHOVEL,
|
||||
SLIME,
|
||||
HEART,
|
||||
BARRIER,
|
||||
ITEM_CRACK(ItemStack.class),
|
||||
BLOCK_CRACK(BlockData.class),
|
||||
BLOCK_DUST(BlockData.class),
|
||||
|
@ -82,7 +81,6 @@ public enum Particle {
|
|||
LANDING_OBSIDIAN_TEAR,
|
||||
REVERSE_PORTAL,
|
||||
WHITE_ASH,
|
||||
LIGHT,
|
||||
DUST_COLOR_TRANSITION(DustTransition.class),
|
||||
VIBRATION(Vibration.class),
|
||||
FALLING_SPORE_BLOSSOM,
|
||||
|
@ -99,6 +97,7 @@ public enum Particle {
|
|||
WAX_OFF,
|
||||
ELECTRIC_SPARK,
|
||||
SCRAPE,
|
||||
BLOCK_MARKER(BlockData.class),
|
||||
// ----- Legacy Separator -----
|
||||
LEGACY_BLOCK_CRACK(MaterialData.class),
|
||||
LEGACY_BLOCK_DUST(MaterialData.class),
|
||||
|
|
|
@ -149,6 +149,13 @@ public interface Server extends PluginMessageRecipient {
|
|||
*/
|
||||
public int getViewDistance();
|
||||
|
||||
/**
|
||||
* Get the simulation distance from this server.
|
||||
*
|
||||
* @return the simulation distance from this server.
|
||||
*/
|
||||
public int getSimulationDistance();
|
||||
|
||||
/**
|
||||
* Get the IP that this server is bound to, or empty string if not
|
||||
* specified.
|
||||
|
@ -761,6 +768,13 @@ public interface Server extends PluginMessageRecipient {
|
|||
*/
|
||||
public void setSpawnRadius(int value);
|
||||
|
||||
/**
|
||||
* Gets whether the Server hide online players in server status.
|
||||
*
|
||||
* @return true if the server hide online players, false otherwise
|
||||
*/
|
||||
public boolean getHideOnlinePlayers();
|
||||
|
||||
/**
|
||||
* Gets whether the Server is in online mode or not.
|
||||
*
|
||||
|
|
|
@ -232,6 +232,7 @@ public abstract class Sound extends OldEnum<Sound> implements Keyed {
|
|||
public static final Sound BLOCK_GRAVEL_PLACE = getSound("block.gravel.place");
|
||||
public static final Sound BLOCK_GRAVEL_STEP = getSound("block.gravel.step");
|
||||
public static final Sound BLOCK_GRINDSTONE_USE = getSound("block.grindstone.use");
|
||||
public static final Sound BLOCK_GROWING_PLANT_CROP = getSound("block.growing_plant.crop");
|
||||
public static final Sound BLOCK_HANGING_ROOTS_BREAK = getSound("block.hanging_roots.break");
|
||||
public static final Sound BLOCK_HANGING_ROOTS_FALL = getSound("block.hanging_roots.fall");
|
||||
public static final Sound BLOCK_HANGING_ROOTS_HIT = getSound("block.hanging_roots.hit");
|
||||
|
@ -1133,6 +1134,9 @@ public abstract class Sound extends OldEnum<Sound> implements Keyed {
|
|||
public static final Sound ITEM_BUCKET_FILL_FISH = getSound("item.bucket.fill_fish");
|
||||
public static final Sound ITEM_BUCKET_FILL_LAVA = getSound("item.bucket.fill_lava");
|
||||
public static final Sound ITEM_BUCKET_FILL_POWDER_SNOW = getSound("item.bucket.fill_powder_snow");
|
||||
public static final Sound ITEM_BUNDLE_DROP_CONTENTS = getSound("item.bundle.drop_contents");
|
||||
public static final Sound ITEM_BUNDLE_INSERT = getSound("item.bundle.insert");
|
||||
public static final Sound ITEM_BUNDLE_REMOVE_ONE = getSound("item.bundle.remove_one");
|
||||
public static final Sound ITEM_CHORUS_FRUIT_TELEPORT = getSound("item.chorus_fruit.teleport");
|
||||
public static final Sound ITEM_CROP_PLANT = getSound("item.crop.plant");
|
||||
public static final Sound ITEM_CROSSBOW_HIT = getSound("item.crossbow.hit");
|
||||
|
@ -1178,6 +1182,7 @@ public abstract class Sound extends OldEnum<Sound> implements Keyed {
|
|||
public static final Sound MUSIC_DISC_FAR = getSound("music_disc.far");
|
||||
public static final Sound MUSIC_DISC_MALL = getSound("music_disc.mall");
|
||||
public static final Sound MUSIC_DISC_MELLOHI = getSound("music_disc.mellohi");
|
||||
public static final Sound MUSIC_DISC_OTHERSIDE = getSound("music_disc.otherside");
|
||||
public static final Sound MUSIC_DISC_PIGSTEP = getSound("music_disc.pigstep");
|
||||
public static final Sound MUSIC_DISC_STAL = getSound("music_disc.stal");
|
||||
public static final Sound MUSIC_DISC_STRAD = getSound("music_disc.strad");
|
||||
|
@ -1192,6 +1197,14 @@ public abstract class Sound extends OldEnum<Sound> implements Keyed {
|
|||
public static final Sound MUSIC_NETHER_NETHER_WASTES = getSound("music.nether.nether_wastes");
|
||||
public static final Sound MUSIC_NETHER_SOUL_SAND_VALLEY = getSound("music.nether.soul_sand_valley");
|
||||
public static final Sound MUSIC_NETHER_WARPED_FOREST = getSound("music.nether.warped_forest");
|
||||
public static final Sound MUSIC_OVERWORLD_DRIPSTONE_CAVES = getSound("music.overworld.dripstone_caves");
|
||||
public static final Sound MUSIC_OVERWORLD_FROZEN_PEAKS = getSound("music.overworld.frozen_peaks");
|
||||
public static final Sound MUSIC_OVERWORLD_GROVE = getSound("music.overworld.grove");
|
||||
public static final Sound MUSIC_OVERWORLD_JAGGED_PEAKS = getSound("music.overworld.jagged_peaks");
|
||||
public static final Sound MUSIC_OVERWORLD_LUSH_CAVES = getSound("music.overworld.lush_caves");
|
||||
public static final Sound MUSIC_OVERWORLD_MEADOW = getSound("music.overworld.meadow");
|
||||
public static final Sound MUSIC_OVERWORLD_SNOWY_SLOPES = getSound("music.overworld.snowy_slopes");
|
||||
public static final Sound MUSIC_OVERWORLD_STONY_PEAKS = getSound("music.overworld.stony_peaks");
|
||||
public static final Sound MUSIC_UNDER_WATER = getSound("music.under_water");
|
||||
public static final Sound PARTICLE_SOUL_ESCAPE = getSound("particle.soul_escape");
|
||||
public static final Sound UI_BUTTON_CLICK = getSound("ui.button.click");
|
||||
|
|
|
@ -235,6 +235,10 @@ public interface Tag<T extends Keyed> extends Keyed {
|
|||
* Vanilla block tag representing all dirt.
|
||||
*/
|
||||
Tag<Material> DIRT = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("dirt"), Material.class);
|
||||
/**
|
||||
* Vanilla block tag representing all terracotta.
|
||||
*/
|
||||
Tag<Material> TERRACOTTA = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("terracotta"), Material.class);
|
||||
/**
|
||||
* Vanilla block tag denoting blocks that enderman may pick up and hold.
|
||||
*/
|
||||
|
@ -332,7 +336,8 @@ public interface Tag<T extends Keyed> extends Keyed {
|
|||
*/
|
||||
Tag<Material> BEACON_BASE_BLOCKS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("beacon_base_blocks"), Material.class);
|
||||
/**
|
||||
* Vanilla block tag representing all blocks affected by the soul speed enchantment.
|
||||
* Vanilla block tag representing all blocks affected by the soul speed
|
||||
* enchantment.
|
||||
*/
|
||||
Tag<Material> SOUL_SPEED_BLOCKS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("soul_speed_blocks"), Material.class);
|
||||
/**
|
||||
|
@ -405,7 +410,8 @@ public interface Tag<T extends Keyed> extends Keyed {
|
|||
*/
|
||||
Tag<Material> STONE_ORE_REPLACEABLES = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("stone_ore_replaceables"), Material.class);
|
||||
/**
|
||||
* Vanilla block tag representing all blocks that may be replaced by deepslate ores.
|
||||
* Vanilla block tag representing all blocks that may be replaced by
|
||||
* deepslate ores.
|
||||
*/
|
||||
Tag<Material> DEEPSLATE_ORE_REPLACEABLES = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("deepslate_ore_replaceables"), Material.class);
|
||||
/**
|
||||
|
@ -433,7 +439,8 @@ public interface Tag<T extends Keyed> extends Keyed {
|
|||
*/
|
||||
Tag<Material> OCCLUDES_VIBRATION_SIGNALS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("occludes_vibration_signals"), Material.class);
|
||||
/**
|
||||
* Vanilla block tag representing all blocks that are replaceable by dripstone.
|
||||
* Vanilla block tag representing all blocks that are replaceable by
|
||||
* dripstone.
|
||||
*/
|
||||
Tag<Material> DRIPSTONE_REPLACEABLE = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("dripstone_replaceable_blocks"), Material.class);
|
||||
/**
|
||||
|
@ -449,9 +456,19 @@ public interface Tag<T extends Keyed> extends Keyed {
|
|||
*/
|
||||
Tag<Material> LUSH_GROUND_REPLACEABLE = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("lush_ground_replaceable"), Material.class);
|
||||
/**
|
||||
* Vanilla block tag representing all blocks which small dripleaf can be placed on.
|
||||
* Vanilla block tag representing all blocks replaceable by azalea root.
|
||||
*/
|
||||
Tag<Material> AZALEA_ROOT_REPLACEABLE = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("azalea_root_replaceable"), Material.class);
|
||||
/**
|
||||
* Vanilla block tag representing all blocks which small dripleaf can be
|
||||
* placed on.
|
||||
*/
|
||||
Tag<Material> SMALL_DRIPLEAF_PLACEABLE = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("small_dripleaf_placeable"), Material.class);
|
||||
/**
|
||||
* Vanilla block tag representing all blocks which big dripleaf can be
|
||||
* placed on.
|
||||
*/
|
||||
Tag<Material> BIG_DRIPLEAF_PLACEABLE = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("big_dripleaf_placeable"), Material.class);
|
||||
/**
|
||||
* Vanilla block tag representing all snow blocks.
|
||||
*/
|
||||
|
@ -485,17 +502,64 @@ public interface Tag<T extends Keyed> extends Keyed {
|
|||
*/
|
||||
Tag<Material> NEEDS_STONE_TOOL = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("needs_stone_tool"), Material.class);
|
||||
/**
|
||||
* Vanilla block tag representing all blocks which will not be replaced by world generation features.
|
||||
* Vanilla block tag representing all blocks which will not be replaced by
|
||||
* world generation features.
|
||||
*/
|
||||
Tag<Material> FEATURES_CANNOT_REPLACE = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("features_cannot_replace"), Material.class);
|
||||
/**
|
||||
* Vanilla block tag representing all blocks which lava pools will not replace.
|
||||
* Vanilla block tag representing all blocks which lava pools will not
|
||||
* replace.
|
||||
*/
|
||||
Tag<Material> LAVA_POOL_STONE_CANNOT_REPLACE = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("lava_pool_stone_replaceables"), Material.class);
|
||||
Tag<Material> LAVA_POOL_STONE_CANNOT_REPLACE = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("lava_pool_stone_cannot_replace"), Material.class);
|
||||
/**
|
||||
* Vanilla block tag representing all blocks which geodes will not spawn in.
|
||||
*/
|
||||
Tag<Material> GEODE_INVALID_BLOCKS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("geode_invalid_blocks"), Material.class);
|
||||
/**
|
||||
* Vanilla block tag representing all blocks which animals will spawn on.
|
||||
*/
|
||||
Tag<Material> ANIMALS_SPAWNABLE_ON = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("animals_spawnable_on"), Material.class);
|
||||
/**
|
||||
* Vanilla block tag representing all blocks which axolotls will spawn on.
|
||||
*/
|
||||
Tag<Material> AXOLOTLS_SPAWNABLE_ON = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("axolotls_spawnable_on"), Material.class);
|
||||
/**
|
||||
* Vanilla block tag representing all blocks which goats will spawn on.
|
||||
*/
|
||||
Tag<Material> GOATS_SPAWNABLE_ON = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("goats_spawnable_on"), Material.class);
|
||||
/**
|
||||
* Vanilla block tag representing all blocks which mooshrooms will spawn on.
|
||||
*/
|
||||
Tag<Material> MOOSHROOMS_SPAWNABLE_ON = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("mooshrooms_spawnable_on"), Material.class);
|
||||
/**
|
||||
* Vanilla block tag representing all blocks which parrots will spawn on.
|
||||
*/
|
||||
Tag<Material> PARROTS_SPAWNABLE_ON = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("parrots_spawnable_on"), Material.class);
|
||||
/**
|
||||
* Vanilla block tag representing all blocks which polar bears will spawn
|
||||
* on.
|
||||
*/
|
||||
Tag<Material> POLAR_BEARS_SPAWNABLE_ON_IN_FROZEN_OCEAN = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("polar_bears_spawnable_on_in_frozen_ocean"), Material.class);
|
||||
/**
|
||||
* Vanilla block tag representing all blocks which rabbits will spawn on.
|
||||
*/
|
||||
Tag<Material> RABBITS_SPAWNABLE_ON = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("rabbits_spawnable_on"), Material.class);
|
||||
/**
|
||||
* Vanilla block tag representing all blocks which foxes will spawn on.
|
||||
*/
|
||||
Tag<Material> FOXES_SPAWNABLE_ON = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("foxes_spawnable_on"), Material.class);
|
||||
/**
|
||||
* Vanilla block tag representing all blocks which wolves will spawn on.
|
||||
*/
|
||||
Tag<Material> WOLVES_SPAWNABLE_ON = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("wolves_spawnable_on"), Material.class);
|
||||
/**
|
||||
* Vanilla block tag representing all blocks which azaleas will grow on.
|
||||
*/
|
||||
Tag<Material> AZALEA_GROWS_ON = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("azalea_grows_on"), Material.class);
|
||||
/**
|
||||
* Vanilla block tag representing all plant blocks which may be replaced.
|
||||
*/
|
||||
Tag<Material> REPLACEABLE_PLANTS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("replaceable_plants"), Material.class);
|
||||
/**
|
||||
* Key for the built in item registry.
|
||||
*/
|
||||
|
|
|
@ -19,7 +19,7 @@ public abstract class Biome extends OldEnum<Biome> implements Keyed {
|
|||
public static final Biome OCEAN = getBiome("ocean");
|
||||
public static final Biome PLAINS = getBiome("plains");
|
||||
public static final Biome DESERT = getBiome("desert");
|
||||
public static final Biome MOUNTAINS = getBiome("mountains");
|
||||
public static final Biome WINDSWEPT_HILLS = getBiome("windswept_Hills");
|
||||
public static final Biome FOREST = getBiome("forest");
|
||||
public static final Biome TAIGA = getBiome("taiga");
|
||||
public static final Biome SWAMP = getBiome("swamp");
|
||||
|
@ -28,34 +28,23 @@ public abstract class Biome extends OldEnum<Biome> implements Keyed {
|
|||
public static final Biome THE_END = getBiome("the_end");
|
||||
public static final Biome FROZEN_OCEAN = getBiome("frozen_ocean");
|
||||
public static final Biome FROZEN_RIVER = getBiome("frozen_river");
|
||||
public static final Biome SNOWY_TUNDRA = getBiome("snowy_tundra");
|
||||
public static final Biome SNOWY_MOUNTAINS = getBiome("snowy_mountains");
|
||||
public static final Biome SNOWY_PLAINS = getBiome("snowy_plains");
|
||||
public static final Biome MUSHROOM_FIELDS = getBiome("mushroom_fields");
|
||||
public static final Biome MUSHROOM_FIELD_SHORE = getBiome("mushroom_field_shore");
|
||||
public static final Biome BEACH = getBiome("beach");
|
||||
public static final Biome DESERT_HILLS = getBiome("desert_hills");
|
||||
public static final Biome WOODED_HILLS = getBiome("wooded_hills");
|
||||
public static final Biome TAIGA_HILLS = getBiome("taiga_hills");
|
||||
public static final Biome MOUNTAIN_EDGE = getBiome("mountain_edge");
|
||||
public static final Biome JUNGLE = getBiome("jungle");
|
||||
public static final Biome JUNGLE_HILLS = getBiome("jungle_hills");
|
||||
public static final Biome JUNGLE_EDGE = getBiome("jungle_edge");
|
||||
public static final Biome SPARSE_JUNGLE = getBiome("sparse_jungle");
|
||||
public static final Biome DEEP_OCEAN = getBiome("deep_ocean");
|
||||
public static final Biome STONE_SHORE = getBiome("stone_shore");
|
||||
public static final Biome STONY_SHORE = getBiome("stony_shore");
|
||||
public static final Biome SNOWY_BEACH = getBiome("snowy_beach");
|
||||
public static final Biome BIRCH_FOREST = getBiome("birch_forest");
|
||||
public static final Biome BIRCH_FOREST_HILLS = getBiome("birch_forest_hills");
|
||||
public static final Biome DARK_FOREST = getBiome("dark_forest");
|
||||
public static final Biome SNOWY_TAIGA = getBiome("snowy_taiga");
|
||||
public static final Biome SNOWY_TAIGA_HILLS = getBiome("snowy_taiga_hills");
|
||||
public static final Biome GIANT_TREE_TAIGA = getBiome("giant_tree_taiga");
|
||||
public static final Biome GIANT_TREE_TAIGA_HILLS = getBiome("giant_tree_taiga_hills");
|
||||
public static final Biome WOODED_MOUNTAINS = getBiome("wooded_mountains");
|
||||
public static final Biome OLD_GROWTH_PINE_TAIGA = getBiome("old_growth_pine_taiga");
|
||||
public static final Biome WINDSWEPT_FOREST = getBiome("windswept_forest");
|
||||
public static final Biome SAVANNA = getBiome("savanna");
|
||||
public static final Biome SAVANNA_PLATEAU = getBiome("savanna_plateau");
|
||||
public static final Biome BADLANDS = getBiome("badlands");
|
||||
public static final Biome WOODED_BADLANDS_PLATEAU = getBiome("wooded_badlands_plateau");
|
||||
public static final Biome BADLANDS_PLATEAU = getBiome("badlands_plateau");
|
||||
public static final Biome WOODED_BADLANDS = getBiome("wooded_badlands");
|
||||
public static final Biome SMALL_END_ISLANDS = getBiome("small_end_islands");
|
||||
public static final Biome END_MIDLANDS = getBiome("end_midlands");
|
||||
public static final Biome END_HIGHLANDS = getBiome("end_highlands");
|
||||
|
@ -63,40 +52,31 @@ public abstract class Biome extends OldEnum<Biome> implements Keyed {
|
|||
public static final Biome WARM_OCEAN = getBiome("warm_ocean");
|
||||
public static final Biome LUKEWARM_OCEAN = getBiome("lukewarm_ocean");
|
||||
public static final Biome COLD_OCEAN = getBiome("cold_ocean");
|
||||
public static final Biome DEEP_WARM_OCEAN = getBiome("deep_warm_ocean");
|
||||
public static final Biome DEEP_LUKEWARM_OCEAN = getBiome("deep_lukewarm_ocean");
|
||||
public static final Biome DEEP_COLD_OCEAN = getBiome("deep_cold_ocean");
|
||||
public static final Biome DEEP_FROZEN_OCEAN = getBiome("deep_frozen_ocean");
|
||||
public static final Biome THE_VOID = getBiome("the_void");
|
||||
public static final Biome SUNFLOWER_PLAINS = getBiome("sunflower_plains");
|
||||
public static final Biome DESERT_LAKES = getBiome("desert_lakes");
|
||||
public static final Biome GRAVELLY_MOUNTAINS = getBiome("gravelly_mountains");
|
||||
public static final Biome WINDSWEPT_GRAVELLY_HILLS = getBiome("windswept_gravelly_hills");
|
||||
public static final Biome FLOWER_FOREST = getBiome("flower_forest");
|
||||
public static final Biome TAIGA_MOUNTAINS = getBiome("taiga_mountains");
|
||||
public static final Biome SWAMP_HILLS = getBiome("swamp_hills");
|
||||
public static final Biome ICE_SPIKES = getBiome("ice_spikes");
|
||||
public static final Biome MODIFIED_JUNGLE = getBiome("modified_jungle");
|
||||
public static final Biome MODIFIED_JUNGLE_EDGE = getBiome("modified_jungle_edge");
|
||||
public static final Biome TALL_BIRCH_FOREST = getBiome("tall_birch_forest");
|
||||
public static final Biome TALL_BIRCH_HILLS = getBiome("tall_birch_hills");
|
||||
public static final Biome DARK_FOREST_HILLS = getBiome("dark_forest_hills");
|
||||
public static final Biome SNOWY_TAIGA_MOUNTAINS = getBiome("snowy_taiga_mountains");
|
||||
public static final Biome GIANT_SPRUCE_TAIGA = getBiome("giant_spruce_taiga");
|
||||
public static final Biome GIANT_SPRUCE_TAIGA_HILLS = getBiome("giant_spruce_taiga_hills");
|
||||
public static final Biome MODIFIED_GRAVELLY_MOUNTAINS = getBiome("modified_gravelly_mountains");
|
||||
public static final Biome SHATTERED_SAVANNA = getBiome("shattered_savanna");
|
||||
public static final Biome SHATTERED_SAVANNA_PLATEAU = getBiome("shattered_savanna_plateau");
|
||||
public static final Biome OLD_GROWTH_BIRCH_FOREST = getBiome("old_growth_birch_forest");
|
||||
public static final Biome OLD_GROWTH_SPRUCE_TAIGA = getBiome("old_growth_spruce_taiga");
|
||||
public static final Biome WINDSWEPT_SAVANNA = getBiome("windswept_savanna");
|
||||
public static final Biome ERODED_BADLANDS = getBiome("eroded_badlands");
|
||||
public static final Biome MODIFIED_WOODED_BADLANDS_PLATEAU = getBiome("modified_wooded_badlands_plateau");
|
||||
public static final Biome MODIFIED_BADLANDS_PLATEAU = getBiome("modified_badlands_plateau");
|
||||
public static final Biome BAMBOO_JUNGLE = getBiome("bamboo_jungle");
|
||||
public static final Biome BAMBOO_JUNGLE_HILLS = getBiome("bamboo_jungle_hills");
|
||||
public static final Biome SOUL_SAND_VALLEY = getBiome("soul_sand_valley");
|
||||
public static final Biome CRIMSON_FOREST = getBiome("crimson_forest");
|
||||
public static final Biome WARPED_FOREST = getBiome("warped_forest");
|
||||
public static final Biome BASALT_DELTAS = getBiome("basalt_deltas");
|
||||
public static final Biome DRIPSTONE_CAVES = getBiome("dripstone_caves");
|
||||
public static final Biome LUSH_CAVES = getBiome("lush_caves");
|
||||
public static final Biome MEADOW = getBiome("meadow");
|
||||
public static final Biome GROVE = getBiome("grove");
|
||||
public static final Biome SNOWY_SLOPES = getBiome("snowy_slopes");
|
||||
public static final Biome FROZEN_PEAKS = getBiome("frozen_peaks");
|
||||
public static final Biome JAGGED_PEAKS = getBiome("jagged_peaks");
|
||||
public static final Biome STONY_PEAKS = getBiome("stony_peaks");
|
||||
|
||||
/**
|
||||
* Represents a custom Biome.
|
||||
|
|
|
@ -511,4 +511,13 @@ public interface Block extends Metadatable {
|
|||
*/
|
||||
@NotNull
|
||||
VoxelShape getCollisionShape();
|
||||
|
||||
/**
|
||||
* Checks if this block is a valid placement location for the specified
|
||||
* block data.
|
||||
*
|
||||
* @param data the block data to check
|
||||
* @return <code>true</code> if the block data can be placed here
|
||||
*/
|
||||
boolean canPlace(@NotNull BlockData data);
|
||||
}
|
||||
|
|
|
@ -106,7 +106,7 @@ public interface ItemFrame extends Hanging {
|
|||
* damage, interaction, pistons, or missing supporting blocks), rotate the
|
||||
* item or place/remove items.
|
||||
*
|
||||
* @param visible whether the item frame is fixed or not
|
||||
* @param fixed whether the item frame is fixed or not
|
||||
*/
|
||||
void setFixed(boolean visible);
|
||||
void setFixed(boolean fixed);
|
||||
}
|
||||
|
|
|
@ -21,6 +21,7 @@ import org.bukkit.conversations.Conversable;
|
|||
import org.bukkit.event.block.BlockBreakEvent;
|
||||
import org.bukkit.event.block.BlockDropItemEvent;
|
||||
import org.bukkit.event.player.PlayerResourcePackStatusEvent;
|
||||
import org.bukkit.inventory.EquipmentSlot;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.map.MapView;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
@ -460,24 +461,15 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
|||
public void sendBlockDamage(@NotNull Location loc, float progress);
|
||||
|
||||
/**
|
||||
* Send a chunk change. This fakes a chunk change packet for a user at a
|
||||
* certain location. The updated cuboid must be entirely within a single
|
||||
* chunk. This will not actually change the world in any way.
|
||||
* <p>
|
||||
* At least one of the dimensions of the cuboid must be even. The size of
|
||||
* the data buffer must be 2.5*sx*sy*sz and formatted in accordance with
|
||||
* the Packet51 format.
|
||||
* Send the equipment change of an entity. This fakes the equipment change
|
||||
* of an entity for a user. This will not actually change the inventory of
|
||||
* the specified entity in any way.
|
||||
*
|
||||
* @param loc The location of the cuboid
|
||||
* @param sx The x size of the cuboid
|
||||
* @param sy The y size of the cuboid
|
||||
* @param sz The z size of the cuboid
|
||||
* @param data The data to be sent
|
||||
* @return true if the chunk change packet was sent
|
||||
* @deprecated Magic value
|
||||
* @param entity The entity that the player will see the change for
|
||||
* @param slot The slot of the spoofed equipment change
|
||||
* @param item The ItemStack to display for the player
|
||||
*/
|
||||
@Deprecated
|
||||
public boolean sendChunkChange(@NotNull Location loc, int sx, int sy, int sz, @NotNull byte[] data);
|
||||
public void sendEquipmentChange(@NotNull LivingEntity entity, @NotNull EquipmentSlot slot, @NotNull ItemStack item);
|
||||
|
||||
/**
|
||||
* Send a sign change. This fakes a sign change packet for a user at
|
||||
|
@ -778,6 +770,39 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
|||
*/
|
||||
public boolean canSee(@NotNull Player player);
|
||||
|
||||
/**
|
||||
* Visually hides an entity from this player.
|
||||
*
|
||||
* @param plugin Plugin that wants to hide the entity
|
||||
* @param entity Entity to hide
|
||||
* @deprecated draft API
|
||||
*/
|
||||
@Deprecated
|
||||
public void hideEntity(@NotNull Plugin plugin, @NotNull Entity entity);
|
||||
|
||||
/**
|
||||
* Allows this player to see an entity that was previously hidden. If
|
||||
* another another plugin had hidden the entity too, then the entity will
|
||||
* remain hidden until the other plugin calls this method too.
|
||||
*
|
||||
* @param plugin Plugin that wants to show the entity
|
||||
* @param entity Entity to show
|
||||
* @deprecated draft API
|
||||
*/
|
||||
@Deprecated
|
||||
public void showEntity(@NotNull Plugin plugin, @NotNull Entity entity);
|
||||
|
||||
/**
|
||||
* Checks to see if an entity has been visually hidden from this player.
|
||||
*
|
||||
* @param entity Entity to check
|
||||
* @return True if the provided entity is not being hidden from this
|
||||
* player
|
||||
* @deprecated draft API
|
||||
*/
|
||||
@Deprecated
|
||||
public boolean canSee(@NotNull Entity entity);
|
||||
|
||||
/**
|
||||
* Checks to see if this player is currently flying or not.
|
||||
*
|
||||
|
@ -1275,13 +1300,13 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
|||
/**
|
||||
* Gets the player's estimated ping in milliseconds.
|
||||
*
|
||||
* In Vanilla this value represents the average of the response time to the
|
||||
* last four application layer ping packets sent. This value does not
|
||||
* represent the network round trip time and as such may have less
|
||||
* granularity and be impacted by other sources. For these reasons it
|
||||
* <b>should not</b> be used for anti-cheat purposes. Its recommended use is
|
||||
* only as a <b>qualitative</b> indicator of connection quality (Vanilla
|
||||
* uses it for this purpose in the tab list).
|
||||
* In Vanilla this value represents a weighted average of the response time
|
||||
* to application layer ping packets sent. This value does not represent the
|
||||
* network round trip time and as such may have less granularity and be
|
||||
* impacted by other sources. For these reasons it <b>should not</b> be used
|
||||
* for anti-cheat purposes. Its recommended use is only as a
|
||||
* <b>qualitative</b> indicator of connection quality (Vanilla uses it for
|
||||
* this purpose in the tab list).
|
||||
*
|
||||
* @return player ping
|
||||
*/
|
||||
|
@ -1315,4 +1340,19 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
|||
* @param book The book to open for this player
|
||||
*/
|
||||
public void openBook(@NotNull ItemStack book);
|
||||
|
||||
/**
|
||||
* Shows the demo screen to the player, this screen is normally only seen in
|
||||
* the demo version of the game.
|
||||
* <br>
|
||||
* Servers can modify the text on this screen using a resource pack.
|
||||
*/
|
||||
public void showDemoScreen();
|
||||
|
||||
/**
|
||||
* Gets whether the player has the "Allow Server Listings" setting enabled.
|
||||
*
|
||||
* @return whether the player allows server listings
|
||||
*/
|
||||
public boolean isAllowingServerListings();
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ package org.bukkit.event.server;
|
|||
import java.net.InetAddress;
|
||||
import java.util.Iterator;
|
||||
import org.apache.commons.lang.Validate;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.UndefinedNullability;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
@ -12,6 +13,9 @@ import org.jetbrains.annotations.NotNull;
|
|||
/**
|
||||
* Called when a server list ping is coming in. Displayed players can be
|
||||
* checked and removed by {@link #iterator() iterating} over this event.
|
||||
* <br>
|
||||
* <b>Note:</b> The players in {@link #iterator()} will not be shown in the
|
||||
* server info if {@link Bukkit#getHideOnlinePlayers()} is true.
|
||||
*/
|
||||
public class ServerListPingEvent extends ServerEvent implements Iterable<Player> {
|
||||
private static final int MAGIC_PLAYER_COUNT = Integer.MIN_VALUE;
|
||||
|
@ -142,6 +146,9 @@ public class ServerListPingEvent extends ServerEvent implements Iterable<Player>
|
|||
* player to not be displayed on the player list, decrease the size
|
||||
* returned by {@link #getNumPlayers()}, and will not be returned again by
|
||||
* any new iterator.
|
||||
* <br>
|
||||
* <b>Note:</b> The players here will not be shown in the server info if
|
||||
* {@link Bukkit#getHideOnlinePlayers()} is true.
|
||||
*
|
||||
* @throws UnsupportedOperationException if the caller of this event does
|
||||
* not support removing players
|
||||
|
|
|
@ -63,7 +63,14 @@ public class MapFont {
|
|||
int result = 0;
|
||||
for (int i = 0; i < text.length(); ++i) {
|
||||
char ch = text.charAt(i);
|
||||
if (ch == ChatColor.COLOR_CHAR) continue;
|
||||
if (ch == ChatColor.COLOR_CHAR) {
|
||||
int j = text.indexOf(';', i);
|
||||
if (j >= 0) {
|
||||
i = j;
|
||||
continue;
|
||||
}
|
||||
throw new IllegalArgumentException("Text contains unterminated color string");
|
||||
}
|
||||
result += chars.get(ch).getWidth();
|
||||
}
|
||||
result += text.length() - 1; // Account for 1px spacing between characters
|
||||
|
|
|
@ -16,17 +16,14 @@ import org.jetbrains.annotations.Nullable;
|
|||
* Base Permissible for use in any Permissible object via proxy or extension
|
||||
*/
|
||||
public class PermissibleBase implements Permissible {
|
||||
private ServerOperator opable;
|
||||
private Permissible parent = this;
|
||||
private final ServerOperator opable;
|
||||
private final Permissible parent;
|
||||
private final List<PermissionAttachment> attachments = new LinkedList<PermissionAttachment>();
|
||||
private final Map<String, PermissionAttachmentInfo> permissions = new HashMap<String, PermissionAttachmentInfo>();
|
||||
|
||||
public PermissibleBase(@Nullable ServerOperator opable) {
|
||||
this.opable = opable;
|
||||
|
||||
if (opable instanceof Permissible) {
|
||||
this.parent = (Permissible) opable;
|
||||
}
|
||||
this.parent = (opable instanceof Permissible) ? (Permissible) opable : this;
|
||||
|
||||
recalculatePermissions();
|
||||
}
|
||||
|
@ -144,8 +141,7 @@ public class PermissibleBase implements Permissible {
|
|||
throw new IllegalArgumentException("Attachment cannot be null");
|
||||
}
|
||||
|
||||
if (attachments.contains(attachment)) {
|
||||
attachments.remove(attachment);
|
||||
if (attachments.remove(attachment)) {
|
||||
PermissionRemovedExecutor ex = attachment.getRemovalCallback();
|
||||
|
||||
if (ex != null) {
|
||||
|
@ -253,7 +249,7 @@ public class PermissibleBase implements Permissible {
|
|||
}
|
||||
|
||||
private static class RemoveAttachmentRunnable implements Runnable {
|
||||
private PermissionAttachment attachment;
|
||||
private final PermissionAttachment attachment;
|
||||
|
||||
public RemoveAttachmentRunnable(@NotNull PermissionAttachment attachment) {
|
||||
this.attachment = attachment;
|
||||
|
|
|
@ -121,7 +121,7 @@ class LibraryLoader
|
|||
} );
|
||||
}
|
||||
|
||||
URLClassLoader loader = new URLClassLoader( jarFiles.toArray( new URL[ jarFiles.size() ] ) );
|
||||
URLClassLoader loader = new URLClassLoader( jarFiles.toArray( new URL[ jarFiles.size() ] ), getClass().getClassLoader() );
|
||||
|
||||
return loader;
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@ import org.bukkit.Color;
|
|||
import org.bukkit.Keyed;
|
||||
import org.bukkit.NamespacedKey;
|
||||
import org.bukkit.Registry;
|
||||
import org.jetbrains.annotations.Contract;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
|
@ -21,166 +22,166 @@ public abstract class PotionEffectType implements Keyed {
|
|||
/**
|
||||
* Increases movement speed.
|
||||
*/
|
||||
public static final PotionEffectType SPEED = getPotionEffectType("speed", 1);
|
||||
public static final PotionEffectType SPEED = getPotionEffectType(1, "speed");
|
||||
|
||||
/**
|
||||
* Decreases movement speed.
|
||||
*/
|
||||
public static final PotionEffectType SLOWNESS = getPotionEffectType("slowness", 2);
|
||||
public static final PotionEffectType SLOWNESS = getPotionEffectType(2, "slowness");
|
||||
|
||||
/**
|
||||
* Increases dig speed.
|
||||
*/
|
||||
public static final PotionEffectType HASTE = getPotionEffectType("haste", 3);
|
||||
public static final PotionEffectType HASTE = getPotionEffectType(3, "haste");
|
||||
|
||||
/**
|
||||
* Decreases dig speed.
|
||||
*/
|
||||
public static final PotionEffectType MINING_FATIGUE = getPotionEffectType("mining_fatigue", 4);
|
||||
public static final PotionEffectType MINING_FATIGUE = getPotionEffectType(4, "mining_fatigue");
|
||||
|
||||
/**
|
||||
* Increases damage dealt.
|
||||
*/
|
||||
public static final PotionEffectType STRENGTH = getPotionEffectType("strength", 5);
|
||||
public static final PotionEffectType STRENGTH = getPotionEffectType(5, "strength");
|
||||
|
||||
/**
|
||||
* Heals an entity.
|
||||
*/
|
||||
public static final PotionEffectType INSTANT_HEALTH = getPotionEffectType("instant_health", 6);
|
||||
public static final PotionEffectType INSTANT_HEALTH = getPotionEffectType(6, "instant_health");
|
||||
|
||||
/**
|
||||
* Hurts an entity.
|
||||
*/
|
||||
public static final PotionEffectType INSTANT_DAMAGE = getPotionEffectType("instant_damage", 7);
|
||||
public static final PotionEffectType INSTANT_DAMAGE = getPotionEffectType(7, "instant_damage");
|
||||
|
||||
/**
|
||||
* Increases jump height.
|
||||
*/
|
||||
public static final PotionEffectType JUMP_BOOST = getPotionEffectType("jump_boost", 8);
|
||||
public static final PotionEffectType JUMP_BOOST = getPotionEffectType(8, "jump_boost");
|
||||
|
||||
/**
|
||||
* Warps vision on the client.
|
||||
*/
|
||||
public static final PotionEffectType NAUSEA = getPotionEffectType("nausea", 9);
|
||||
public static final PotionEffectType NAUSEA = getPotionEffectType(9, "nausea");
|
||||
|
||||
/**
|
||||
* Regenerates health.
|
||||
*/
|
||||
public static final PotionEffectType REGENERATION = getPotionEffectType("regeneration", 10);
|
||||
public static final PotionEffectType REGENERATION = getPotionEffectType(10, "regeneration");
|
||||
|
||||
/**
|
||||
* Decreases damage dealt to an entity.
|
||||
*/
|
||||
public static final PotionEffectType RESISTANCE = getPotionEffectType("resistance", 11);
|
||||
public static final PotionEffectType RESISTANCE = getPotionEffectType(11, "resistance");
|
||||
|
||||
/**
|
||||
* Stops fire damage.
|
||||
*/
|
||||
public static final PotionEffectType FIRE_RESISTANCE = getPotionEffectType("fire_resistance", 12);
|
||||
public static final PotionEffectType FIRE_RESISTANCE = getPotionEffectType(12, "fire_resistance");
|
||||
|
||||
/**
|
||||
* Allows breathing underwater.
|
||||
*/
|
||||
public static final PotionEffectType WATER_BREATHING = getPotionEffectType("water_breathing", 13);
|
||||
public static final PotionEffectType WATER_BREATHING = getPotionEffectType(13, "water_breathing");
|
||||
|
||||
/**
|
||||
* Grants invisibility.
|
||||
*/
|
||||
public static final PotionEffectType INVISIBILITY = getPotionEffectType("invisibility", 14);
|
||||
public static final PotionEffectType INVISIBILITY = getPotionEffectType(14, "invisibility");
|
||||
|
||||
/**
|
||||
* Blinds an entity.
|
||||
*/
|
||||
public static final PotionEffectType BLINDNESS = getPotionEffectType("blindness", 15);
|
||||
public static final PotionEffectType BLINDNESS = getPotionEffectType(15, "blindness");
|
||||
|
||||
/**
|
||||
* Allows an entity to see in the dark.
|
||||
*/
|
||||
public static final PotionEffectType NIGHT_VISION = getPotionEffectType("night_vision", 16);
|
||||
public static final PotionEffectType NIGHT_VISION = getPotionEffectType(16, "night_vision");
|
||||
|
||||
/**
|
||||
* Increases hunger.
|
||||
*/
|
||||
public static final PotionEffectType HUNGER = getPotionEffectType("hunger", 17);
|
||||
public static final PotionEffectType HUNGER = getPotionEffectType(17, "hunger");
|
||||
|
||||
/**
|
||||
* Decreases damage dealt by an entity.
|
||||
*/
|
||||
public static final PotionEffectType WEAKNESS = getPotionEffectType("weakness", 18);
|
||||
public static final PotionEffectType WEAKNESS = getPotionEffectType(18, "weakness");
|
||||
|
||||
/**
|
||||
* Deals damage to an entity over time.
|
||||
*/
|
||||
public static final PotionEffectType POISON = getPotionEffectType("poison", 19);
|
||||
public static final PotionEffectType POISON = getPotionEffectType(19, "poison");
|
||||
|
||||
/**
|
||||
* Deals damage to an entity over time and gives the health to the
|
||||
* shooter.
|
||||
*/
|
||||
public static final PotionEffectType WITHER = getPotionEffectType("wither", 20);
|
||||
public static final PotionEffectType WITHER = getPotionEffectType(20, "wither");
|
||||
|
||||
/**
|
||||
* Increases the maximum health of an entity.
|
||||
*/
|
||||
public static final PotionEffectType HEALTH_BOOST = getPotionEffectType("health_boost", 21);
|
||||
public static final PotionEffectType HEALTH_BOOST = getPotionEffectType(21, "health_boost");
|
||||
|
||||
/**
|
||||
* Increases the maximum health of an entity with health that cannot be
|
||||
* regenerated, but is refilled every 30 seconds.
|
||||
*/
|
||||
public static final PotionEffectType ABSORPTION = getPotionEffectType("absorption", 22);
|
||||
public static final PotionEffectType ABSORPTION = getPotionEffectType(22, "absorption");
|
||||
|
||||
/**
|
||||
* Increases the food level of an entity each tick.
|
||||
*/
|
||||
public static final PotionEffectType SATURATION = getPotionEffectType("saturation", 23);
|
||||
public static final PotionEffectType SATURATION = getPotionEffectType(23, "saturation");
|
||||
|
||||
/**
|
||||
* Outlines the entity so that it can be seen from afar.
|
||||
*/
|
||||
public static final PotionEffectType GLOWING = getPotionEffectType("glowing", 24);
|
||||
public static final PotionEffectType GLOWING = getPotionEffectType(24, "glowing");
|
||||
|
||||
/**
|
||||
* Causes the entity to float into the air.
|
||||
*/
|
||||
public static final PotionEffectType LEVITATION = getPotionEffectType("levitation", 25);
|
||||
public static final PotionEffectType LEVITATION = getPotionEffectType(25, "levitation");
|
||||
|
||||
/**
|
||||
* Loot table luck.
|
||||
*/
|
||||
public static final PotionEffectType LUCK = getPotionEffectType("luck", 26);
|
||||
public static final PotionEffectType LUCK = getPotionEffectType(26, "luck");
|
||||
|
||||
/**
|
||||
* Loot table unluck.
|
||||
*/
|
||||
public static final PotionEffectType UNLUCK = getPotionEffectType("unluck", 27);
|
||||
public static final PotionEffectType UNLUCK = getPotionEffectType(27, "unluck");
|
||||
|
||||
/**
|
||||
* Slows entity fall rate.
|
||||
*/
|
||||
public static final PotionEffectType SLOW_FALLING = getPotionEffectType("slow_falling", 28);
|
||||
public static final PotionEffectType SLOW_FALLING = getPotionEffectType(28, "slow_falling");
|
||||
|
||||
/**
|
||||
* Effects granted by a nearby conduit. Includes enhanced underwater abilities.
|
||||
*/
|
||||
public static final PotionEffectType CONDUIT_POWER = getPotionEffectType("conduit_power", 29);
|
||||
public static final PotionEffectType CONDUIT_POWER = getPotionEffectType(29, "conduit_power");
|
||||
|
||||
/**
|
||||
* Squee'ek uh'k kk'kkkk squeek eee'eek.
|
||||
*/
|
||||
public static final PotionEffectType DOLPHINS_GRACE = getPotionEffectType("dolphins_grace", 30);
|
||||
public static final PotionEffectType DOLPHINS_GRACE = getPotionEffectType(30, "dolphins_grace");
|
||||
|
||||
/**
|
||||
* oof.
|
||||
*/
|
||||
public static final PotionEffectType BAD_OMEN = getPotionEffectType("bad_omen", 31);
|
||||
public static final PotionEffectType BAD_OMEN = getPotionEffectType(31, "bad_omen");
|
||||
|
||||
/**
|
||||
* \o/.
|
||||
*/
|
||||
public static final PotionEffectType HERO_OF_THE_VILLAGE = getPotionEffectType("hero_of_the_village", 32);
|
||||
public static final PotionEffectType HERO_OF_THE_VILLAGE = getPotionEffectType(32, "hero_of_the_village");
|
||||
|
||||
private static PotionEffectType getPotionEffectType(@NotNull String key, int typeId) {
|
||||
private static PotionEffectType getPotionEffectType(int typeId, @NotNull String key) {
|
||||
NamespacedKey namespacedKey = NamespacedKey.minecraft(key);
|
||||
PotionEffectType potionEffectType = Registry.POTION_EFFECT_TYPE.get(namespacedKey);
|
||||
Preconditions.checkNotNull(potionEffectType, "No PotionEffectType found for %s. This is a bug.", namespacedKey);
|
||||
|
@ -247,6 +248,18 @@ public abstract class PotionEffectType implements Keyed {
|
|||
@Deprecated
|
||||
public abstract String getName();
|
||||
|
||||
/**
|
||||
* Gets the PotionEffectType at the specified key
|
||||
*
|
||||
* @param key key to fetch
|
||||
* @return Resulting PotionEffectType, or null if not found
|
||||
*/
|
||||
@Contract("null -> null")
|
||||
@Nullable
|
||||
public static PotionEffectType getByKey(@Nullable NamespacedKey key) {
|
||||
return Registry.POTION_EFFECT_TYPE.get(key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the effect type specified by the unique id.
|
||||
*
|
||||
|
|
|
@ -130,7 +130,7 @@ public interface Objective {
|
|||
* @return Score tracking the Objective and entry specified
|
||||
* @throws IllegalArgumentException if entry is null
|
||||
* @throws IllegalStateException if this objective has been unregistered
|
||||
* @throws IllegalArgumentException if entry is longer than 40 characters.
|
||||
* @throws IllegalArgumentException if entry is longer than 32767 characters.
|
||||
*/
|
||||
@NotNull
|
||||
Score getScore(@NotNull String entry) throws IllegalArgumentException, IllegalStateException;
|
||||
|
|
|
@ -17,7 +17,7 @@ public interface Scoreboard {
|
|||
* @param criteria Criteria for the Objective
|
||||
* @return The registered Objective
|
||||
* @throws IllegalArgumentException if name is null
|
||||
* @throws IllegalArgumentException if name is longer than 16
|
||||
* @throws IllegalArgumentException if name is longer than 32767
|
||||
* characters.
|
||||
* @throws IllegalArgumentException if criteria is null
|
||||
* @throws IllegalArgumentException if an objective by that name already
|
||||
|
@ -36,7 +36,7 @@ public interface Scoreboard {
|
|||
* @param displayName Name displayed to players for the Objective.
|
||||
* @return The registered Objective
|
||||
* @throws IllegalArgumentException if name is null
|
||||
* @throws IllegalArgumentException if name is longer than 16
|
||||
* @throws IllegalArgumentException if name is longer than 32767
|
||||
* characters.
|
||||
* @throws IllegalArgumentException if criteria is null
|
||||
* @throws IllegalArgumentException if displayName is null
|
||||
|
@ -57,7 +57,7 @@ public interface Scoreboard {
|
|||
* @param renderType Manner of rendering the Objective
|
||||
* @return The registered Objective
|
||||
* @throws IllegalArgumentException if name is null
|
||||
* @throws IllegalArgumentException if name is longer than 16
|
||||
* @throws IllegalArgumentException if name is longer than 32767
|
||||
* characters.
|
||||
* @throws IllegalArgumentException if criteria is null
|
||||
* @throws IllegalArgumentException if displayName is null
|
||||
|
|
Loading…
Add table
Reference in a new issue