use of micdoodle8.mods.galacticraft.core.blocks.BlockBasicMoon.EnumBlockBasicMoon in project Galacticraft by micdoodle8.
the class BlockBasicMoon method breakBlock.
@Override
public void breakBlock(World worldIn, BlockPos pos, IBlockState state) {
super.breakBlock(worldIn, pos, state);
EnumBlockBasicMoon type = ((EnumBlockBasicMoon) state.getValue(BASIC_TYPE_MOON));
if (!worldIn.isRemote && type == EnumBlockBasicMoon.MOON_TURF) {
Map<Long, List<Footprint>> footprintChunkMap = TickHandlerServer.serverFootprintMap.get(GCCoreUtil.getDimensionID(worldIn));
if (footprintChunkMap != null) {
long chunkKey = ChunkCoordIntPair.chunkXZ2Int(pos.getX() >> 4, pos.getZ() >> 4);
List<Footprint> footprintList = footprintChunkMap.get(chunkKey);
if (footprintList != null && !footprintList.isEmpty()) {
List<Footprint> toRemove = new ArrayList<Footprint>();
for (Footprint footprint : footprintList) {
if (footprint.position.x > pos.getX() && footprint.position.x < pos.getX() + 1 && footprint.position.z > pos.getZ() && footprint.position.z < pos.getZ() + 1) {
toRemove.add(footprint);
}
}
if (!toRemove.isEmpty()) {
footprintList.removeAll(toRemove);
}
}
}
TickHandlerServer.footprintBlockChanges.add(new BlockVec3Dim(pos, GCCoreUtil.getDimensionID(worldIn)));
}
}
Aggregations