Вопрос Не работают HitSounds и ClientSounds expensive 2.0

Забаненный
Статус
Оффлайн
Регистрация
24 Ноя 2023
Сообщения
58
Реакции[?]
0
Поинты[?]
0
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.

Перед прочтением основного контента ниже, пожалуйста, обратите внимание на обновление внутри секции Майна на нашем форуме. У нас появились:

  • бесплатные читы для Майнкрафт — любое использование на свой страх и риск;
  • маркетплейс Майнкрафт — абсолютно любая коммерция, связанная с игрой, за исключением продажи читов (аккаунты, предоставления услуг, поиск кодеров читов и так далее);
  • приватные читы для Minecraft — в этом разделе только платные хаки для игры, покупайте группу "Продавец" и выставляйте на продажу свой софт;
  • обсуждения и гайды — всё тот же раздел с вопросами, но теперь модернизированный: поиск нужных хаков, пати с игроками-читерами и другая полезная информация.

Спасибо!

Не работают HitSounds и ClientSounds expensive 2.0. Решил попрактиковатся на экспе, вижу что хит и клиент саунды не работают, я что только не делал
и кстати еще не сохраняется список серверов, кто поможет спс

package wtf.expensive.modules.impl.util;
// это хитсаунды
import net.minecraft.client.Minecraft;
import net.minecraft.entity.Entity;
import net.minecraft.network.play.client.CUseEntityPacket;
import net.minecraft.network.play.server.SChangeGameStatePacket;
import net.minecraft.network.play.server.SEntityStatusPacket;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.vector.Vector3d;
import wtf.expensive.events.Event;
import wtf.expensive.events.impl.packet.EventPacket;
import wtf.expensive.events.impl.player.EventWorldChange;
import wtf.expensive.modules.Module;
import wtf.expensive.modules.ModuleSession;
import wtf.expensive.modules.Type;
import wtf.expensive.modules.settings.imp.BooleanOption;
import wtf.expensive.modules.settings.imp.ModeSetting;
import wtf.expensive.modules.settings.imp.MultiBoxSetting;
import wtf.expensive.modules.settings.imp.SliderSetting;
import javax.sound.sampled.AudioInputStream;
import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.Clip;
import javax.sound.sampled.FloatControl;
import java.util.HashMap;
import java.util.Map;
import static java.lang.Math.*;
import static java.lang.Math.signum;
import static net.minecraft.network.play.client.CUseEntityPacket.Action.ATTACK;
import static net.minecraft.network.play.server.SChangeGameStatePacket.field_241770_g_;
import static net.minecraft.util.math.MathHelper.wrapDegrees;
@ModuleSession(name = "HitSound", type = Type.Other)
public class HitSound extends Module {
private final ModeSetting sound = new ModeSetting("Звук",
"bubble",
"bell", "metallic", "rust", "bubble", "bonk"
);
private final MultiBoxSetting triggers = new MultiBoxSetting("Тригеры",
new BooleanOption("Удар", true),
new BooleanOption("Выстрел", true)
);
SliderSetting volume = new SliderSetting("Громкость", 35, 1, 100, 5);
Map<Entity, Long> targets = new HashMap<>();
public HitSound() {
addSettings(sound, triggers, volume);
}
@Override
public void EventUpdated(Event event) {
if (mc.player == null || mc.world == null) return;
if (event instanceof EventWorldChange) {
targets.clear();
}
if (event instanceof EventPacket e) {
if (triggers.get(1) && e.getPacket() instanceof SChangeGameStatePacket p) {
if (p.func_241776_b_() == field_241770_g_) {
playSound(null);
}
}
if (!triggers.get(0)) return;
if (e.getPacket() instanceof CUseEntityPacket p && p.getAction() == ATTACK) {
targets.put(p.getEntityFromWorld(mc.world), System.currentTimeMillis());
}
if (targets.isEmpty()) return;
if (e.getPacket() instanceof SEntityStatusPacket p) {
targets.forEach((entity, time) -> {
if (entity != null && entity.getEntityId() == p.entityId) {
if (time + 500 >= System.currentTimeMillis()) {
playSound(entity);
}
}
});
}
}
}
public void playSound(Entity e) {
try {
Clip clip = AudioSystem.getClip();
AudioInputStream audioInputStream = AudioSystem
.getAudioInputStream(mc.getResourceManager().getResource(new ResourceLocation("/assets/minecraft/expenis/sounds/" + sound.get() + ".wav")).getInputStream());
if (audioInputStream == null) {
System.out.println("Sound not found!");
return;
}
clip.open(audioInputStream);
clip.start();
FloatControl floatControl = (FloatControl) clip.getControl(FloatControl.Type.MASTER_GAIN);
if (e != null) {
FloatControl balance = (FloatControl) clip.getControl(FloatControl.Type.BALANCE);
Vector3d vec = e.getPositionVec().subtract(Minecraft.getInstance().player.getPositionVec());
double yaw = wrapDegrees(toDegrees(atan2(vec.z, vec.x)) - 90);
double delta = wrapDegrees(yaw - mc.player.rotationYaw);
if (abs(delta) > 180) delta -= signum(delta) * 360;
try {
balance.setValue((float) delta / 180);
} catch (Exception ex) {
ex.printStackTrace();
}
}
floatControl.setValue(-(mc.player.getDistance(e) * 5) - (volume.getMax() / volume.getValue().floatValue()));
} catch (Exception exception) {
//exception.printStackTrace();
}
}
@Override
protected void onEnable() {
super.onEnable();
targets.clear();
}
@Override
protected void onDisable() {
super.onDisable();
targets.clear();
}
}
package wtf.expensive.util;
// это саунд утилки, там же и клиент саундс
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.SoundEvents;
import wtf.expensive.modules.impl.util.ClientSounds;

import javax.sound.sampled.AudioInputStream;
import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.Clip;
import javax.sound.sampled.FloatControl;
import java.io.BufferedInputStream;
import java.io.InputStream;
import java.util.concurrent.CompletableFuture;

public class SoundUtil implements IMinecraft {
public SoundUtil() {
}

public static void playSound(float pitch, float volume) {
if (mc.player != null) {
if (ClientSounds.settings.is("1 Звук")) {
mc.player.playSound(SoundEvents.BLOCK_NOTE_BLOCK_PLING, volume, pitch);
}

if (ClientSounds.settings.is("Тестовый")) {
try {
Clip clip = AudioSystem.getClip();
AudioInputStream audioInputStream = AudioSystem.getAudioInputStream(mc.getResourceManager().getResource(new ResourceLocation("/assets/minecraft/kwnc/sounds/Speech_On.wav")).getInputStream());
if (audioInputStream == null) {
System.out.println("Sound not found!");
return;
}

clip.open(audioInputStream);
clip.start();
FloatControl floatControl = (FloatControl)clip.getControl(FloatControl.Type.MASTER_GAIN);
floatControl.setValue(ClientSounds.volume.getValue().floatValue() * 10.0F);
} catch (Exception var5) {
}
}
if (ClientSounds.settings.is("3 Звук")) {
try {
Clip clip = AudioSystem.getClip();
AudioInputStream audioInputStream = AudioSystem.getAudioInputStream(mc.getResourceManager().getResource(new ResourceLocation("/assets/minecraft/kwnc/sounds/on.wav")).getInputStream());
if (audioInputStream == null) {
System.out.println("Sound not found!");
return;
}

clip.open(audioInputStream);
clip.start();
FloatControl floatControl = (FloatControl)clip.getControl(FloatControl.Type.MASTER_GAIN);
floatControl.setValue(ClientSounds.volume.getValue().floatValue() * 10.0F);
} catch (Exception var5) {
}
}
}
}

public static void playSound1(float pitch, float volume) {
if (mc.player != null) {
if (ClientSounds.settings.is("1 Звук")) {
mc.player.playSound(SoundEvents.BLOCK_NOTE_BLOCK_PLING, volume, pitch);
}

if (ClientSounds.settings.is("Тестовый")) {
try {
Clip clip = AudioSystem.getClip();
AudioInputStream audioInputStream = AudioSystem.getAudioInputStream(mc.getResourceManager().getResource(new ResourceLocation("/assets/minecraft/kwnc/sounds/Speech_Sleep.wav")).getInputStream());
if (audioInputStream == null) {
System.out.println("Sound not found!");
return;
}

clip.open(audioInputStream);
clip.start();
FloatControl floatControl = (FloatControl)clip.getControl(FloatControl.Type.MASTER_GAIN);
floatControl.setValue(ClientSounds.volume.getValue().floatValue() * 10.0F);
} catch (Exception var5) {
}
}
if (ClientSounds.settings.is("3 Звук")) {
try {
Clip clip = AudioSystem.getClip();
AudioInputStream audioInputStream = AudioSystem.getAudioInputStream(mc.getResourceManager().getResource(new ResourceLocation("/assets/minecraft/kwnc/sounds/off.wav")).getInputStream());
if (audioInputStream == null) {
System.out.println("Sound not found!");
return;
}

clip.open(audioInputStream);
clip.start();
FloatControl floatControl = (FloatControl)clip.getControl(FloatControl.Type.MASTER_GAIN);
floatControl.setValue(ClientSounds.volume.getValue().floatValue() * 10.0F);
} catch (Exception var5) {
}
}
}
}
public static void playSound3(float pitch, float volume) {
if (mc.player != null) {
try {
Clip clip = AudioSystem.getClip();
AudioInputStream audioInputStream = AudioSystem.getAudioInputStream(mc.getResourceManager().getResource(new ResourceLocation("/assets/minecraft/kwnc/sounds/start.wav")).getInputStream());
if (audioInputStream == null) {
System.out.println("Sound not found!");
return;
}

clip.open(audioInputStream);
clip.start();
FloatControl floatControl = (FloatControl)clip.getControl(FloatControl.Type.MASTER_GAIN);
floatControl.setValue(ClientSounds.volume.getValue().floatValue() * 10.0F);
} catch (Exception var5) {
}
}

}

public static void playSound(String s, int i, boolean b) {
}
}

я не умею делать текст в код
 
expenis 3.1 paster
Пользователь
Статус
Оффлайн
Регистрация
20 Апр 2021
Сообщения
1,453
Реакции[?]
33
Поинты[?]
45K
Не работают HitSounds и ClientSounds expensive 2.0. Решил попрактиковатся на экспе, вижу что хит и клиент саунды не работают, я что только не делал
и кстати еще не сохраняется список серверов, кто поможет спс

package wtf.expensive.modules.impl.util;
// это хитсаунды
import net.minecraft.client.Minecraft;
import net.minecraft.entity.Entity;
import net.minecraft.network.play.client.CUseEntityPacket;
import net.minecraft.network.play.server.SChangeGameStatePacket;
import net.minecraft.network.play.server.SEntityStatusPacket;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.vector.Vector3d;
import wtf.expensive.events.Event;
import wtf.expensive.events.impl.packet.EventPacket;
import wtf.expensive.events.impl.player.EventWorldChange;
import wtf.expensive.modules.Module;
import wtf.expensive.modules.ModuleSession;
import wtf.expensive.modules.Type;
import wtf.expensive.modules.settings.imp.BooleanOption;
import wtf.expensive.modules.settings.imp.ModeSetting;
import wtf.expensive.modules.settings.imp.MultiBoxSetting;
import wtf.expensive.modules.settings.imp.SliderSetting;
import javax.sound.sampled.AudioInputStream;
import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.Clip;
import javax.sound.sampled.FloatControl;
import java.util.HashMap;
import java.util.Map;
import static java.lang.Math.*;
import static java.lang.Math.signum;
import static net.minecraft.network.play.client.CUseEntityPacket.Action.ATTACK;
import static net.minecraft.network.play.server.SChangeGameStatePacket.field_241770_g_;
import static net.minecraft.util.math.MathHelper.wrapDegrees;
@ModuleSession(name = "HitSound", type = Type.Other)
public class HitSound extends Module {
private final ModeSetting sound = new ModeSetting("Звук",
"bubble",
"bell", "metallic", "rust", "bubble", "bonk"
);
private final MultiBoxSetting triggers = new MultiBoxSetting("Тригеры",
new BooleanOption("Удар", true),
new BooleanOption("Выстрел", true)
);
SliderSetting volume = new SliderSetting("Громкость", 35, 1, 100, 5);
Map<Entity, Long> targets = new HashMap<>();
public HitSound() {
addSettings(sound, triggers, volume);
}
@Override
public void EventUpdated(Event event) {
if (mc.player == null || mc.world == null) return;
if (event instanceof EventWorldChange) {
targets.clear();
}
if (event instanceof EventPacket e) {
if (triggers.get(1) && e.getPacket() instanceof SChangeGameStatePacket p) {
if (p.func_241776_b_() == field_241770_g_) {
playSound(null);
}
}
if (!triggers.get(0)) return;
if (e.getPacket() instanceof CUseEntityPacket p && p.getAction() == ATTACK) {
targets.put(p.getEntityFromWorld(mc.world), System.currentTimeMillis());
}
if (targets.isEmpty()) return;
if (e.getPacket() instanceof SEntityStatusPacket p) {
targets.forEach((entity, time) -> {
if (entity != null && entity.getEntityId() == p.entityId) {
if (time + 500 >= System.currentTimeMillis()) {
playSound(entity);
}
}
});
}
}
}
public void playSound(Entity e) {
try {
Clip clip = AudioSystem.getClip();
AudioInputStream audioInputStream = AudioSystem
.getAudioInputStream(mc.getResourceManager().getResource(new ResourceLocation("/assets/minecraft/expenis/sounds/" + sound.get() + ".wav")).getInputStream());
if (audioInputStream == null) {
System.out.println("Sound not found!");
return;
}
clip.open(audioInputStream);
clip.start();
FloatControl floatControl = (FloatControl) clip.getControl(FloatControl.Type.MASTER_GAIN);
if (e != null) {
FloatControl balance = (FloatControl) clip.getControl(FloatControl.Type.BALANCE);
Vector3d vec = e.getPositionVec().subtract(Minecraft.getInstance().player.getPositionVec());
double yaw = wrapDegrees(toDegrees(atan2(vec.z, vec.x)) - 90);
double delta = wrapDegrees(yaw - mc.player.rotationYaw);
if (abs(delta) > 180) delta -= signum(delta) * 360;
try {
balance.setValue((float) delta / 180);
} catch (Exception ex) {
ex.printStackTrace();
}
}
floatControl.setValue(-(mc.player.getDistance(e) * 5) - (volume.getMax() / volume.getValue().floatValue()));
} catch (Exception exception) {
//exception.printStackTrace();
}
}
@Override
protected void onEnable() {
super.onEnable();
targets.clear();
}
@Override
protected void onDisable() {
super.onDisable();
targets.clear();
}
}
package wtf.expensive.util;
// это саунд утилки, там же и клиент саундс
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.SoundEvents;
import wtf.expensive.modules.impl.util.ClientSounds;

import javax.sound.sampled.AudioInputStream;
import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.Clip;
import javax.sound.sampled.FloatControl;
import java.io.BufferedInputStream;
import java.io.InputStream;
import java.util.concurrent.CompletableFuture;

public class SoundUtil implements IMinecraft {
public SoundUtil() {
}

public static void playSound(float pitch, float volume) {
if (mc.player != null) {
if (ClientSounds.settings.is("1 Звук")) {
mc.player.playSound(SoundEvents.BLOCK_NOTE_BLOCK_PLING, volume, pitch);
}

if (ClientSounds.settings.is("Тестовый")) {
try {
Clip clip = AudioSystem.getClip();
AudioInputStream audioInputStream = AudioSystem.getAudioInputStream(mc.getResourceManager().getResource(new ResourceLocation("/assets/minecraft/kwnc/sounds/Speech_On.wav")).getInputStream());
if (audioInputStream == null) {
System.out.println("Sound not found!");
return;
}

clip.open(audioInputStream);
clip.start();
FloatControl floatControl = (FloatControl)clip.getControl(FloatControl.Type.MASTER_GAIN);
floatControl.setValue(ClientSounds.volume.getValue().floatValue() * 10.0F);
} catch (Exception var5) {
}
}
if (ClientSounds.settings.is("3 Звук")) {
try {
Clip clip = AudioSystem.getClip();
AudioInputStream audioInputStream = AudioSystem.getAudioInputStream(mc.getResourceManager().getResource(new ResourceLocation("/assets/minecraft/kwnc/sounds/on.wav")).getInputStream());
if (audioInputStream == null) {
System.out.println("Sound not found!");
return;
}

clip.open(audioInputStream);
clip.start();
FloatControl floatControl = (FloatControl)clip.getControl(FloatControl.Type.MASTER_GAIN);
floatControl.setValue(ClientSounds.volume.getValue().floatValue() * 10.0F);
} catch (Exception var5) {
}
}
}
}

public static void playSound1(float pitch, float volume) {
if (mc.player != null) {
if (ClientSounds.settings.is("1 Звук")) {
mc.player.playSound(SoundEvents.BLOCK_NOTE_BLOCK_PLING, volume, pitch);
}

if (ClientSounds.settings.is("Тестовый")) {
try {
Clip clip = AudioSystem.getClip();
AudioInputStream audioInputStream = AudioSystem.getAudioInputStream(mc.getResourceManager().getResource(new ResourceLocation("/assets/minecraft/kwnc/sounds/Speech_Sleep.wav")).getInputStream());
if (audioInputStream == null) {
System.out.println("Sound not found!");
return;
}

clip.open(audioInputStream);
clip.start();
FloatControl floatControl = (FloatControl)clip.getControl(FloatControl.Type.MASTER_GAIN);
floatControl.setValue(ClientSounds.volume.getValue().floatValue() * 10.0F);
} catch (Exception var5) {
}
}
if (ClientSounds.settings.is("3 Звук")) {
try {
Clip clip = AudioSystem.getClip();
AudioInputStream audioInputStream = AudioSystem.getAudioInputStream(mc.getResourceManager().getResource(new ResourceLocation("/assets/minecraft/kwnc/sounds/off.wav")).getInputStream());
if (audioInputStream == null) {
System.out.println("Sound not found!");
return;
}

clip.open(audioInputStream);
clip.start();
FloatControl floatControl = (FloatControl)clip.getControl(FloatControl.Type.MASTER_GAIN);
floatControl.setValue(ClientSounds.volume.getValue().floatValue() * 10.0F);
} catch (Exception var5) {
}
}
}
}
public static void playSound3(float pitch, float volume) {
if (mc.player != null) {
try {
Clip clip = AudioSystem.getClip();
AudioInputStream audioInputStream = AudioSystem.getAudioInputStream(mc.getResourceManager().getResource(new ResourceLocation("/assets/minecraft/kwnc/sounds/start.wav")).getInputStream());
if (audioInputStream == null) {
System.out.println("Sound not found!");
return;
}

clip.open(audioInputStream);
clip.start();
FloatControl floatControl = (FloatControl)clip.getControl(FloatControl.Type.MASTER_GAIN);
floatControl.setValue(ClientSounds.volume.getValue().floatValue() * 10.0F);
} catch (Exception var5) {
}
}

}

public static void playSound(String s, int i, boolean b) {
}
}
я не умею делать текст в код
ебать как ты это вставил
 
Забаненный
Статус
Оффлайн
Регистрация
24 Ноя 2023
Сообщения
58
Реакции[?]
0
Поинты[?]
0
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Забаненный
Статус
Оффлайн
Регистрация
24 Ноя 2023
Сообщения
58
Реакции[?]
0
Поинты[?]
0
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
ап
 
Сверху Снизу