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,8 +46,30 @@ 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)
{
GL11.glPushMatrix();
GL11.glTranslated(x + 0.5, y + 1.5, z + 0.5);
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
if (((TileEntityBattery) t).structure.isMultiblock)
{
this.func_110628_a(TEXTURE_MULTI);
}
else
{
this.func_110628_a(TEXTURE);
}
MODEL.render(0.0625f);
// batteryModel.renderAll();
GL11.glPopMatrix();
if (Minecraft.getMinecraft().gameSettings.fancyGraphics)
{ {
if (this.fakeBattery == null) if (this.fakeBattery == null)
{ {
@ -58,22 +82,6 @@ public class RenderBattery extends TileEntitySpecialRenderer
this.renderManager = RenderManager.instance; this.renderManager = RenderManager.instance;
} }
GL11.glPushMatrix();
GL11.glTranslated(x + 0.5, y + 1.5, z + 0.5);
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
if (((TileEntityBattery) t).structure.isMultiblock)
{
this.func_110628_a(TEXTURE_MULTI);
}
else
{
this.func_110628_a(TEXTURE);
}
MODEL.render(0.0625f);
GL11.glPopMatrix();
int renderAmount = Math.min(((TileEntityBattery) t).clientCells, 16); int renderAmount = Math.min(((TileEntityBattery) t).clientCells, 16);
if (renderAmount == 0) if (renderAmount == 0)
@ -153,6 +161,7 @@ public class RenderBattery extends TileEntitySpecialRenderer
} }
} }
} }
}
private ForgeDirection correctSide(ForgeDirection side) private ForgeDirection correctSide(ForgeDirection side)
{ {

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