Merge branch 'master' into 1.15

This commit is contained in:
gnembon committed 2019-11-07 01:11:51 -04:00
commit 947e53d770
8 files changed
+111 -38

No files matched your search

@@ -78,6 +78,7 @@ import net.minecraft.world.LightType;
import net.minecraft.world.World;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.chunk.Chunk;
import net.minecraft.world.chunk.ChunkStatus;
import net.minecraft.world.chunk.WorldChunk;
import net.minecraft.world.dimension.DimensionType;
import net.minecraft.loot.context.LootContext;
@@ -805,6 +806,14 @@ public class CarpetExpression
return (c_, t_) -> retval;
});
this.expr.addLazyFunction("generation_status", -1, (c, t, lv) ->
{
BlockPos pos = BlockValue.fromParams((CarpetContext)c, lv, 0).block.getPos();
Chunk chunk = ((CarpetContext)c).s.getWorld().getChunk(pos.getX()>>4, pos.getZ()>>4, ChunkStatus.EMPTY);
Value retval = new StringValue(chunk.getStatus().getName());
return (c_, t_) -> retval;
});
this.expr.addLazyFunction("suffocates", -1, (c, t, lv) ->
genericStateTest(c, "suffocates", lv, (s, p, w) -> new NumericValue(s.canSuffocate(w, p))));