This commit is contained in:
gnembon committed 2020-06-12 00:24:46 -03:00
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())));