porting - finish compiler errors

This commit is contained in:
James Seibel
2021-10-30 13:47:39 -05:00
parent ff5d2e6047
commit adcd835642
12 changed files with 37 additions and 37 deletions
@@ -93,6 +93,7 @@ public class LodBufferBuilder
*/
public static final int DEFAULT_MEMORY_ALLOCATION = 1024;
// TODO this should be moved to LodUtil
public static int skyLightPlayer = 15;
/**
@@ -29,8 +29,8 @@ import com.seibel.lod.util.ColorUtil;
import com.seibel.lod.util.DataPointUtil;
import com.seibel.lod.util.LodUtil;
import com.seibel.lod.wrappers.MinecraftWrapper;
import com.seibel.lod.wrappers.Block.BlockPosWrapper;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.core.Vec3i;
@@ -279,7 +279,7 @@ public class Box
}
/** determine which faces should be culled */
public void setUpCulling(int cullingDistance, BlockPos playerPos)
public void setUpCulling(int cullingDistance, BlockPosWrapper playerPos)
{
for (Direction direction : DIRECTIONS)
{
@@ -21,14 +21,14 @@ package com.seibel.lod.builders.bufferBuilding.lodTemplates;
import java.util.Map;
import com.mojang.blaze3d.vertex.BufferBuilder;
import com.seibel.lod.enums.DebugMode;
import com.seibel.lod.util.ColorUtil;
import com.seibel.lod.util.DataPointUtil;
import com.seibel.lod.util.LodUtil;
import com.seibel.lod.wrappers.Block.BlockPosWrapper;
import net.minecraft.client.renderer.BufferBuilder;
import net.minecraft.util.Direction;
import net.minecraft.util.math.BlockPos;
import net.minecraft.core.Direction;
/**
* Builds LODs as rectangular prisms.
@@ -44,7 +44,7 @@ public class CubicLodTemplate extends AbstractLodTemplate
}
@Override
public void addLodToBuffer(BufferBuilder buffer, BlockPos bufferCenterBlockPos, long data, Map<Direction, long[]> adjData,
public void addLodToBuffer(BufferBuilder buffer, BlockPosWrapper bufferCenterBlockPos, long data, Map<Direction, long[]> adjData,
byte detailLevel, int posX, int posZ, Box box, DebugMode debugging, boolean[] adjShadeDisabled)
{
if (box == null)
@@ -79,7 +79,7 @@ public class CubicLodTemplate extends AbstractLodTemplate
private void generateBoundingBox(Box box,
int height, int depth, int width,
double xOffset, double yOffset, double zOffset,
BlockPos bufferCenterBlockPos,
BlockPosWrapper bufferCenterBlockPos,
Map<Direction, long[]> adjData,
int color,
int skyLight,
@@ -21,12 +21,12 @@ package com.seibel.lod.builders.bufferBuilding.lodTemplates;
import java.util.Map;
import com.mojang.blaze3d.vertex.BufferBuilder;
import com.seibel.lod.enums.DebugMode;
import com.seibel.lod.proxy.ClientProxy;
import com.seibel.lod.wrappers.Block.BlockPosWrapper;
import net.minecraft.client.renderer.BufferBuilder;
import net.minecraft.util.Direction;
import net.minecraft.util.math.BlockPos;
import net.minecraft.core.Direction;
/**
* TODO DynamicLodTemplate
@@ -39,7 +39,7 @@ import net.minecraft.util.math.BlockPos;
public class DynamicLodTemplate extends AbstractLodTemplate
{
@Override
public void addLodToBuffer(BufferBuilder buffer, BlockPos bufferCenterBlockPos, long data, Map<Direction, long[]> adjData,
public void addLodToBuffer(BufferBuilder buffer, BlockPosWrapper bufferCenterBlockPos, long data, Map<Direction, long[]> adjData,
byte detailLevel, int posX, int posZ, Box box, DebugMode debugging, boolean[] adjShadeDisabled)
{
ClientProxy.LOGGER.error(DynamicLodTemplate.class.getSimpleName() + " is not implemented!");
@@ -21,12 +21,12 @@ package com.seibel.lod.builders.bufferBuilding.lodTemplates;
import java.util.Map;
import com.mojang.blaze3d.vertex.BufferBuilder;
import com.seibel.lod.enums.DebugMode;
import com.seibel.lod.proxy.ClientProxy;
import com.seibel.lod.wrappers.Block.BlockPosWrapper;
import net.minecraft.client.renderer.BufferBuilder;
import net.minecraft.util.Direction;
import net.minecraft.util.math.BlockPos;
import net.minecraft.core.Direction;
/**
* TODO #21 TriangularLodTemplate
@@ -37,7 +37,7 @@ import net.minecraft.util.math.BlockPos;
public class TriangularLodTemplate extends AbstractLodTemplate
{
@Override
public void addLodToBuffer(BufferBuilder buffer, BlockPos bufferCenterBlockPos, long data, Map<Direction, long[]> adjData,
public void addLodToBuffer(BufferBuilder buffer, BlockPosWrapper bufferCenterBlockPos, long data, Map<Direction, long[]> adjData,
byte detailLevel, int posX, int posZ, Box box, DebugMode debugging, boolean[] adjShadeDisabled)
{
ClientProxy.LOGGER.error(DynamicLodTemplate.class.getSimpleName() + " is not implemented!");
@@ -21,10 +21,9 @@ package com.seibel.lod.util;
import static com.seibel.lod.builders.bufferBuilding.LodBufferBuilder.skyLightPlayer;
import com.mojang.blaze3d.platform.NativeImage;
import com.seibel.lod.enums.DistanceGenerationMode;
import net.minecraft.client.renderer.texture.NativeImage;
/**
*
* @author Leonardo Amato
@@ -3,6 +3,7 @@ package com.seibel.lod.wrappers.Block;
import java.util.Objects;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
//This class wraps the minecraft BlockPos.Mutable (and BlockPos) class
@@ -43,6 +44,13 @@ public class BlockPosWrapper
return blockPos.getZ();
}
public int get(Direction.Axis axis)
{
return axis.choose(getX(), getY(), getZ());
}
public BlockPos.MutableBlockPos getBlockPos()
{
return blockPos;
@@ -71,7 +71,7 @@ public class BlockShapeWrapper
BlockPos blockPos = blockPosWrapper.getBlockPos();
boolean noCollisionSetted = false;
boolean nonFullSetted = false;
if (!block.defaultBlockState().getFluidState().isEmpty() || block instanceof SixWayBlock)
if (!block.defaultBlockState().getFluidState().isEmpty())// || block instanceof SixWayBlock)
{
noCollisionSetted = true;
nonFullSetted = true;
@@ -26,7 +26,7 @@ public class ChunkWrapper
BlockState blockState = chunk.getBlockState(blockPos.getBlockPos());
//This type of block is always in water
if((blockState.getBlock() instanceof LiquidBlock) && !(blockState.getBlock() instanceof IWaterLoggable))
if((blockState.getBlock() instanceof LiquidBlock))// && !(blockState.getBlock() instanceof IWaterLoggable))
return true;
//This type of block could be in water
@@ -77,9 +77,9 @@ public class ChunkWrapper
{
BlockState blockState = chunk.getBlockState(blockPos.getBlockPos());
//This type of block is always in water
if((blockState.getBlock() instanceof ILiquidContainer) && !(blockState.getBlock() instanceof IWaterLoggable))
return true;
// //This type of block is always in water
// if((blockState.getBlock() instanceof ILiquidContainer) && !(blockState.getBlock() instanceof IWaterLoggable))
// return true;
//This type of block could be in water
if(blockState.getOptionalValue(BlockStateProperties.WATERLOGGED).isPresent() && blockState.getOptionalValue(BlockStateProperties.WATERLOGGED).get())
@@ -1,15 +1,14 @@
package com.seibel.lod.wrappers;
import net.minecraft.client.renderer.texture.NativeImage;
import com.mojang.blaze3d.platform.NativeImage;
public class LigthMapWrapper
public class LightMapWrapper
{
static NativeImage lightMap = null;
public static void setLightMap(NativeImage lightMap)
public static void setLightMap(NativeImage newLightMap)
{
lightMap = lightMap;
lightMap = newLightMap;
}
public static int getLightValue(int skyLight, int blockLight)
@@ -1,16 +1,8 @@
package com.seibel.lod.wrappers.World;
import com.seibel.lod.util.LodUtil;
import com.seibel.lod.wrappers.Block.BlockPosWrapper;
import net.minecraft.block.Blocks;
import net.minecraft.block.material.MaterialColor;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.biome.BiomeColors;
import java.awt.*;
import java.util.Objects;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import net.minecraft.client.renderer.BiomeColors;
public class BiomeColorWrapper
@@ -1,5 +1,7 @@
package com.seibel.lod.wrappers.World;
import java.awt.Color;
import java.util.Objects;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
@@ -8,7 +10,6 @@ import com.seibel.lod.util.LodUtil;
import net.minecraft.world.level.biome.Biome;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.material.MaterialColor;
import net.minecraftforge.client.event.RenderTooltipEvent.Color;
//This class wraps the minecraft BlockPos.Mutable (and BlockPos) class
public class BiomeWrapper