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.

Using a RenderTickHandler makes the game lag, not even opening the save

Featured Replies

Posted

I'm having problems with Rendering a Wavefront Object as Armor.

 

So, I've been looking around 'da webs' and didn't find anything usefull. I tried using the 'getArmorModel' method in the ItemArmor class (overriding it in my Item class), but it doesn't get called. Do I need to make anything else so it does get called?

 

As that didn't work I tried to setup a RenderTickHandler, however, now the game runs really slowly, and fails to open the world, because of that slowness.

I'm using TickEvents.RenderTickEvent, and I've tried  registering my handler in both FMLCommonHandler and MinecraftForge.EVENT_BUS. here is my code:

 

RenderTickHandler:

 

public class RenderTickHandler{

/*public RenderTickHandler(){ }*/

HashMap<EntityPlayer, ItemStack> map = new HashMap();

public void addArmorToList(EntityPlayer player, ItemStack stack){

	if(map.get(player) != null)
		map.put(player, stack);
}

@SubscribeEvent
public void onPlayerRender(/*RenderPlayerEvent*/ TickEvent.RenderTickEvent event){

	EntityPlayer player = Minecraft.getMinecraft().thePlayer;
	ItemStack stack = map.get(player);

	if(stack != null){
		if(stack.getItem() instanceof WuellrovKnightArmor){

			WuellrovKnightArnorRender.render(player, ((ItemArmor) stack.getItem()).armorType);

		}


	}
}
}

 

 

ClientProxy:

 

	public static RenderTickHandler renderer;

@Override
public void initRenderes() {

	renderer = new RenderTickHandler();
	//FMLCommonHandler.instance().bus().register(renderer);
	MinecraftForge.EVENT_BUS.register(renderer);
}
}

 

 

Additionally, I'm running the game on debug mode, in eclipse, which ran just fine using the RenderPlayerEvent, however it didn't get called (that might be why... </sarcasm>), and other models work just fine.

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.