Java Code Examples for net.minecraft.entity.player.EntityPlayer#sendChatToPlayer()
The following examples show how to use
net.minecraft.entity.player.EntityPlayer#sendChatToPlayer() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AbilityHandler.java From HexxitGear with GNU General Public License v3.0 | 6 votes |
public void onTick(EntityPlayer player) { if (activeTime > 0) { if (ability != null) { if (ability.getActive() == activeTime) player.sendChatToPlayer(ability.getName() + " activated!"); ability.start(player); if (ability.isInstant()) activeTime = 0; } activeTime--; } else if (cooldownTime > 0) { if (ability != null) { ability.end(player); } cooldownTime--; } else { player.sendChatToPlayer("Ability refreshed"); removePlayer(playerName); } }
Example 2
Source File: BlockBusFluidExport.java From ExtraCells1 with MIT License | 4 votes |
@Override public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float offsetX, float offsetY, float offsetZ) { if (!world.isRemote) { ItemStack currentItem = player.inventory.getCurrentItem(); if (currentItem != null) { IMemoryCard card = Util.getAppEngApi().getMemoryCardHandler(); TileEntity blockTE = world.getBlockTileEntity(x, y, z); if (card.isMemoryCard(currentItem)) { if (player.isSneaking()) { NBTTagCompound nbt = new NBTTagCompound(); blockTE.writeToNBT(nbt); nbt.removeTag("x"); nbt.removeTag("y"); nbt.removeTag("z"); blockTE.readFromNBT(nbt); card.setMemoryCardContents(currentItem, getUnlocalizedName() + ".name", nbt); player.sendChatToPlayer(new ChatMessageComponent().addText(StatCollector.translateToLocal("ChatMsg.SettingsSaved"))); return true; } else if (card.getSettingsName(currentItem).equals(getUnlocalizedName() + ".name") || card.getSettingsName(currentItem).equals("AppEng.GuiITooltip.Blank")) { blockTE.readFromNBT(card.getData(currentItem)); Packet description = blockTE.getDescriptionPacket(); if (description != null) PacketDispatcher.sendPacketToAllPlayers(description); player.sendChatToPlayer(new ChatMessageComponent().addText(StatCollector.translateToLocal("ChatMsg.SettingsLoaded"))); return true; } else { player.sendChatToPlayer(new ChatMessageComponent().addText(StatCollector.translateToLocal("ChatMsg.IncorrectDevice"))); return true; } } } if (world.getBlockTileEntity(x, y, z) == null || player.isSneaking()) { return false; } player.openGui(Extracells.instance, 4, world, x, y, z); } return true; }
Example 3
Source File: BlockBusFluidImport.java From ExtraCells1 with MIT License | 4 votes |
@Override public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float offsetX, float offsetY, float offsetZ) { if (!world.isRemote) { ItemStack currentItem = player.inventory.getCurrentItem(); if (currentItem != null) { IMemoryCard card = Util.getAppEngApi().getMemoryCardHandler(); TileEntity blockTE = world.getBlockTileEntity(x, y, z); if (card.isMemoryCard(currentItem)) { if (player.isSneaking()) { NBTTagCompound nbt = new NBTTagCompound(); blockTE.writeToNBT(nbt); nbt.removeTag("x"); nbt.removeTag("y"); nbt.removeTag("z"); blockTE.readFromNBT(nbt); card.setMemoryCardContents(currentItem, getUnlocalizedName() + ".name", nbt); player.sendChatToPlayer(new ChatMessageComponent().addText(StatCollector.translateToLocal("ChatMsg.SettingsSaved"))); return true; } else if (card.getSettingsName(currentItem).equals(getUnlocalizedName() + ".name") || card.getSettingsName(currentItem).equals("AppEng.GuiITooltip.Blank")) { blockTE.readFromNBT(card.getData(currentItem)); Packet description = blockTE.getDescriptionPacket(); if (description != null) PacketDispatcher.sendPacketToAllPlayers(description); player.sendChatToPlayer(new ChatMessageComponent().addText(StatCollector.translateToLocal("ChatMsg.SettingsLoaded"))); return true; } else { player.sendChatToPlayer(new ChatMessageComponent().addText(StatCollector.translateToLocal("ChatMsg.IncorrectDevice"))); return true; } } } if (world.getBlockTileEntity(x, y, z) == null || player.isSneaking()) { return false; } player.openGui(Extracells.instance, 3, world, x, y, z); } return true; }
Example 4
Source File: BlockBusFluidStorage.java From ExtraCells1 with MIT License | 4 votes |
@Override public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float offsetX, float offsetY, float offsetZ) { if (!world.isRemote) { ItemStack currentItem = player.inventory.getCurrentItem(); if (currentItem != null) { IMemoryCard card = Util.getAppEngApi().getMemoryCardHandler(); TileEntity blockTE = world.getBlockTileEntity(x, y, z); if (card.isMemoryCard(currentItem)) { if (player.isSneaking()) { NBTTagCompound nbt = new NBTTagCompound(); blockTE.writeToNBT(nbt); nbt.removeTag("x"); nbt.removeTag("y"); nbt.removeTag("z"); blockTE.readFromNBT(nbt); card.setMemoryCardContents(currentItem, getUnlocalizedName() + ".name", nbt); player.sendChatToPlayer(new ChatMessageComponent().addText(StatCollector.translateToLocal("ChatMsg.SettingsSaved"))); return true; } else if (card.getSettingsName(currentItem).equals(getUnlocalizedName() + ".name") || card.getSettingsName(currentItem).equals("AppEng.GuiITooltip.Blank")) { blockTE.readFromNBT(card.getData(currentItem)); Packet description = blockTE.getDescriptionPacket(); if (description != null) PacketDispatcher.sendPacketToAllPlayers(description); player.sendChatToPlayer(new ChatMessageComponent().addText(StatCollector.translateToLocal("ChatMsg.SettingsLoaded"))); return true; } else { player.sendChatToPlayer(new ChatMessageComponent().addText(StatCollector.translateToLocal("ChatMsg.IncorrectDevice"))); return true; } } } if (world.getBlockTileEntity(x, y, z) == null || player.isSneaking()) { return false; } PacketDispatcher.sendPacketToPlayer(world.getBlockTileEntity(x, y, z).getDescriptionPacket(), (Player) player); player.openGui(Extracells.instance, 2, world, x, y, z); } return true; }