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

Hello,

 

I've searched and searched with no answer....

 

What my problem is:

    When i call my Rotation with partialTick, it stays at 0 Degrees and flickers....

 

What i found out by other threads:

    I have to call item onUpdate i entityUpdate or something, but can't seem to find a way in 1.8.9 to do this....

 

My codes:

 

TileEntity:

package dk.glazzo.mod.tileentity;

import dk.glazzo.mod.tileentity.render.GRenderer_glazzoItemStand;
import net.minecraft.client.renderer.texture.ITickable;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.Packet;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IProgressUpdate;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

public class GTileEntity_glazzoItemStand extends TileEntity implements ITickable {

@SideOnly(Side.CLIENT)
public int rotation = 0;

@Override
public void tick() {

	if(worldObj.isRemote) {
		rotation++;
		if(rotation > 360) {
			rotation = 0;
		}
	}

}

}

 

 

TileRenderer:

package dk.glazzo.mod.tileentity.render;

import dk.glazzo.mod.blocks.GBlocks_glazzoItemStand;
import dk.glazzo.mod.tileentity.GTileEntity_glazzoItemStand;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;

public class GRenderer_glazzoItemStand extends TileEntitySpecialRenderer  {



EntityItem entityItem = new EntityItem(Minecraft.getMinecraft().theWorld, 0D, 0D, 0D, new ItemStack(Items.fish));

@Override
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float partialTicks, int destroyStage) {

	entityItem.hoverStart = 0;

	if(!(tileEntity.getBlockType() instanceof GBlocks_glazzoItemStand))
		return;

	GTileEntity_glazzoItemStand tileEntity_glazzoItemStand = (GTileEntity_glazzoItemStand) tileEntity;

	GlStateManager.pushMatrix(); 
	{

		GlStateManager.translate(x, y, z);
		GlStateManager.translate(0.5, 0, 0.5);
		float rotation = (float) tileEntity_glazzoItemStand.rotation + partialTicks;
		GlStateManager.rotate(rotation, 0, 1, 0);
		Minecraft.getMinecraft().getRenderManager().renderEntityWithPosYaw(entityItem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
		Minecraft.getMinecraft().getRenderItem();

	}
	GlStateManager.popMatrix();
}

}

 

Thanks!

 

  • Author

Im very confused...

 

Can you tell me how do do such thing? im totaly lost... :/

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.