Jump to content

[1.8]Mob RenderProblem


a84759

Recommended Posts

I have tested 1.7.X and thats works but not 1.8 heres the render thing, i nulled it so it dident couse trouble when running.

 

    public RenderUndead(ModelBase par1ModelBase, float par2) {

super(null,par1ModelBase, par2); 

 

the null is there the problem is.

Link to comment
Share on other sites

still it dosent work i am getting an error here in the proxy file

 

RenderingRegistry.registerEntityRenderingHandler(EntityUndead.class, new RenderUndead(new Undead(), 0));

 

on registerEntityRendringHandler

 

What error???

Link to comment
Share on other sites

Captain-Picard-Facepalm.jpg

WHAT IS ERROR????????????

registerEntityRenderingHandler IS WHERE IS ERROR!!!!

WHAT IS ERROR MEANS: WHAT ECLIPSE WRITES YOU WHEN YOU PUT YOUR MOUSE ON registerEntityRenderingHandler !!!!!

FOR EXAMPLE:

The method registerEntityRenderingHandler(Class<? extends Entity>, Render) in the type RenderingRegistry is not applicable for the arguments ()

Link to comment
Share on other sites

package a84759.mod.Mobs;

import a84759.mod.Refrence;
import net.minecraft.client.Minecraft;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.client.renderer.entity.RenderLiving;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.entity.Entity;
import net.minecraft.util.ResourceLocation;

public class RenderUndead extends Render{

private static final ResourceLocation mobTextures = new ResourceLocation(Refrence.MOD_ID + ":textures/entity/Undead.png");



public RenderUndead(ModelBase par1ModelBase, float par2) {
super(Minecraft.getMinecraft().getRenderManager());
}
       
protected ResourceLocation getEntityTexture(EntityUndeadMob entity){
    return mobTextures;
  }
    @Override
protected ResourceLocation getEntityTexture(Entity entity){
return this.getEntityTexture((EntityUndeadMob)entity);
}
}
[/Code]

-------

[Code]// Date: 04.03.2015 18:26:25
// Template version 1.1
// Java generated by Techne
// Keep in mind that you still need to fill in some blanks
// - ZeuX






package a84759.mod.Mobs;

import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
import net.minecraft.util.MathHelper;

public class Undead extends ModelBase
{
  //fields
    ModelRenderer Shape1;
    ModelRenderer Shape2;
    ModelRenderer Shape4;
    ModelRenderer Shape5;
    ModelRenderer Shape3;
    ModelRenderer Shape6;
 
  public Undead()
  {
    textureWidth = 64;
    textureHeight = 32;
   
      Shape1 = new ModelRenderer(this, 0, 0);
      Shape1.addBox(0F, 0F, 0F, 1, 5, 2);
      Shape1.setRotationPoint(0F, 19F, 0F);
      Shape1.setTextureSize(64, 32);
      Shape1.mirror = true;
      setRotation(Shape1, 0F, 0F, 0F);
      Shape2 = new ModelRenderer(this, 0, 0);
      Shape2.addBox(0F, 0F, 0F, 1, 5, 2);
      Shape2.setRotationPoint(-3F, 19F, 0F);
      Shape2.setTextureSize(64, 32);
      Shape2.mirror = true;
      setRotation(Shape2, 0F, 0F, 0F);
      Shape4 = new ModelRenderer(this, 0, 0);
      Shape4.addBox(0F, 0F, 0F, 2, 2, 2);
      Shape4.setRotationPoint(-2F, 12F, 0F);
      Shape4.setTextureSize(64, 32);
      Shape4.mirror = true;
      setRotation(Shape4, 0F, 0F, 0F);
      Shape5 = new ModelRenderer(this, 0, 0);
      Shape5.addBox(0F, 0F, 0F, 4, 5, 2);
      Shape5.setRotationPoint(-3F, 14F, 0F);
      Shape5.setTextureSize(64, 32);
      Shape5.mirror = true;
      setRotation(Shape5, 0F, 0F, 0F);
      Shape3 = new ModelRenderer(this, 0, 0);
      Shape3.addBox(0F, 0F, 0F, 1, 4, 2);
      Shape3.setRotationPoint(1F, 14F, 0F);
      Shape3.setTextureSize(64, 32);
      Shape3.mirror = true;
      setRotation(Shape3, 0F, 0F, 0F);
      Shape6 = new ModelRenderer(this, 0, 0);
      Shape6.addBox(0F, 0F, 0F, 1, 4, 2);
      Shape6.setRotationPoint(-4F, 14F, 0F);
      Shape6.setTextureSize(64, 32);
      Shape6.mirror = true;
      setRotation(Shape6, 0F, 0F, 0F);
  }
 
  public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5)
  {
    super.render(entity, f, f1, f2, f3, f4, f5);
    setRotationAngles(f, f1, f2, f3, f4, f5, entity);
    Shape1.render(f5);
    Shape2.render(f5);
    Shape4.render(f5);
    Shape5.render(f5);
    Shape3.render(f5);
    Shape6.render(f5);
  }
 
  private void setRotation(ModelRenderer model, float x, float y, float z)
  {
    model.rotateAngleX = x;
    model.rotateAngleY = y;
    model.rotateAngleZ = z;
  }
 
  public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity)
  {
  super.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
    float f6 = (180F / (float)Math.PI);
    this.Shape1.rotateAngleX = MathHelper.cos(f * 0.6662F) * 1.4F * f1; 
    this.Shape2.rotateAngleX = MathHelper.cos(f * 0.6662F + (float)Math.PI) * 1.4F * f1; 
    }

}
[/Code]

------

[Code]package a84759.mod.Mobs;

import a84759.mod.RandomStuffMod;
import a84759.mod.Refrence;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityList;
import net.minecraft.entity.EnumCreatureType;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraftforge.fml.common.registry.EntityRegistry;

public abstract class EntityUndead extends Entity{

public EntityUndead(World worldIn) {
super(worldIn);
}
public static void register(){
registerEntity();
}
public static void registerEntity(){
createEntity(EntityUndeadMob.class, "Undead", 0x151517, 0xFAFAFA);
}
public static void createEntity(Class entityClass, String entityName, int solidColor, int spotColor){
int randomid = EntityRegistry.findGlobalUniqueEntityId();
EntityRegistry.registerGlobalEntityID(entityClass, entityName, randomid);
EntityRegistry.registerModEntity(entityClass, entityName, randomid, RandomStuffMod.modInstance , 64, 1, true);
EntityRegistry.addSpawn(entityClass, 2, 0, 1, EnumCreatureType.CREATURE, BiomeGenBase.plains);

createEgg(randomid, solidColor, spotColor);
}
private static void createEgg(int randomId, int solidColor, int spotColor){
EntityList.entityEggs.put(Integer.valueOf(randomId), new EntityList.EntityEggInfo(randomId, solidColor, spotColor));
}


}

[/Code]

------

[Code]package a84759.mod.Mobs;

import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.EntityAIAttackOnCollide;
import net.minecraft.entity.ai.EntityAIBase;
import net.minecraft.entity.ai.EntityAIHurtByTarget;
import net.minecraft.entity.ai.EntityAILookIdle;
import net.minecraft.entity.ai.EntityAIMoveThroughVillage;
import net.minecraft.entity.ai.EntityAIMoveTowardsRestriction;
import net.minecraft.entity.ai.EntityAINearestAttackableTarget;
import net.minecraft.entity.ai.EntityAISwimming;
import net.minecraft.entity.ai.EntityAIWander;
import net.minecraft.entity.ai.EntityAIWatchClosest;
import net.minecraft.entity.monster.EntityIronGolem;
import net.minecraft.entity.monster.EntityMob;
import net.minecraft.entity.monster.EntityPigZombie;
import net.minecraft.entity.monster.EntityZombie;
import net.minecraft.entity.passive.EntityVillager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.pathfinding.PathNavigateGround;
import net.minecraft.world.World;

public class EntityUndeadMob extends EntityMob{

public EntityUndeadMob(World par1World) {
super(par1World);
((PathNavigateGround)this.getNavigator()).func_179688_b(true);
this.setSize(0.8F, 1.95F);
this.tasks.addTask(0, new EntityAIWander(this, 1.0D));
this.tasks.addTask(1, new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.0D, false));
this.tasks.addTask(2, new EntityAISwimming(this));
this.tasks.addTask(3, new EntityAIMoveTowardsRestriction(this, 1.0D));
this.tasks.addTask(4, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
this.tasks.addTask(5, new EntityAILookIdle(this));
this.applyEntityAI();
}
protected void applyEntityAI(){
        this.tasks.addTask(4, new EntityAIAttackOnCollide(this, EntityVillager.class, 1.0D, true));
        this.tasks.addTask(4, new EntityAIAttackOnCollide(this, EntityIronGolem.class, 1.0D, true));
        this.tasks.addTask(6, new EntityAIMoveThroughVillage(this, 1.0D, false));
        this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, true, new Class[] {EntityPigZombie.class}));
        this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true));
        this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityVillager.class, false));
        this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityIronGolem.class, true));

}


public boolean isAIEnabled(){
return true;
}
protected void applyEntityAttributes(){
super.applyEntityAttributes();
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(20D);
this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.23000000417232513D);
this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(3.0D);
this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(35.0D);
}


}


[/Code]

Link to comment
Share on other sites

Are you extending RenderLiving and passing it model ? If not, make RenderUndead extend RenderLiving, and pass it render manager as first param, model as second and shadow size as third... When done, re try.

If still not working re post RenderUndead code and screen of what it looks like...

Link to comment
Share on other sites

Aaaaaaa, ok.

In constructor you need 3 params:

RenderManager, ModelBase and float. First one you can get from Minecraft.getMinecraft().getRenderManager(), but you cannot put it in super directly, so now RenderUndead constructor must also contain RenderManager param, which you can give him while constructing it in proxy... ModelBase is your model. And float is shadow size!

Link to comment
Share on other sites

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.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • I have now easily fixed the duplication error present, I was just not looking.   I have been working for the past half hour to try and fix another error present, this time with the Creative Mode Tab.   I have changed some things around to get where I am currently. (ModFoods to ModDrinks*) and it cannot find the symbol ".get" at the end of the code. *The custom class you recommended pOutput.accept(ModDrinks.ORANGE_JUICE.get()); I think the point I am at currently is the closest I have to how it should be but because I am not as experienced with java I would not know.  I have also removed ORANGE_JUICE and LEMON_JUICE from the ModFoods class, to avoid confliction. I do hope all this can be fully resolved soon.  
    • [SOLVED]  public class RenderGUIHandler { @SubscribeEvent public void renderGUI(RenderGameOverlayEvent.Text event){ Client.hud.draw(); } } As I was playing around a little with the code, i found out about an option to change The RenderGameOverlayEvent.Post to RenderGameOverlayEvent.Text
    • public class HUD { public Minecraft mc = Minecraft.getMinecraft(); public static class ModuleComparator implements Comparator<Module>{ @Override public int compare(Module o1, Module o2) { if (Minecraft.getMinecraft().fontRendererObj.getStringWidth(o1.name) > Minecraft.getMinecraft().fontRendererObj.getStringWidth(o2.name)){ return -1; } if (Minecraft.getMinecraft().fontRendererObj.getStringWidth(o1.name) < Minecraft.getMinecraft().fontRendererObj.getStringWidth(o2.name)){ return 1; } return 0; } } public void draw(){ ScaledResolution sr = new ScaledResolution(mc); FontRenderer fr = mc.fontRendererObj; Collections.sort(Client.modules, new ModuleComparator()); GlStateManager.pushMatrix(); GlStateManager.translate(4,4,0); GlStateManager.scale(1.5,1.5,1); GlStateManager.translate(-4, -4, 0); fr.drawString("Skyline", 10, 10, -1); GlStateManager.popMatrix(); int count = 0; for (Module m : Client.modules){ if (!m.toggled || m.name.equals("TabGUI")) continue; int offset = count* (fr.FONT_HEIGHT + 6); GL11.glTranslated(0.0f, 0.0f, -1.0f); Gui.drawRect(sr.getScaledWidth() - fr.getStringWidth(m.name) - 10, offset, sr.getScaledWidth() - fr.getStringWidth(m.name) - 8, 6 + fr.FONT_HEIGHT + offset, -1); Gui.drawRect(sr.getScaledWidth() - fr.getStringWidth(m.name) - 8, offset, sr.getScaledWidth(), 6 + fr.FONT_HEIGHT + offset, 0x90000000); fr.drawString(m.name, sr.getScaledWidth() - fr.getStringWidth(m.name) - 4, offset + 4, -1); count++; } Client.onEvent(new EventRenderGUI()); } } I have just recently stumbled upon this Problem, where the HudRenderer renders the wrong section of the textures and therefore completely destroys the Minecraft Armour and Hunger Bar. I am currently thinking if it is an issue with the DrawRect changing something it shouldn't. But I couldn't find anything about it. (To keep things Clean, the function is Called from another file) public class RenderGUIHandler { @SubscribeEvent public void renderGUI(RenderGameOverlayEvent.Post event){ Client.hud.draw(); } } Any help would be greatly appreciated  
    • Hello, I play on a private server (forge 47.2.0) (about 200 mods) with my friends. Everything is normal until the game crashes. I assume it's due to the generation of a chunk, possibly in a biome from the Aquamirae mod. Caused by: java.lang.NullPointerException: No chunk exists at [9, 38]     at net.minecraft.server.level.WorldGenRegion.m_6325_(WorldGenRegion.java:2079) ~[server-1.20.1-20230612.114412-srg.jar%23375!/:?]     at net.minecraft.server.level.WorldGenRegion.m_6924_(WorldGenRegion.java:375) ~[server-1.20.1-20230612.114412-srg.jar%23375!/:?]     at net.minecraft.world.level.levelgen.structure.structures.ShipwreckPieces$ShipwreckPiece.m_213694_(ShipwreckPieces.java:127) ~[server-1.20.1-20230612.114412-srg.jar%23375!/:?]     at net.minecraft.world.level.levelgen.structure.StructureStart.m_226850_(StructureStart.java:90) ~[server-1.20.1-20230612.114412-srg.jar%23375!/:?]     at net.minecraft.world.level.chunk.ChunkGenerator.m_223080_(ChunkGenerator.java:320) ~[server-1.20.1-20230612.114412-srg.jar%23375!/:?]     at com.google.common.collect.ImmutableList.forEach(ImmutableList.java:422) ~[guava-31.1-jre.jar%2374!/:?]     at net.minecraft.world.level.chunk.ChunkGenerator.m_213609_(ChunkGenerator.java:319) ~[server-1.20.1-20230612.114412-srg.jar%23375!/:?]     at net.minecraft.world.level.chunk.ChunkStatus.m_279978_(ChunkStatus.java:108) ~[server-1.20.1-20230612.114412-srg.jar%23375!/:?]     at net.minecraft.world.level.chunk.ChunkStatus$SimpleGenerationTask.m_214024_(ChunkStatus.java:309) ~[server-1.20.1-20230612.114412-srg.jar%23375!/:?]     at net.minecraft.world.level.chunk.ChunkStatus.m_280308_(ChunkStatus.java:252) ~[server-1.20.1-20230612.114412-srg.jar%23375!/:?]     at net.minecraft.server.level.ChunkMap.lambda$scheduleChunkGeneration$27(ChunkMap.java:643) ~[server-1.20.1-20230612.114412-srg.jar%23375!/:?]     at com.mojang.datafixers.util.Either$Left.map(Either.java:38) ~[datafixerupper-6.0.8.jar%2377!/:?]     at net.minecraft.server.level.ChunkMap.lambda$scheduleChunkGeneration$29(ChunkMap.java:634) ~[server-1.20.1-20230612.114412-srg.jar%23375!/:?]     at java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:1150) ~[?:?]     ... 11 more
    • that fixed it! Thank you soo much!!! If there is a way I can like upvote your profile or something let me know!
  • Topics

×
×
  • Create New...

Important Information

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