fix toggle send to all

This commit is contained in:
MachineMuse 2014-09-13 16:21:37 -06:00
parent 6d27408b50
commit e9696fb23f

View file

@ -11,6 +11,7 @@ import net.machinemuse.utils.render.MuseRenderer;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.EntityClientPlayerMP; import net.minecraft.client.entity.EntityClientPlayerMP;
import net.minecraft.client.settings.KeyBinding; import net.minecraft.client.settings.KeyBinding;
import net.minecraft.util.ChatComponentText;
import org.lwjgl.input.Keyboard; import org.lwjgl.input.Keyboard;
import java.util.ArrayList; import java.util.ArrayList;
@ -55,7 +56,7 @@ public class ClickableKeybinding extends ClickableButton {
for (ClickableModule module : boundModules) { for (ClickableModule module : boundModules) {
String valstring = toggleval ? " on" : " off"; String valstring = toggleval ? " on" : " off";
if (FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT) { if (FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT) {
player.sendChatMessage("Toggled " + module.getModule().getDataName() + valstring); player.addChatMessage(new ChatComponentText("Toggled " + module.getModule().getDataName() + valstring));
} }
MuseItemUtils.toggleModuleForPlayer(player, module.getModule().getDataName(), toggleval); MuseItemUtils.toggleModuleForPlayer(player, module.getModule().getDataName(), toggleval);
MusePacketToggleRequest toggleRequest = new MusePacketToggleRequest(player, module.getModule().getDataName(), toggleval); MusePacketToggleRequest toggleRequest = new MusePacketToggleRequest(player, module.getModule().getDataName(), toggleval);