Search in sources :

Example 11 with ChatComponentTranslation

use of net.minecraft.util.ChatComponentTranslation in project Tale-of-Kingdoms by Ivasik78.

the class EntityStockKeeper method interact.

@Override
public boolean interact(EntityPlayer player) {
    if (this.canInteractWith(player)) {
        if (!this.worldObj.isRemote) {
            this.heal(100.0F);
            player.addChatMessage(new ChatComponentTranslation("npc.stockKeeper.dialog"));
        }
        player.openGui(TaleOfKingdoms.instance, GUI_STOCK, worldObj, 0, 0, 0);
    }
    return true;
}
Also used : ChatComponentTranslation(net.minecraft.util.ChatComponentTranslation)

Example 12 with ChatComponentTranslation

use of net.minecraft.util.ChatComponentTranslation in project Tale-of-Kingdoms by Ivasik78.

the class EntityLumber method interact.

@Override
public boolean interact(EntityPlayer player) {
    if (this.canInteractWith(player)) {
        if (!this.worldObj.isRemote) {
            this.heal(100.0F);
            player.addChatMessage(new ChatComponentTranslation("npc.foreman.dialog"));
        }
        player.openGui(TaleOfKingdoms.instance, GUI_LUMBER, worldObj, 0, 0, 0);
    }
    return true;
}
Also used : ChatComponentTranslation(net.minecraft.util.ChatComponentTranslation)

Example 13 with ChatComponentTranslation

use of net.minecraft.util.ChatComponentTranslation in project Tale-of-Kingdoms by Ivasik78.

the class EntityMageKeeper method interact.

@Override
public boolean interact(EntityPlayer player) {
    if (this.canInteractWith(player)) {
        if (!worldObj.isRemote) {
            this.heal(100.0F);
            player.addChatMessage(new ChatComponentTranslation("npc.headMage.dialog"));
        }
        player.openGui(TaleOfKingdoms.instance, GUI_MAGEHALL, worldObj, 0, 0, 0);
    }
    return true;
}
Also used : ChatComponentTranslation(net.minecraft.util.ChatComponentTranslation)

Example 14 with ChatComponentTranslation

use of net.minecraft.util.ChatComponentTranslation in project Tale-of-Kingdoms by Ivasik78.

the class SPacketAdd method server.

@Override
public void server(EntityPlayerMP player) {
    ItemStack stack = ByteBufUtils.readItemStack(buf());
    stack.stackSize = buf().readInt();
    if (!player.inventory.addItemStackToInventory(stack))
        player.entityDropItem(stack, 0);
    player.addChatMessage(new ChatComponentTranslation(ByteBufUtils.readUTF8String(buf())));
}
Also used : ChatComponentTranslation(net.minecraft.util.ChatComponentTranslation) ItemStack(net.minecraft.item.ItemStack)

Example 15 with ChatComponentTranslation

use of net.minecraft.util.ChatComponentTranslation in project Galacticraft by micdoodle8.

the class NEIServerUtils method sendNotice.

public static void sendNotice(ICommandSender sender, IChatComponent msg, String permission) {
    ChatComponentTranslation notice = new ChatComponentTranslation("chat.type.admin", sender.getName(), msg.createCopy());
    notice.getChatStyle().setColor(EnumChatFormatting.GRAY).setItalic(true);
    if (NEIServerConfig.canPlayerPerformAction("CONSOLE", permission)) {
        MinecraftServer.getServer().addChatMessage(notice);
    }
    for (EntityPlayer p : ServerUtils.getPlayers()) {
        if (p == sender) {
            p.addChatComponentMessage(msg);
        } else if (NEIServerConfig.canPlayerPerformAction(p.getName(), permission)) {
            p.addChatComponentMessage(notice);
        }
    }
}
Also used : ChatComponentTranslation(net.minecraft.util.ChatComponentTranslation) EntityPlayer(net.minecraft.entity.player.EntityPlayer)

Aggregations

ChatComponentTranslation (net.minecraft.util.ChatComponentTranslation)77 ItemStack (net.minecraft.item.ItemStack)19 EntityPlayer (net.minecraft.entity.player.EntityPlayer)13 TileEntity (net.minecraft.tileentity.TileEntity)13 EntityPlayerMP (net.minecraft.entity.player.EntityPlayerMP)11 ArrayList (java.util.ArrayList)5 Block (net.minecraft.block.Block)4 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)4 World (net.minecraft.world.World)4 Item1N4148 (club.nsdn.nyasamarailway.item.tool.Item1N4148)3 ItemNTP32Bit (club.nsdn.nyasamarailway.item.tool.ItemNTP32Bit)3 ItemNTP8Bit (club.nsdn.nyasamarailway.item.tool.ItemNTP8Bit)3 TrainPacket (club.nsdn.nyasamarailway.network.TrainPacket)3 TileEntityActuator (club.nsdn.nyasamatelecom.api.tileentity.TileEntityActuator)3 EntityItem (net.minecraft.entity.item.EntityItem)3 ForgeDirection (net.minecraftforge.common.util.ForgeDirection)3 TileEntityRailSniffer (club.nsdn.nyasamarailway.tileblock.signal.TileEntityRailSniffer)2 TileEntityReceiver (club.nsdn.nyasamatelecom.api.tileentity.TileEntityReceiver)2 SubscribeEvent (cpw.mods.fml.common.eventhandler.SubscribeEvent)2 Side (cpw.mods.fml.relauncher.Side)2