@Override public int getBlockLightLevel(BlockVector3 pt) { return getWorld().getBlockAt(pt.getBlockX(), pt.getBlockY(), pt.getBlockZ()).getLightLevel(); }
break; case GRASS: canPlaceShroom = (block.getLightLevel() < 13); break; case DIRT: if (data instanceof Dirt) { canPlaceShroom = (((Dirt) data).getType() == DirtType.PODZOL || block.getLightLevel() < 13); } else { canPlaceShroom = false;
if (block.getType() == Material.DIRT && !blockAbove.getType().isOccluding() && blockAbove.getLightLevel() > 0) { block.setType(mycelBiome ? Material.MYCEL : Material.GRASS);
@Override public int getLightLevel(int x, int y, int z) { if(world != null) { if ((y >= 0) && (y < this.worldheight)) { return world.getBlockAt(x, y, z).getLightLevel(); } return 0; } else { return -1; } } /* Get highest Y coord of given location */
@Override public int getLightLevel() { return b.getLightLevel(); }
@Override public byte getLightLevel() { return base.getLightLevel(); }
@Override protected int getLightLevel(Chunk chunk, int x, int y, int z) { return chunk.getBlock(x, y, z).getLightLevel(); }
protected BlockLight(Location location, long ticks) { this.block = location.getBlock(); this.chunk = location.getChunk(); this.originalLight = block.getLightLevel(); this.currentLight = originalLight; this.cachedLight = originalLight; this.removeLater(ticks); }
@Override public void progress() { if (!this.bPlayer.canBendIgnoreBindsCooldowns(this) || this.player.getLocation().getBlock().getLightLevel() > this.lightThreshold) { this.remove(); return; } else { this.tryToSetGlowBlock(); } }
@Override public ScriptReference get(String name) { if (name.equalsIgnoreCase("pos")) { return wrap(object.getLocation()); } else if (name.equalsIgnoreCase("type")) { return ScriptValue.of(object.getType()); } else if (name.equalsIgnoreCase("data")) { return ScriptValue.of(object.getBlockData()); } else if (name.equalsIgnoreCase("temperature")) { return ScriptValue.of(object.getTemperature()); } else if (name.equalsIgnoreCase("light")) { return ScriptValue.of(object.getLightLevel()); } else if (name.equalsIgnoreCase("blocklight")) { return ScriptValue.of(object.getLightFromBlocks()); } else if (name.equalsIgnoreCase("skylight")) { return ScriptValue.of(object.getLightFromSky()); } else if (name.equalsIgnoreCase("redstone")) { return ScriptValue.of(object.getBlockPower()); } return null; }
public Illumination(final Player player) { super(player); this.range = this.getDayFactor(getConfig().getDouble("Abilities.Fire.Illumination.Range")); this.cooldown = getConfig().getLong("Abilities.Fire.Illumination.Cooldown"); this.lightThreshold = getConfig().getInt("Abilities.Fire.Illumination.LightThreshold"); final Illumination oldIllumination = getAbility(player, Illumination.class); if (oldIllumination != null) { oldIllumination.remove(); return; } if (this.bPlayer.isOnCooldown(this)) { return; } if (player.getLocation().getBlock().getLightLevel() < this.lightThreshold) { this.oldLevel = player.getLocation().getBlock().getLightLevel(); this.bPlayer.addCooldown(this); this.set(); this.start(); } }
public Tremorsense(final Player player, final boolean clicked) { super(player); if (!this.bPlayer.canBendIgnoreBinds(this)) { return; } this.setFields(); final byte lightLevel = player.getLocation().getBlock().getLightLevel(); if (lightLevel < this.lightThreshold && this.isEarthbendable(player.getLocation().getBlock().getRelative(BlockFace.DOWN))) { if (clicked) { this.bPlayer.addCooldown(this); this.activate(); } this.start(); } }
public BlockState newInstance(Block block, Object tileEntity) { final BlockState state = (BlockState) STATE.newInstanceNull(); final int typeId = MaterialUtil.getTypeId(block); tileField.set(state, tileEntity); world.set(state, block.getWorld()); secondWorld.set(state, block.getWorld()); chunk.set(state, block.getChunk()); type.set(state, typeId); light.set(state, block.getLightLevel()); x.set(state, block.getX()); y.set(state, block.getY()); z.set(state, block.getZ()); data.set(state, BlockUtil.getData(typeId, MaterialUtil.getRawData(block))); this.apply(state, tileEntity); return state; } }