Introduce registry entry and builders
Co-authored-by: kokiriglade <git@kokirigla.de>
This commit is contained in:
@@ -141,4 +141,22 @@ public abstract class GameEvent implements Keyed {
|
||||
private static GameEvent getEvent(@NotNull String key) {
|
||||
return Registry.GAME_EVENT.getOrThrow(NamespacedKey.minecraft(key));
|
||||
}
|
||||
// Paper start
|
||||
/**
|
||||
* Gets the range of the event which is used to
|
||||
* notify listeners of the event.
|
||||
*
|
||||
* @return the range
|
||||
*/
|
||||
public abstract int getRange();
|
||||
|
||||
/**
|
||||
* Gets the vibration level of the game event for vibration listeners.
|
||||
* Not all events have vibration levels, and a level of 0 means
|
||||
* it won't cause any vibrations.
|
||||
*
|
||||
* @return the vibration level
|
||||
*/
|
||||
public abstract int getVibrationLevel();
|
||||
// Paper end
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
* official replacement for the aforementioned enum. Entirely incompatible
|
||||
* changes may occur. Do not use this API in plugins.
|
||||
*/
|
||||
@ApiStatus.Internal
|
||||
@ApiStatus.Experimental // Paper - already required for registry builders
|
||||
public interface ItemType extends Keyed, Translatable, net.kyori.adventure.translation.Translatable { // Paper - add Translatable
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user