• Recently Browsing

    No registered users viewing this page.

  • Posts

    • The Entity-class: package drachenbauer32.angrybirdsmod.entities; import drachenbauer32.angrybirdsmod.init.AngryBirdsEntities; import net.minecraft.entity.AgeableEntity; import net.minecraft.entity.EntityType; import net.minecraft.entity.Pose; import net.minecraft.entity.ai.goal.LookAtGoal; import net.minecraft.entity.ai.goal.LookRandomlyGoal; import net.minecraft.entity.ai.goal.RandomSwimmingGoal; import net.minecraft.entity.ai.goal.RandomWalkingGoal; import net.minecraft.entity.ai.goal.SwimGoal; import net.minecraft.entity.passive.AnimalEntity; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.world.World; public class StellaEntity extends AnimalEntity { public StellaEntity(EntityType<? extends AnimalEntity> type, World worldIn) { super((EntityType<? extends AnimalEntity>) AngryBirdsEntities.STELLA, worldIn); } @Override public AgeableEntity createChild(AgeableEntity arg0) { return null; } @Override public float getEyeHeight(Pose pose) { return this.getSize(pose).height / 2; } @Override protected void registerGoals() { this.goalSelector.addGoal(0, new SwimGoal(this)); this.goalSelector.addGoal(1, new RandomSwimmingGoal(this, 0.2d, 10)); this.goalSelector.addGoal(2, new RandomWalkingGoal(this, 0.2d)); this.goalSelector.addGoal(3, new LookAtGoal(this, PlayerEntity.class, 6.0F)); this.goalSelector.addGoal(4, new LookRandomlyGoal(this)); } @Override public boolean canBreatheUnderwater() { return true; } @Override protected void registerAttributes() { super.registerAttributes(); } }   The Renderer-class: package drachenbauer32.angrybirdsmod.entities.renderers; import drachenbauer32.angrybirdsmod.entities.StellaEntity; import drachenbauer32.angrybirdsmod.entities.models.StellaModel; import drachenbauer32.angrybirdsmod.util.Reference; import net.minecraft.client.renderer.entity.EntityRendererManager; import net.minecraft.client.renderer.entity.MobRenderer; import net.minecraft.client.renderer.entity.model.EntityModel; import net.minecraft.util.ResourceLocation; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; @OnlyIn(Dist.CLIENT) public class StellaRenderer extends MobRenderer<StellaEntity, EntityModel<StellaEntity>> { private static final ResourceLocation STELLA_TEXTURE = new ResourceLocation(Reference.MOD_ID + ":textures/entity/stella.png"); public StellaRenderer(EntityRendererManager manager) { super(manager, new StellaModel<>(), 0.5f); } @Override public ResourceLocation getEntityTexture(StellaEntity stella) { return STELLA_TEXTURE; } /*public static class RenderFactory implements IRenderFactory<StellaEntity> { @Override public EntityRenderer<? super StellaEntity> createRenderFor(EntityRendererManager manager) { return new StellaRenderer(manager); } }*/ } i commented out the RenderFactory, because i didn´t see it in the vanilla-renderers any more.   The Model-class: package drachenbauer32.angrybirdsmod.entities.models; import com.google.common.collect.ImmutableList; import drachenbauer32.angrybirdsmod.entities.StellaEntity; import net.minecraft.client.renderer.entity.model.AgeableModel; import net.minecraft.client.renderer.model.ModelRenderer; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; @OnlyIn(Dist.CLIENT) public class StellaModel<T extends StellaEntity> extends AgeableModel<T> { private final ModelRenderer bone; private final ModelRenderer bone2; private final ModelRenderer bone3; private final ModelRenderer bone4; private final ModelRenderer bone5; public StellaModel() { textureWidth = 32; textureHeight = 16; bone = new ModelRenderer(this); bone.setRotationPoint(0.0F, 20.0F, 0.0F); bone.addBox("body", -4.0F, -4.0F, -4.0F, 8, 8, 8, 0.0F, 0, 0); bone.addBox("beak", -1.0F, 2.0F, -5.0F, 2, 1, 1, 0.0F, 25, 0); bone.addBox("head_feather_1", 0.0F, -6.0F, -8.0F, 0, 2, 6, 0.0F, 10, 10); bone.addBox("tail_feather_1", 0.0F, 1.0F, 4.0F, 0, 1, 4, 0.0F, 24, 3); bone2 = new ModelRenderer(this); bone2.setRotationPoint(0.0F, -4.0F, -2.0F); setRotationAngle(bone2, -0.5236F, 0.0F, 0.0F); bone.addChild(bone2); bone2.addBox("head_feather_2", 0.0F, -2.0F, -6.0F, 0, 2, 6, 0.0F, 10, 10); bone3 = new ModelRenderer(this); bone3.setRotationPoint(0.0F, -4.0F, -2.0F); setRotationAngle(bone3, -1.0472F, 0.0F, 0.0F); bone.addChild(bone3); bone3.addBox("head_feather_3", 0.0F, -2.0F, -6.0F, 0, 2, 8, 0.0F, 8, 8); bone4 = new ModelRenderer(this); bone4.setRotationPoint(0.0F, 1.0F, 4.0F); setRotationAngle(bone4, 0.5236F, 0.0F, 0.0F); bone.addChild(bone4); bone4.addBox("tail_feather_2", 0.0F, 0.0F, 0.0F, 0, 1, 4, 0.0F, 24, 3); bone5 = new ModelRenderer(this); bone5.setRotationPoint(0.0F, 1.0F, 4.0F); setRotationAngle(bone5, -0.5236F, 0.0F, 0.0F); bone.addChild(bone5); bone5.addBox("tail_feather_3", 0.0F, 0.0F, 0.0F, 0, 1, 4, 0.0F, 24, 3); } @Override protected Iterable<ModelRenderer> getHeadParts() { return ImmutableList.of(bone); } @Override protected Iterable<ModelRenderer> getBodyParts() { return null; } @Override public void setRotationAngles(StellaEntity stella, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch) { bone.rotateAngleX = headPitch * 0.017453292f; bone.rotateAngleY = netHeadYaw * 0.017453292f; } private void setRotationAngle(ModelRenderer model, float x, float y, float z) { model.rotateAngleX = x; model.rotateAngleY = y; model.rotateAngleZ = z; } } in the method getBodyParts i return null, because it´s a classic Angry Birds-character. they are not much more than bird-heads with some feathers stick out. So i only needed stuff as head-part
    • 1.8 is no longer supported on this forum. Please update to a modern version of Minecraft to receive support.
    • I had as a draft, "I'd be surprised if it doesn't use the ASM library." But as I haven't messed with it or even looked at it, I wasn't confident enough to say that it did. Good to know I was right.
    • Everytime i want to launch minecraft with forge 1.8.9, i go this error. Help pls!   An error occurred trying to configure the minecraft home at C:\Users\Romain\AppData\Roaming\.minecraft for Forge Mod Loader java.lang.NoClassDefFoundError: cpw/mods/fml/relauncher/IFMLLoadingPlugin at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:760) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at java.net.URLClassLoader.defineClass(URLClassLoader.java:467) at java.net.URLClassLoader.access$100(URLClassLoader.java:73) at java.net.URLClassLoader$1.run(URLClassLoader.java:368) at java.net.URLClassLoader$1.run(URLClassLoader.java:362) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:361) at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:117) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:348) at net.minecraftforge.fml.relauncher.CoreModManager.loadCoreMod(CoreModManager.java:536) at net.minecraftforge.fml.relauncher.CoreModManager.discoverCoreMods(CoreModManager.java:416) at net.minecraftforge.fml.relauncher.CoreModManager.handleLaunch(CoreModManager.java:246) at net.minecraftforge.fml.relauncher.FMLLaunchHandler.setupHome(FMLLaunchHandler.java:95) at net.minecraftforge.fml.relauncher.FMLLaunchHandler.setupClient(FMLLaunchHandler.java:72) at net.minecraftforge.fml.relauncher.FMLLaunchHandler.configureForClientLaunch(FMLLaunchHandler.java:34) at net.minecraftforge.fml.common.launcher.FMLTweaker.injectIntoClassLoader(FMLTweaker.java:119) at net.minecraft.launchwrapper.Launch.launch(Launch.java:115) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) Caused by: java.lang.ClassNotFoundException: cpw.mods.fml.relauncher.IFMLLoadingPlugin at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:191) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 23 more Caused by: java.lang.NullPointerException at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:182) ... 25 more
    • Show your code (the entity, the renderer, the model...).
  • Topics

  • Who's Online (See full list)