Fixed model error reporting, fixed model errors in test mods that shouldn't happen, fixed custom texture loading, made more things private/final.

This commit is contained in:
RainWarrior committed 2016-03-16 01:42:23 +03:00
1 parent 2bdb614fda
commit b81a13d010
26 files changed
+308 -278

No files matched your search

@@ -37,9 +37,10 @@ import net.minecraftforge.fml.common.registry.GameRegistry;
import java.util.List;
@Mod(modid = "DynBucketTest", version = "0.1", dependencies = "after:" + ModelFluidDebug.MODID)
@Mod(modid = DynBucketTest.MODID, version = "0.1", dependencies = "after:" + ModelFluidDebug.MODID)
public class DynBucketTest
{
public static final String MODID = "DynBucketTest";
public static final Item dynBucket = new DynBucket();
public static final Item dynBottle = new DynBottle();
@@ -79,6 +80,7 @@ public class DynBucketTest
}
});
ModelBakery.registerItemVariants(dynBottle, bottle);
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(GameRegistry.findBlock(MODID, "simpletank")), 0, new ModelResourceLocation(new ResourceLocation(MODID, "simpletank"), "normal"));
}
}
@@ -55,7 +55,7 @@ public class ItemTileDebug
public static class ClientProxy extends CommonProxy
{
private static ModelResourceLocation itemLocation = new ModelResourceLocation(blockName, "inventory");
private static ModelResourceLocation itemLocation = new ModelResourceLocation(blockName, "normal");
@SuppressWarnings("deprecation")
@Override
@@ -203,8 +203,8 @@ public class ModelAnimationDebug
{
model = ((IModelCustomData)model).process(ImmutableMap.of("mesh", "[\"Base\", \"Lid\"]"));
}*/
IModel base = ModelLoaderRegistry.getModel(new ResourceLocation(ModelAnimationDebug.MODID, "block/engine"));
IModel ring = ModelLoaderRegistry.getModel(new ResourceLocation(ModelAnimationDebug.MODID, "block/engine_ring"));
IModel base = ModelLoaderRegistry.getModelOrMissing(new ResourceLocation(ModelAnimationDebug.MODID, "block/engine"));
IModel ring = ModelLoaderRegistry.getModelOrMissing(new ResourceLocation(ModelAnimationDebug.MODID, "block/engine_ring"));
ImmutableMap<String, String> textures = ImmutableMap.of(
"base", "blocks/stone",
"front", "blocks/log_oak",
@@ -251,21 +251,24 @@ public class ModelBakeEventDebug
@Override
public List<BakedQuad> getQuads(IBlockState state, EnumFacing side, long rand)
{
if(side != null || !(state instanceof IExtendedBlockState)) return ImmutableList.of();
if(side != null) return ImmutableList.of();
IExtendedBlockState exState = (IExtendedBlockState)state;
int len = cubeSize * 5 + 1;
List<BakedQuad> ret = new ArrayList<BakedQuad>();
for(EnumFacing f : EnumFacing.values())
{
ret.add(createSidedBakedQuad(0, 1, 0, 1, 1, base, f));
for(int i = 0; i < cubeSize; i++)
if(state != null)
{
for(int j = 0; j < cubeSize; j++)
for(int i = 0; i < cubeSize; i++)
{
Integer value = exState.getValue(properties[f.ordinal()]);
if(value != null && (value & (1 << (i * cubeSize + j))) != 0)
for(int j = 0; j < cubeSize; j++)
{
ret.add(createSidedBakedQuad((float)(1 + i * 5) / len, (float)(5 + i * 5) / len, (float)(1 + j * 5) / len, (float)(5 + j * 5) / len, 1.0001f, overlay, f));
Integer value = exState.getValue(properties[f.ordinal()]);
if(value != null && (value & (1 << (i * cubeSize + j))) != 0)
{
ret.add(createSidedBakedQuad((float)(1 + i * 5) / len, (float)(5 + i * 5) / len, (float)(1 + j * 5) / len, (float)(5 + j * 5) / len, 1.0001f, overlay, f));
}
}
}
}
@@ -255,7 +255,7 @@ public class ModelLoaderRegistryDebug
{
if (world.getTileEntity(pos) == null) world.setTileEntity(pos, new OBJTesseractTileEntity());
OBJTesseractTileEntity tileEntity = (OBJTesseractTileEntity) world.getTileEntity(pos);
IModel model = ModelLoaderRegistry.getModel(new ResourceLocation(MODID.toLowerCase() + ":" + "block/tesseract.obj"));
IModel model = ModelLoaderRegistry.getModelOrMissing(new ResourceLocation(MODID.toLowerCase() + ":" + "block/tesseract.obj"));
if (player.isSneaking())
{