Jump to content

Recommended Posts

Posted (edited)

So I'm working on moving my Mobile Suit type entities over to a non-player based model design and I made the entity class for the Mobile Suits no longer extend EntityMob it now extends Entity and I had to rewrite the renderer but I'm not getting anything to render. The code I've attached is my rendering code.

	public static class MSRender extends Render<MSMob> {
		
		private MobileSuit ms;
		private ModelBase model;
		
		public MSRender(RenderManager rendermanagerIn,MobileSuit ms) {
			super(rendermanagerIn);
			this.model = ms.createModel() == null ? new ModelPlayer(1.0f,false) : ms.createModel();
			this.model.isChild = false;
			this.ms = ms;
		}
		
		protected float handleRotationFloat(MSMob entity,float partialTicks) {
	        return (float)entity.ticksExisted + partialTicks;
	    }
		
		protected float interpolateRotation(float prevYawOffset,float yawOffset,float partialTicks) {
	        float f;
	        for(f = yawOffset-prevYawOffset;f < -180.0F;f += 360.0F);
	        while(f >= 180.0F) f -= 360.0F;
	        return prevYawOffset+partialTicks*f;
	    }
		
		@Override
		public void doRender(MSMob entity,double x,double y,double z,float entityYaw,float partialTicks) {
			GlStateManager.pushMatrix();
			this.scale(entity,partialTicks);
			GlStateManager.translate(x,y,z);
			GlStateManager.rotate(-entityYaw,0,1,0);
			this.getRenderManager().renderEngine.bindTexture(this.getEntityTexture(entity));
			this.model.render(entity,0,0,entity.ticksExisted+partialTicks,entity.rotationYaw,entity.rotationPitch,entity.scale/0.0625F);
			super.doRender(entity,x,y,z,entityYaw,partialTicks);
			GlStateManager.popMatrix();
		}
		
		protected void scale(MSMob mob,float par2) {
			this.shadowSize = mob.scale/2.0f;
		}

		@Override
		protected ResourceLocation getEntityTexture(MSMob entity) {
			return new ResourceLocation(this.ms.getBaseResourceLocation()+".png");
		}
		
		public static class Factory implements IRenderFactory<MSMob> {
			
			private MobileSuit ms;
			
			public Factory(MobileSuit ms) {
				this.ms = ms;
			}
			
			@Override
			public Render<? super MSMob> createRenderFor(RenderManager manager) {
				return new MSRender(manager,this.ms);
			}
		}
	}

 

Edited by Spaceboy Ross

The official YouTuber Spaceboy Ross

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

    • Please read the FAQ and post logs as described there.   Also, do not just add a post onto someone else's thread with your issue, create a new one please.
    • seguridad seguridad
    • I am creating a server with mods but when i try tostart it it say in the logs:   [29Jan2025 20:36:50.715] [main/WARN] [net.minecraftforge.fml.loading.moddiscovery.ModFileParser/LOADING]: Mod file /server/libraries/net/minecraftforge/fmlcore/1.20.1-47.3.27/fmlcore-1.20.1-47.3.27.jar is missing mods.toml file 159[29Jan2025 20:36:50.717] [main/DEBUG] [net.minecraftforge.fml.loading.moddiscovery.ModFileParser/LOADING]: Considering mod file candidate /server/libraries/net/minecraftforge/javafmllanguage/1.20.1-47.3.27/javafmllanguage-1.20.1-47.3.27.jar 160[29Jan2025 20:36:50.717] [main/WARN] [net.minecraftforge.fml.loading.moddiscovery.ModFileParser/LOADING]: Mod file /server/libraries/net/minecraftforge/javafmllanguage/1.20.1-47.3.27/javafmllanguage-1.20.1-47.3.27.jar is missing mods.toml file 161[29Jan2025 20:36:50.718] [main/DEBUG] [net.minecraftforge.fml.loading.moddiscovery.ModFileParser/LOADING]: Considering mod file candidate /server/libraries/net/minecraftforge/lowcodelanguage/1.20.1-47.3.27/lowcodelanguage-1.20.1-47.3.27.jar 162[29Jan2025 20:36:50.718] [main/WARN] [net.minecraftforge.fml.loading.moddiscovery.ModFileParser/LOADING]: Mod file /server/libraries/net/minecraftforge/lowcodelanguage/1.20.1-47.3.27/lowcodelanguage-1.20.1-47.3.27.jar is missing mods.toml file 163[29Jan2025 20:36:50.719] [main/DEBUG] [net.minecraftforge.fml.loading.moddiscovery.ModFileParser/LOADING]: Considering mod file candidate /server/libraries/net/minecraftforge/mclanguage/1.20.1-47.3.27/mclanguage-1.20.1-47.3.27.jar 164[29Jan2025 20:36:50.719] [main/WARN] [net.minecraftforge.fml.loading.moddiscovery.ModFileParser/LOADING]: Mod file /server/libraries/net/minecraftforge/mclanguage/1.20.1-47.3.27/mclanguage-1.20.1-47.3.27.jar is missing mods.toml file
    • How do you configure the entity reach of a custom weapon? Asking for 1.21 Minecraft parchment
    • This topic is over a year old. If you are having an issue, please read the FAQ for the proper way to post logs, and create your own thread.
  • Topics

×
×
  • Create New...

Important Information

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