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

Here's the top few lines of the crash log I was supplied with. This never happened while testing in the development environment. This may only be occurring on servers.

Spoiler
  1. Time: 2019-08-08 17:45:02 CEST
  2. Description: Ticking entity
  3.  
  4. java.lang.NoClassDefFoundError: net/minecraft/client/Minecraft
  5.     at com.salvestrom.w2theJungle.mobs.entity.EntityRhinopter.updatePassenger(EntityRhinopter.java:1689)
  6.     at net.minecraft.entity.Entity.updateRidden(Entity.java:2020)
  7.     at net.minecraft.entity.EntityLivingBase.updateRidden(EntityLivingBase.java:2489)
  8.     at com.salvestrom.w2theJungle.mobs.entity.EntityLizardmanBase.updateRidden(EntityLizardmanBase.java:157)
  9.     at com.salvestrom.w2theJungle.mobs.entity.EntityLizardmanSticker.updateRidden(EntityLizardmanSticker.java:179)
  10.     at net.minecraft.world.World.updateEntityWithOptionalForce(World.java:1988)

And here is the method from the entity file. This was an attempt to give a rider a bobbing effect while mounted. It was mostly successful. Am I doing something wrong with the Minecraft.get Minecraft() call?The line specified by the crash log corresponds to the first usage of Minecraft.getMinecraft. Again this never happens while in the development environment.

Spoiler

    public void updatePassenger(Entity passenger)
    {    	
        if (this.isPassenger(passenger))
        {
        	float f5 = this.prevLimbSwingAmount + (this.limbSwingAmount - this.prevLimbSwingAmount) * 
        			Minecraft.getMinecraft().getRenderPartialTicks();
        	//"Time" in the model file
        	float f6 = this.limbSwing - this.limbSwingAmount * 
        			(1.0F - Minecraft.getMinecraft().getRenderPartialTicks());
        	
        	if (f5 > 1.0F)
            {
                f5 = 1.0F;
            }
        	
        	float f0 = MathHelper.sin(((1.0995574287564276334619251841478f) 
        			+ (f6*1.226612f)) )
        			* (f5);

        	passenger.setPosition(this.posX + 0,
            		this.posY + this.getMountedYOffset() + passenger.getYOffset() 
            		+ (this.isRaptorJumping() ? 0 : f0 * 0.0625),
            		this.posZ - 0);
        }
        
        if (passenger instanceof EntityLiving)
        {
        	EntityLiving entityliving = (EntityLiving)passenger;
        	this.renderYawOffset = entityliving.renderYawOffset;
        }
       
    }

 

 

  • Author
Spoiler

    public void updatePassenger(Entity passenger)
    {    	
        float f5 = 0;
    	float f6 = 0;

    	if (this.world.isRemote && this.isPassenger(passenger))
        {
    		f5 = this.prevLimbSwingAmount + (this.limbSwingAmount - this.prevLimbSwingAmount) * 
        			Minecraft.getMinecraft().getRenderPartialTicks();
        	//"Time" in the model file
    		f6 = this.limbSwing - this.limbSwingAmount * 
        			(1.0F - Minecraft.getMinecraft().getRenderPartialTicks());
        	
        	if (f5 > 1.0F)
            {
                f5 = 1.0F;
            }
        }
        	float f0 = MathHelper.sin(((1.0995574287564276334619251841478f) 
        			+ (f6*1.226612f)) )
        			* (f5);

        	passenger.setPosition(this.posX + 0,
            		this.posY + this.getMountedYOffset() + passenger.getYOffset() 
            		+ (this.isRaptorJumping() ? 0 : f0 * 0.0625),
            		this.posZ - 0);
        
        
        if (passenger instanceof EntityLiving)
        {
        	EntityLiving entityliving = (EntityLiving)passenger;
        	this.renderYawOffset = entityliving.renderYawOffset;
        }
       
    }

 

This is what I currently have. I had to move the passenger.setPosition outside of the isRemote check because the player was immediately warping back to the position they mounted the entity at on dismounting. I have no idea if this will actually cure the original problem on a server, or if there is some other way around this.

Edited by salvestrom

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.