Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.