@SideOnly(Side.CLIENT) @Override public void addInformation(ItemStack is, @Nullable World worldIn, List<String> list, ITooltipFlag flag) { NBTTagCompound tag = is.getTagCompound(); if(tag != null) { Instrument instrument = InstrumentLibrary.getInstrumentByName(tag.getString("itemName")); if(instrument != null) { list.add(I18n.translateToLocal("item.clef.instrument." + instrument.info.itemName + ".desc")); list.add(I18n.translateToLocal(instrument.info.twoHanded && Clef.config.allowOneHandedTwoHandedInstrumentUse == 0 ? "clef.item.twoHanded" : "clef.item.oneHanded")); if(GuiScreen.isShiftKeyDown()) { list.add(""); list.add(I18n.translateToLocal("clef.item.packName") + ": " + instrument.packInfo.packName); list.add(I18n.translateToLocal("clef.item.itemName") + ": " + instrument.info.itemName); } } } }
@SideOnly(Side.CLIENT) public static void pressUnicode(Robot r, int key_code) { r.keyPress(KeyEvent.VK_ALT); for(int i = 3; i >= 0; --i) { int numpad_kc = key_code / (int) (Math.pow(10, i)) % 10 + KeyEvent.VK_NUMPAD0; r.keyPress(numpad_kc); r.keyRelease(numpad_kc); } r.keyRelease(KeyEvent.VK_ALT); }
@SideOnly(Side.CLIENT) public void randomDisplayTick(IBlockState stateIn, World worldIn, BlockPos pos, Random rand) { if (rand.nextInt(16) == 0) { BlockPos blockpos = pos.down(); if (canFallThrough(worldIn.getBlockState(blockpos))) { double d0 = (double)((float)pos.getX() + rand.nextFloat()); double d1 = (double)pos.getY() - 0.05D; double d2 = (double)((float)pos.getZ() + rand.nextFloat()); worldIn.spawnParticle(EnumParticleTypes.FALLING_DUST, d0, d1, d2, 0.0D, 0.0D, 0.0D, new int[] {Block.getStateId(stateIn)}); } } }
/** * Updates the velocity of the entity to a new value. */ @SideOnly(Side.CLIENT) public void setVelocity(double x, double y, double z) { this.motionX = x; this.motionY = y; this.motionZ = z; if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) { float f = MathHelper.sqrt_double(x * x + z * z); this.rotationPitch = (float)(MathHelper.atan2(y, (double)f) * (180D / Math.PI)); this.rotationYaw = (float)(MathHelper.atan2(x, z) * (180D / Math.PI)); this.prevRotationPitch = this.rotationPitch; this.prevRotationYaw = this.rotationYaw; this.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch); this.ticksInGround = 0; } }
@SideOnly(Side.CLIENT) public boolean shouldRenderSides(IBlockAccess blockAccess, BlockPos pos) { for (int i = -1; i <= 1; ++i) { for (int j = -1; j <= 1; ++j) { IBlockState iblockstate = blockAccess.getBlockState(pos.add(i, 0, j)); if (iblockstate.getMaterial() != this.blockMaterial && !iblockstate.isFullBlock()) { return true; } } } return false; }
@SideOnly(Side.SERVER) public static void InjectDedicated(MinecraftServer server) { PlayerList playerList = server.getPlayerList(); try { if (playerList instanceof DedicatedPlayerList) { server.setPlayerList(new HookedDedicatedPlayerList((DedicatedPlayerList)playerList)); } else { // uh ho... Util.logger.error("Unable to inject custom PlayerList into server due to unknown type! PlayerList was of type {}.", playerList.getClass().toString()); } } catch (IllegalAccessException | NoSuchFieldException | SecurityException e) { Util.logger.logException("Exception trying to inject custom PlayerList into server!", e); } }
@SideOnly(Side.CLIENT) public void updateProgressBar(int barId, int newValue) { if (barId == 0) { tileEntity.cookTime = newValue; } if (barId == 1) { tileEntity.burnTime = newValue; } if (barId == 2) { tileEntity.currentItemBurnTime = newValue; } if (barId == 3) { tileEntity.decayTime = newValue; } }
@Override @SideOnly(Side.CLIENT) public void render(float width) { //Render ties using current texture but with dynamic width. //This will cause stretching of the texture, but it ensures uniformity for all sizes. GL11.glBegin(GL11.GL_QUADS); renderTieBottom(width); renderTieTop(width); renderTieFront(width); renderTieRear(width); renderTieLeft(width); renderTieRight(width); GL11.glEnd(); }
@Override @SideOnly(Side.CLIENT) public void getSubBlocks(CreativeTabs tab, NonNullList<ItemStack> list) { if (tab!=this.getCreativeTabToDisplayOn()) return; for (int i=0; i<16; i++) { list.add(new ItemStack(ItemBlock.getItemFromBlock(this), 1, i)); } }
@SideOnly(Side.CLIENT) @EventHandler public void init(FMLInitializationEvent event) { overlayRenderer = new LithiumOverlay(); MinecraftForge.EVENT_BUS.register(NetworkEventHandler.INSTANCE); MinecraftForge.EVENT_BUS.register(overlayRenderer); network = NetworkRegistry.INSTANCE.newSimpleChannel(LithiumMod.CHANNELNAME); Handle.setPacketHandler(new PacketHandlerImpl()); getSimpleNetworkWrapper().registerMessage(Handle.class, LithiumMessage.class, 0, Side.CLIENT); }
/** * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) */ @SideOnly(Side.CLIENT) public void getSubBlocks(Item itemIn, CreativeTabs tab, List<ItemStack> list) { if (itemIn != Item.getItemFromBlock(Blocks.DOUBLE_STONE_SLAB)) { for (BlockStoneSlab.EnumType blockstoneslab$enumtype : BlockStoneSlab.EnumType.values()) { if (blockstoneslab$enumtype != BlockStoneSlab.EnumType.WOOD) { list.add(new ItemStack(itemIn, 1, blockstoneslab$enumtype.getMetadata())); } } } }
@SideOnly(Side.CLIENT) private static void addClientHandlers() { FMLEmbeddedChannel clientChannel = channelPair.get(Side.CLIENT); String handlerName = clientChannel.findChannelHandlerNameForType(ForgeRuntimeCodec.class); clientChannel.pipeline().addAfter(handlerName, "DimensionHandler", new DimensionMessageHandler()); clientChannel.pipeline().addAfter(handlerName, "FluidIdRegistryHandler", new FluidIdRegistryMessageHandler()); }
@SubscribeEvent @SideOnly(Side.CLIENT) public void onModelLoad(ModelRegistryEvent ev) { RandoresBlocks.registerModels(); RandoresItems.registerModels(); CraftingBlocks.registerModels(); CraftingItems.registerModels(); }
@SideOnly(Side.CLIENT) public int getLightFor(EnumSkyBlock p_175628_1_, BlockPos pos) { if (pos.getY() >= 0 && pos.getY() < 256) { int i = (pos.getX() >> 4) - this.chunkX; int j = (pos.getZ() >> 4) - this.chunkZ; if (i < 0 || i >= chunkArray.length || j < 0 || j >= chunkArray[i].length) return p_175628_1_.defaultLightValue; return this.chunkArray[i][j].getLightFor(p_175628_1_, pos); } else { return p_175628_1_.defaultLightValue; } }
@Override @SideOnly(Side.CLIENT) public ItemStack getTabIconItem() { ItemStack stack = new ItemStack(ModItems.pickaxe); NBTTagCompound tag = new NBTTagCompound(); tag.setString(IHeadTool.HEAD_TAG, "iron"); tag.setString(IHaftTool.HAFT_TAG, "wood"); tag.setString(IHandleTool.HANDLE_TAG, "leather"); tag.setString(IAdornedTool.ADORNMENT_TAG, "diamond"); stack.setTagCompound(tag); return stack; }
@SideOnly(Side.CLIENT) public void setupJei() { for(IfEntry entr : entries) { for(IIfPage p : entr.getPages()) { if(p instanceof IfPageCrafting) { for(Supplied<CraftingControl> sup : ((IfPageCrafting) p).getCrafts()) sup.supply(); } } } }
@SideOnly(Side.CLIENT) public EntityFishHook(World worldIn, double x, double y, double z, EntityPlayer anglerIn) { this(worldIn); this.setPosition(x, y, z); this.ignoreFrustumCheck = true; this.angler = anglerIn; anglerIn.fishEntity = this; }
@Override @SideOnly(Side.CLIENT) @SuppressWarnings("incomplete-switch") public void randomDisplayTick(IBlockState stateIn, World worldIn, BlockPos pos, Random rand) { if (stateIn.getValue(BURNING)) { EnumFacing enumfacing = stateIn.getValue(FACING); double d0 = pos.getX() + 0.5D; double d1 = pos.getY() + rand.nextDouble() * 6.0D / 16.0D; double d2 = pos.getZ() + 0.5D; double d3 = 0.52D; double d4 = rand.nextDouble() * 0.6D - 0.3D; if (rand.nextDouble() < 0.1D) worldIn.playSound(pos.getX() + 0.5D, pos.getY(), pos.getZ() + 0.5D, SoundEvents.BLOCK_FURNACE_FIRE_CRACKLE, SoundCategory.BLOCKS, 1.0F, 1.0F, false); switch (enumfacing) { case WEST: worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 - 0.52D, d1, d2 + d4, 0.0D, 0.0D, 0.0D, new int[0]); worldIn.spawnParticle(EnumParticleTypes.FLAME, d0 - 0.52D, d1, d2 + d4, 0.0D, 0.0D, 0.0D, new int[0]); break; case EAST: worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 + 0.52D, d1, d2 + d4, 0.0D, 0.0D, 0.0D, new int[0]); worldIn.spawnParticle(EnumParticleTypes.FLAME, d0 + 0.52D, d1, d2 + d4, 0.0D, 0.0D, 0.0D, new int[0]); break; case NORTH: worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 + d4, d1, d2 - 0.52D, 0.0D, 0.0D, 0.0D, new int[0]); worldIn.spawnParticle(EnumParticleTypes.FLAME, d0 + d4, d1, d2 - 0.52D, 0.0D, 0.0D, 0.0D, new int[0]); break; case SOUTH: worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 + d4, d1, d2 + 0.52D, 0.0D, 0.0D, 0.0D, new int[0]); worldIn.spawnParticle(EnumParticleTypes.FLAME, d0 + d4, d1, d2 + 0.52D, 0.0D, 0.0D, 0.0D, new int[0]); } } }
@SideOnly(Side.CLIENT) @Override public void getSubBlocks(CreativeTabs tab, NonNullList<ItemStack> list) { for (int i = 0; i < 4; ++i) { list.add(new ItemStack(this, 1, i)); } }
@Override @SideOnly(Side.CLIENT) public void getSubItems(Item item, CreativeTabs tab, NonNullList<ItemStack> subItems) { //if (isInCreativeTab(tab)) { for (int i = 0; i < 6; i++) { subItems.add(new ItemStack(item, 1, i)); } //} }
@SubscribeEvent @SideOnly(Side.CLIENT) public void onFovModifier(EntityViewRenderEvent.FOVModifier event) { if (event.getEntity() instanceof EntityLivingBase) { EntityLivingBase living = (EntityLivingBase)event.getEntity(); if (living.getActivePotionEffect(Thermionics.POTION_EFFORTLESS_SPEED)!=null) { event.setFOV( Minecraft.getMinecraft().gameSettings.fovSetting ); } } }
/** * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) */ @SideOnly(Side.CLIENT) public void getSubBlocks(Item itemIn, CreativeTabs tab, List<ItemStack> list) { for (BlockDoublePlant.EnumPlantType blockdoubleplant$enumplanttype : BlockDoublePlant.EnumPlantType.values()) { list.add(new ItemStack(itemIn, 1, blockdoubleplant$enumplanttype.getMeta())); } }
/** * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) */ @SideOnly(Side.CLIENT) public void getSubBlocks(Item itemIn, CreativeTabs tab, List<ItemStack> list) { for (int i = 0; i < 16; ++i) { list.add(new ItemStack(itemIn, 1, i)); } }
@SideOnly(Side.CLIENT) @Override public void getSubBlocks(CreativeTabs tab, NonNullList<ItemStack> list) { for (int i = 0; i < EnumRockClass.values().length; ++i) { list.add(new ItemStack(this, 1, i)); } }
@SideOnly(Side.CLIENT) public void spookyScarySkeletons() { IBakedModel pumpkin = Minecraft.getMinecraft().getBlockRendererDispatcher().getModelForState(Minecraft.getMinecraft().world.getTotalWorldTime() % 200 < 100 ? Blocks.LIT_PUMPKIN.getDefaultState() : Blocks.PUMPKIN.getDefaultState()); GlStateManager.rotate(90, 0, -1, 0); GlStateManager.translate(0.08, 0.485, -0.1); GlStateManager.scale(2 / 16D, 3 / 16D, 2 / 16D); Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelRenderer().renderModelBrightnessColor(pumpkin, 0.5f, 255, 255, 255); GlStateManager.translate(-0.08 * 28, 0, 0); Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelRenderer().renderModelBrightnessColor(pumpkin, 0.5f, 255, 255, 255); }
@Override @SideOnly(Side.CLIENT) public void randomDisplayTick(IBlockState stateIn, World worldIn, BlockPos pos, Random rand) { if (rand.nextInt(2) == 0) { ParticleEngine.addParticle(new ParticleCrystal(pos.getX() + rand.nextFloat(), pos.getY() + 1.5f, pos.getZ() + rand.nextFloat(), SipUtils.getSipInBlock(worldIn, pos), 100)); } }
@SideOnly(Side.CLIENT) @SubscribeEvent public void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent eventArgs) { // TF2weapons.syncConfig(); if (eventArgs.getModID().equals("rafradek_spin")) { syncConfig(); } }
@SideOnly(Side.CLIENT) private void suppressSwitchAnimation() { Minecraft mc = Minecraft.getMinecraft(); ItemRenderer renderer = mc.entityRenderer.itemRenderer; renderer.updateEquippedItem(); renderer.equippedProgressMainHand = 1; renderer.prevEquippedProgressMainHand = 1; }
@SideOnly(Side.CLIENT) @Override public void addInformation(ItemStack itemStack, World player, List<String> list, ITooltipFlag whatIsThis) { super.addInformation(itemStack, player, list, whatIsThis); if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT)) { list.add(TextFormatting.WHITE + "This machine cleans air"); list.add(TextFormatting.WHITE + "using power and coal or charcoal"); list.add(TextFormatting.WHITE + "Works best in closed area!"); } else { list.add(TextFormatting.WHITE + NeedToBreathe.SHIFT_MESSAGE); } }
/** * Updates the velocity of the entity to a new value. */ @SideOnly(Side.CLIENT) public void setVelocity(double x, double y, double z) { this.motionX = x; this.motionY = y; this.motionZ = z; this.clientMotionX = this.motionX; this.clientMotionY = this.motionY; this.clientMotionZ = this.motionZ; }
/** * Set the position and rotation values directly without any clamping. */ @SideOnly(Side.CLIENT) public void setPositionAndRotationDirect(double x, double y, double z, float yaw, float pitch, int posRotationIncrements, boolean teleport) { this.boatPitch = x; this.lerpY = y; this.lerpZ = z; this.boatYaw = (double)yaw; this.lerpXRot = (double)pitch; this.lerpSteps = 10; }
@SideOnly(Side.CLIENT) @Override public void getSubBlocks(CreativeTabs tab, NonNullList<ItemStack> list) { for (int i = 0; i < EnumDirtClass.values().length; ++i) { list.add(new ItemStack(this, 1, i)); } }
@SideOnly(Side.CLIENT) @Override public void registerModel() { Block block = Block.getBlockFromItem(this); //noinspection ConstantConditions ModelHandler.registerModel(this, 0, ResourceLibrary.getModel(block.getRegistryName().getResourcePath() + '_', "")); }
@SideOnly(Side.CLIENT) public void tessellatePart(Tessellator tessellator, String partName) { for (GroupObject groupObject : groupObjects) { if (partName.equalsIgnoreCase(groupObject.name)) { groupObject.render(tessellator.getBuffer()); } } }
@SideOnly(Side.CLIENT) public int getCombinedLight(BlockPos pos, int lightValue) { int i = this.getLightForExt(EnumSkyBlock.SKY, pos); int j = this.getLightForExt(EnumSkyBlock.BLOCK, pos); if (j < lightValue) { j = lightValue; } return i << 20 | j << 4; }
@Override @SideOnly(Side.CLIENT) public IMessage onMessage(RandoresDefineByDataRequest message, MessageContext ctx) { Minecraft.getMinecraft().addScheduledTask(() -> { Randores.debug("Received define-by-data request from server: " + message.getDefinition().getName()); World world = Minecraft.getMinecraft().world; RandoresWorldData data = RandoresWorldData.getSimply(world); data.getCache().add(message.getDefinition()); data.markDirty(); }); return null; }
@Override @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack, World world, List<String> infoList, ITooltipFlag par4) { if (PneumaticCraftRepressurized.proxy.isSneakingInGui()) { infoList.add(I18n.format("gui.tooltip.item.upgrade.usedIn")); PneumaticRegistry.getInstance().getItemRegistry().addTooltip(this, infoList); } else { infoList.add(I18n.format("gui.tooltip.item.upgrade.shiftMessage")); } super.addInformation(stack, world, infoList, par4); }
@SideOnly(Side.CLIENT) public ItemStack getTabIconItem() { return new ItemStack(ItemWrench.wrench); }
@SideOnly(Side.CLIENT) public float getTailRotation() { return this.isAngry() ? 1.5393804F : (this.isTamed() ? (0.55F - (this.getMaxHealth() - ((Float)this.dataManager.get(DATA_HEALTH_ID)).floatValue()) * 0.02F) * (float)Math.PI : ((float)Math.PI / 5F)); }
@Override @SideOnly(Side.CLIENT) public ItemStack getTabIconItem() { return getIconItemStack(); }