本文整理汇总了Java中net.minecraft.entity.player.EntityPlayer.sendStatusMessage方法的典型用法代码示例。如果您正苦于以下问题:Java EntityPlayer.sendStatusMessage方法的具体用法?Java EntityPlayer.sendStatusMessage怎么用?Java EntityPlayer.sendStatusMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.entity.player.EntityPlayer
的用法示例。
在下文中一共展示了EntityPlayer.sendStatusMessage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onSlotHack
import net.minecraft.entity.player.EntityPlayer; //导入方法依赖的package包/类
@Override
protected void onSlotHack(int slot, boolean nuked) {
if (!nuked && gui instanceof GuiSecurityStationHacking) {
((GuiSecurityStationHacking) gui).onSlotHack(slot);
}
ItemStack stack = station.getPrimaryInventory().getStackInSlot(slot);
if (stack.getItemDamage() == ItemNetworkComponents.NETWORK_REGISTRY || stack.getItemDamage() == ItemNetworkComponents.DIAGNOSTIC_SUBROUTINE) {
hackedSuccessfully = true;
EntityPlayer player = FMLClientHandler.instance().getClient().player;
NetworkHandler.sendToServer(new PacketSecurityStationAddHacker(station, player.getName()));
FMLClientHandler.instance().getClient().player.closeScreen();
player.sendStatusMessage(new TextComponentString(TextFormatting.GREEN + "Hacking successful! This Security Station now doesn't protect the area any longer!"), false);
if (gui instanceof GuiSecurityStationHacking)
((GuiSecurityStationHacking) gui).removeUpdatesOnConnectionHandlers();
}
}
示例2: handleServerSide
import net.minecraft.entity.player.EntityPlayer; //导入方法依赖的package包/类
@Override
public void handleServerSide(PacketAmadronTradeAdd message, EntityPlayer player) {
AmadronOfferCustom offer = message.getOffer();
offer.updatePlayerId();
if (AmadronOfferManager.getInstance().hasOffer(offer.copy().invert())) {
player.sendStatusMessage(new TextComponentTranslation("message.amadron.duplicateReversedOffer"), false);
} else if (AmadronOfferManager.getInstance().addStaticOffer(offer)) {
if (AmadronOfferSettings.notifyOfTradeAddition) NetworkHandler.sendToAll(message);
try {
AmadronOfferStaticConfig.INSTANCE.writeToFile();
} catch (IOException e) {
e.printStackTrace();
}
} else {
player.sendStatusMessage(new TextComponentTranslation("message.amadron.duplicateOffer"), false);
}
}
示例3: isAllowedToEdit
import net.minecraft.entity.player.EntityPlayer; //导入方法依赖的package包/类
private boolean isAllowedToEdit(EntityPlayer player, ItemStack remote) {
NBTTagCompound tag = remote.getTagCompound();
if (tag != null) {
if (tag.hasKey("securityX")) {
int x = tag.getInteger("securityX");
int y = tag.getInteger("securityY");
int z = tag.getInteger("securityZ");
int dimensionId = tag.getInteger("securityDimension");
WorldServer world = DimensionManager.getWorld(dimensionId);
if (world != null) {
TileEntity te = world.getTileEntity(new BlockPos(x, y, z));
if (te instanceof TileEntitySecurityStation) {
boolean canAccess = ((TileEntitySecurityStation) te).doesAllowPlayer(player);
if (!canAccess) {
player.sendStatusMessage(new TextComponentTranslation("gui.remote.noEditRights", x, y, z), false);
}
return canAccess;
}
}
}
}
return true;
}
示例4: itemInteractionForEntity
import net.minecraft.entity.player.EntityPlayer; //导入方法依赖的package包/类
@Override
public boolean itemInteractionForEntity(ItemStack iStack, EntityPlayer player, EntityLivingBase entity, EnumHand hand) {
if (!player.world.isRemote) {
if (entity instanceof IManoMeasurable) {
if (((IPressurizable) iStack.getItem()).getPressure(iStack) > 0F) {
List<String> curInfo = new ArrayList<String>();
((IManoMeasurable) entity).printManometerMessage(player, curInfo);
if (curInfo.size() > 0) {
((IPressurizable) iStack.getItem()).addAir(iStack, -30);
for (String s : curInfo) {
player.sendStatusMessage(new TextComponentTranslation(s), false);
}
return true;
}
} else {
player.sendStatusMessage(new TextComponentTranslation(TextFormatting.RED + "The Manometer doesn't have any charge!"), false);
}
}
}
return false;
}
示例5: onBlockActivated
import net.minecraft.entity.player.EntityPlayer; //导入方法依赖的package包/类
@Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing side, float par7, float par8, float par9) {
if (player.isSneaking()) return false;
else {
if (!world.isRemote) {
TileEntitySecurityStation te = (TileEntitySecurityStation) world.getTileEntity(pos);
if (te != null) {
if (te.isPlayerOnWhiteList(player)) {
player.openGui(PneumaticCraftRepressurized.instance, EnumGuiId.SECURITY_STATION_INVENTORY.ordinal(), world, pos.getX(), pos.getY(), pos.getZ());
} else if (!te.hasValidNetwork()) {
player.sendStatusMessage(new TextComponentString(TextFormatting.GREEN + "This Security Station is out of order: Its network hasn't been properly configured."), false);
} else if (te.hasPlayerHacked(player)) {
player.sendStatusMessage(new TextComponentString(TextFormatting.GREEN + "You've already hacked this Security Station!"), false);
} else if (getPlayerHackLevel(player) < te.getSecurityLevel()) {
player.sendStatusMessage(new TextComponentString(TextFormatting.RED + "You can't access or hack this Security Station. To hack it you need at least a Pneumatic Helmet upgraded with " + te.getSecurityLevel() + " Security upgrade(s)."), false);
} else {
player.openGui(PneumaticCraftRepressurized.instance, EnumGuiId.HACKING.ordinal(), world, pos.getX(), pos.getY(), pos.getZ());
}
}
}
return true;
}
}
示例6: handleGUIButtonPress
import net.minecraft.entity.player.EntityPlayer; //导入方法依赖的package包/类
@Override
public void handleGUIButtonPress(int buttonID, EntityPlayer player) {
if (buttonID == 0) {
redstoneMode++;
if (redstoneMode > 2) redstoneMode = 0;
updateNeighbours();
} else if (buttonID == 2) {
rebootStation();
} else if (buttonID == 3) {
if (!hasValidNetwork()) {
player.sendStatusMessage(new TextComponentTranslation(TextFormatting.GREEN + "This Security Station is out of order: Its network hasn't been properly configured."), false);
} else {
player.openGui(PneumaticCraftRepressurized.instance, EnumGuiId.HACKING.ordinal(), getWorld(), getPos().getX(), getPos().getY(), getPos().getZ());
}
} else if (buttonID > 3 && buttonID - 4 < sharedUsers.size()) {
sharedUsers.remove(buttonID - 4);
}
sendDescriptionPacket();
}
示例7: onBlockActivated
import net.minecraft.entity.player.EntityPlayer; //导入方法依赖的package包/类
@Override
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ)
{
if (Config.getInstance().boringSamples)
{
String resource = Types.Vanilla.byMetadata(state.getBlock().getMetaFromState(state)).getResource();
playerIn.sendStatusMessage(new TextComponentString("You break the sample to find " + resource), true);
}
else
{
this.dropBlockAsItem(worldIn, pos, state, 0);
}
worldIn.setBlockToAir(pos);
playerIn.swingArm(EnumHand.MAIN_HAND);
return true;
}
示例8: onBlockActivated
import net.minecraft.entity.player.EntityPlayer; //导入方法依赖的package包/类
@Override
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn,
EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ)
{
if(!worldIn.isRemote)
if(((Boolean)state.getValue(ACTIVE)).booleanValue())
{
Boolean goHome = playerIn.dimension == DimensionPontus.DIMENSION_ID;
if(playerIn instanceof EntityPlayerMP)
if(goHome)
HarshenUtils.transferPlayerToDimension((EntityPlayerMP) playerIn, 0, pos);
else
HarshenUtils.transferPlayerToDimension((EntityPlayerMP) playerIn, DimensionPontus.DIMENSION_ID, pos, getStateFromMeta(3));
}
else
playerIn.sendStatusMessage(new TextComponentTranslation("block.gate.reactivate"), true);
return super.onBlockActivated(worldIn, pos, state, playerIn, hand, facing, hitX, hitY, hitZ);
}
示例9: onDeath
import net.minecraft.entity.player.EntityPlayer; //导入方法依赖的package包/类
@Override
public void onDeath(DamageSource par1DamageSource) {
for (int i = 0; i < inventory.getSlots(); i++) {
if (!inventory.getStackInSlot(i).isEmpty()) {
entityDropItem(inventory.getStackInSlot(i), 0);
inventory.setStackInSlot(i, ItemStack.EMPTY);
}
}
if (naturallySpawned) {
} else {
ItemStack drone = getDroppedStack();
if (hasCustomName()) drone.setStackDisplayName(getCustomNameTag());
entityDropItem(drone, 0);
if (!world.isRemote) {
EntityPlayer owner = getOwner();
if (owner != null) {
int x = (int) Math.floor(posX);
int y = (int) Math.floor(posY);
int z = (int) Math.floor(posZ);
if (hasCustomName()) {
owner.sendStatusMessage(new TextComponentTranslation("death.drone.named", getCustomNameTag(), x, y, z), false);
} else {
owner.sendStatusMessage(new TextComponentTranslation("death.drone", x, y, z), false);
}
}
}
}
if (!world.isRemote) getFakePlayer().interactionManager.cancelDestroyingBlock();
super.onDeath(par1DamageSource);
}
示例10: handleClientSide
import net.minecraft.entity.player.EntityPlayer; //导入方法依赖的package包/类
@Override
public void handleClientSide(PacketAmadronTradeRemoved message, EntityPlayer player) {
if (AmadronOfferSettings.notifyOfTradeRemoval)
player.sendStatusMessage(new TextComponentTranslation("message.amadron.playerRemovedTrade",
message.getOffer().getVendor(),
WidgetAmadronOffer.getStringForObject(message.getOffer().getInput()),
WidgetAmadronOffer.getStringForObject(message.getOffer().getOutput())),
false);
}
示例11: handleClientSide
import net.minecraft.entity.player.EntityPlayer; //导入方法依赖的package包/类
@Override
public void handleClientSide(PacketAmadronTradeNotifyDeal message, EntityPlayer player) {
if (AmadronOfferSettings.notifyOfDealMade)
player.sendStatusMessage(new TextComponentTranslation("message.amadron.playerBought",
message.buyingPlayer,
WidgetAmadronOffer.getStringForObject(message.getOffer().getOutput(), message.offerAmount),
WidgetAmadronOffer.getStringForObject(message.getOffer().getInput(), message.offerAmount)),
false);
}
示例12: handleClientSide
import net.minecraft.entity.player.EntityPlayer; //导入方法依赖的package包/类
@Override
public void handleClientSide(PacketAmadronTradeAdd message, EntityPlayer player) {
if (AmadronOfferSettings.notifyOfTradeAddition)
player.sendStatusMessage(new TextComponentTranslation("message.amadron.playerAddedTrade",
message.getOffer().getVendor(),
WidgetAmadronOffer.getStringForObject(message.getOffer().getOutput()),
WidgetAmadronOffer.getStringForObject(message.getOffer().getInput())), false);
}
示例13: handleClientSide
import net.minecraft.entity.player.EntityPlayer; //导入方法依赖的package包/类
@Override
public void handleClientSide(PacketCommandGetGlobalVariableOutput message, EntityPlayer player) {
player.sendStatusMessage(new TextComponentTranslation("command.getGlobalVariable.output",
message.varName,
message.pos.getX(), message.pos.getY(), message.pos.getZ(),
message.stack.isEmpty() ? "-" : message.stack.getDisplayName()),
false);
}
示例14: onItemUse
import net.minecraft.entity.player.EntityPlayer; //导入方法依赖的package包/类
@Override
public EnumActionResult onItemUse(EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) {
if (!world.isRemote) {
int startY = pos.getY();
while (pos.getY() > 0) {
pos = pos.offset(EnumFacing.DOWN);
if (world.getBlockState(pos).getBlock() == FluidRegistry.getFluid(Fluids.OIL.getName()).getBlock()) {
Set<BlockPos> oilPositions = new HashSet<>();
Stack<BlockPos> pendingPositions = new Stack<>();
pendingPositions.add(new BlockPos(pos));
while (!pendingPositions.empty()) {
BlockPos checkingPos = pendingPositions.pop();
for (EnumFacing d : EnumFacing.VALUES) {
BlockPos newPos = checkingPos.offset(d);
if (world.getBlockState(newPos).getBlock() == Fluids.OIL.getBlock() && FluidUtils.isSourceBlock(world, newPos) && oilPositions.add(newPos)) {
pendingPositions.add(newPos);
}
}
}
player.sendStatusMessage(new TextComponentTranslation(
"message.seismicSensor.foundOilDetails",
TextFormatting.GREEN.toString() + (startY - pos.getY()),
TextFormatting.GREEN.toString() + oilPositions.size() / 10 * 10),
false);
return EnumActionResult.SUCCESS;
}
}
player.sendStatusMessage(new TextComponentTranslation("message.seismicSensor.noOilFound"), false);
}
return EnumActionResult.SUCCESS; // we don't want to use the item.
}
示例15: sendEditorMessage
import net.minecraft.entity.player.EntityPlayer; //导入方法依赖的package包/类
private void sendEditorMessage(EntityPlayer player) {
ITextComponent msg = new TextComponentString(TextFormatting.WHITE.toString())
.appendSibling(new TextComponentTranslation("gui.aphorismTileEditor"))
.appendSibling(new TextComponentString(": "))
.appendSibling(new TextComponentTranslation("gui.holdF1forHelp"));
player.sendStatusMessage(msg, true);
}