relight
This commit is contained in:
1 parent
ac9fcd9ece
commit
d9aa6f15ad
4 files changed
+65
No files matched your search
@@ -5,6 +5,7 @@ import carpet.fakes.ChunkTicketManagerInterface;
|
||||
import carpet.fakes.MinecraftServerInterface;
|
||||
import carpet.fakes.BiomeArrayInterface;
|
||||
import carpet.fakes.ServerChunkManagerInterface;
|
||||
import carpet.fakes.ServerLightingProviderInterface;
|
||||
import carpet.fakes.StatTypeInterface;
|
||||
import carpet.fakes.ThreadedAnvilChunkStorageInterface;
|
||||
import carpet.helpers.FeatureGenerator;
|
||||
@@ -2948,6 +2949,16 @@ public class CarpetExpression
|
||||
return (cc, tt) -> ret;
|
||||
});
|
||||
|
||||
this.expr.addLazyFunction("relight", -1, (c, t, lv) ->
|
||||
{
|
||||
CarpetContext cc = (CarpetContext) c;
|
||||
BlockArgument locator = BlockArgument.findIn(cc, lv, 0);
|
||||
BlockPos pos = locator.block.getPos();
|
||||
ServerWorld world = cc.s.getWorld();
|
||||
((ServerLightingProviderInterface)world.getChunkManager().getLightingProvider()).resetLight(new ChunkPos(pos)); //light(world.getChunk(pos), false);
|
||||
return LazyValue.TRUE;
|
||||
});
|
||||
|
||||
this.expr.addLazyFunction("current_dimension", 0, (c, t, lv) -> {
|
||||
ServerCommandSource s = ((CarpetContext)c).s;
|
||||
Value retval = new StringValue(NBTSerializableValue.nameFromRegistryId(Registry.DIMENSION_TYPE.getId(s.getWorld().dimension.getType())));
|
||||
|
||||
Reference in new issue
Block a user