Skip to content

Commit

Permalink
Enabled the other event because its way better looking
Browse files Browse the repository at this point in the history
Signed-off-by: Emily Engel <Justsweetluna@gmail.com>
  • Loading branch information
HerXayah committed May 1, 2022
1 parent 2401c65 commit 67a6bab
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 13 deletions.
18 changes: 12 additions & 6 deletions src/main/java/meow/emily/patootie/Emily.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
import net.labymod.utils.ModColor;
import net.minecraft.client.network.NetworkPlayerInfo;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.TickEvent;

import java.util.*;
import java.util.logging.Logger;
Expand Down Expand Up @@ -65,7 +63,7 @@ public void onEnable() {
System.out.println("Starting...");
}

@SubscribeEvent
/* @SubscribeEvent
public void onTick(TickEvent.ClientTickEvent event) {
if (!voiceexist) {
for (LabyModAddon addon : AddonLoader.getAddons()) {
Expand All @@ -75,15 +73,15 @@ public void onTick(TickEvent.ClientTickEvent event) {
LabyModAddon voicechat = AddonLoader.getAddonByUUID(UUID.fromString(String.valueOf(vcUuid8)));
if (voicechat instanceof VoiceChat && addon.about.name.equals("VoiceChat")) {
voiceChat = (VoiceChat) addon;
LabyMod.getInstance().displayMessageInChat("VoiceChat addon found!");
System.out.println(PREFIX + "VoiceChat found!");
voiceexist = true;
} else {
LabyMod.getInstance().displayMessageInChat("VoiceChat addon not found!");
System.out.println(PREFIX + "VoiceChat not found!");
voiceexist = false;
}
}
}
}
} */

private UserActionEntry createBlacklistEntry() {
return new UserActionEntry(
Expand All @@ -96,6 +94,14 @@ public void execute(User user, EntityPlayer entityPlayer, NetworkPlayerInfo netw
// getConfig().addProperty("playersToRenderString", networkPlayerInfo.getGameProfile().getName());
//labyMod().displayMessageInChat("Name: " + getConfig().get("playersToRenderString"));
try {
RemovePlayer(networkPlayerInfo.getGameProfile().getName());
UUID uuid = networkPlayerInfo.getGameProfile().getId();
if (isVoiceexist()) {
VoiceChat voiceChat = (VoiceChat) AddonLoader.getAddonByUUID(UUID.fromString(String.valueOf(vcUuid8)));
Map<UUID, Integer> volume = voiceChat.getPlayerVolumes();
volume.put(uuid, 0);
voiceChat.savePlayersVolumes();
}
playersToRender.put(networkPlayerInfo.getGameProfile().getId(), 0);
savePlayersToRender();
playersToRenderString.add(networkPlayerInfo.getGameProfile().getName());
Expand Down
14 changes: 7 additions & 7 deletions src/main/java/meow/emily/patootie/events/PlayerEventHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@
import meow.emily.patootie.util.Utils;
import net.labymod.addon.AddonLoader;
import net.labymod.addons.voicechat.VoiceChat;
import net.labymod.api.LabyModAddon;
import net.labymod.main.LabyMod;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraftforge.client.event.RenderPlayerEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.InputEvent;
import net.minecraftforge.fml.common.gameevent.TickEvent;
import org.lwjgl.input.Keyboard;

import java.util.List;
Expand All @@ -24,9 +26,7 @@ public class PlayerEventHandler {
// UUID VoiceChat 1.8
private final UUID vcUuid8 = UUID.fromString("43152d5b-ca80-4b29-8f48-39fd63e48dee");

/*

Useful Debug Event btw

@SubscribeEvent
public void onTick(TickEvent.ClientTickEvent event) {
Expand All @@ -35,14 +35,14 @@ public void onTick(TickEvent.ClientTickEvent event) {
LabyModAddon addon = AddonLoader.getAddonByUUID(UUID.fromString(String.valueOf(vcUuid8)));
if (addon instanceof VoiceChat && addon.about.name.equals("VoiceChat")) {
VoiceChat voiceChat = (VoiceChat) addon;
LabyMod.getInstance().displayMessageInChat("VoiceChat addon found!");
// instance.setVoiceexist(true);
//LabyMod.getInstance().displayMessageInChat("VoiceChat addon found!");
instance.setVoiceexist(true);
} else {
LabyMod.getInstance().displayMessageInChat("VoiceChat addon not found!");
// instance.setVoiceexist(false);
//LabyMod.getInstance().displayMessageInChat("VoiceChat addon not found!");
instance.setVoiceexist(false);
}
}
} */
}

@SubscribeEvent
public void onPrePlayerRender(RenderPlayerEvent.Pre e) {
Expand Down

0 comments on commit 67a6bab

Please sign in to comment.