Finish model loader debug mod

This commit is contained in:
tterrag 2019-04-13 21:30:42 -04:00
parent e482793f69
commit 01a0674490
11 changed files with 66 additions and 19 deletions

View file

@ -55,6 +55,8 @@ import net.minecraft.util.EnumHand;
import net.minecraft.util.ITickable;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.shapes.VoxelShape;
import net.minecraft.util.math.shapes.VoxelShapes;
import net.minecraft.util.text.TextComponentString;
import net.minecraft.world.IBlockReader;
import net.minecraft.world.IWorld;
@ -186,6 +188,8 @@ public class ModelLoaderRegistryTest
};
}
}
static final VoxelShape SHAPE = VoxelShapes.create(1/16D, 1/16D, 1/16D, 15/16D, 15/16D, 15/16D); // We don't really care, just not solid
public static class CustomModelBlock extends Block
{
@ -199,6 +203,12 @@ public class ModelLoaderRegistryTest
this.setDefaultState(this.getStateContainer().getBaseState().with(FACING, EnumFacing.NORTH));
setRegistryName(new ResourceLocation(MODID, name));
}
@Override
public VoxelShape getRenderShape(IBlockState state, IBlockReader worldIn, BlockPos pos)
{
return SHAPE;
}
@Override
public boolean isFullCube(IBlockState state)
@ -285,6 +295,12 @@ public class ModelLoaderRegistryTest
{
return new OBJTesseractTileEntity();
}
@Override
public VoxelShape getRenderShape(IBlockState state, IBlockReader worldIn, BlockPos pos)
{
return SHAPE;
}
@Override
public boolean isFullCube(IBlockState state)
@ -430,6 +446,12 @@ public class ModelLoaderRegistryTest
super(Properties.create(Material.IRON));
setRegistryName(new ResourceLocation(MODID, name));
}
@Override
public VoxelShape getRenderShape(IBlockState state, IBlockReader worldIn, BlockPos pos)
{
return SHAPE;
}
@Override
public boolean isFullCube(IBlockState state)
@ -475,7 +497,13 @@ public class ModelLoaderRegistryTest
{
builder.add(FACING);
}
@Override
public VoxelShape getRenderShape(IBlockState state, IBlockReader worldIn, BlockPos pos)
{
return SHAPE;
}
@Override
public boolean isFullCube(IBlockState state)
{
@ -614,6 +642,12 @@ public class ModelLoaderRegistryTest
this.setDefaultState(this.getStateContainer().getBaseState().with(FACING, EnumFacing.NORTH));
setRegistryName(new ResourceLocation(MODID, name));
}
@Override
public VoxelShape getRenderShape(IBlockState state, IBlockReader worldIn, BlockPos pos)
{
return SHAPE;
}
@Override
public boolean isFullCube(IBlockState state)
@ -660,6 +694,12 @@ public class ModelLoaderRegistryTest
this.setDefaultState(this.getStateContainer().getBaseState().with(NORTH, false).with(SOUTH, false).with(WEST, false).with(EAST, false));
setRegistryName(new ResourceLocation(MODID, name));
}
@Override
public VoxelShape getRenderShape(IBlockState state, IBlockReader worldIn, BlockPos pos)
{
return SHAPE;
}
@Override
public boolean isFullCube(IBlockState state)
@ -707,6 +747,12 @@ public class ModelLoaderRegistryTest
{
return new OBJDynamicEyeTileEntity();
}
@Override
public VoxelShape getRenderShape(IBlockState state, IBlockReader worldIn, BlockPos pos)
{
return SHAPE;
}
@Override
public boolean isFullCube(IBlockState state)

View file

@ -2,13 +2,10 @@
"forge_marker": 1,
"defaults": {
"textures": {},
"model": "forgedebugmodelloaderregistry:direction_test.obj"
"model": "forgedebugmodelloaderregistry:direction_test.obj",
"transform": "forge:default-block"
},
"variants": {
"normal": [{}],
"inventory": [{
"transform": "forge:default-block"
}],
"facing": {
"down": {"model": "forgedebugmodelloaderregistry:direction_test.obj", "x": 90},
"up": {"model": "forgedebugmodelloaderregistry:direction_test.obj", "x": 270},

View file

@ -5,8 +5,7 @@
"model": "forgedebugmodelloaderregistry:eye.obj"
},
"variants": {
"normal": [{}],
"inventory": [{
"": [{
"transform": {
"thirdperson": {
"translation": [0, 0.09375, -0.171875],

View file

@ -5,8 +5,7 @@
"model": "forgedebugmodelloaderregistry:eye.obj"
},
"variants": {
"normal": [{}],
"inventory": [{
"": [{
"transform": {
"thirdperson": {
"translation": [0, 0.09375, -0.171875],

View file

@ -7,8 +7,7 @@
"model": "forgedebugmodelloaderregistry:tesseract.obj"
},
"variants": {
"normal": [{}],
"inventory": [{
"": [{
"transform": "forge:default-block"
}]
}

View file

@ -5,8 +5,7 @@
"model": "forgedebugmodelloaderregistry:vertex_coloring.obj"
},
"variants": {
"normal": [{}],
"inventory": [{
"": [{
"transform": "forge:default-block"
}]
}

View file

@ -5,8 +5,7 @@
"model": "forgedebugmodelloaderregistry:vertex_coloring.obj"
},
"variants": {
"normal": [{}],
"inventory": [{
"": [{
"transform": "forge:default-block"
}]
}

View file

@ -1,2 +1,3 @@
newmtl fancy_fence:Default
Kd 1.00 1.00 1.00
Kd 1.00 1.00 1.00
map_Kd forgedebugmodelloaderregistry:white

View file

@ -1,4 +1,4 @@
newmtl lambert7SG
Kd 1.00 1.00 1.00
Ka 1.00 1.00 1.00
map_Kd minecraft:blocks/redstone_block
map_Kd minecraft:block/redstone_block

View file

@ -1,23 +1,31 @@
newmtl red
Kd 1 0 0
map_Kd forgedebugmodelloaderregistry:white
newmtl orange
Kd 1 0.5 0
map_Kd forgedebugmodelloaderregistry:white
newmtl yellow
Kd 1 1 0
map_Kd forgedebugmodelloaderregistry:white
newmtl yellow-green
Kd 0.5 1 0
map_Kd forgedebugmodelloaderregistry:white
newmtl green
Kd 0 1 0
map_Kd forgedebugmodelloaderregistry:white
newmtl green-blue
Kd 0 1 1
map_Kd forgedebugmodelloaderregistry:white
newmtl blue
Kd 0 0 1
map_Kd forgedebugmodelloaderregistry:white
newmtl purple
Kd 1 0 1
Kd 1 0 1
map_Kd forgedebugmodelloaderregistry:white

Binary file not shown.

After

Width:  |  Height:  |  Size: 164 B