use of net.minecraft.sound.SoundEvent in project meteor-client by MeteorDevelopment.
the class SoundEventListSetting method parseImpl.
@Override
protected List<SoundEvent> parseImpl(String str) {
String[] values = str.split(",");
List<SoundEvent> sounds = new ArrayList<>(values.length);
try {
for (String value : values) {
SoundEvent sound = parseId(Registry.SOUND_EVENT, value);
if (sound != null)
sounds.add(sound);
}
} catch (Exception ignored) {
}
return sounds;
}
use of net.minecraft.sound.SoundEvent in project MiniMap by pl3xgaming.
the class Sound method initialize.
public static void initialize() {
REGISTERED_SOUNDS.forEach(sound -> {
sound.soundEvent = new SoundEvent(sound.identifier);
MiniMap.LOG.info("Loaded sound " + sound.identifier);
});
}
use of net.minecraft.sound.SoundEvent in project MCDoom by AzureDoom.
the class ModSoundEvents method of.
static SoundEvent of(String id) {
SoundEvent sound = new SoundEvent(new Identifier(DoomMod.MODID, id));
Registry.register(Registry.SOUND_EVENT, new Identifier(DoomMod.MODID, id), sound);
return sound;
}
use of net.minecraft.sound.SoundEvent in project WK by witches-kitchen.
the class ParticlePacketHandler method handle.
@Environment(EnvType.CLIENT)
@Override
public void handle(MinecraftClient client, ClientPlayNetworkHandler handler, PacketByteBuf buf, PacketSender responseSender) {
final BlockPos pos = buf.readBlockPos();
final Identifier particleId = buf.readIdentifier();
final Identifier soundId = buf.readIdentifier();
final byte range = buf.readByte();
client.execute(() -> {
final ClientWorld world = client.world;
final ParticleType<?> particle = Registry.PARTICLE_TYPE.get(particleId);
if (world != null) {
for (int i = 0; i < range; i++) {
world.addParticle((ParticleEffect) particle, pos.getX() + 0.5D, pos.getY() + 1.0D, pos.getZ() + 0.5D, 0.5D, 0.5D, 0.5D);
}
if (!soundId.toString().isEmpty()) {
final SoundEvent soundEvent = Registry.SOUND_EVENT.get(soundId);
world.playSound(pos, soundEvent, SoundCategory.NEUTRAL, 1.0F, 1.0F, false);
}
}
});
}
use of net.minecraft.sound.SoundEvent in project DawnAPI by DawnTeamMC.
the class SoundCreator method register.
@Override
public void register(ModData modData) {
Identifier id = modData.id(this.name);
this.sound = Registry.register(Registry.SOUND_EVENT, id, new SoundEvent(id));
}
Aggregations