Uploaded all models

This commit is contained in:
Calclavia 2013-08-07 17:59:02 -04:00
parent c099462b3f
commit 84e6df0b93
11 changed files with 100 additions and 82 deletions

Binary file not shown.

View file

@ -90,6 +90,7 @@ public class ResonantInduction
public static final String BLOCK_TEXTURE_DIRECTORY = TEXTURE_DIRECTORY + "blocks/"; public static final String BLOCK_TEXTURE_DIRECTORY = TEXTURE_DIRECTORY + "blocks/";
public static final String ITEM_TEXTURE_DIRECTORY = TEXTURE_DIRECTORY + "items/"; public static final String ITEM_TEXTURE_DIRECTORY = TEXTURE_DIRECTORY + "items/";
public static final String MODEL_TEXTURE_DIRECTORY = TEXTURE_DIRECTORY + "models/"; public static final String MODEL_TEXTURE_DIRECTORY = TEXTURE_DIRECTORY + "models/";
public static final String MODEL_DIRECTORY = DIRECTORY + "models/";
public static final String LANGUAGE_DIRECTORY = DIRECTORY + "languages/"; public static final String LANGUAGE_DIRECTORY = DIRECTORY + "languages/";
public static final String[] LANGUAGES = new String[] { "en_US" }; public static final String[] LANGUAGES = new String[] { "en_US" };

View file

@ -303,9 +303,8 @@ public class FXElectricBolt extends EntityFX
if (segment != null && segment.id <= renderlength) if (segment != null && segment.id <= renderlength)
{ {
double renderWidth = this.boltWidth * ((new Vector3(player).distance(segment.start) / 5f + 1f) * (1 + segment.alpha) * 0.5f); double renderWidth = this.boltWidth * ((new Vector3(player).distance(segment.start) / 5f + 1f) * (1 + segment.alpha) * 0.5f);
Vector3 diffPrev = playerVector.clone().crossProduct(segment.prevDiff).scale(renderWidth / segment.sinPrev);
Vector3 diffPrev = playerVector.crossProduct(segment.prevDiff).scale(renderWidth / segment.sinPrev); Vector3 diffNext = playerVector.clone().crossProduct(segment.nextDiff).scale(renderWidth / segment.sinNext);
Vector3 diffNext = playerVector.crossProduct(segment.nextDiff).scale(renderWidth / segment.sinNext);
Vector3 startVec = segment.start; Vector3 startVec = segment.start;
Vector3 endVec = segment.end; Vector3 endVec = segment.end;
float rx1 = (float) (startVec.x - interpPosX); float rx1 = (float) (startVec.x - interpPosX);
@ -420,7 +419,7 @@ public class FXElectricBolt extends EntityFX
Vector3 prevDiffNorm = this.prev.difference.clone().normalize(); Vector3 prevDiffNorm = this.prev.difference.clone().normalize();
Vector3 diffNorm = this.difference.clone().normalize(); Vector3 diffNorm = this.difference.clone().normalize();
this.prevDiff = diffNorm.clone().translate(prevDiffNorm).normalize(); this.prevDiff = diffNorm.clone().translate(prevDiffNorm).normalize();
this.sinPrev = Math.sin(diffNorm.anglePreNorm(prevDiffNorm.clone().scale(-1)) / 2); this.sinPrev = Math.sin(diffNorm.clone().anglePreNorm(prevDiffNorm.clone().scale(-1)) / 2);
} }
else else
{ {
@ -433,7 +432,7 @@ public class FXElectricBolt extends EntityFX
Vector3 nextDiffNorm = this.next.difference.clone().normalize(); Vector3 nextDiffNorm = this.next.difference.clone().normalize();
Vector3 diffNorm = this.difference.clone().normalize(); Vector3 diffNorm = this.difference.clone().normalize();
this.nextDiff = diffNorm.clone().translate(nextDiffNorm).normalize(); this.nextDiff = diffNorm.clone().translate(nextDiffNorm).normalize();
this.sinNext = Math.sin(diffNorm.anglePreNorm(nextDiffNorm.clone().scale(-1)) / 2); this.sinNext = Math.sin(diffNorm.clone().anglePreNorm(nextDiffNorm.clone().scale(-1)) / 2);
} }
else else
{ {

View file

@ -3,13 +3,23 @@
*/ */
package resonantinduction.render; package resonantinduction.render;
import java.net.URL;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.IBlockAccess; import net.minecraft.world.IBlockAccess;
import net.minecraftforge.client.model.AdvancedModelLoader;
import net.minecraftforge.client.model.IModelCustom;
import net.minecraftforge.client.model.IModelCustomLoader;
import net.minecraftforge.client.model.ModelFormatException;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import resonantinduction.ResonantInduction;
import resonantinduction.battery.BlockBattery; import resonantinduction.battery.BlockBattery;
import resonantinduction.battery.TileEntityBattery;
import resonantinduction.contractor.BlockEMContractor; import resonantinduction.contractor.BlockEMContractor;
import resonantinduction.multimeter.BlockMultimeter; import resonantinduction.multimeter.BlockMultimeter;
import resonantinduction.tesla.BlockTesla; import resonantinduction.tesla.BlockTesla;
@ -87,5 +97,4 @@ public class BlockRenderingHandler implements ISimpleBlockRenderingHandler
{ {
return ID; return ID;
} }
} }

View file

@ -18,6 +18,8 @@ import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Icon; import net.minecraft.util.Icon;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.model.AdvancedModelLoader;
import net.minecraftforge.client.model.IModelCustom;
import net.minecraftforge.common.ForgeDirection; import net.minecraftforge.common.ForgeDirection;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
@ -44,24 +46,16 @@ public class RenderBattery extends TileEntitySpecialRenderer
private Random random = new Random(); private Random random = new Random();
protected RenderManager renderManager; protected RenderManager renderManager;
// IModelCustom batteryModel = AdvancedModelLoader.loadModel(ResonantInduction.MODEL_DIRECTORY +
// "modularBattery.tcn");
@Override @Override
public void renderTileEntityAt(TileEntity t, double x, double y, double z, float f) public void renderTileEntityAt(TileEntity t, double x, double y, double z, float f)
{ {
if (this.fakeBattery == null)
{
this.fakeBattery = new EntityItem(t.worldObj, 0, 0, 0, new ItemStack(ResonantInduction.itemCapacitor));
this.fakeBattery.age = 10;
}
if (this.renderManager == null)
{
this.renderManager = RenderManager.instance;
}
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslated(x + 0.5, y + 1.5, z + 0.5); GL11.glTranslated(x + 0.5, y + 1.5, z + 0.5);
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
if (((TileEntityBattery) t).structure.isMultiblock) if (((TileEntityBattery) t).structure.isMultiblock)
{ {
this.func_110628_a(TEXTURE_MULTI); this.func_110628_a(TEXTURE_MULTI);
@ -72,83 +66,98 @@ public class RenderBattery extends TileEntitySpecialRenderer
} }
MODEL.render(0.0625f); MODEL.render(0.0625f);
// batteryModel.renderAll();
GL11.glPopMatrix(); GL11.glPopMatrix();
int renderAmount = Math.min(((TileEntityBattery) t).clientCells, 16); if (Minecraft.getMinecraft().gameSettings.fancyGraphics)
if (renderAmount == 0)
{ {
return; if (this.fakeBattery == null)
}
for (int i = 2; i < 6; i++)
{
ForgeDirection direction = ForgeDirection.getOrientation(i);
for (int slot = 0; slot < 4; slot++)
{ {
Vector3 sideVec = new Vector3(t).modifyPositionFromSide(correctSide(direction)); this.fakeBattery = new EntityItem(t.worldObj, 0, 0, 0, new ItemStack(ResonantInduction.itemCapacitor));
Block block = Block.blocksList[sideVec.getBlockID(t.worldObj)]; this.fakeBattery.age = 10;
}
if (block != null && block.isOpaqueCube()) if (this.renderManager == null)
{
this.renderManager = RenderManager.instance;
}
int renderAmount = Math.min(((TileEntityBattery) t).clientCells, 16);
if (renderAmount == 0)
{
return;
}
for (int i = 2; i < 6; i++)
{
ForgeDirection direction = ForgeDirection.getOrientation(i);
for (int slot = 0; slot < 4; slot++)
{ {
continue; Vector3 sideVec = new Vector3(t).modifyPositionFromSide(correctSide(direction));
} Block block = Block.blocksList[sideVec.getBlockID(t.worldObj)];
GL11.glPushMatrix(); if (block != null && block.isOpaqueCube())
GL11.glTranslatef((float) x + 0.5f, (float) y + 0.7f, (float) z + 0.5f); {
continue;
}
float translateX = 0; GL11.glPushMatrix();
float translateY = 0; GL11.glTranslatef((float) x + 0.5f, (float) y + 0.7f, (float) z + 0.5f);
switch (slot) float translateX = 0;
{ float translateY = 0;
case 0:
translateX = 0.25f;
break;
case 1:
translateX = 0.25f;
translateY = -0.5f;
break;
case 2:
translateX = -0.25f;
translateY = -0.5f;
break;
case 3:
translateX = -0.25f;
break;
}
switch (direction) switch (slot)
{ {
case NORTH: case 0:
GL11.glTranslatef(-0.5f, 0, 0); translateX = 0.25f;
GL11.glTranslatef(0, translateY, translateX); break;
GL11.glRotatef(90, 0, 1, 0); case 1:
break; translateX = 0.25f;
case SOUTH: translateY = -0.5f;
GL11.glTranslatef(0, 0, -0.5f); break;
GL11.glTranslatef(translateX, translateY, 0); case 2:
break; translateX = -0.25f;
case WEST: translateY = -0.5f;
GL11.glTranslatef(0.5f, 0, 0); break;
GL11.glTranslatef(0, translateY, translateX); case 3:
GL11.glRotatef(90, 0, 1, 0); translateX = -0.25f;
break; break;
case EAST: }
GL11.glTranslatef(0, 0, 0.5f);
GL11.glTranslatef(translateX, translateY, 0);
break;
}
GL11.glScalef(0.5f, 0.5f, 0.5f); switch (direction)
{
case NORTH:
GL11.glTranslatef(-0.5f, 0, 0);
GL11.glTranslatef(0, translateY, translateX);
GL11.glRotatef(90, 0, 1, 0);
break;
case SOUTH:
GL11.glTranslatef(0, 0, -0.5f);
GL11.glTranslatef(translateX, translateY, 0);
break;
case WEST:
GL11.glTranslatef(0.5f, 0, 0);
GL11.glTranslatef(0, translateY, translateX);
GL11.glRotatef(90, 0, 1, 0);
break;
case EAST:
GL11.glTranslatef(0, 0, 0.5f);
GL11.glTranslatef(translateX, translateY, 0);
break;
}
this.renderItemSimple(this.fakeBattery); GL11.glScalef(0.5f, 0.5f, 0.5f);
GL11.glPopMatrix();
if (--renderAmount <= 0) this.renderItemSimple(this.fakeBattery);
{ GL11.glPopMatrix();
return;
if (--renderAmount <= 0)
{
return;
}
} }
} }
} }

View file

@ -299,7 +299,7 @@ public class TileEntityTesla extends TileEntityUniversalElectrical implements IT
@Override @Override
public boolean canReceive(TileEntity tileEntity) public boolean canReceive(TileEntity tileEntity)
{ {
return this.canReceive && !this.outputBlacklist.contains(tileEntity); return this.canReceive && !this.outputBlacklist.contains(tileEntity) && this.getRequest(ForgeDirection.UNKNOWN) > 0;
} }
@Override @Override