Add registry entry and builders
This commit is contained in:
@@ -18,10 +18,12 @@ public class CraftGameEvent extends GameEvent implements Handleable<net.minecraf
|
||||
}
|
||||
|
||||
private final NamespacedKey key;
|
||||
private final net.minecraft.resources.ResourceKey<net.minecraft.world.level.gameevent.GameEvent> handleKey; // Paper
|
||||
private final net.minecraft.world.level.gameevent.GameEvent handle;
|
||||
|
||||
public CraftGameEvent(NamespacedKey key, net.minecraft.world.level.gameevent.GameEvent handle) {
|
||||
this.key = key;
|
||||
this.handleKey = net.minecraft.resources.ResourceKey.create(net.minecraft.core.registries.Registries.GAME_EVENT, org.bukkit.craftbukkit.util.CraftNamespacedKey.toMinecraft(key)); // Paper
|
||||
this.handle = handle;
|
||||
}
|
||||
|
||||
@@ -30,6 +32,18 @@ public class CraftGameEvent extends GameEvent implements Handleable<net.minecraf
|
||||
return this.handle;
|
||||
}
|
||||
|
||||
// Paper start
|
||||
@Override
|
||||
public int getRange() {
|
||||
return this.handle.notificationRadius();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getVibrationLevel() {
|
||||
return net.minecraft.world.level.gameevent.vibrations.VibrationSystem.getGameEventFrequency(this.handleKey);
|
||||
}
|
||||
// Paper end
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public NamespacedKey getKey() {
|
||||
|
||||
Reference in New Issue
Block a user