Remove check for sound presence from Scarpet's sound function (#1834)

This commit is contained in:
ch-yx authored and GitHub committed 2024-01-18 18:06:03 +01:00
1 parent 2fabf39f50
commit 4aec8114c9
3 files changed
+3 -8

No files matched your search

+2 -3
View File
@@ -12,9 +12,8 @@ Valid mixer options are `master`, `music`, `record`, `weather`, `block`, `hostil
and `voice`. `pos` can be either a block, triple of coords, or a list of three numbers. Uses the same options as a and `voice`. `pos` can be either a block, triple of coords, or a list of three numbers. Uses the same options as a
corresponding `playsound` command. corresponding `playsound` command.
Used with no arguments, return the list of available sound names. Used with no arguments, returns a list of available sound names. Note that this list may not include all sounds that
clients will actually be able to receive (they may have more available via resourcepacks for example).
Throws `unknown_sound` if sound doesn't exist.
## Particles ## Particles
@@ -138,10 +138,7 @@ public class Auxiliary
String rawString = lv.get(0).getString(); String rawString = lv.get(0).getString();
ResourceLocation soundName = InputValidator.identifierOf(rawString); ResourceLocation soundName = InputValidator.identifierOf(rawString);
Vector3Argument locator = Vector3Argument.findIn(lv, 1); Vector3Argument locator = Vector3Argument.findIn(lv, 1);
if (cc.registry(Registries.SOUND_EVENT).get(soundName) == null)
{
throw new ThrowStatement(rawString, Throwables.UNKNOWN_SOUND);
}
Holder<SoundEvent> soundHolder = Holder.direct(SoundEvent.createVariableRangeEvent(soundName)); Holder<SoundEvent> soundHolder = Holder.direct(SoundEvent.createVariableRangeEvent(soundName));
float volume = 1.0F; float volume = 1.0F;
float pitch = 1.0F; float pitch = 1.0F;
@@ -21,7 +21,6 @@ public class Throwables
public static final Throwables UNKNOWN_ITEM = register("unknown_item", VALUE_EXCEPTION); public static final Throwables UNKNOWN_ITEM = register("unknown_item", VALUE_EXCEPTION);
public static final Throwables UNKNOWN_BLOCK = register("unknown_block", VALUE_EXCEPTION); public static final Throwables UNKNOWN_BLOCK = register("unknown_block", VALUE_EXCEPTION);
public static final Throwables UNKNOWN_BIOME = register("unknown_biome", VALUE_EXCEPTION); public static final Throwables UNKNOWN_BIOME = register("unknown_biome", VALUE_EXCEPTION);
public static final Throwables UNKNOWN_SOUND = register("unknown_sound", VALUE_EXCEPTION);
public static final Throwables UNKNOWN_PARTICLE = register("unknown_particle", VALUE_EXCEPTION); public static final Throwables UNKNOWN_PARTICLE = register("unknown_particle", VALUE_EXCEPTION);
public static final Throwables UNKNOWN_POI = register("unknown_poi", VALUE_EXCEPTION); public static final Throwables UNKNOWN_POI = register("unknown_poi", VALUE_EXCEPTION);
public static final Throwables UNKNOWN_DIMENSION = register("unknown_dimension", VALUE_EXCEPTION); public static final Throwables UNKNOWN_DIMENSION = register("unknown_dimension", VALUE_EXCEPTION);