mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-03 15:08:29 +01:00
make Sound enum implement Adventure's Sound.Type
This commit is contained in:
parent
0082f5776b
commit
8ee624f02d
@ -11,7 +11,7 @@ import net.minestom.server.utils.NamespaceID;
|
|||||||
* //==============================
|
* //==============================
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings({"deprecation"})
|
@SuppressWarnings({"deprecation"})
|
||||||
public enum Sound implements Keyed {
|
public enum Sound implements Keyed, net.kyori.adventure.sound.Sound.Type {
|
||||||
AMBIENT_CAVE("minecraft:ambient.cave"),
|
AMBIENT_CAVE("minecraft:ambient.cave"),
|
||||||
|
|
||||||
AMBIENT_BASALT_DELTAS_ADDITIONS("minecraft:ambient.basalt_deltas.additions"),
|
AMBIENT_BASALT_DELTAS_ADDITIONS("minecraft:ambient.basalt_deltas.additions"),
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
package net.minestom.codegen.sounds;
|
package net.minestom.codegen.sounds;
|
||||||
|
|
||||||
|
import com.squareup.javapoet.ClassName;
|
||||||
|
import net.kyori.adventure.sound.Sound;
|
||||||
import net.minestom.codegen.BasicEnumGenerator;
|
import net.minestom.codegen.BasicEnumGenerator;
|
||||||
import net.minestom.codegen.stats.StatsEnumGenerator;
|
import net.minestom.codegen.EnumGenerator;
|
||||||
import net.minestom.server.registry.ResourceGatherer;
|
import net.minestom.server.registry.ResourceGatherer;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
@ -45,6 +47,14 @@ public class SoundEnumGenerator extends BasicEnumGenerator {
|
|||||||
super(targetFolder);
|
super(targetFolder);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void prepare(EnumGenerator generator) {
|
||||||
|
super.prepare(generator);
|
||||||
|
|
||||||
|
// implement type as well
|
||||||
|
generator.addSuperinterface(ClassName.get(Sound.Type.class));
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String getCategoryID() {
|
protected String getCategoryID() {
|
||||||
return "minecraft:sound_event";
|
return "minecraft:sound_event";
|
||||||
|
Loading…
Reference in New Issue
Block a user