本文整理了Java中net.minecraft.world.World.checkLightFor()
方法的一些代码示例,展示了World.checkLightFor()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。World.checkLightFor()
方法的具体详情如下:
包路径:net.minecraft.world.World
类名称:World
方法名:checkLightFor
暂无
代码示例来源:origin: SleepyTrousers/EnderIO
@Override
public boolean checkLightFor(@Nonnull EnumSkyBlock lightType, @Nonnull BlockPos pos) {
return wrapped.checkLightFor(lightType, pos);
}
代码示例来源:origin: amadornes/MCMultiPart
@Override
public boolean checkLightFor(EnumSkyBlock lightType, BlockPos pos) {
return getActualWorld().checkLightFor(lightType, pos);
}
代码示例来源:origin: SleepyTrousers/EnderIO
@Override
public void doUpdate() {
super.doUpdate();
if (isActive() != wasActive) {
wasActive = isActive();
world.checkLightFor(EnumSkyBlock.BLOCK, pos);
}
}
代码示例来源:origin: Esteemed-Innovation/Esteemed-Innovation
@Override
public void safeUpdate() {
if (timer > maximumTicks) {
timer = 0;
}
// FIXME: This might be bad for performance. Test.
world.checkLightFor(EnumSkyBlock.BLOCK, pos);
world.notifyNeighborsOfStateChange(pos, world.getBlockState(pos).getBlock(), true);
timer++;
}
代码示例来源:origin: TheGreyGhost/MinecraftByExample
@Override
public void update()
{
// For some reason, the colour and lighting don't always automatically update just in response to the
// worldIn.markBlockForUpdate(pos); on the server in onNeighborBlockChange().
// So force the block to re-render when we detect a colour change, otherwise the change in
// state will not always be visible. Likewise, we need to force a lighting recalculation.
// The block update (for renderer) is only required on client side, but the lighting is required on both, since
// the client needs it for rendering and the server needs it for crop growth etc
int currentRGBcolour = getRGBcolour();
if (previousRGBcolor != currentRGBcolour) {
previousRGBcolor = currentRGBcolour;
if (world.isRemote) {
IBlockState iblockstate = this.world.getBlockState(pos);
final int FLAGS = 3; // I'm not sure what these flags do, exactly.
this.world.notifyBlockUpdate(pos, iblockstate, iblockstate, FLAGS);
}
world.checkLightFor(EnumSkyBlock.BLOCK, pos);
}
}
代码示例来源:origin: vadis365/TheErebus
@SideOnly(Side.CLIENT)
private void switchOff() {
getEntityWorld().checkLightFor(EnumSkyBlock.BLOCK, new BlockPos(lastX, lastY, lastZ));
getEntityWorld().checkLightFor(EnumSkyBlock.BLOCK, new BlockPos(MathHelper.floor(posX), MathHelper.floor(posY), MathHelper.floor(posZ)));
}
代码示例来源:origin: vadis365/TheErebus
@SideOnly(Side.CLIENT)
private void switchOff() {
if (!ConfigHandler.INSTANCE.bioluminescence)
return;
if(triggerOnce) {
getEntityWorld().checkLightFor(EnumSkyBlock.BLOCK, new BlockPos(lastX, lastY, lastZ));
getEntityWorld().checkLightFor(EnumSkyBlock.BLOCK, new BlockPos(MathHelper.floor(posX), MathHelper.floor(posY), MathHelper.floor(posZ)));
triggerOnce = false;
}
}
代码示例来源:origin: CoFH/CoFHCore
protected void updateLighting() {
int light2 = world.getLightFor(EnumSkyBlock.BLOCK, pos), light1 = getLightValue();
if (light1 != light2 && world.checkLightFor(EnumSkyBlock.BLOCK, pos)) {
IBlockState state = world.getBlockState(pos);
world.notifyBlockUpdate(pos, state, state, 3);
}
}
代码示例来源:origin: SleepyTrousers/EnderIO
@Override
public void updateEntity(@Nonnull World world) {
if (ConduitConfig.dynamicLighting.get()) {
int lightValue = getLightValue();
if (lastLightValue != lightValue) {
BlockPos pos = getBundle().getLocation();
getBundle().getBundleworld().checkLightFor(EnumSkyBlock.BLOCK, pos);
lastLightValue = lightValue;
}
}
super.updateEntity(world);
}
代码示例来源:origin: SleepyTrousers/EnderIO
public void updateLight() {
final FluidStack fluid = tank.getFluid();
int thisFluidLuminosity = fluid == null || fluid.getFluid() == null || tank.isEmpty() ? 0 : fluid.getFluid().getLuminosity(fluid);
if (thisFluidLuminosity != lastFluidLuminosity) {
if (world.checkLightFor(EnumSkyBlock.BLOCK, getPos())) {
updateBlock();
}
lastFluidLuminosity = thisFluidLuminosity;
}
}
代码示例来源:origin: TheGreyGhost/MinecraftByExample
world.notifyBlockUpdate(pos, iblockstate, iblockstate, FLAGS);
world.checkLightFor(EnumSkyBlock.BLOCK, pos);
代码示例来源:origin: vadis365/TheErebus
@SideOnly(Side.CLIENT)
private void lightUp(World world, BlockPos pos) {
world.setLightFor(EnumSkyBlock.BLOCK, pos, 9);
for (int i = -2; i < 2; i++)
for (int j = -2; j < 2; j++)
for (int k = -2; k < 2; k++)
if (pos.getX() + i != lastX || pos.getY() + j != lastY || pos.getZ() + k != lastZ || isDead) {
world.checkLightFor(EnumSkyBlock.BLOCK, new BlockPos(lastX + i, lastY + j, lastZ + k));
lastX = pos.getX();
lastY = pos.getY();
lastZ = pos.getZ();
}
}
代码示例来源:origin: vadis365/TheErebus
@SideOnly(Side.CLIENT)
private void lightUp(World world, BlockPos pos) {
if (!ConfigHandler.INSTANCE.bioluminescence)
return;
world.setLightFor(EnumSkyBlock.BLOCK, pos, 9);
for (int i = -2; i < 2; i++)
for (int j = -2; j < 2; j++)
for (int k = -2; k < 2; k++)
if (pos.getX() + i != lastX || pos.getY() + j != lastY || pos.getZ() + k != lastZ || isDead) {
world.checkLightFor(EnumSkyBlock.BLOCK, new BlockPos(lastX + i, lastY + j, lastZ + k));
lastX = pos.getX();
lastY = pos.getY();
lastZ = pos.getZ();
}
triggerOnce = true;
}
代码示例来源:origin: ForestryMC/ForestryMC
updatedLight = world.checkLightFor(EnumSkyBlock.BLOCK, getPos());
代码示例来源:origin: SleepyTrousers/EnderIO
world.setBlockState(ln, bs, 2);
world.notifyBlockUpdate(ln, bs, bs, 3);
world.checkLightFor(EnumSkyBlock.BLOCK, ln);
world.checkLightFor(EnumSkyBlock.BLOCK, pos);
init = false;
lastActive = isActivated;
内容来源于网络,如有侵权,请联系作者删除!