net.minecraft.world.World.checkLight()方法的使用及代码示例

x33g5p2x  于2022-02-02 转载在 其他  
字(6.5k)|赞(0)|评价(0)|浏览(122)

本文整理了Java中net.minecraft.world.World.checkLight()方法的一些代码示例,展示了World.checkLight()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。World.checkLight()方法的具体详情如下:
包路径:net.minecraft.world.World
类名称:World
方法名:checkLight

World.checkLight介绍

暂无

代码示例

代码示例来源:origin: EngineHub/WorldEdit

  1. newState = old;
  2. world.checkLight(pos);
  3. world.markAndNotifyBlock(pos, chunk, old, newState, UPDATE | NOTIFY);

代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2

  1. @Override
  2. public void markForUpdate()
  3. {
  4. super.markForUpdate();
  5. final boolean hasLight = this.getLightValue() > 0;
  6. if( hasLight != this.didHaveLight )
  7. {
  8. this.didHaveLight = hasLight;
  9. this.world.checkLight( this.pos );
  10. // world.updateAllLightTypes( xCoord, yCoord, zCoord );
  11. }
  12. }

代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2

  1. @Override
  2. public void markForUpdate()
  3. {
  4. if( this.world == null )
  5. {
  6. return;
  7. }
  8. final int newLV = this.getCableBus().getLightValue();
  9. if( newLV != this.oldLV )
  10. {
  11. this.oldLV = newLV;
  12. this.world.checkLight( this.pos );
  13. }
  14. super.markForUpdate();
  15. }

代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2

  1. @Override
  2. protected boolean readFromStream( final ByteBuf data ) throws IOException
  3. {
  4. final boolean c = super.readFromStream( data );
  5. boolean ret = this.getCableBus().readFromStream( data );
  6. final int newLV = this.getCableBus().getLightValue();
  7. if( newLV != this.oldLV )
  8. {
  9. this.oldLV = newLV;
  10. this.world.checkLight( this.pos );
  11. ret = true;
  12. }
  13. this.updateTileSetting();
  14. return ret || c;
  15. }

代码示例来源:origin: TheCBProject/EnderStorage

  1. @Override
  2. public void onLiquidChanged() {
  3. world.checkLight(pos);
  4. }
  5. }

代码示例来源:origin: SleepyTrousers/EnderIO

  1. @Override
  2. public boolean checkLight(@Nonnull BlockPos pos) {
  3. return wrapped.checkLight(pos);
  4. }

代码示例来源:origin: Vazkii/Botania

  1. world.checkLight(pos);
  2. tile.setWater(false);
  3. world.updateComparatorOutputLevel(pos, this);
  4. world.checkLight(pos);
  5. else tile.setWater(false);
  6. world.updateComparatorOutputLevel(pos, this);
  7. world.checkLight(pos);

代码示例来源:origin: amadornes/MCMultiPart

  1. @Override
  2. public boolean checkLight(BlockPos pos) {
  3. return getActualWorld().checkLight(pos);
  4. }

代码示例来源:origin: CoFH/CoFHCore

  1. @Override
  2. @SideOnly (Side.CLIENT)
  3. public void handleTilePacket(PacketBase payload) {
  4. customName = payload.getString();
  5. world.checkLight(pos);
  6. }

代码示例来源:origin: GregTechCE/GregTech

  1. private void updateLightValue() {
  2. int newLightValue = getLightValue();
  3. if(oldLightValue != newLightValue) {
  4. MetaTileEntityTank.this.oldLightValue = newLightValue;
  5. getWorld().checkLight(getPos());
  6. }
  7. }

代码示例来源:origin: CyclopsMC/IntegratedDynamics

  1. @Override
  2. public void onUpdateReceived() {
  3. if(!lightLevels.equals(previousLightLevels)) {
  4. previousLightLevels = lightLevels;
  5. getWorld().checkLight(getPos());
  6. }
  7. cachedState = null;
  8. }

代码示例来源:origin: WayofTime/BloodMagic

  1. @Override
  2. public boolean onBlockActivated(World world, BlockPos blockPos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) {
  3. boolean success = FluidUtil.interactWithFluidHandler(player, hand, world, blockPos, side);
  4. if (success) {
  5. world.checkLight(blockPos);
  6. world.updateComparatorOutputLevel(blockPos, this);
  7. world.markAndNotifyBlock(blockPos, world.getChunkFromBlockCoords(blockPos), state, state, 3);
  8. return true;
  9. }
  10. return true;
  11. }

代码示例来源:origin: TeamWizardry/Wizardry

  1. @Override
  2. public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) {
  3. if (ItemNBTHelper.getBoolean(stack, Constants.NBT.FAIRY_INSIDE, false)) {
  4. TileEntity entity = worldIn.getTileEntity(pos);
  5. if (entity != null && entity instanceof TileJar) {
  6. TileJar jar = (TileJar) entity;
  7. jar.color = new Color(ItemNBTHelper.getInt(stack, Constants.NBT.FAIRY_COLOR, 0xFFFFFF));
  8. jar.age = ItemNBTHelper.getInt(stack, Constants.NBT.FAIRY_AGE, 0);
  9. jar.hasFairy = true;
  10. jar.markDirty();
  11. worldIn.checkLight(pos);
  12. }
  13. }
  14. }

代码示例来源:origin: AlgorithmX2/Chisels-and-Bits

  1. @Override
  2. public void breakBlock(
  3. final World worldIn,
  4. final BlockPos pos,
  5. final IBlockState state )
  6. {
  7. try
  8. {
  9. final TileEntityBlockChiseled tebc = getTileEntity( worldIn, pos );
  10. tebc.setNormalCube( false );
  11. worldIn.checkLight( pos );
  12. }
  13. catch ( final ExceptionNoTileEntity e )
  14. {
  15. }
  16. finally
  17. {
  18. super.breakBlock( worldIn, pos, state );
  19. }
  20. }

代码示例来源:origin: GregTechCE/GregTech

  1. @Override
  2. public void update() {
  3. if(metaTileEntity != null) {
  4. metaTileEntity.update();
  5. }
  6. if(this.needToUpdateLightning) {
  7. getWorld().checkLight(getPos());
  8. this.needToUpdateLightning = false;
  9. }
  10. //increment only after current tick, so meta tile entities will get first tick as timer == 0
  11. //and update their settings which depend on getTimer() % N properly
  12. super.update();
  13. }

代码示例来源:origin: AlgorithmX2/Chisels-and-Bits

  1. @Override
  2. public void onDataPacket(
  3. final NetworkManager net,
  4. final SPacketUpdateTileEntity pkt )
  5. {
  6. final int oldLight = lightlevel;
  7. final boolean changed = readChisleData( pkt.getNbtCompound() );
  8. if ( worldObj != null && changed )
  9. {
  10. worldObj.markBlockRangeForRenderUpdate( pos, pos );
  11. triggerDynamicUpdates();
  12. // fixes lighting on placement when tile packet arrives.
  13. if ( oldLight != lightlevel )
  14. {
  15. worldObj.checkLight( pos );
  16. }
  17. }
  18. }

代码示例来源:origin: AlgorithmX2/Chisels-and-Bits

  1. private void saveAndUpdate()
  2. {
  3. markDirty();
  4. ModUtil.sendUpdate( worldObj, getPos() );
  5. final int lv = getLightValue();
  6. if ( oldLV != lv )
  7. {
  8. getWorld().checkLight( getPos() );
  9. oldLV = lv;
  10. }
  11. }

代码示例来源:origin: ForestryMC/ForestryMC

  1. @Override
  2. public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) {
  3. TileCandle tileCandle = TileUtil.getTile(world, pos, TileCandle.class);
  4. if (tileCandle != null) {
  5. int colour = getColourValueFromItemStack(stack);
  6. boolean isLit = isLit(stack);
  7. tileCandle.setColour(colour);
  8. tileCandle.setLit(isLit);
  9. if (tileCandle.isLit()) {
  10. world.profiler.startSection("checkLight");
  11. world.checkLight(pos);
  12. world.profiler.endSection();
  13. }
  14. }
  15. }

代码示例来源:origin: WayofTime/BloodMagic

  1. @Override
  2. public void onBlockPlacedBy(World world, BlockPos pos, IBlockState blockState, EntityLivingBase placer, ItemStack stack) {
  3. TileEntity tile = world.getTileEntity(pos);
  4. if (tile instanceof TileBloodTank) {
  5. TileBloodTank bloodTank = (TileBloodTank) tile;
  6. NBTTagCompound tag = stack.getTagCompound();
  7. if (stack.hasTagCompound() && stack.getTagCompound().hasKey("Fluid")) {
  8. FluidStack fluidStack = FluidStack.loadFluidStackFromNBT(tag.getCompoundTag("Fluid"));
  9. bloodTank.getTank().setFluid(fluidStack);
  10. }
  11. }
  12. world.checkLight(pos);
  13. world.updateComparatorOutputLevel(pos, this);
  14. world.markAndNotifyBlock(pos, world.getChunkFromBlockCoords(pos), blockState, blockState, 3);
  15. }

代码示例来源:origin: RS485/LogisticsPipes

  1. @Override
  2. protected void updateWorldState() {
  3. //super.updateWorldState();
  4. LPTickHandler.getWorldInfo(getWorld()).setSkipBlockUpdateForWorld(true);
  5. IBlockState prevSt = this.getWorld().getBlockState(this.getPos());
  6. IBlockState st = this.getWorld().getBlockState(this.getPos());
  7. this.getWorld().markAndNotifyBlock(this.getPos(), (Chunk)null, prevSt, st, 1);
  8. this.getWorld().checkLight(this.getPos());
  9. LPTickHandler.getWorldInfo(getWorld()).setSkipBlockUpdateForWorld(true);
  10. }

相关文章

World类方法