Separated assets in 3 parts-Condensed rendering code

This commit is contained in:
GotoLink 2013-11-04 00:02:10 +01:00
commit 7cf77cdad0
257 changed files with 536 additions and 1648 deletions

View file

@ -103,7 +103,7 @@ public class BlockBush extends BlockFlower {
public void registerIcons(IconRegister iconRegister) {
textures = new Icon[16];
for (int i = 0; i < 12; i++) {
textures[i] = iconRegister.registerIcon("mysticmods:" + ItemBush.BUSH_TYPES[i]);
textures[i] = iconRegister.registerIcon("mysticworld:" + ItemBush.BUSH_TYPES[i]);
}
}

View file

@ -16,9 +16,9 @@ public class BlockHandler {
public static void init() {
oreImbuedStone = new BlockImbuedStone(BlockIds.ORE_STONE_1).setUnlocalizedName(Strings.IMBUED_STONE_NAME);
bush = new BlockBush(BlockIds.BUSH).setUnlocalizedName(Strings.BUSH_NAME);
lightCube = new BlockLightCube(BlockIds.LIGHT_CUBE).setUnlocalizedName(Strings.LIGHT_CUBE_NAME);
pillarPlatform = new BlockPlatform(BlockIds.PLATFORM).setUnlocalizedName(Strings.PLATFORM_NAME);
pillar = new BlockPillar(BlockIds.PILLAR).setUnlocalizedName(Strings.PILLAR_NAME);
lightCube = new BlockLightCube(BlockIds.LIGHT_CUBE).setUnlocalizedName(Strings.LIGHT_CUBE_NAME).setTextureName("mysticworld:lightCube");
pillarPlatform = new BlockPlatform(BlockIds.PLATFORM).setUnlocalizedName(Strings.PLATFORM_NAME).setTextureName("mysticworld:Platform");
pillar = new BlockPillar(BlockIds.PILLAR).setUnlocalizedName(Strings.PILLAR_NAME).setTextureName("mysticworld:Pillar");
pillarInsert = new BlockPillarInsert(BlockIds.PILLAR_INSERT).setUnlocalizedName(Strings.PILLAR_INSERT_NAME);
registerBlocks();
setBlockHarvestLevels();

View file

@ -87,7 +87,7 @@ public class BlockImbuedStone extends Block {
public void registerIcons(IconRegister iconRegister) {
textures = new Icon[16];
for (int i = 0; i < 5; i++) {
textures[i] = iconRegister.registerIcon("mysticmods" + ":" + ItemImbuedStone.IMBUED_STONE_TYPE[i] + " Imbued Stone");
textures[i] = iconRegister.registerIcon("mysticworld:" + ItemImbuedStone.IMBUED_STONE_TYPE[i] + " Imbued Stone");
}
}

View file

@ -5,10 +5,7 @@ import java.util.Random;
import mysticworld.MysticWorld;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockLightCube extends Block {
public BlockLightCube(int id) {
@ -34,12 +31,6 @@ public class BlockLightCube extends Block {
MysticWorld.proxy.lightCubeFX(world, x + random.nextDouble(), y + 0.75D, z + random.nextDouble(), 0.0D, 0.0D, 0.0D, 1.0F);
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister iconRegister) {
this.blockIcon = iconRegister.registerIcon("mysticmods:" + "lightCube");
}
@Override
public boolean renderAsNormalBlock() {
return false;

View file

@ -3,9 +3,6 @@ package mysticworld.blocks;
import mysticworld.MysticWorld;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockPillar extends Block {
public BlockPillar(int id) {
@ -21,12 +18,6 @@ public class BlockPillar extends Block {
return false;
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister iconRegister) {
this.blockIcon = iconRegister.registerIcon("mysticmods:" + "Pillar");
}
@Override
public boolean renderAsNormalBlock() {
return false;

View file

@ -1,9 +1,12 @@
package mysticworld.blocks;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import mysticworld.MysticWorld;
import mysticworld.tiles.TileEntityPillarInsert;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.tileentity.TileEntity;
@ -51,6 +54,11 @@ public class BlockPillarInsert extends BlockContainer {
return false;
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister par1IconRegister) {
}
@Override
public boolean renderAsNormalBlock() {
return false;

View file

@ -5,10 +5,7 @@ import java.util.Random;
import mysticworld.MysticWorld;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockPlatform extends Block {
public BlockPlatform(int id) {
@ -42,12 +39,6 @@ public class BlockPlatform extends Block {
}
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister iconRegister) {
this.blockIcon = iconRegister.registerIcon("mysticmods:" + "Platform");
}
@Override
public boolean renderAsNormalBlock() {
return false;

View file

@ -4,10 +4,7 @@ import mysticworld.blocks.BlockHandler;
import mysticworld.blocks.BlockPillarInsert;
import mysticworld.client.fx.LightCubeFX;
import mysticworld.client.fx.PowerAirFX;
import mysticworld.client.fx.PowerEarthFX;
import mysticworld.client.fx.PowerEnergyFX;
import mysticworld.client.fx.PowerFireFX;
import mysticworld.client.fx.PowerWaterFX;
import mysticworld.client.fx.PowerFX;
import mysticworld.entity.EntityChargeAir;
import mysticworld.entity.EntityChargeEarth;
import mysticworld.entity.EntityChargeEnergy;
@ -36,25 +33,25 @@ public class ClientProxy extends CommonProxy {
//particles
@Override
public void airFeetFX(World worldObj, double x, double y, double z, float scale, int age) {
PowerAirFX airFX = new PowerAirFX(worldObj, x, y, z, scale, age);
PowerFX airFX = new PowerAirFX(worldObj, x, y, z, scale, age);
mc.effectRenderer.addEffect(airFX);
}
@Override
public void earthFX(World worldObj, double x, double y, double z, float scale) {
PowerEarthFX earthFX = new PowerEarthFX(worldObj, x, y, z, scale);
PowerFX earthFX = new PowerFX(worldObj, x, y, z, scale).setTexture("earth");
mc.effectRenderer.addEffect(earthFX);
}
@Override
public void energyFX(World worldObj, double x, double y, double z, float scale) {
PowerEnergyFX energyFX = new PowerEnergyFX(worldObj, x, y, z, scale);
PowerFX energyFX = new PowerFX(worldObj, x, y, z, scale).setTexture("energy");
mc.effectRenderer.addEffect(energyFX);
}
@Override
public void fireFX(World worldObj, double x, double y, double z, float scale) {
PowerFireFX fireFX = new PowerFireFX(worldObj, x, y, z, scale);
PowerFX fireFX = new PowerFX(worldObj, x, y, z, scale).setTexture("fire");
mc.effectRenderer.addEffect(fireFX);
}
@ -68,16 +65,16 @@ public class ClientProxy extends CommonProxy {
public void registerRenders() {
BlockPillarInsert.RENDER_PILLAR_INSERT = RenderingRegistry.getNextAvailableRenderId();
MinecraftForgeClient.registerItemRenderer(BlockHandler.pillarInsert.blockID, new BlockPillarInsertRenderer());
MinecraftForgeClient.registerItemRenderer(ItemHandler.fireStaff.itemID, new ItemStaffFireRenderer());
MinecraftForgeClient.registerItemRenderer(ItemHandler.earthStaff.itemID, new ItemStaffEarthRenderer());
MinecraftForgeClient.registerItemRenderer(ItemHandler.airStaff.itemID, new ItemStaffAirRenderer());
MinecraftForgeClient.registerItemRenderer(ItemHandler.energyStaff.itemID, new ItemStaffEnergyRenderer());
MinecraftForgeClient.registerItemRenderer(ItemHandler.waterStaff.itemID, new ItemStaffWaterRenderer());
MinecraftForgeClient.registerItemRenderer(ItemHandler.fireOrb.itemID, new ItemOrbFireRenderer());
MinecraftForgeClient.registerItemRenderer(ItemHandler.earthOrb.itemID, new ItemOrbEarthRenderer());
MinecraftForgeClient.registerItemRenderer(ItemHandler.airOrb.itemID, new ItemOrbAirRenderer());
MinecraftForgeClient.registerItemRenderer(ItemHandler.energyOrb.itemID, new ItemOrbEnergyRenderer());
MinecraftForgeClient.registerItemRenderer(ItemHandler.waterOrb.itemID, new ItemOrbWaterRenderer());
MinecraftForgeClient.registerItemRenderer(ItemHandler.fireStaff.itemID, new StaffItemRenderer("Fire"));
MinecraftForgeClient.registerItemRenderer(ItemHandler.earthStaff.itemID, new StaffItemRenderer("Earth"));
MinecraftForgeClient.registerItemRenderer(ItemHandler.airStaff.itemID, new StaffItemRenderer("Air"));
MinecraftForgeClient.registerItemRenderer(ItemHandler.energyStaff.itemID, new StaffItemRenderer("Energy"));
MinecraftForgeClient.registerItemRenderer(ItemHandler.waterStaff.itemID, new StaffItemRenderer("Water"));
MinecraftForgeClient.registerItemRenderer(ItemHandler.fireOrb.itemID, new OrbItemRenderer("Fire"));
MinecraftForgeClient.registerItemRenderer(ItemHandler.earthOrb.itemID, new OrbItemRenderer("Earth"));
MinecraftForgeClient.registerItemRenderer(ItemHandler.airOrb.itemID, new OrbItemRenderer("Air"));
MinecraftForgeClient.registerItemRenderer(ItemHandler.energyOrb.itemID, new OrbItemRenderer("Energy"));
MinecraftForgeClient.registerItemRenderer(ItemHandler.waterOrb.itemID, new OrbItemRenderer("Water"));
RenderingRegistry.registerEntityRenderingHandler(EntityChargeFire.class, new RenderStaffPower(0));
RenderingRegistry.registerEntityRenderingHandler(EntityChargeWater.class, new RenderStaffPower(1));
RenderingRegistry.registerEntityRenderingHandler(EntityChargeEarth.class, new RenderStaffPower(2));
@ -88,7 +85,7 @@ public class ClientProxy extends CommonProxy {
@Override
public void waterFX(World worldObj, double x, double y, double z, float scale) {
PowerWaterFX waterFX = new PowerWaterFX(worldObj, x, y, z, scale);
PowerFX waterFX = new PowerFX(worldObj, x, y, z, scale).setTexture("water");
mc.effectRenderer.addEffect(waterFX);
}
}

View file

@ -1,24 +1,15 @@
package mysticworld.client.fx;
import mysticworld.client.ClientProxy;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.client.FMLClientHandler;
public class LightCubeFX extends EntityFX {
public static final ResourceLocation lightFX = new ResourceLocation("mysticmods", "textures/misc/lightCubeFX.png");
public class LightCubeFX extends PowerFX {
public LightCubeFX(World world, double x, double y, double z) {
super(world, x, y, z);
this.setTexture("lightCube");
}
public LightCubeFX(World world, double x, double y, double z, double motionX, double motionY, double motionZ, float scale) {
super(world, x, y, z);
this(world, x, y, z);
this.motionX *= 0.10000000149011612D;
this.motionY *= 0.10000000149011612D;
this.motionZ *= 0.10000000149011612D;
@ -32,55 +23,4 @@ public class LightCubeFX extends EntityFX {
this.noClip = true;
this.particleMaxAge = rand.nextInt(25);
}
@Override
public void onUpdate() {
this.prevPosX = this.posX;
this.prevPosY = this.posY;
this.prevPosZ = this.posZ;
if (this.particleAge++ >= this.particleMaxAge) {
this.setDead();
}
this.motionY += 0.004D;
this.moveEntity(this.motionX, this.motionY, this.motionZ);
if (this.posY == this.prevPosY) {
this.motionX *= 1.1D;
this.motionZ *= 1.1D;
}
this.motionX *= 0.9599999785423279D;
this.motionY *= 0.9599999785423279D;
this.motionZ *= 0.9599999785423279D;
if (this.onGround) {
this.motionX *= 0.699999988079071D;
this.motionZ *= 0.699999988079071D;
}
}
@Override
public void renderParticle(Tessellator tessellator, float par2, float par3, float par4, float par5, float par6, float par7) {
tessellator.draw();
GL11.glPushMatrix();
GL11.glDepthMask(false);
GL11.glEnable(3042);
GL11.glBlendFunc(770, 1);
FMLClientHandler.instance().getClient().renderEngine.bindTexture(lightFX);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.75F);
float scale = 0.1F * this.particleScale;
float xPos = (float) (this.prevPosX + (this.posX - this.prevPosX) * par2 - interpPosX);
float yPos = (float) (this.prevPosY + (this.posY - this.prevPosY) * par2 - interpPosY);
float zPos = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * par2 - interpPosZ);
tessellator.startDrawingQuads();
tessellator.setBrightness(240);
tessellator.setColorOpaque_F(this.particleRed, this.particleGreen, this.particleBlue);
tessellator.addVertexWithUV(xPos - par3 * scale - par6 * scale, yPos - par4 * scale, zPos - par5 * scale - par7 * scale, 0D, 1D);
tessellator.addVertexWithUV(xPos - par3 * scale + par6 * scale, yPos + par4 * scale, zPos - par5 * scale + par7 * scale, 1D, 1D);
tessellator.addVertexWithUV(xPos + par3 * scale + par6 * scale, yPos + par4 * scale, zPos + par5 * scale + par7 * scale, 1D, 0D);
tessellator.addVertexWithUV(xPos + par3 * scale - par6 * scale, yPos - par4 * scale, zPos + par5 * scale - par7 * scale, 0D, 0D);
tessellator.draw();
GL11.glDisable(3042);
GL11.glDepthMask(true);
GL11.glPopMatrix();
FMLClientHandler.instance().getClient().renderEngine.bindTexture(ClientProxy.particle);
tessellator.startDrawingQuads();
}
}

View file

@ -1,25 +1,16 @@
package mysticworld.client.fx;
import mysticworld.client.ClientProxy;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.util.MathHelper;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.client.FMLClientHandler;
public class PowerAirFX extends EntityFX {
public static final ResourceLocation airFX = new ResourceLocation("mysticmods", "textures/misc/airFX.png");
public class PowerAirFX extends PowerFX {
public PowerAirFX(World world, double x, double y, double z) {
super(world, x, y, z);
this.setTexture("air");
}
public PowerAirFX(World world, double x, double y, double z, double motionX, double motionY, double motionZ, float rotPitch, float rotYaw) {
super(world, x, y, z);
this(world, x, y, z);
this.motionX = -MathHelper.sin(this.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI);
this.motionY = (-MathHelper.sin((this.rotationPitch) / 180.0F * (float) Math.PI));
this.motionZ = MathHelper.cos(this.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI);
@ -34,7 +25,7 @@ public class PowerAirFX extends EntityFX {
}
public PowerAirFX(World world, double x, double y, double z, float scale, int age) {
super(world, x, y, z);
this(world, x, y, z);
this.motionX += motionX;
this.motionY += motionY;
this.motionZ += motionZ;
@ -51,56 +42,10 @@ public class PowerAirFX extends EntityFX {
@Override
public void onUpdate() {
this.prevPosX = this.posX;
this.prevPosY = this.posY;
this.prevPosZ = this.posZ;
if (this.particleAge++ >= this.particleMaxAge) {
this.setDead();
}
this.motionY += 0.004D;
this.moveEntity(this.motionX, this.motionY, this.motionZ);
if (this.posY == this.prevPosY) {
this.motionX *= 1.1D;
this.motionZ *= 1.1D;
}
this.motionX *= 0.9599999785423279D;
this.motionY *= 0.9599999785423279D;
this.motionZ *= 0.9599999785423279D;
if (this.onGround) {
this.motionX *= 0.699999988079071D;
this.motionZ *= 0.699999988079071D;
}
super.onUpdate();
this.posX += this.motionX;
this.posY += this.motionY;
this.posZ += this.motionZ;
this.setPosition(this.posX, this.posY, this.posZ);
}
@Override
public void renderParticle(Tessellator tessellator, float par2, float par3, float par4, float par5, float par6, float par7) {
tessellator.draw();
GL11.glPushMatrix();
GL11.glDepthMask(false);
GL11.glEnable(3042);
GL11.glBlendFunc(770, 1);
FMLClientHandler.instance().getClient().renderEngine.bindTexture(airFX);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.75F);
float scale = 0.1F * this.particleScale;
float xPos = (float) (this.prevPosX + (this.posX - this.prevPosX) * par2 - interpPosX);
float yPos = (float) (this.prevPosY + (this.posY - this.prevPosY) * par2 - interpPosY);
float zPos = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * par2 - interpPosZ);
tessellator.startDrawingQuads();
tessellator.setBrightness(240);
tessellator.setColorOpaque_F(this.particleRed, this.particleGreen, this.particleBlue);
tessellator.addVertexWithUV(xPos - par3 * scale - par6 * scale, yPos - par4 * scale, zPos - par5 * scale - par7 * scale, 0D, 1D);
tessellator.addVertexWithUV(xPos - par3 * scale + par6 * scale, yPos + par4 * scale, zPos - par5 * scale + par7 * scale, 1D, 1D);
tessellator.addVertexWithUV(xPos + par3 * scale + par6 * scale, yPos + par4 * scale, zPos + par5 * scale + par7 * scale, 1D, 0D);
tessellator.addVertexWithUV(xPos + par3 * scale - par6 * scale, yPos - par4 * scale, zPos + par5 * scale - par7 * scale, 0D, 0D);
tessellator.draw();
GL11.glDisable(3042);
GL11.glDepthMask(true);
GL11.glPopMatrix();
FMLClientHandler.instance().getClient().renderEngine.bindTexture(ClientProxy.particle);
tessellator.startDrawingQuads();
}
}

View file

@ -1,86 +0,0 @@
package mysticworld.client.fx;
import mysticworld.client.ClientProxy;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.client.FMLClientHandler;
public class PowerEarthFX extends EntityFX {
public static final ResourceLocation earthFX = new ResourceLocation("mysticmods", "textures/misc/earthFX.png");
public PowerEarthFX(World world, double x, double y, double z) {
super(world, x, y, z);
}
public PowerEarthFX(World world, double x, double y, double z, float scale) {
super(world, x, y, z);
this.motionX *= 0.019999999552965164D;
this.motionY *= 0.019999999552965164D;
this.motionZ *= 0.019999999552965164D;
this.motionX += motionX;
this.motionY += motionY;
this.motionZ += motionZ;
this.particleRed = 1.0F;
this.particleGreen = 1.0F;
this.particleBlue = 1.0F;
this.particleScale = scale;
this.noClip = true;
this.particleMaxAge = 15;
}
@Override
public void onUpdate() {
this.prevPosX = this.posX;
this.prevPosY = this.posY;
this.prevPosZ = this.posZ;
if (this.particleAge++ >= this.particleMaxAge) {
this.setDead();
}
this.motionY += 0.004D;
this.moveEntity(this.motionX, this.motionY, this.motionZ);
if (this.posY == this.prevPosY) {
this.motionX *= 1.1D;
this.motionZ *= 1.1D;
}
this.motionX *= 0.9599999785423279D;
this.motionY *= 0.9599999785423279D;
this.motionZ *= 0.9599999785423279D;
if (this.onGround) {
this.motionX *= 0.699999988079071D;
this.motionZ *= 0.699999988079071D;
}
}
@Override
public void renderParticle(Tessellator tessellator, float par2, float par3, float par4, float par5, float par6, float par7) {
tessellator.draw();
GL11.glPushMatrix();
GL11.glDepthMask(false);
GL11.glEnable(3042);
GL11.glBlendFunc(770, 1);
FMLClientHandler.instance().getClient().renderEngine.bindTexture(earthFX);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.75F);
float scale = 0.1F * this.particleScale;
float xPos = (float) (this.prevPosX + (this.posX - this.prevPosX) * par2 - interpPosX);
float yPos = (float) (this.prevPosY + (this.posY - this.prevPosY) * par2 - interpPosY);
float zPos = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * par2 - interpPosZ);
tessellator.startDrawingQuads();
tessellator.setBrightness(240);
tessellator.setColorOpaque_F(this.particleRed, this.particleGreen, this.particleBlue);
tessellator.addVertexWithUV(xPos - par3 * scale - par6 * scale, yPos - par4 * scale, zPos - par5 * scale - par7 * scale, 0D, 1D);
tessellator.addVertexWithUV(xPos - par3 * scale + par6 * scale, yPos + par4 * scale, zPos - par5 * scale + par7 * scale, 1D, 1D);
tessellator.addVertexWithUV(xPos + par3 * scale + par6 * scale, yPos + par4 * scale, zPos + par5 * scale + par7 * scale, 1D, 0D);
tessellator.addVertexWithUV(xPos + par3 * scale - par6 * scale, yPos - par4 * scale, zPos + par5 * scale - par7 * scale, 0D, 0D);
tessellator.draw();
GL11.glDisable(3042);
GL11.glDepthMask(true);
GL11.glPopMatrix();
FMLClientHandler.instance().getClient().renderEngine.bindTexture(ClientProxy.particle);
tessellator.startDrawingQuads();
}
}

View file

@ -1,86 +0,0 @@
package mysticworld.client.fx;
import mysticworld.client.ClientProxy;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.client.FMLClientHandler;
public class PowerEnergyFX extends EntityFX {
public static final ResourceLocation energyFX = new ResourceLocation("mysticmods", "textures/misc/energyFX.png");
public PowerEnergyFX(World world, double x, double y, double z) {
super(world, x, y, z);
}
public PowerEnergyFX(World world, double x, double y, double z, float scale) {
super(world, x, y, z);
this.motionX *= 0.019999999552965164D;
this.motionY *= 0.019999999552965164D;
this.motionZ *= 0.019999999552965164D;
this.motionX += motionX;
this.motionY += motionY;
this.motionZ += motionZ;
this.particleRed = 1.0F;
this.particleGreen = 1.0F;
this.particleBlue = 1.0F;
this.particleScale = scale;
this.noClip = true;
this.particleMaxAge = 15;
}
@Override
public void onUpdate() {
this.prevPosX = this.posX;
this.prevPosY = this.posY;
this.prevPosZ = this.posZ;
if (this.particleAge++ >= this.particleMaxAge) {
this.setDead();
}
this.motionY += 0.004D;
this.moveEntity(this.motionX, this.motionY, this.motionZ);
if (this.posY == this.prevPosY) {
this.motionX *= 1.1D;
this.motionZ *= 1.1D;
}
this.motionX *= 0.9599999785423279D;
this.motionY *= 0.9599999785423279D;
this.motionZ *= 0.9599999785423279D;
if (this.onGround) {
this.motionX *= 0.699999988079071D;
this.motionZ *= 0.699999988079071D;
}
}
@Override
public void renderParticle(Tessellator tessellator, float par2, float par3, float par4, float par5, float par6, float par7) {
tessellator.draw();
GL11.glPushMatrix();
GL11.glDepthMask(false);
GL11.glEnable(3042);
GL11.glBlendFunc(770, 1);
FMLClientHandler.instance().getClient().renderEngine.bindTexture(energyFX);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.75F);
float scale = 0.1F * this.particleScale;
float xPos = (float) (this.prevPosX + (this.posX - this.prevPosX) * par2 - interpPosX);
float yPos = (float) (this.prevPosY + (this.posY - this.prevPosY) * par2 - interpPosY);
float zPos = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * par2 - interpPosZ);
tessellator.startDrawingQuads();
tessellator.setBrightness(240);
tessellator.setColorOpaque_F(this.particleRed, this.particleGreen, this.particleBlue);
tessellator.addVertexWithUV(xPos - par3 * scale - par6 * scale, yPos - par4 * scale, zPos - par5 * scale - par7 * scale, 0D, 1D);
tessellator.addVertexWithUV(xPos - par3 * scale + par6 * scale, yPos + par4 * scale, zPos - par5 * scale + par7 * scale, 1D, 1D);
tessellator.addVertexWithUV(xPos + par3 * scale + par6 * scale, yPos + par4 * scale, zPos + par5 * scale + par7 * scale, 1D, 0D);
tessellator.addVertexWithUV(xPos + par3 * scale - par6 * scale, yPos - par4 * scale, zPos + par5 * scale - par7 * scale, 0D, 0D);
tessellator.draw();
GL11.glDisable(3042);
GL11.glDepthMask(true);
GL11.glPopMatrix();
FMLClientHandler.instance().getClient().renderEngine.bindTexture(ClientProxy.particle);
tessellator.startDrawingQuads();
}
}

View file

@ -1,86 +0,0 @@
package mysticworld.client.fx;
import mysticworld.client.ClientProxy;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.client.FMLClientHandler;
public class PowerFireFX extends EntityFX {
public static final ResourceLocation fireFX = new ResourceLocation("mysticmods", "textures/misc/fireFX.png");
public PowerFireFX(World world, double x, double y, double z) {
super(world, x, y, z);
}
public PowerFireFX(World world, double x, double y, double z, float scale) {
super(world, x, y, z);
this.motionX *= 0.019999999552965164D;
this.motionY *= 0.019999999552965164D;
this.motionZ *= 0.019999999552965164D;
this.motionX += motionX;
this.motionY += motionY;
this.motionZ += motionZ;
this.particleRed = 1.0F;
this.particleGreen = 1.0F;
this.particleBlue = 1.0F;
this.particleScale = scale;
this.noClip = true;
this.particleMaxAge = 15;
}
@Override
public void onUpdate() {
this.prevPosX = this.posX;
this.prevPosY = this.posY;
this.prevPosZ = this.posZ;
if (this.particleAge++ >= this.particleMaxAge) {
this.setDead();
}
this.motionY += 0.004D;
this.moveEntity(this.motionX, this.motionY, this.motionZ);
if (this.posY == this.prevPosY) {
this.motionX *= 1.1D;
this.motionZ *= 1.1D;
}
this.motionX *= 0.9599999785423279D;
this.motionY *= 0.9599999785423279D;
this.motionZ *= 0.9599999785423279D;
if (this.onGround) {
this.motionX *= 0.699999988079071D;
this.motionZ *= 0.699999988079071D;
}
}
@Override
public void renderParticle(Tessellator tessellator, float par2, float par3, float par4, float par5, float par6, float par7) {
tessellator.draw();
GL11.glPushMatrix();
GL11.glDepthMask(false);
GL11.glEnable(3042);
GL11.glBlendFunc(770, 1);
FMLClientHandler.instance().getClient().renderEngine.bindTexture(fireFX);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.75F);
float scale = 0.1F * this.particleScale;
float xPos = (float) (this.prevPosX + (this.posX - this.prevPosX) * par2 - interpPosX);
float yPos = (float) (this.prevPosY + (this.posY - this.prevPosY) * par2 - interpPosY);
float zPos = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * par2 - interpPosZ);
tessellator.startDrawingQuads();
tessellator.setBrightness(240);
tessellator.setColorOpaque_F(this.particleRed, this.particleGreen, this.particleBlue);
tessellator.addVertexWithUV(xPos - par3 * scale - par6 * scale, yPos - par4 * scale, zPos - par5 * scale - par7 * scale, 0D, 1D);
tessellator.addVertexWithUV(xPos - par3 * scale + par6 * scale, yPos + par4 * scale, zPos - par5 * scale + par7 * scale, 1D, 1D);
tessellator.addVertexWithUV(xPos + par3 * scale + par6 * scale, yPos + par4 * scale, zPos + par5 * scale + par7 * scale, 1D, 0D);
tessellator.addVertexWithUV(xPos + par3 * scale - par6 * scale, yPos - par4 * scale, zPos + par5 * scale - par7 * scale, 0D, 0D);
tessellator.draw();
GL11.glDisable(3042);
GL11.glDepthMask(true);
GL11.glPopMatrix();
FMLClientHandler.instance().getClient().renderEngine.bindTexture(ClientProxy.particle);
tessellator.startDrawingQuads();
}
}

View file

@ -1,86 +0,0 @@
package mysticworld.client.fx;
import mysticworld.client.ClientProxy;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.client.FMLClientHandler;
public class PowerWaterFX extends EntityFX {
public static final ResourceLocation waterFX = new ResourceLocation("mysticmods", "textures/misc/waterFX.png");
public PowerWaterFX(World world, double x, double y, double z) {
super(world, x, y, z);
}
public PowerWaterFX(World world, double x, double y, double z, float scale) {
super(world, x, y, z);
this.motionX *= 0.019999999552965164D;
this.motionY *= 0.019999999552965164D;
this.motionZ *= 0.019999999552965164D;
this.motionX += motionX;
this.motionY += motionY;
this.motionZ += motionZ;
this.particleRed = 1.0F;
this.particleGreen = 1.0F;
this.particleBlue = 1.0F;
this.particleScale = scale;
this.noClip = true;
this.particleMaxAge = 15;
}
@Override
public void onUpdate() {
this.prevPosX = this.posX;
this.prevPosY = this.posY;
this.prevPosZ = this.posZ;
if (this.particleAge++ >= this.particleMaxAge) {
this.setDead();
}
this.motionY += 0.004D;
this.moveEntity(this.motionX, this.motionY, this.motionZ);
if (this.posY == this.prevPosY) {
this.motionX *= 1.1D;
this.motionZ *= 1.1D;
}
this.motionX *= 0.9599999785423279D;
this.motionY *= 0.9599999785423279D;
this.motionZ *= 0.9599999785423279D;
if (this.onGround) {
this.motionX *= 0.699999988079071D;
this.motionZ *= 0.699999988079071D;
}
}
@Override
public void renderParticle(Tessellator tessellator, float par2, float par3, float par4, float par5, float par6, float par7) {
tessellator.draw();
GL11.glPushMatrix();
GL11.glDepthMask(false);
GL11.glEnable(3042);
GL11.glBlendFunc(770, 1);
FMLClientHandler.instance().getClient().renderEngine.bindTexture(waterFX);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.75F);
float scale = 0.1F * this.particleScale;
float xPos = (float) (this.prevPosX + (this.posX - this.prevPosX) * par2 - interpPosX);
float yPos = (float) (this.prevPosY + (this.posY - this.prevPosY) * par2 - interpPosY);
float zPos = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * par2 - interpPosZ);
tessellator.startDrawingQuads();
tessellator.setBrightness(240);
tessellator.setColorOpaque_F(this.particleRed, this.particleGreen, this.particleBlue);
tessellator.addVertexWithUV(xPos - par3 * scale - par6 * scale, yPos - par4 * scale, zPos - par5 * scale - par7 * scale, 0D, 1D);
tessellator.addVertexWithUV(xPos - par3 * scale + par6 * scale, yPos + par4 * scale, zPos - par5 * scale + par7 * scale, 1D, 1D);
tessellator.addVertexWithUV(xPos + par3 * scale + par6 * scale, yPos + par4 * scale, zPos + par5 * scale + par7 * scale, 1D, 0D);
tessellator.addVertexWithUV(xPos + par3 * scale - par6 * scale, yPos - par4 * scale, zPos + par5 * scale - par7 * scale, 0D, 0D);
tessellator.draw();
GL11.glDisable(3042);
GL11.glDepthMask(true);
GL11.glPopMatrix();
FMLClientHandler.instance().getClient().renderEngine.bindTexture(ClientProxy.particle);
tessellator.startDrawingQuads();
}
}

View file

@ -20,11 +20,11 @@ public class ItemArmorAdamantine extends ItemArmor {
@Override
public String getArmorTexture(ItemStack stack, Entity entity, int slot, int layer) {
int suffix = this.armorType == 2 ? 2 : 1;
return "mysticmods:textures" + "/models/armor/Adamantine_layer_" + suffix + ".png";
return "mysticworld:textures/models/armor/Adamantine_layer_" + suffix + ".png";
}
@Override
public void registerIcons(IconRegister iconRegister) {
itemIcon = iconRegister.registerIcon("mysticmods:AdamantineArmor_" + ArmorType);
itemIcon = iconRegister.registerIcon("mysticworld:AdamantineArmor_" + ArmorType);
}
}

View file

@ -24,7 +24,7 @@ public class ItemArmorIridium extends ItemArmor {
@Override
public String getArmorTexture(ItemStack stack, Entity entity, int slot, int layer) {
int suffix = this.armorType == 2 ? 2 : 1;
return "mysticmods:textures" + "/models/armor/Iridium_layer_" + suffix + ".png";
return "mysticworld:textures/models/armor/Iridium_layer_" + suffix + ".png";
}
@Override
@ -60,6 +60,6 @@ public class ItemArmorIridium extends ItemArmor {
@Override
public void registerIcons(IconRegister iconRegister) {
itemIcon = iconRegister.registerIcon("mysticmods:IridiumArmor_" + ArmorType);
itemIcon = iconRegister.registerIcon("mysticworld:IridiumArmor_" + ArmorType);
}
}

View file

@ -20,11 +20,11 @@ public class ItemArmorMithril extends ItemArmor {
@Override
public String getArmorTexture(ItemStack stack, Entity entity, int slot, int layer) {
int suffix = this.armorType == 2 ? 2 : 1;
return "mysticmods:textures" + "/models/armor/Mithril_layer_" + suffix + ".png";
return "mysticworld:textures/models/armor/Mithril_layer_" + suffix + ".png";
}
@Override
public void registerIcons(IconRegister iconRegister) {
itemIcon = iconRegister.registerIcon("mysticmods:MithrilArmor_" + ArmorType);
itemIcon = iconRegister.registerIcon("mysticworld:MithrilArmor_" + ArmorType);
}
}

View file

@ -20,11 +20,11 @@ public class ItemArmorVerdite extends ItemArmor {
@Override
public String getArmorTexture(ItemStack stack, Entity entity, int slot, int layer) {
int suffix = this.armorType == 2 ? 2 : 1;
return "mysticmods:textures" + "/models/armor/Verdite_layer_" + suffix + ".png";
return "mysticworld:textures/models/armor/Verdite_layer_" + suffix + ".png";
}
@Override
public void registerIcons(IconRegister iconRegister) {
itemIcon = iconRegister.registerIcon("mysticmods:VerditeArmor_" + ArmorType);
itemIcon = iconRegister.registerIcon("mysticworld:VerditeArmor_" + ArmorType);
}
}

View file

@ -63,7 +63,7 @@ public class ItemBushFruit extends ItemFood {
public void registerIcons(IconRegister iconRegister) {
icons = new Icon[FRUIT_TYPES.length];
for (int i = 0; i < FRUIT_TYPES.length; ++i) {
icons[i] = iconRegister.registerIcon("mysticmods:Fruit" + FRUIT_TYPES[i]);
icons[i] = iconRegister.registerIcon("mysticworld:Fruit" + FRUIT_TYPES[i]);
}
}

View file

@ -50,7 +50,7 @@ public class ItemImbuedShard extends Item {
public void registerIcons(IconRegister iconRegister) {
icons = new Icon[SHARD_TYPES.length];
for (int i = 0; i < SHARD_TYPES.length; ++i) {
icons[i] = iconRegister.registerIcon("mysticmods:Shard" + SHARD_TYPES[i]);
icons[i] = iconRegister.registerIcon("mysticworld:Shard" + SHARD_TYPES[i]);
}
}
}

View file

@ -2,7 +2,11 @@ package mysticworld.items;
import java.util.Random;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import mysticworld.MysticWorld;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.item.Item;
public class ItemOrb extends Item {
@ -14,4 +18,9 @@ public class ItemOrb extends Item {
this.setMaxDamage(200);
this.setCreativeTab(MysticWorld.MysticWorldTab);
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister par1IconRegister) {
}
}

View file

@ -3,6 +3,7 @@ package mysticworld.items;
import java.util.Random;
import mysticworld.MysticWorld;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.item.Item;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@ -22,4 +23,9 @@ public class ItemStaff extends Item {
public boolean isFull3D() {
return true;
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister par1IconRegister) {
}
}

View file

@ -54,7 +54,7 @@ public class ItemStaffParts extends Item {
public void registerIcons(IconRegister iconRegister) {
icons = new Icon[STAFF_PARTS.length];
for (int i = 0; i < STAFF_PARTS.length; ++i) {
icons[i] = iconRegister.registerIcon("mysticmods:StaffPart_" + STAFF_PARTS[i]);
icons[i] = iconRegister.registerIcon("mysticworld:StaffPart_" + STAFF_PARTS[i]);
}
}
}

View file

@ -37,7 +37,7 @@ public class ItemStaffPower extends Item {
public void registerIcons(IconRegister iconRegister) {
icons = new Icon[CHARGE_NAMES.length];
for (int i = 0; i < CHARGE_NAMES.length; ++i) {
icons[i] = iconRegister.registerIcon("mysticmods:Charge" + CHARGE_NAMES[i]);
icons[i] = iconRegister.registerIcon("mysticworld:Charge" + CHARGE_NAMES[i]);
}
}
}

View file

@ -3,7 +3,6 @@ package mysticworld.items;
import java.util.List;
import mysticworld.MysticWorld;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
@ -63,10 +62,4 @@ public class ItemVoidShard extends Item {
}
return itemStack;
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister iconRegister) {
itemIcon = iconRegister.registerIcon("mysticmods:ShardVoid");
}
}

View file

@ -8,7 +8,7 @@ public class ModelOrb extends ModelBase {
private IModelCustom modelOrb;
public ModelOrb() {
modelOrb = AdvancedModelLoader.loadModel("/assets/mysticmods/models/orb.obj");
modelOrb = AdvancedModelLoader.loadModel("/assets/mysticworld/models/orb.obj");
}
public void render() {

View file

@ -10,7 +10,7 @@ import org.lwjgl.opengl.GL11;
import cpw.mods.fml.client.FMLClientHandler;
public class BlockPillarInsertRenderer implements IItemRenderer {
private static final ResourceLocation texture = new ResourceLocation("mysticmods:textures" + "/models/PillarInsert.png");
private static final ResourceLocation texture = new ResourceLocation("mysticworld", "textures/models/PillarInsert.png");
private final ModelPillarInsert model;
public BlockPillarInsertRenderer() {

View file

@ -1,82 +0,0 @@
package mysticworld.renderer;
import mysticworld.model.ModelOrb;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.IItemRenderer;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.client.FMLClientHandler;
public class ItemOrbAirRenderer implements IItemRenderer {
private ModelOrb modelOrb;
public ItemOrbAirRenderer() {
modelOrb = new ModelOrb();
}
@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 void renderItem(ItemRenderType type, ItemStack item, Object... data) {
switch (type) {
case ENTITY:
renderOrb(0.0f, 0.5f, 0.0f, 0.4f);
break;
case EQUIPPED:
renderOrb(0.5f, 1.0f, 0.5f, 0.5f);
break;
case INVENTORY:
renderOrb(0.0f, 0.0f, 0.0f, 0.5f);
break;
case EQUIPPED_FIRST_PERSON:
renderOrb(0.0f, 1.0f, 1.0f, 0.5f);
break;
default:
break;
}
}
public void renderOrb(float x, float y, float z, float scale) {
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glTranslatef(x, y, z);
GL11.glScalef(scale, scale, scale);
GL11.glRotatef(180f, 0f, 1f, 0f);
FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("mysticmods:textures" + "/models/OrbAir.png"));
modelOrb.render();
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopMatrix();
}
@Override
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
switch (type) {
case ENTITY:
return true;
case EQUIPPED:
return true;
case INVENTORY:
return true;
case EQUIPPED_FIRST_PERSON:
return true;
default:
return false;
}
}
}

View file

@ -1,82 +0,0 @@
package mysticworld.renderer;
import mysticworld.model.ModelOrb;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.IItemRenderer;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.client.FMLClientHandler;
public class ItemOrbEarthRenderer implements IItemRenderer {
private ModelOrb modelOrb;
public ItemOrbEarthRenderer() {
modelOrb = new ModelOrb();
}
@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 void renderItem(ItemRenderType type, ItemStack item, Object... data) {
switch (type) {
case ENTITY:
renderOrb(0.0f, 0.5f, 0.0f, 0.4f);
break;
case EQUIPPED:
renderOrb(0.5f, 1.0f, 0.5f, 0.5f);
break;
case INVENTORY:
renderOrb(0.0f, 0.0f, 0.0f, 0.5f);
break;
case EQUIPPED_FIRST_PERSON:
renderOrb(0.0f, 1.0f, 1.0f, 0.5f);
break;
default:
break;
}
}
public void renderOrb(float x, float y, float z, float scale) {
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glTranslatef(x, y, z);
GL11.glScalef(scale, scale, scale);
GL11.glRotatef(180f, 0f, 1f, 0f);
FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("mysticmods:textures" + "/models/OrbEarth.png"));
modelOrb.render();
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopMatrix();
}
@Override
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
switch (type) {
case ENTITY:
return true;
case EQUIPPED:
return true;
case INVENTORY:
return true;
case EQUIPPED_FIRST_PERSON:
return true;
default:
return false;
}
}
}

View file

@ -1,82 +0,0 @@
package mysticworld.renderer;
import mysticworld.model.ModelOrb;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.IItemRenderer;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.client.FMLClientHandler;
public class ItemOrbEnergyRenderer implements IItemRenderer {
private ModelOrb modelOrb;
public ItemOrbEnergyRenderer() {
modelOrb = new ModelOrb();
}
@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 void renderItem(ItemRenderType type, ItemStack item, Object... data) {
switch (type) {
case ENTITY:
renderOrb(0.0f, 0.5f, 0.0f, 0.4f);
break;
case EQUIPPED:
renderOrb(0.5f, 1.0f, 0.5f, 0.5f);
break;
case INVENTORY:
renderOrb(0.0f, 0.0f, 0.0f, 0.5f);
break;
case EQUIPPED_FIRST_PERSON:
renderOrb(0.0f, 1.0f, 1.0f, 0.5f);
break;
default:
break;
}
}
public void renderOrb(float x, float y, float z, float scale) {
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glTranslatef(x, y, z);
GL11.glScalef(scale, scale, scale);
GL11.glRotatef(180f, 0f, 1f, 0f);
FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("mysticmods:textures" + "/models/OrbEnergy.png"));
modelOrb.render();
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopMatrix();
}
@Override
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
switch (type) {
case ENTITY:
return true;
case EQUIPPED:
return true;
case INVENTORY:
return true;
case EQUIPPED_FIRST_PERSON:
return true;
default:
return false;
}
}
}

View file

@ -1,82 +0,0 @@
package mysticworld.renderer;
import mysticworld.model.ModelOrb;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.IItemRenderer;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.client.FMLClientHandler;
public class ItemOrbFireRenderer implements IItemRenderer {
private ModelOrb modelOrb;
public ItemOrbFireRenderer() {
modelOrb = new ModelOrb();
}
@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 void renderItem(ItemRenderType type, ItemStack item, Object... data) {
switch (type) {
case ENTITY:
renderOrb(0.0f, 0.5f, 0.0f, 0.4f);
break;
case EQUIPPED:
renderOrb(0.5f, 1.0f, 0.5f, 0.5f);
break;
case INVENTORY:
renderOrb(0.0f, 0.0f, 0.0f, 0.5f);
break;
case EQUIPPED_FIRST_PERSON:
renderOrb(0.0f, 1.0f, 1.0f, 0.5f);
break;
default:
break;
}
}
public void renderOrb(float x, float y, float z, float scale) {
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glTranslatef(x, y, z);
GL11.glScalef(scale, scale, scale);
GL11.glRotatef(180f, 0f, 1f, 0f);
FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("mysticmods:textures" + "/models/OrbFire.png"));
modelOrb.render();
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopMatrix();
}
@Override
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
switch (type) {
case ENTITY:
return true;
case EQUIPPED:
return true;
case INVENTORY:
return true;
case EQUIPPED_FIRST_PERSON:
return true;
default:
return false;
}
}
}

View file

@ -1,82 +0,0 @@
package mysticworld.renderer;
import mysticworld.model.ModelOrb;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.IItemRenderer;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.client.FMLClientHandler;
public class ItemOrbWaterRenderer implements IItemRenderer {
private ModelOrb modelOrb;
public ItemOrbWaterRenderer() {
modelOrb = new ModelOrb();
}
@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 void renderItem(ItemRenderType type, ItemStack item, Object... data) {
switch (type) {
case ENTITY:
renderOrb(0.0f, 0.5f, 0.0f, 0.4f);
break;
case EQUIPPED:
renderOrb(0.5f, 1.0f, 0.5f, 0.5f);
break;
case INVENTORY:
renderOrb(0.0f, 0.0f, 0.0f, 0.5f);
break;
case EQUIPPED_FIRST_PERSON:
renderOrb(0.0f, 1.0f, 1.0f, 0.5f);
break;
default:
break;
}
}
public void renderOrb(float x, float y, float z, float scale) {
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glTranslatef(x, y, z);
GL11.glScalef(scale, scale, scale);
GL11.glRotatef(180f, 0f, 1f, 0f);
FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("mysticmods:textures" + "/models/OrbWater.png"));
modelOrb.render();
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopMatrix();
}
@Override
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
switch (type) {
case ENTITY:
return true;
case EQUIPPED:
return true;
case INVENTORY:
return true;
case EQUIPPED_FIRST_PERSON:
return true;
default:
return false;
}
}
}

View file

@ -1,95 +0,0 @@
package mysticworld.renderer;
import mysticworld.model.ModelStaff;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.IItemRenderer;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.client.FMLClientHandler;
public class ItemStaffAirRenderer implements IItemRenderer {
private final ModelStaff model;
public ItemStaffAirRenderer() {
this.model = new ModelStaff();
}
@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 void renderItem(ItemRenderType type, ItemStack item, Object... data) {
switch (type) {
case ENTITY:
renderModel(0.0F, 1.2F, 0.0F, 1.0F);
break;
case INVENTORY:
renderModel(0.5F, 0.95F, 0.5F, 1.0F);
break;
case EQUIPPED_FIRST_PERSON:
renderModel(1.0F, 1.2f, 0.0f, 1.0f);
break;
case EQUIPPED:
renderModelEquipped(0.0F, 0.9f, 0.0f, 1.0f);
break;
default:
break;
}
}
@Override
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
switch (type) {
case ENTITY:
return true;
case EQUIPPED:
return false;
case INVENTORY:
return true;
case EQUIPPED_FIRST_PERSON:
return false;
default:
return false;
}
}
private void renderModel(float x, float y, float z, float scale) {
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glScalef(scale, scale, scale);
GL11.glTranslatef(x, y, z);
GL11.glRotatef(180.0F, 0.0F, 0.0F, 0.0F);
FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("mysticmods:textures" + "/models/StaffAir.png"));
model.renderModel(0.0625f);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopMatrix();
}
private void renderModelEquipped(float x, float y, float z, float scale) {
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glScalef(scale, scale, scale);
GL11.glTranslatef(x, y, z);
GL11.glRotatef(180.0F, 1.0F, 0.0F, 0.0F);
GL11.glRotatef(-45.0F, 0.0F, 0.0F, 1.0F);
FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("mysticmods:textures" + "/models/StaffAir.png"));
model.renderModel(0.0625f);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopMatrix();
}
}

View file

@ -1,95 +0,0 @@
package mysticworld.renderer;
import mysticworld.model.ModelStaff;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.IItemRenderer;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.client.FMLClientHandler;
public class ItemStaffEarthRenderer implements IItemRenderer {
private final ModelStaff model;
public ItemStaffEarthRenderer() {
this.model = new ModelStaff();
}
@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 void renderItem(ItemRenderType type, ItemStack item, Object... data) {
switch (type) {
case ENTITY:
renderModel(0.0F, 1.2F, 0.0F, 1.0F);
break;
case INVENTORY:
renderModel(0.5F, 0.95F, 0.5F, 1.0F);
break;
case EQUIPPED_FIRST_PERSON:
renderModel(1.0F, 1.2f, 0.0f, 1.0f);
break;
case EQUIPPED:
renderModelEquipped(0.0F, 0.9f, 0.0f, 1.0f);
break;
default:
break;
}
}
@Override
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
switch (type) {
case ENTITY:
return true;
case EQUIPPED:
return false;
case INVENTORY:
return true;
case EQUIPPED_FIRST_PERSON:
return false;
default:
return false;
}
}
private void renderModel(float x, float y, float z, float scale) {
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glScalef(scale, scale, scale);
GL11.glTranslatef(x, y, z);
GL11.glRotatef(180.0F, 0.0F, 0.0F, 0.0F);
FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("mysticmods:textures" + "/models/StaffEarth.png"));
model.renderModel(0.0625f);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopMatrix();
}
private void renderModelEquipped(float x, float y, float z, float scale) {
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glScalef(scale, scale, scale);
GL11.glTranslatef(x, y, z);
GL11.glRotatef(180.0F, 1.0F, 0.0F, 0.0F);
GL11.glRotatef(-45.0F, 0.0F, 0.0F, 1.0F);
FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("mysticmods:textures" + "/models/StaffEarth.png"));
model.renderModel(0.0625f);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopMatrix();
}
}

View file

@ -1,95 +0,0 @@
package mysticworld.renderer;
import mysticworld.model.ModelStaff;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.IItemRenderer;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.client.FMLClientHandler;
public class ItemStaffEnergyRenderer implements IItemRenderer {
private final ModelStaff model;
public ItemStaffEnergyRenderer() {
this.model = new ModelStaff();
}
@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 void renderItem(ItemRenderType type, ItemStack item, Object... data) {
switch (type) {
case ENTITY:
renderModel(0.0F, 1.2F, 0.0F, 1.0F);
break;
case INVENTORY:
renderModel(0.5F, 0.95F, 0.5F, 1.0F);
break;
case EQUIPPED_FIRST_PERSON:
renderModel(1.0F, 1.2f, 0.0f, 1.0f);
break;
case EQUIPPED:
renderModelEquipped(0.0F, 0.9f, 0.0f, 1.0f);
break;
default:
break;
}
}
@Override
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
switch (type) {
case ENTITY:
return true;
case EQUIPPED:
return false;
case INVENTORY:
return true;
case EQUIPPED_FIRST_PERSON:
return false;
default:
return false;
}
}
private void renderModel(float x, float y, float z, float scale) {
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glScalef(scale, scale, scale);
GL11.glTranslatef(x, y, z);
GL11.glRotatef(180.0F, 0.0F, 0.0F, 0.0F);
FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("mysticmods:textures" + "/models/StaffEnergy.png"));
model.renderModel(0.0625f);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopMatrix();
}
private void renderModelEquipped(float x, float y, float z, float scale) {
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glScalef(scale, scale, scale);
GL11.glTranslatef(x, y, z);
GL11.glRotatef(180.0F, 1.0F, 0.0F, 0.0F);
GL11.glRotatef(-45.0F, 0.0F, 0.0F, 1.0F);
FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("mysticmods:textures" + "/models/StaffEnergy.png"));
model.renderModel(0.0625f);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopMatrix();
}
}

View file

@ -1,95 +0,0 @@
package mysticworld.renderer;
import mysticworld.model.ModelStaff;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.IItemRenderer;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.client.FMLClientHandler;
public class ItemStaffFireRenderer implements IItemRenderer {
private final ModelStaff model;
public ItemStaffFireRenderer() {
this.model = new ModelStaff();
}
@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 void renderItem(ItemRenderType type, ItemStack item, Object... data) {
switch (type) {
case ENTITY:
renderModel(0.0F, 1.2F, 0.0F, 1.0F);
break;
case INVENTORY:
renderModel(0.5F, 0.95F, 0.5F, 1.0F);
break;
case EQUIPPED_FIRST_PERSON:
renderModel(1.0F, 1.2f, 0.0f, 1.0f);
break;
case EQUIPPED:
renderModelEquipped(0.0F, 0.9f, 0.0f, 1.0f);
break;
default:
break;
}
}
@Override
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
switch (type) {
case ENTITY:
return true;
case EQUIPPED:
return false;
case INVENTORY:
return true;
case EQUIPPED_FIRST_PERSON:
return false;
default:
return false;
}
}
private void renderModel(float x, float y, float z, float scale) {
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glScalef(scale, scale, scale);
GL11.glTranslatef(x, y, z);
GL11.glRotatef(180.0F, 0.0F, 0.0F, 0.0F);
FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("mysticmods:textures" + "/models/StaffFire.png"));
model.renderModel(0.0625f);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopMatrix();
}
private void renderModelEquipped(float x, float y, float z, float scale) {
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glScalef(scale, scale, scale);
GL11.glTranslatef(x, y, z);
GL11.glRotatef(180.0F, 1.0F, 0.0F, 0.0F);
GL11.glRotatef(-45.0F, 0.0F, 0.0F, 1.0F);
FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("mysticmods:textures" + "/models/StaffFire.png"));
model.renderModel(0.0625f);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopMatrix();
}
}

View file

@ -1,95 +0,0 @@
package mysticworld.renderer;
import mysticworld.model.ModelStaff;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.IItemRenderer;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.client.FMLClientHandler;
public class ItemStaffWaterRenderer implements IItemRenderer {
private final ModelStaff model;
public ItemStaffWaterRenderer() {
this.model = new ModelStaff();
}
@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 void renderItem(ItemRenderType type, ItemStack item, Object... data) {
switch (type) {
case ENTITY:
renderModel(0.0F, 1.2F, 0.0F, 1.0F);
break;
case INVENTORY:
renderModel(0.5F, 0.95F, 0.5F, 1.0F);
break;
case EQUIPPED_FIRST_PERSON:
renderModel(1.0F, 1.2f, 0.0f, 1.0f);
break;
case EQUIPPED:
renderModelEquipped(0.0F, 0.9f, 0.0f, 1.0f);
break;
default:
break;
}
}
@Override
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
switch (type) {
case ENTITY:
return true;
case EQUIPPED:
return false;
case INVENTORY:
return true;
case EQUIPPED_FIRST_PERSON:
return false;
default:
return false;
}
}
private void renderModel(float x, float y, float z, float scale) {
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glScalef(scale, scale, scale);
GL11.glTranslatef(x, y, z);
GL11.glRotatef(180.0F, 0.0F, 0.0F, 0.0F);
FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("mysticmods:textures" + "/models/StaffWater.png"));
model.renderModel(0.0625f);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopMatrix();
}
private void renderModelEquipped(float x, float y, float z, float scale) {
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glScalef(scale, scale, scale);
GL11.glTranslatef(x, y, z);
GL11.glRotatef(180.0F, 1.0F, 0.0F, 0.0F);
GL11.glRotatef(-45.0F, 0.0F, 0.0F, 1.0F);
FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("mysticmods:textures" + "/models/StaffWater.png"));
model.renderModel(0.0625f);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopMatrix();
}
}

View file

@ -11,7 +11,7 @@ import org.lwjgl.opengl.GL11;
import cpw.mods.fml.client.FMLClientHandler;
public class TileEntityPillarInsertRenderer extends TileEntitySpecialRenderer {
private static final ResourceLocation texture = new ResourceLocation("mysticmods:textures" + "/models/PillarInsert.png");
private static final ResourceLocation texture = new ResourceLocation("mysticworld", "textures/models/PillarInsert.png");
private ModelPillarInsert model;
public TileEntityPillarInsertRenderer() {