@Override public void notifyUser( final EntityPlayer player, final MemoryCardMessages msg ) { if( Platform.isClient() ) { return; } switch( msg ) { case SETTINGS_CLEARED: player.sendMessage( PlayerMessages.SettingCleared.get() ); break; case INVALID_MACHINE: player.sendMessage( PlayerMessages.InvalidMachine.get() ); break; case SETTINGS_LOADED: player.sendMessage( PlayerMessages.LoadedSettings.get() ); break; case SETTINGS_SAVED: player.sendMessage( PlayerMessages.SavedSettings.get() ); break; case SETTINGS_RESET: player.sendMessage( PlayerMessages.ResetSettings.get() ); break; default: } }
@Override public void onUpdate(ItemStack stack, World world, Entity e, int t, boolean idunno) { if(!world.isRemote && e instanceof EntityPlayer && e.ticksExisted % 30 == 0 && TYPOS.contains(stack.getDisplayName().toLowerCase())) { EntityPlayer player = (EntityPlayer) e; int ticks = ItemNBTHelper.getInt(stack, TAG_TICKS, 0); if(ticks < NOT_MY_NAME.length) { player.sendMessage(new TextComponentString(TextFormatting.RED + NOT_MY_NAME[ticks])); ItemNBTHelper.setInt(stack, TAG_TICKS, ticks + 1); } } }
@SubscribeEvent public static void onTick(ClientTickEvent event) { if(event.phase == Phase.END && Minecraft.getMinecraft().player != null && !triedToWarnPlayer && doneChecking) { if(!onlineVersion.isEmpty()) { EntityPlayer player = Minecraft.getMinecraft().player; int onlineBuild = Integer.parseInt(onlineVersion.split("-")[1]); int clientBuild = LibMisc.BUILD.contains("GRADLE") ? Integer.MAX_VALUE : Integer.parseInt(LibMisc.BUILD); if(onlineBuild > clientBuild) { player.sendMessage(new TextComponentTranslation("botania.versioning.flavour" + player.world.rand.nextInt(FLAVOUR_MESSAGES)).setStyle(new Style().setColor(TextFormatting.LIGHT_PURPLE))); player.sendMessage(new TextComponentTranslation("botania.versioning.outdated", clientBuild, onlineBuild)); ITextComponent component = ITextComponent.Serializer.fromJsonLenient(I18n.translateToLocal("botania.versioning.updateMessage").replaceAll("%version%", onlineVersion)); player.sendMessage(component); } } triedToWarnPlayer = true; } }
public void tellChanges(EntityPlayer player) { if(changes.size() == 0) return; player.sendMessage(new TextComponentTranslation("botaniamisc.adaptativeConfigChanges").setStyle(new Style().setColor(TextFormatting.GOLD))); for(String change : changes) player.sendMessage(new TextComponentString(change).setStyle(new Style().setColor(TextFormatting.LIGHT_PURPLE))); }
@Nonnull @Override public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player, @Nonnull EnumHand hand) { ItemStack stack = player.getHeldItem(hand); if(isRightPlayer(player, stack)) { if(world.isRemote) return ActionResult.newResult(EnumActionResult.SUCCESS, stack); world.playSound(null, player.posX, player.posY, player.posZ, SoundEvents.ENTITY_ARROW_SHOOT, SoundCategory.PLAYERS, 0.5F, 0.4F / (world.rand.nextFloat() * 0.4F + 0.8F)); List<Integer> possible = new ArrayList<>(); for(int i = 0; i < 6; i++) { if(!hasRelicAlready(player, i)) possible.add(i); } if(possible.isEmpty()) { player.sendMessage(new TextComponentTranslation("botaniamisc.dudDiceRoll", world.rand.nextInt(6) + 1).setStyle(new Style().setColor(TextFormatting.DARK_GREEN))); stack.shrink(1); return ActionResult.newResult(EnumActionResult.SUCCESS, stack); } else { int relic = possible.get(world.rand.nextInt(possible.size())); player.sendMessage(new TextComponentTranslation("botaniamisc.diceRoll", relic + 1).setStyle(new Style().setColor(TextFormatting.DARK_GREEN))); return ActionResult.newResult(EnumActionResult.SUCCESS, relicStacks[relic].copy()); } } return ActionResult.newResult(EnumActionResult.PASS, stack); }
player.sendMessage( PlayerMessages.DeviceNotWirelessTerminal.get() ); return; if( unparsedKey.isEmpty() ) player.sendMessage( PlayerMessages.DeviceNotLinked.get() ); return; if( securityStation == null ) player.sendMessage( PlayerMessages.StationCanNotBeLocated.get() ); return; player.sendMessage( PlayerMessages.DeviceNotPowered.get() );
@Nonnull @Override public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player, @Nonnull EnumHand hand) { ItemStack stack = player.getHeldItem(hand); String force = getForcedPage(stack); if(force != null && !force.isEmpty()) { LexiconEntry entry = getEntryFromForce(stack); if(entry != null) Botania.proxy.setEntryToOpen(entry); else player.sendMessage(new TextComponentTranslation("botaniamisc.cantOpen").setStyle(new Style().setColor(TextFormatting.RED))); setForcedPage(stack, ""); } openBook(player, stack, world, skipSound); skipSound = false; return ActionResult.newResult(EnumActionResult.SUCCESS, stack); }
@Override public void update() { if( !this.is.isEmpty() && Platform.isServer() ) { this.countdown--; if( this.countdown % 20 == 0 ) { for( final EntityPlayer e : AppEng.proxy.getPlayers() ) { e.sendMessage( new TextComponentString( "Spawning in... " + ( this.countdown / 20 ) ) ); } } if( this.countdown <= 0 ) { this.spawn(); } } }
player.sendMessage( new TextComponentString( "Size: " + this.size ) );
@Override public boolean onActivated( final World w, final BlockPos pos, final EntityPlayer p, final EnumHand hand, final @Nullable ItemStack heldItem, final EnumFacing side, final float hitX, final float hitY, final float hitZ ) { final TileChest tg = this.getTileEntity( w, pos ); if( tg != null && !p.isSneaking() ) { if( Platform.isClient() ) { return true; } if( side != tg.getUp() ) { Platform.openGUI( p, tg, AEPartLocation.fromFacing( side ), GuiBridge.GUI_CHEST ); } else { if( !tg.openGui( p ) ) { p.sendMessage( PlayerMessages.ChestCannotReadStorageCell.get() ); } } return true; } return false; } }
@Override public EnumActionResult onItemUseFirst( final EntityPlayer player, final World world, final BlockPos pos, final EnumFacing side, final float hitX, final float hitY, final float hitZ, final EnumHand hand ) { if( Platform.isClient() ) { return EnumActionResult.PASS; } final MeteoritePlacer mp = new MeteoritePlacer(); final boolean worked = mp.spawnMeteorite( new StandardWorld( world ), pos.getX(), pos.getY(), pos.getZ() ); if( !worked ) { player.sendMessage( new TextComponentString( "Un-suitable Location." ) ); } return EnumActionResult.SUCCESS; } }
@Override public void detectAndSendChanges() { super.detectAndSendChanges(); if( !this.wirelessTerminalGUIObject.rangeCheck() ) { if( Platform.isServer() && this.isValidContainer() ) { this.getPlayerInv().player.sendMessage( PlayerMessages.OutOfRange.get() ); } this.setValidContainer( false ); } else { this.setPowerMultiplier( AEConfig.instance().wireless_getDrainRate( this.wirelessTerminalGUIObject.getRange() ) ); } } }
@Override public boolean onPartShiftActivate( EntityPlayer player, EnumHand hand, Vec3d pos ) { if( Platform.isClient() ) { return true; } if( !this.getProxy().isActive() ) { return false; } if( !Platform.hasPermissions( this.getLocation(), player ) ) { return false; } if( player.getHeldItem( hand ).isEmpty() ) { this.isLocked = !this.isLocked; player.sendMessage( ( this.isLocked ? PlayerMessages.isNowLocked : PlayerMessages.isNowUnlocked ).get() ); this.getHost().markForSave(); this.getHost().markForUpdate(); } return true; }
ItemStack stackAt = getItemHandler().getStackInSlot(i); if(!stackAt.isEmpty() && stackAt.getItem() == Item.getItemFromBlock(ModBlocks.tinyPotato)) { player.sendMessage(new TextComponentString("Don't talk to me or my son ever again.")); return;
if(world.getDifficulty() == EnumDifficulty.PEACEFUL) { if(!world.isRemote) player.sendMessage(new TextComponentTranslation("botaniamisc.peacefulNoob").setStyle(new Style().setColor(TextFormatting.RED))); return false; if(blockat != ModBlocks.pylon || state.getValue(BotaniaStateProps.PYLON_VARIANT) != PylonVariant.GAIA) { if(!world.isRemote) player.sendMessage(new TextComponentTranslation("botaniamisc.needsCatalysts").setStyle(new Style().setColor(TextFormatting.RED))); return false; new PacketBotaniaEffect(PacketBotaniaEffect.EffectType.ARENA_INDICATOR, pos.getX(), pos.getY(), pos.getZ())); player.sendMessage(new TextComponentTranslation("botaniamisc.badArena").setStyle(new Style().setColor(TextFormatting.RED)));
@Override public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing side, float xs, float ys, float zs) { TileHourglass hourglass = (TileHourglass) world.getTileEntity(pos); ItemStack hgStack = hourglass.getItemHandler().getStackInSlot(0); ItemStack stack = player.getHeldItem(hand); if(!stack.isEmpty() && stack.getItem() == ModItems.twigWand) return false; if(hourglass.lock) { if(!player.world.isRemote) player.sendMessage(new TextComponentTranslation("botaniamisc.hourglassLock")); return true; } if(hgStack.isEmpty() && TileHourglass.getStackItemTime(stack) > 0) { hourglass.getItemHandler().setStackInSlot(0, stack.copy()); hourglass.markDirty(); stack.setCount(0); return true; } else if(!hgStack.isEmpty()) { ItemHandlerHelper.giveItemToPlayer(player, hgStack); hourglass.getItemHandler().setStackInSlot(0, ItemStack.EMPTY); hourglass.markDirty(); return true; } return false; }
private @Nonnull EnumActionResult onTelepadClicked(@Nonnull ItemStack stack, @Nonnull EntityPlayer player, @Nonnull World worldIn, @Nonnull ICoordinateAware.SingleTarget tile, @Nonnull TelepadTarget targ) { if (tile.canBlockBeAccessed(player)) { tile.setTarget(targ); if (worldIn.isRemote) { player.sendMessage(Lang.PRINTOUT_SETTARGET.toChat(targ.getChatString())); } } else { sendPrivateChatMessage(player, tile.getOwner()); } return EnumActionResult.SUCCESS; }
private static void renderPlayerLook(EntityPlayer player, RayTraceResult src) { if(currentMultiblock != null && dimension == player.world.provider.getDimension()) { BlockPos anchorPos = anchor != null ? anchor : src.getBlockPos(); GlStateManager.pushMatrix(); GL11.glPushAttrib(GL11.GL_LIGHTING_BIT); GlStateManager.enableBlend(); GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GlStateManager.disableLighting(); rendering = true; Multiblock mb = anchor != null ? currentMultiblock.getForFacing(angle) : currentMultiblock.getForEntity(player); boolean didAny = false; blockAccess.update(player.world, mb, anchorPos); ShaderHelper.useShader(ShaderHelper.alpha, shader -> { int alpha = ARBShaderObjects.glGetUniformLocationARB(shader, "alpha"); ARBShaderObjects.glUniform1fARB(alpha, 0.4F); }); for(MultiblockComponent comp : mb.getComponents()) { if(renderComponentInWorld(player.world, mb, comp, anchorPos)) didAny = true; } ShaderHelper.releaseShader(); rendering = false; GL11.glPopAttrib(); GlStateManager.popMatrix(); if(!didAny) { setMultiblock(null); player.sendMessage(new TextComponentTranslation("botaniamisc.structureComplete").setStyle(new Style().setColor(TextFormatting.GREEN))); } } }
this.getPlayerInv().player.sendMessage( new TextComponentString( "Error: " + e.toString() ) ); AELog.debug( e ); this.setValidContainer( false );
p.sendMessage( PlayerMessages.AmmoDepleted.get() );