LOTS of alchemy changes...
This commit is contained in:
parent
64ccc50698
commit
2b749000b6
99 changed files with 7488 additions and 659 deletions
|
@ -0,0 +1,92 @@
|
|||
package WayofTime.alchemicalWizardry.common.renderer.block.itemRender;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import WayofTime.alchemicalWizardry.ModBlocks;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.model.ModelAlchemicalCalcinator;
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
|
||||
public class TEAlchemicalCalcinatorItemRenderer implements IItemRenderer
|
||||
{
|
||||
private ModelAlchemicalCalcinator modelConduit = new ModelAlchemicalCalcinator();
|
||||
|
||||
private void renderConduitItem(RenderBlocks render, ItemStack item, float translateX, float translateY, float translateZ)
|
||||
{
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
|
||||
Block block = ModBlocks.blockAlchemicCalcinator;
|
||||
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
/**
|
||||
* Render the ghost item inside of the Altar, slowly spinning
|
||||
*/
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float) translateX + 0.5F, (float) translateY + 1.5F, (float) translateZ + 0.5F);
|
||||
ResourceLocation test = new ResourceLocation("alchemicalwizardry:textures/models/AlchemicalCalcinator.png");
|
||||
FMLClientHandler.instance().getClient().renderEngine.bindTexture(test);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
|
||||
//GL11.glRotatef(90F, 0.0F, 0.0F, 1.0F);
|
||||
//A reference to your Model file. Again, very important.
|
||||
this.modelConduit.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);
|
||||
//Tell it to stop rendering for both the PushMatrix's
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* IItemRenderer implementation *
|
||||
*/
|
||||
@Override
|
||||
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
|
||||
switch (type) {
|
||||
case ENTITY:
|
||||
return true;
|
||||
case EQUIPPED:
|
||||
return true;
|
||||
case EQUIPPED_FIRST_PERSON:
|
||||
return true;
|
||||
case INVENTORY:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
|
||||
switch (type) {
|
||||
case ENTITY:
|
||||
renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
|
||||
break;
|
||||
case EQUIPPED:
|
||||
renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f);
|
||||
break;
|
||||
case EQUIPPED_FIRST_PERSON:
|
||||
renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f);
|
||||
break;
|
||||
case INVENTORY:
|
||||
renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
|
||||
break;
|
||||
default:
|
||||
}
|
||||
}
|
||||
}
|
|
@ -2,9 +2,11 @@ package WayofTime.alchemicalWizardry.common.renderer.block.itemRender;
|
|||
|
||||
import WayofTime.alchemicalWizardry.common.renderer.model.ModelBloodAltar;
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class TEAltarItemRenderer implements IItemRenderer
|
||||
|
@ -38,30 +40,25 @@ public class TEAltarItemRenderer implements IItemRenderer
|
|||
// TODO Auto-generated method stub
|
||||
switch (type)
|
||||
{
|
||||
case ENTITY:
|
||||
{
|
||||
renderBloodAltar(0f, 0f, 0f, scale);
|
||||
return;
|
||||
}
|
||||
|
||||
case EQUIPPED:
|
||||
{
|
||||
renderBloodAltar(0f, 0f, 0f, scale);
|
||||
return;
|
||||
}
|
||||
|
||||
case INVENTORY:
|
||||
{
|
||||
renderBloodAltar(0f, -0.25f, 0f, scale);
|
||||
return;
|
||||
}
|
||||
case ENTITY:
|
||||
renderBloodAltar((RenderBlocks) data[0], item, 0, 0, 0, scale);
|
||||
break;
|
||||
case EQUIPPED:
|
||||
renderBloodAltar((RenderBlocks) data[0], item, 0, 0, 0.5f, scale);
|
||||
break;
|
||||
case EQUIPPED_FIRST_PERSON:
|
||||
renderBloodAltar((RenderBlocks) data[0], item, +0.5f, 0.5f, +0.5f, scale);
|
||||
break;
|
||||
case INVENTORY:
|
||||
renderBloodAltar((RenderBlocks) data[0], item, -0.5f, -0.75f, -0.5f, scale);
|
||||
break;
|
||||
|
||||
default:
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
private void renderBloodAltar(float x, float y, float z, float scale)
|
||||
private void renderBloodAltar(RenderBlocks render, ItemStack item, float x, float y, float z, float scale)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
// Disable Lighting Calculations
|
||||
|
|
|
@ -0,0 +1,90 @@
|
|||
package WayofTime.alchemicalWizardry.common.renderer.block.itemRender;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import WayofTime.alchemicalWizardry.ModBlocks;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.model.ModelCrystalBelljar;
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
|
||||
public class TEBellJarItemRenderer implements IItemRenderer
|
||||
{
|
||||
private ModelCrystalBelljar modelConduit = new ModelCrystalBelljar();
|
||||
|
||||
private void renderConduitItem(RenderBlocks render, ItemStack item, float translateX, float translateY, float translateZ)
|
||||
{
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
|
||||
/**
|
||||
* Render the ghost item inside of the Altar, slowly spinning
|
||||
*/
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float) translateX + 0.5F, (float) translateY + 1.5F, (float) translateZ + 0.5F);
|
||||
ResourceLocation test = new ResourceLocation("alchemicalwizardry:textures/models/CrystalBelljar.png");
|
||||
FMLClientHandler.instance().getClient().renderEngine.bindTexture(test);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
|
||||
//GL11.glRotatef(90F, 0.0F, 0.0F, 1.0F);
|
||||
//A reference to your Model file. Again, very important.
|
||||
this.modelConduit.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);
|
||||
//Tell it to stop rendering for both the PushMatrix's
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPopMatrix();
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* IItemRenderer implementation *
|
||||
*/
|
||||
@Override
|
||||
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
|
||||
switch (type) {
|
||||
case ENTITY:
|
||||
return true;
|
||||
case EQUIPPED:
|
||||
return true;
|
||||
case EQUIPPED_FIRST_PERSON:
|
||||
return true;
|
||||
case INVENTORY:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
|
||||
switch (type) {
|
||||
case ENTITY:
|
||||
renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
|
||||
break;
|
||||
case EQUIPPED:
|
||||
renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f);
|
||||
break;
|
||||
case EQUIPPED_FIRST_PERSON:
|
||||
renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f);
|
||||
break;
|
||||
case INVENTORY:
|
||||
renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
|
||||
break;
|
||||
default:
|
||||
}
|
||||
}
|
||||
}
|
|
@ -28,6 +28,7 @@ public class TEConduitItemRenderer implements IItemRenderer
|
|||
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
|
||||
/**
|
||||
* Render the ghost item inside of the Altar, slowly spinning
|
||||
*/
|
||||
|
@ -92,4 +93,4 @@ public class TEConduitItemRenderer implements IItemRenderer
|
|||
default:
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue