Search in sources :

Example 11 with ChatComponentText

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

the class EntityDefendBandit method interact.

public boolean interact(EntityPlayer entityplayer) {
    if (!this.follow) {
        this.follow = true;
        if (!worldObj.isRemote) {
            entityplayer.addChatMessage(new ChatComponentText("Bandit: I will follow you."));
        }
        this.defend.setDead();
        this.createdMarker = false;
    } else {
        this.follow = false;
        if (!worldObj.isRemote) {
            entityplayer.addChatMessage(new ChatComponentText("Bandit: I will guard this area."));
        }
    }
    return true;
}
Also used : ChatComponentText(net.minecraft.util.ChatComponentText)

Example 12 with ChatComponentText

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

the class GuiLibrary method actionPerformed.

@Override
protected void actionPerformed(GuiButton guibutton) {
    if (guibutton.id == 1) {
        if (this.get.studied) {
            if (!this.world.isRemote) {
                this.world.spawnEntityInWorld(new EntityXPOrb(this.world, this.player.posX, this.player.posY, this.player.posZ, 150));
                this.player.addChatMessage(new ChatComponentText("You have gained experience."));
            }
            this.get.studied = false;
        } else if (!this.world.isRemote) {
            this.player.addChatMessage(new ChatComponentText("You have already studied for a while, go back in a few moments"));
        }
        this.goldchecker = false;
    }
    if (guibutton.id == 2) {
        if (500 + playerProvider.libraryInvestment * 2 <= playerProvider.getGoldTotal()) {
            playerProvider.libraryInvestment += 5;
            if (!this.world.isRemote) {
                this.player.addChatMessage(new ChatComponentText("Tax is now increased by " + playerProvider.libraryInvestment + " gold per house."));
            }
            playerProvider.decreaseGold(500 + playerProvider.libraryInvestment * 2);
        } else {
            this.goldchecker = true;
        }
    }
    if (guibutton.id == 3) {
        this.mc.displayGuiScreen(null);
        this.goldchecker = false;
    }
    if (guibutton.id == 4) {
        ;
    }
}
Also used : ChatComponentText(net.minecraft.util.ChatComponentText) EntityXPOrb(net.minecraft.entity.item.EntityXPOrb)

Example 13 with ChatComponentText

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

the class EntityDefendPaladin method interact.

public boolean interact(EntityPlayer entityplayer) {
    if (!this.follow) {
        this.follow = true;
        if (!this.worldObj.isRemote) {
            entityplayer.addChatMessage(new ChatComponentText("Paladin: I will follow you."));
        }
        this.defend.setDead();
        this.createdMarker = false;
    } else {
        this.follow = false;
        if (!this.worldObj.isRemote) {
            entityplayer.addChatMessage(new ChatComponentText("Paladin:I will guard this area."));
        }
    }
    return true;
}
Also used : ChatComponentText(net.minecraft.util.ChatComponentText)

Example 14 with ChatComponentText

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

the class EntityGuildMember method onDeath.

@Override
public void onDeath(DamageSource damagesource) {
    if (!worldObj.isRemote) {
        if (this.fight && this.player != null) {
            PlayerProvider.get(player).addGlory(50);
            this.player.addChatMessage(new ChatComponentText("Guild Member: Your a good fighter my friend, I will let the guild master know of your strength."));
            this.fight = false;
            counter = 0;
            this.setAIMoveSpeed(0.5F);
            Entity entity = UltimateHelper.INSTANCE.getEntity("GuildMember", worldObj);
            entity.setLocationAndAngles(player.posX + 2, player.posY, player.posZ + 2, 0, 0);
            worldObj.spawnEntityInWorld(entity);
        }
    }
}
Also used : Entity(net.minecraft.entity.Entity) ChatComponentText(net.minecraft.util.ChatComponentText)

Example 15 with ChatComponentText

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

the class EntityGuildMember method interact.

@Override
public boolean interact(EntityPlayer entityplayer) {
    this.player = entityplayer;
    if (ended) {
        ItemStack itemstack = entityplayer.getHeldItem();
        if (itemstack != null) {
            if (itemstack.getItem() == Items.wooden_sword) {
                defaultHeldItem = new ItemStack(Items.wooden_sword, 1);
                this.swingItem();
                if (!worldObj.isRemote) {
                    entityplayer.addChatMessage(new ChatComponentText("Guild Member: Get Ready."));
                }
                this.fight = true;
            } else if (!worldObj.isRemote) {
                entityplayer.addChatMessage(new ChatComponentText("Guild Member: Greetings. You seem like a tough fighter. Give me a wooden sword and lets have a sparing match!"));
            }
        } else if (!worldObj.isRemote) {
            entityplayer.addChatMessage(new ChatComponentText("Guild Member: Greetings. You seem like a tough fighter. Give me a wooden sword and lets have a sparing match!"));
        }
    } else if (!worldObj.isRemote) {
        entityplayer.addChatMessage(new ChatComponentText("Guild Member: Damn this Reficules"));
    }
    return true;
}
Also used : ItemStack(net.minecraft.item.ItemStack) ChatComponentText(net.minecraft.util.ChatComponentText)

Aggregations

ChatComponentText (net.minecraft.util.ChatComponentText)164 ItemStack (net.minecraft.item.ItemStack)27 EntityPlayer (net.minecraft.entity.player.EntityPlayer)24 EntityPlayerMP (net.minecraft.entity.player.EntityPlayerMP)16 TileEntity (net.minecraft.tileentity.TileEntity)13 Entity (net.minecraft.entity.Entity)12 ClickEvent (net.minecraft.event.ClickEvent)10 IChatComponent (net.minecraft.util.IChatComponent)10 ArrayList (java.util.ArrayList)9 ChatStyle (net.minecraft.util.ChatStyle)9 GCPlayerStats (micdoodle8.mods.galacticraft.core.entities.player.GCPlayerStats)8 Block (net.minecraft.block.Block)8 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)8 SubscribeEvent (cpw.mods.fml.common.eventhandler.SubscribeEvent)7 File (java.io.File)7 RfToolsDimensionManager (mcjty.rftoolsdim.dimensions.RfToolsDimensionManager)7 WrongUsageException (net.minecraft.command.WrongUsageException)7 World (net.minecraft.world.World)6 AccessGroup (com.builtbroken.mc.lib.access.AccessGroup)5 DimensionInformation (mcjty.rftoolsdim.dimensions.DimensionInformation)5