mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-18 03:25:18 +00:00
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:
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())
|
||||
{
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package net.minecraftforge.test;
|
||||
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayer.EnumStatus;
|
||||
@@ -14,6 +15,7 @@ import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.model.ModelLoader;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.capabilities.Capability;
|
||||
import net.minecraftforge.common.capabilities.CapabilityInject;
|
||||
@@ -24,6 +26,7 @@ import net.minecraftforge.event.AttachCapabilitiesEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerWakeUpEvent;
|
||||
import net.minecraftforge.event.entity.player.SleepingLocationCheckEvent;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.common.SidedProxy;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraftforge.fml.common.eventhandler.Event.Result;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
@@ -37,12 +40,35 @@ public class NoBedSleepingTest
|
||||
@CapabilityInject(IExtraSleeping.class)
|
||||
private static final Capability<IExtraSleeping> SLEEP_CAP = null;
|
||||
|
||||
@SidedProxy
|
||||
public static CommonProxy proxy = null;
|
||||
|
||||
public static abstract class CommonProxy
|
||||
{
|
||||
public void preInit(FMLPreInitializationEvent event)
|
||||
{
|
||||
GameRegistry.registerItem(ItemSleepingPill.instance, ItemSleepingPill.name);
|
||||
CapabilityManager.INSTANCE.register(IExtraSleeping.class, new Storage(), DefaultImpl.class);
|
||||
MinecraftForge.EVENT_BUS.register(new EventHandler());
|
||||
}
|
||||
}
|
||||
|
||||
public static final class ServerProxy extends CommonProxy {}
|
||||
|
||||
public static final class ClientProxy extends CommonProxy
|
||||
{
|
||||
@Override
|
||||
public void preInit(FMLPreInitializationEvent event)
|
||||
{
|
||||
super.preInit(event);
|
||||
ModelLoader.setCustomModelResourceLocation(ItemSleepingPill.instance, 0, new ModelResourceLocation(new ResourceLocation(MODID, ItemSleepingPill.name), "inventory"));
|
||||
}
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
public void preInit(FMLPreInitializationEvent event)
|
||||
{
|
||||
GameRegistry.registerItem(ItemSleepingPill.instance, ItemSleepingPill.name);
|
||||
CapabilityManager.INSTANCE.register(IExtraSleeping.class, new Storage(), DefaultImpl.class);
|
||||
MinecraftForge.EVENT_BUS.register(new EventHandler());
|
||||
proxy.preInit(event);
|
||||
}
|
||||
|
||||
public static class EventHandler
|
||||
|
||||
Reference in new issue
Block a user