1234567891011121314151617181920212223242526272829 |
- package me.km;
- import me.km.api.GlobalText;
- import net.minecraft.util.text.TextComponentString;
- import net.minecraft.util.text.TextComponentTranslation;
- import net.minecraftforge.client.event.ClientChatReceivedEvent;
- import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
- import net.minecraftforge.fml.relauncher.Side;
- import net.minecraftforge.fml.relauncher.SideOnly;
- public class ClientEvents
- {
- @SideOnly(Side.CLIENT)
- @SubscribeEvent
- public void preventChatMessage(ClientChatReceivedEvent e)
- {
- if(e.getMessage() instanceof TextComponentTranslation)
- {
- TextComponentTranslation trans = (TextComponentTranslation) e.getMessage();
- switch(trans.getKey())
- {
- case "commands.generic.permission":
- {
- e.setMessage(new TextComponentString("[§5Perms§r] " + GlobalText.noPermission()));
- }
- }
- }
- }
- }
|