Introduce registry entry and builders

Co-authored-by: kokiriglade <git@kokirigla.de>
This commit is contained in:
Bjarne Koll
2024-06-13 22:35:05 +02:00
parent 146cd1a015
commit fcc777a0a8
8 changed files with 551 additions and 3 deletions

View File

@@ -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
}

View File

@@ -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
/**