Implemented custom item rotation rate, and start using, using, stop using, finished using events for custom items.

This commit is contained in:
Luis C.M committed 2022-05-11 14:24:12 -05:00
1 parent 11cc46b48f
commit aab550cdca
7 files changed
+212 -36

No files matched your search

@@ -4,6 +4,7 @@ import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.EntityClientPlayerMP;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
@@ -161,19 +162,4 @@ public class ItemScripted extends Item implements ItemRenderInterface {
public void renderSpecial() {
GL11.glTranslatef(0.135F, 0.2F, 0.07F);
}
public void renderCustomAttributes(ItemStack itemStack) {
ScriptCustomItem scriptCustomItem = GetWrapper(itemStack);
GL11.glRotatef(scriptCustomItem.rotationX, 1, 0, 0);
GL11.glRotatef(scriptCustomItem.rotationY, 0, 1, 0);
GL11.glRotatef(scriptCustomItem.rotationZ, 0, 0, 1);
GL11.glScalef(scriptCustomItem.scaleX, scriptCustomItem.scaleY, scriptCustomItem.scaleZ);
int color = scriptCustomItem.getColor();
float itemRed = (color >> 16 & 255) / 255f;
float itemGreen = (color >> 8 & 255) / 255f;
float itemBlue = (color & 255) / 255f;
GL11.glColor4f(itemRed, itemGreen, itemBlue, 1.0F);
}
}