From ebbf304c946d96c0166ecc69fe4f2c4c0d12d762 Mon Sep 17 00:00:00 2001 From: TomTheFurry <46843632+TomTheFurry@users.noreply.github.com> Date: Mon, 14 Mar 2022 15:10:20 +0800 Subject: [PATCH] Updated core --- .../lod/common/wrappers/chunk/ChunkWrapper.java | 17 +++++++++++++++++ core | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/common/src/main/java/com/seibel/lod/common/wrappers/chunk/ChunkWrapper.java b/common/src/main/java/com/seibel/lod/common/wrappers/chunk/ChunkWrapper.java index a7359bc08..89344bb12 100644 --- a/common/src/main/java/com/seibel/lod/common/wrappers/chunk/ChunkWrapper.java +++ b/common/src/main/java/com/seibel/lod/common/wrappers/chunk/ChunkWrapper.java @@ -1,5 +1,6 @@ package com.seibel.lod.common.wrappers.chunk; +import com.seibel.lod.core.enums.LodDirection; import com.seibel.lod.core.util.LevelPosUtil; import com.seibel.lod.core.util.LodUtil; import com.seibel.lod.core.wrapperInterfaces.chunk.IChunkWrapper; @@ -83,6 +84,22 @@ public class ChunkWrapper implements IChunkWrapper return blockDetail == BlockDetailWrapper.NULL_BLOCK_DETAIL ? null : blockDetail; } + @Override + public BlockDetailWrapper getBlockDetailAtFace(int x, int y, int z, LodDirection dir) { + int fy = y+dir.getNormal().y; + if (fy < getMinBuildHeight() || fy > getMaxBuildHeight()) return null; + BlockPos pos = new BlockPos(x+dir.getNormal().x,fy,z+dir.getNormal().z); + BlockState blockState; + if (blockPosInsideChunk(x,y,z)) + blockState = chunk.getBlockState(pos); + else { + blockState = lightSource.getBlockState(pos); + } + if (blockState == null || blockState.isAir()) return null; + BlockDetailWrapper blockDetail = BlockDetailMap.getOrMakeBlockDetailCache(blockState, pos, lightSource); + return blockDetail == BlockDetailWrapper.NULL_BLOCK_DETAIL ? null : blockDetail; + } + public ChunkAccess getChunk() { return chunk; } diff --git a/core b/core index fbd8f4843..7da2b9061 160000 --- a/core +++ b/core @@ -1 +1 @@ -Subproject commit fbd8f48433749607b38789b597f7a7c12425faff +Subproject commit 7da2b90611790b680dbe271ea66e608b84d9229b