use of net.minecraft.sound.SoundEvent in project meteor-client by MeteorDevelopment.
the class SoundEventListSetting method save.
@Override
public NbtCompound save(NbtCompound tag) {
NbtList valueTag = new NbtList();
for (SoundEvent sound : get()) {
Identifier id = Registry.SOUND_EVENT.getId(sound);
if (id != null)
valueTag.add(NbtString.of(id.toString()));
}
tag.put("value", valueTag);
return tag;
}
use of net.minecraft.sound.SoundEvent in project KiwiClient by TangyKiwi.
the class KiwiClient method onInitialize.
@Override
public void onInitialize() {
mc = MinecraftClient.getInstance();
Utils.mc = mc;
CustomMatrix.begin(new MatrixStack());
moduleManager = new ModuleManager();
moduleManager.init();
commandManager = new CommandManager();
commandManager.init();
discordRPC = new DiscordRP();
discordRPC.start();
EChestMemory eChestMemory = new EChestMemory();
TickRate tickRate = new TickRate();
eventBus.register(eChestMemory);
eventBus.register(tickRate);
eventBus.register(moduleManager);
ClickGui.clickGui.initWindows();
FabricLoader.getInstance().getModContainer("kiwiclient").ifPresent(modContainer -> {
ResourceManagerHelper.registerBuiltinResourcePack(new Identifier("kiwiclient:kiwitweaks"), "resourcepacks/kiwitweaks", modContainer, true);
});
UseItemCallback.EVENT.register((player, world, hand) -> {
MinecraftClient mc = MinecraftClient.getInstance();
ClientPlayerInteractionManager interactionManager = mc.interactionManager;
if (mc.mouse.wasRightButtonClicked() && moduleManager.getModule(ArmorSwap.class).isEnabled()) {
ItemStack stack = player.getMainHandStack();
int currentItemIndex = player.getInventory().main.indexOf(stack);
EquipmentSlot equipmentSlot = MobEntity.getPreferredEquipmentSlot(stack);
int armorIndexSlot = determineIndex(equipmentSlot);
if (hand == Hand.MAIN_HAND && armorIndexSlot != -1) {
SoundEvent sound = determineSound(stack.getItem());
player.playSound(sound, 1.0F, 1.0F);
interactionManager.clickSlot(player.playerScreenHandler.syncId, armorIndexSlot, currentItemIndex, SlotActionType.SWAP, player);
return TypedActionResult.success(stack);
}
}
return TypedActionResult.pass(ItemStack.EMPTY);
});
KeyBindingHelper.registerKeyBinding(zoomKey);
}
use of net.minecraft.sound.SoundEvent in project pingspam by BasiqueEvangelist.
the class PingLogic method pingOnlinePlayer.
public static void pingOnlinePlayer(ServerPlayerEntity player, Text message, MessageType type, UUID senderUUID) {
SoundEvent pingSound = PlayerUtils.getPingSound(player);
if (pingSound != null) {
player.playSound(pingSound, SoundCategory.PLAYERS, 1.0F, 1.0F);
}
List<Text> unreadPings = PlayerUtils.getUnreadPingsFor(player);
while (unreadPings.size() >= 100) {
unreadPings.remove(0);
}
unreadPings.add(message);
Text pingMessage = message.shallowCopy().formatted(Formatting.AQUA);
player.networkHandler.sendPacket(new GameMessageS2CPacket(pingMessage, type, senderUUID));
}
use of net.minecraft.sound.SoundEvent in project friends-and-foes by Faboslav.
the class GlareEntity method playRustleSound.
public void playRustleSound() {
SoundEvent soundEvent = this.getRustleSound();
this.playSound(soundEvent, 0.15F, 0.1F);
}
use of net.minecraft.sound.SoundEvent in project friends-and-foes by Faboslav.
the class GlareEntity method playGrumpinessShortSound.
public void playGrumpinessShortSound() {
SoundEvent soundEvent = this.getGrumpinessShortSound();
this.playSound(soundEvent, 0.05F, RandomGenerator.generateFloat(1.2F, 1.3F));
}
Aggregations