Jump to content

Recommended Posts

Posted

So, a friend and I have been working on a modification that worked just fine in 1.9.4 and 1.10.2, but in 1.11.2 we've fixed all the various bugs... except for the fact that the mobs just render as cuboid white prisms, and my friend says that it appears the methods in render class don't get called at all. The mobile in question is virtually a copy of vanilla wolves, but with various spawning differences, different textures, and sometimes, different behaviors. However, RenderWolf and ModelWolf were copied to give the wolves their models and such. Right now, we simply cannot figure out what is wrong with the rendering on these mobs.

 

The modification adds various wolves to the Minecraft world, all of which are modeled after the vanilla wolf and use basically the same behavior. But the various kinds spawn in different biomes and have their own textures. Code is in the spoiler below. 

 

  Reveal hidden contents
 
Not signed in

 

Posted

Hmmmm... Put a System.out.printLn() in your renderers. Are they being called?

Apparently I'm addicted to these forums and can't help but read all the posts. So if I somehow help you, please click the "Like This" button, it helps.

Posted

Main mod class: LupineMod.java

package slvr.LupineMod;

import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.Mod.Instance;
import net.minecraftforge.fml.common.SidedProxy;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.registry.EntityRegistry;
import slvr.LupineMod.proxy.*;
import net.minecraftforge.common.BiomeManager.BiomeType;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.common.Mod;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.EnumCreatureType;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.biome.Biome.SpawnListEntry;
import net.minecraftforge.fml.common.Mod;
import slvr.LupineMod.entities.*;
import slvr.LupineMod.init.ModItems;
import slvr.LupineMod.proxy.CommonProxy;
import net.minecraftforge.common.BiomeDictionary;
import static net.minecraftforge.common.BiomeDictionary.Type;

@Mod(modid =Reference.MOD_ID, name =Reference.NAME, version =Reference.VERSION, acceptedMinecraftVersions =Reference.ACCEPTED_VERSIONS)
public class LupineMod {

	@Instance
	public static LupineMod instance;
	
	@SidedProxy(clientSide = Reference.CLIENT_PROXY_CLASS, serverSide = Reference.SERVER_PROXY_CLASS)
	public static CommonProxy proxy;
	
	@EventHandler
	public void preInit(FMLPreInitializationEvent event)
	{
		System.out.println("Pre Init");
		EntityRegistry.registerModEntity(new ResourceLocation(Reference.MOD_ID, "africanWildDog"), EntityAfricanWildDog.class, "africanWildDog", 9, this, 50, 2, true, 0, 0);
		EntityRegistry.registerModEntity(new ResourceLocation(Reference.MOD_ID, "redWolf"), EntityRedWolf.class, "redWolf", 9, this, 50, 2, true);
		EntityRegistry.registerModEntity(new ResourceLocation(Reference.MOD_ID, "coyote"), EntityCoyote.class, "coyote", 9, this, 50, 2, true);
		EntityRegistry.registerModEntity(new ResourceLocation(Reference.MOD_ID, "netherhound"), EntityNetherhound.class, "netherhound", 9, this, 50, 2, true);
		EntityRegistry.registerModEntity(new ResourceLocation(Reference.MOD_ID, "germanShepherd"), EntityGermanShepherd.class, "germanShepherd", 9, this, 50, 2, true);
		EntityRegistry.registerModEntity(new ResourceLocation(Reference.MOD_ID, "goldenRetriever"), EntityGoldenRetriever.class, "goldenRetriever", 9, this, 50, 2, true);
		EntityRegistry.registerModEntity(new ResourceLocation(Reference.MOD_ID, "pitBull"), EntityPitBull.class, "pitBull", 9, this, 50, 2, true);
		EntityRegistry.registerModEntity(new ResourceLocation(Reference.MOD_ID, "dingo"), EntityDingo.class, "dingo", 9, this, 50, 2, true);
		EntityRegistry.registerModEntity(new ResourceLocation(Reference.MOD_ID, "arcticWolf"), EntityArcticWolf.class, "arcticWolf", 9, this, 50, 2, true);
		EntityRegistry.registerModEntity(new ResourceLocation(Reference.MOD_ID, "endWolf"), EntityEndWolf.class, "endWolf", 9, this, 50, 2, true);
		ModItems.init();
		ModItems.register();
		
	}	
	
	@EventHandler
	public void init(FMLInitializationEvent event)
	{
		System.out.println("Init");
		proxy.init();
	}
	
	@EventHandler
	public void postInit(FMLPostInitializationEvent event)
	{
		System.out.println("Post Init");
		MinecraftForge.EVENT_BUS.register(new LupineEventHandler());
		SpawnListEntry african = new SpawnListEntry(EntityAfricanWildDog.class, 4, 2, 4);
		SpawnListEntry red = new SpawnListEntry(EntityRedWolf.class, 4, 2, 6);
		SpawnListEntry coyote = new SpawnListEntry(EntityCoyote.class, 1, 4, 4);
		SpawnListEntry netherhound = new SpawnListEntry(EntityNetherhound.class, 25, 1, 2);
		SpawnListEntry gs = new SpawnListEntry(EntityGermanShepherd.class, 1, 1, 1);
		SpawnListEntry golden = new SpawnListEntry(EntityGoldenRetriever.class, 1, 1, 1);
		SpawnListEntry pit = new SpawnListEntry(EntityPitBull.class, 1, 1, 1);
		SpawnListEntry dingo = new SpawnListEntry(EntityDingo.class, 2, 1, 1);
		SpawnListEntry arctic = new SpawnListEntry(EntityArcticWolf.class, 4, 4, 4);
		SpawnListEntry end = new SpawnListEntry(EntityEndWolf.class, 5, 4, 4);
		
		Object biomes[] = BiomeDictionary.getBiomes(Type.SANDY).toArray();
		for (int i = 0; i < biomes.length; i++){
			if(BiomeDictionary.hasType((Biome)biomes[i], Type.HOT)){
				((Biome)biomes[i]).getSpawnableList(EnumCreatureType.CREATURE).add(dingo);
				((Biome)biomes[i]).getSpawnableList(EnumCreatureType.CREATURE).add(african);
				((Biome)biomes[i]).getSpawnableList(EnumCreatureType.CREATURE).add(red);
			}
			((Biome)biomes[i]).getSpawnableList(EnumCreatureType.CREATURE).add(gs);
			((Biome)biomes[i]).getSpawnableList(EnumCreatureType.CREATURE).add(pit);
			((Biome)biomes[i]).getSpawnableList(EnumCreatureType.CREATURE).add(golden);
			((Biome)biomes[i]).getSpawnableList(EnumCreatureType.CREATURE).add(coyote);
		}
		
		biomes = BiomeDictionary.getBiomes(Type.SNOWY).toArray();
		for (int i = 0; i < biomes.length; i++){
			((Biome)biomes[i]).getSpawnableList(EnumCreatureType.CREATURE).add(arctic);
		}
		
		biomes = BiomeDictionary.getBiomes(Type.PLAINS).toArray();
		for (int i = 0; i < biomes.length; i++){
			((Biome)biomes[i]).getSpawnableList(EnumCreatureType.CREATURE).add(african);
			((Biome)biomes[i]).getSpawnableList(EnumCreatureType.CREATURE).add(gs);
			((Biome)biomes[i]).getSpawnableList(EnumCreatureType.CREATURE).add(pit);
			((Biome)biomes[i]).getSpawnableList(EnumCreatureType.CREATURE).add(golden);
			((Biome)biomes[i]).getSpawnableList(EnumCreatureType.CREATURE).add(coyote);
		}
		
		biomes = BiomeDictionary.getBiomes(Type.FOREST).toArray();
		for (int i = 0; i < biomes.length; i++){
			if(!BiomeDictionary.hasType((Biome)biomes[i], Type.SNOWY)){
				((Biome)biomes[i]).getSpawnableList(EnumCreatureType.CREATURE).add(red);
			}
			((Biome)biomes[i]).getSpawnableList(EnumCreatureType.CREATURE).add(gs);
			((Biome)biomes[i]).getSpawnableList(EnumCreatureType.CREATURE).add(pit);
			((Biome)biomes[i]).getSpawnableList(EnumCreatureType.CREATURE).add(golden);
			((Biome)biomes[i]).getSpawnableList(EnumCreatureType.CREATURE).add(coyote);
		}
		
		biomes = BiomeDictionary.getBiomes(Type.NETHER).toArray();
		for (int i = 0; i < biomes.length; i++){
			((Biome)biomes[i]).getSpawnableList(EnumCreatureType.MONSTER).add(netherhound);
		}
		
		biomes = BiomeDictionary.getBiomes(Type.END).toArray();
		for (int i = 0; i < biomes.length; i++){
			((Biome)biomes[i]).getSpawnableList(EnumCreatureType.MONSTER).add(end);
		}
		
		biomes = BiomeDictionary.getBiomes(Type.WASTELAND).toArray();
		for (int i = 0; i < biomes.length; i++){
			((Biome)biomes[i]).getSpawnableList(EnumCreatureType.CREATURE).add(red);
		}
		
		biomes = BiomeDictionary.getBiomes(Type.MOUNTAIN).toArray();
		for (int i = 0; i < biomes.length; i++){
			((Biome)biomes[i]).getSpawnableList(EnumCreatureType.CREATURE).add(gs);
			((Biome)biomes[i]).getSpawnableList(EnumCreatureType.CREATURE).add(pit);
			((Biome)biomes[i]).getSpawnableList(EnumCreatureType.CREATURE).add(golden);
			((Biome)biomes[i]).getSpawnableList(EnumCreatureType.CREATURE).add(coyote);
		}
		
		biomes = BiomeDictionary.getBiomes(Type.MUSHROOM).toArray();
		for (int i = 0; i < biomes.length; i++){
			((Biome)biomes[i]).getSpawnableList(EnumCreatureType.CREATURE).add(gs);
			((Biome)biomes[i]).getSpawnableList(EnumCreatureType.CREATURE).add(pit);
			((Biome)biomes[i]).getSpawnableList(EnumCreatureType.CREATURE).add(golden);
			((Biome)biomes[i]).getSpawnableList(EnumCreatureType.CREATURE).add(coyote);
			
		}
		
		biomes = BiomeDictionary.getBiomes(Type.JUNGLE).toArray();
		for (int i = 0; i < biomes.length; i++){
			((Biome)biomes[i]).getSpawnableList(EnumCreatureType.CREATURE).add(gs);
			((Biome)biomes[i]).getSpawnableList(EnumCreatureType.CREATURE).add(pit);
			((Biome)biomes[i]).getSpawnableList(EnumCreatureType.CREATURE).add(golden);
			((Biome)biomes[i]).getSpawnableList(EnumCreatureType.CREATURE).add(coyote);
		}
		
		biomes = BiomeDictionary.getBiomes(Type.SWAMP).toArray();
		for (int i = 0; i < biomes.length; i++){
			((Biome)biomes[i]).getSpawnableList(EnumCreatureType.CREATURE).add(gs);
			((Biome)biomes[i]).getSpawnableList(EnumCreatureType.CREATURE).add(pit);
			((Biome)biomes[i]).getSpawnableList(EnumCreatureType.CREATURE).add(golden);
			((Biome)biomes[i]).getSpawnableList(EnumCreatureType.CREATURE).add(coyote);
		}
		
		biomes = BiomeDictionary.getBiomes(Type.WATER).toArray();
		for (int i = 0; i < biomes.length; i++){
			((Biome)biomes[i]).getSpawnableList(EnumCreatureType.CREATURE).add(gs);
			((Biome)biomes[i]).getSpawnableList(EnumCreatureType.CREATURE).add(pit);
			((Biome)biomes[i]).getSpawnableList(EnumCreatureType.CREATURE).add(golden);
		}
	}

}

 

Posted (edited)
  On 2/25/2017 at 6:38 PM, Leomelonseeds said:

System.out.printLn() in your renderers. Are they being called?

Expand  

-Shoudn't ClientProxy EXTEND CommonProxy?

-In each eventhandler of your main mod class, you need proxy.init(event); (or preinit, postinit)

 

Edited by Leomelonseeds

Apparently I'm addicted to these forums and can't help but read all the posts. So if I somehow help you, please click the "Like This" button, it helps.

Posted
public static class Factory implements IRenderFactory<ENTITYCLASSNAME> {

        @Override
        public Render<? super ENTITYCLASSNAME> createRenderFor(RenderManager manager) {
            return new RENDERCLASSNAME(manager);
        }

Try this. Also client proxy should extend commonproxy.

Add this to your client proxy and common proxy.

//ClientProxy
@Override
    public void preInit(FMLPreInitializationEvent e) {
        super.preInit(e);
        ModEntities.initModels();
    }
//CommonProxy
public void preInit(FMLPreInitializationEvent e) {
        ModEntities.init();
    }

Then in your main mod class preinit do: proxy.preInit(event);

In your ModEntities have something like this.

public static void init() {
        // Every entity in our mod has an ID (local to this mod)
        int id = 1;
        ResourceLocation resourceLocation = new ResourceLocation("mmm", "fastZombie");
        EntityRegistry.registerModEntity(resourceLocation, EntityFastZombie.class, resourceLocation.toString(), 9990, MastersMobs.instance, 64, 1, true, 8388608, 32768);
        // We want our mob to spawn in Plains and ice plains biomes. If you don't add this then it will not spawn automatically
        // but you can of course still make it spawn manually
        EntityRegistry.addSpawn(ENTITYCLASS.class, 100, 3, 5, EnumCreatureType.MONSTER, Biomes.PLAINS, Biomes.ICE_PLAINS, Biomes.BIRCH_FOREST, Biomes.BIRCH_FOREST_HILLS, Biomes.FOREST, Biomes.FOREST_HILLS, Biomes.DESERT, Biomes.EXTREME_HILLS);
    }

    @SideOnly(Side.CLIENT)
    public static void initModels() {
        RenderingRegistry.registerEntityRenderingHandler(ENTITYFLLASS.class, FACTORYCLASS.class);
    }

This is just how I would do it. I don't think your renders aren't being called.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.