mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-24 22:14:42 +00:00
Improved renderer for capacitor banks and fused quartz.
This commit is contained in:
commit
430f8d71ce
19 files changed
+1311
-93
No files matched your search
@@ -43,8 +43,9 @@ import crazypants.enderio.machine.light.ElectricLightRenderer;
|
||||
import crazypants.enderio.machine.painter.BlockCustomFenceGate;
|
||||
import crazypants.enderio.machine.painter.BlockCustomFenceGateRenderer;
|
||||
import crazypants.enderio.machine.painter.PaintedItemRenderer;
|
||||
import crazypants.enderio.machine.power.BlockCapacitorBank;
|
||||
import crazypants.enderio.machine.power.CapBankRenderer2;
|
||||
import crazypants.enderio.machine.power.CapacitorBankRenderer;
|
||||
import crazypants.enderio.machine.power.TileCapacitorBank;
|
||||
import crazypants.enderio.machine.reservoir.ReservoirRenderer;
|
||||
import crazypants.enderio.machine.reservoir.TileReservoir;
|
||||
import crazypants.enderio.material.BlockFusedQuartz;
|
||||
@@ -116,9 +117,12 @@ public class ClientProxy extends CommonProxy {
|
||||
RenderingRegistry.registerBlockHandler(new ElectricLightRenderer());
|
||||
|
||||
CapacitorBankRenderer capr = new CapacitorBankRenderer();
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileCapacitorBank.class, capr);
|
||||
MinecraftForgeClient.registerItemRenderer(EnderIO.blockCapacitorBank.blockID, capr);
|
||||
|
||||
BlockCapacitorBank.renderId = RenderingRegistry.getNextAvailableRenderId();
|
||||
CapBankRenderer2 cbr2 = new CapBankRenderer2();
|
||||
RenderingRegistry.registerBlockHandler(cbr2);
|
||||
|
||||
FusedQuartzFrameRenderer fqfr = new FusedQuartzFrameRenderer();
|
||||
MinecraftForgeClient.registerItemRenderer(EnderIO.itemFusedQuartzFrame.itemID, fqfr);
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ import crazypants.enderio.conduit.render.ConduitBundleRenderer;
|
||||
import crazypants.enderio.conduit.render.DefaultConduitRenderer;
|
||||
import crazypants.render.BoundingBox;
|
||||
import crazypants.render.RenderUtil;
|
||||
import crazypants.vecmath.Vector2d;
|
||||
import crazypants.vecmath.Vector2f;
|
||||
import crazypants.vecmath.Vector3d;
|
||||
import crazypants.vecmath.Vector3f;
|
||||
import crazypants.vecmath.Vertex;
|
||||
@@ -96,7 +96,7 @@ public class LiquidConduitRenderer extends DefaultConduitRenderer {
|
||||
tes.setNormal(face.offsetX, face.offsetY, face.offsetZ);
|
||||
|
||||
float scaleFactor = 13f / 16f;
|
||||
Vector2d uv = new Vector2d();
|
||||
Vector2f uv = new Vector2f();
|
||||
List<ForgeDirection> edges = RenderUtil.getEdgesForFace(face);
|
||||
for (ForgeDirection edge : edges) {
|
||||
if(edge != component.dir && edge != component.dir.getOpposite()) {
|
||||
|
||||
@@ -37,7 +37,7 @@ import crazypants.vecmath.Vector3d;
|
||||
|
||||
public class BlockCapacitorBank extends Block implements ITileEntityProvider, IGuiHandler {
|
||||
|
||||
//static final NumberFormat NF = NumberFormat.getIntegerInstance();
|
||||
public static int renderId = -1;
|
||||
|
||||
public static BlockCapacitorBank create() {
|
||||
BlockCapacitorBank res = new BlockCapacitorBank();
|
||||
@@ -123,7 +123,7 @@ public class BlockCapacitorBank extends Block implements ITileEntityProvider, IG
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return -1;
|
||||
return renderId;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -0,0 +1,160 @@
|
||||
package crazypants.enderio.machine.power;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.machine.power.GaugeBounds.VPos;
|
||||
import crazypants.render.CustomCubeRenderer;
|
||||
import crazypants.render.RenderUtil;
|
||||
import crazypants.util.BlockCoord;
|
||||
import crazypants.util.ForgeDirectionOffsets;
|
||||
import crazypants.vecmath.Vector2f;
|
||||
import crazypants.vecmath.Vector4d;
|
||||
import crazypants.vecmath.Vertex;
|
||||
|
||||
public class CapBankRenderer2 implements ISimpleBlockRenderingHandler {
|
||||
|
||||
private static final BlockCoord DEFAULT_BC = new BlockCoord(0, 0, 0);
|
||||
private static final BlockCoord[] DEFAULT_MB = new BlockCoord[] { DEFAULT_BC };
|
||||
private static final double PIXEL_SIZE = 1 / 16d;
|
||||
|
||||
@Override
|
||||
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
|
||||
//Base block
|
||||
CustomCubeRenderer.instance.renderBlock(world, block, x, y, z, EnderIO.blockAlloySmelter.getBlockTextureFromSide(3), false);
|
||||
|
||||
//Gauge
|
||||
TileEntity te = world.getBlockTileEntity(x, y, z);
|
||||
if(!(te instanceof TileCapacitorBank)) {
|
||||
return true;
|
||||
}
|
||||
List<GaugeBounds> gaugeBounds = null;
|
||||
gaugeBounds = ((TileCapacitorBank) te).getGaugeBounds();
|
||||
|
||||
if(gaugeBounds == null || gaugeBounds.isEmpty()) {
|
||||
return true;
|
||||
}
|
||||
Tessellator tes = Tessellator.instance;
|
||||
tes.addTranslation(x, y, z);
|
||||
for (GaugeBounds gb : gaugeBounds) {
|
||||
renderGaugeOnFace(gb, EnderIO.blockCapacitorBank.overlayIcon);
|
||||
renderFillBarOnFace(gb, EnderIO.blockCapacitorBank.fillBarIcon, ((TileCapacitorBank) te).getEnergyStoredRatio());
|
||||
}
|
||||
tes.addTranslation(-x, -y, -z);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRender3DInInventory() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderId() {
|
||||
return BlockCapacitorBank.renderId;
|
||||
}
|
||||
|
||||
private List<GaugeBounds> calculateGaugeBounds(BlockCoord me, BlockCoord[] mb) {
|
||||
List<GaugeBounds> res = new ArrayList<GaugeBounds>();
|
||||
for (ForgeDirection face : ForgeDirection.VALID_DIRECTIONS) {
|
||||
if(face != ForgeDirection.UP && face != ForgeDirection.DOWN) {
|
||||
boolean isRight = isRightFace(me, mb, face);
|
||||
if(isRight) {
|
||||
res.add(new GaugeBounds(me, mb, face));
|
||||
}
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
private void renderGaugeOnFace(GaugeBounds gb, Icon icon) {
|
||||
Tessellator tes = Tessellator.instance;
|
||||
tes.setNormal(gb.face.offsetX, gb.face.offsetY, gb.face.offsetZ);
|
||||
Vector2f u = gb.getMinMaxU(icon);
|
||||
List<Vertex> corners = gb.bb.getCornersWithUvForFace(gb.face, u.x, u.y, icon.getMinV(), icon.getMaxV());
|
||||
for (Vertex coord : corners) {
|
||||
coord.xyz.add(ForgeDirectionOffsets.offsetScaled(gb.face, 0.001f));
|
||||
|
||||
tes.setNormal(coord.nx(), coord.ny(), coord.nz());
|
||||
if(coord.uv != null) {
|
||||
tes.addVertexWithUV(coord.x(), coord.y(), coord.z(), coord.u(), coord.v());
|
||||
} else {
|
||||
tes.addVertexWithUV(coord.x(), coord.y(), coord.z(), 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void renderFillBarOnFace(GaugeBounds gb, Icon icon, float filledRatio) {
|
||||
|
||||
int totalPixels;
|
||||
if(gb.vInfo.verticalHeight == 1) {
|
||||
totalPixels = VPos.SINGLE_BLOCK.numFillPixels;
|
||||
} else {
|
||||
totalPixels = VPos.BOTTOM.numFillPixels + VPos.TOP.numFillPixels + (VPos.MIDDLE.numFillPixels * (gb.vInfo.verticalHeight - 2));
|
||||
}
|
||||
|
||||
int targetPixelCount = Math.max(0, Math.round(totalPixels * filledRatio));
|
||||
int pixelsBellowFace;
|
||||
if(gb.vInfo.index < 2) {
|
||||
// either none or a bottom section
|
||||
pixelsBellowFace = gb.vInfo.index * VPos.BOTTOM.numFillPixels;
|
||||
} else { // has middle section
|
||||
pixelsBellowFace = VPos.BOTTOM.numFillPixels + (VPos.MIDDLE.numFillPixels * (gb.vInfo.index - 1));
|
||||
}
|
||||
|
||||
if(pixelsBellowFace >= targetPixelCount) {
|
||||
return;
|
||||
}
|
||||
|
||||
VPos yPos = gb.vInfo.pos;
|
||||
int numPixelsLeft = targetPixelCount - pixelsBellowFace;
|
||||
int fillPixels = Math.min(numPixelsLeft, yPos.numFillPixels);
|
||||
|
||||
double maxY = (yPos.fillOffset * PIXEL_SIZE) + (fillPixels * PIXEL_SIZE);
|
||||
float vWidth = icon.getMaxV() - icon.getMinV();
|
||||
float maxV = icon.getMinV() + ((float) maxY * vWidth);
|
||||
|
||||
Tessellator tes = Tessellator.instance;
|
||||
tes.setNormal(gb.face.offsetX, gb.face.offsetY, gb.face.offsetZ);
|
||||
Vector2f u = gb.getMinMaxU(icon);
|
||||
List<crazypants.vecmath.Vertex> corners = gb.bb.getCornersWithUvForFace(gb.face, u.x, u.y, icon.getMinV(), maxV);
|
||||
for (Vertex coord : corners) {
|
||||
coord.xyz.add(ForgeDirectionOffsets.offsetScaled(gb.face, 0.002f));
|
||||
if(coord.uv != null) {
|
||||
tes.addVertexWithUV(coord.x(), Math.min(coord.y(), maxY), coord.z(), coord.u(), coord.v());
|
||||
} else {
|
||||
tes.addVertexWithUV(coord.x(), Math.min(coord.y(), maxY), coord.z(), 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isRightFace(BlockCoord me, BlockCoord[] mb, ForgeDirection dir) {
|
||||
Vector4d uPlane = RenderUtil.getUPlaneForFace(dir);
|
||||
|
||||
int myRightVal = (int) uPlane.x * me.x + (int) uPlane.y * me.y + (int) uPlane.z * me.z;
|
||||
int max = myRightVal;
|
||||
for (BlockCoord bc : mb) {
|
||||
int val = (int) uPlane.x * bc.x + (int) uPlane.y * bc.y + (int) uPlane.z * bc.z;
|
||||
if(val > max) {
|
||||
max = val;
|
||||
}
|
||||
}
|
||||
return myRightVal == max;
|
||||
}
|
||||
|
||||
//------------ Inner Classes
|
||||
|
||||
}
|
||||
@@ -52,7 +52,6 @@ public class CapacitorBankRenderer extends TileEntitySpecialRenderer implements
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity te, double x, double y, double z, float f) {
|
||||
|
||||
if(!(te instanceof TileCapacitorBank)) {
|
||||
return;
|
||||
}
|
||||
@@ -168,7 +167,11 @@ public class CapacitorBankRenderer extends TileEntitySpecialRenderer implements
|
||||
List<Vertex> corners = gb.bb.getCornersWithUvForFace(gb.face, u.x, u.y, icon.getMinV(), icon.getMaxV());
|
||||
for (Vertex coord : corners) {
|
||||
tes.setNormal(coord.nx(), coord.ny(), coord.nz());
|
||||
tes.addVertexWithUV(coord.x(), coord.y(), coord.z(), coord.u(), coord.v());
|
||||
if(coord.uv != null) {
|
||||
tes.addVertexWithUV(coord.x(), coord.y(), coord.z(), coord.u(), coord.v());
|
||||
} else {
|
||||
tes.addVertexWithUV(coord.x(), coord.y(), coord.z(), 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -207,7 +210,11 @@ public class CapacitorBankRenderer extends TileEntitySpecialRenderer implements
|
||||
Vector2f u = gb.getMinMaxU(icon);
|
||||
List<crazypants.vecmath.Vertex> corners = gb.bb.getCornersWithUvForFace(gb.face, u.x, u.y, icon.getMinV(), maxV);
|
||||
for (Vertex coord : corners) {
|
||||
tes.addVertexWithUV(coord.x(), Math.min(coord.y(), maxY), coord.z(), coord.u(), coord.v());
|
||||
if(coord.uv != null) {
|
||||
tes.addVertexWithUV(coord.x(), Math.min(coord.y(), maxY), coord.z(), coord.u(), coord.v());
|
||||
} else {
|
||||
tes.addVertexWithUV(coord.x(), Math.min(coord.y(), maxY), coord.z(), 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,162 @@
|
||||
package crazypants.enderio.machine.power;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import crazypants.render.BoundingBox;
|
||||
import crazypants.render.RenderUtil;
|
||||
import crazypants.util.BlockCoord;
|
||||
import crazypants.vecmath.Vector2f;
|
||||
import crazypants.vecmath.Vector4d;
|
||||
|
||||
class GaugeBounds {
|
||||
|
||||
private static final BlockCoord DEFAULT_BC = new BlockCoord(0, 0, 0);
|
||||
private static final BlockCoord[] DEFAULT_MB = new BlockCoord[] { DEFAULT_BC };
|
||||
|
||||
static List<GaugeBounds> calculateGaugeBounds(BlockCoord me, BlockCoord[] mbIn) {
|
||||
|
||||
BlockCoord myBC;
|
||||
BlockCoord[] mb;
|
||||
if(mbIn != null) {
|
||||
myBC = me;
|
||||
mb = mbIn;
|
||||
} else {
|
||||
myBC = me;
|
||||
DEFAULT_MB[0] = me;
|
||||
mb = DEFAULT_MB;
|
||||
}
|
||||
|
||||
List<GaugeBounds> res = new ArrayList<GaugeBounds>();
|
||||
for (ForgeDirection face : ForgeDirection.VALID_DIRECTIONS) {
|
||||
if(face != ForgeDirection.UP && face != ForgeDirection.DOWN) {
|
||||
boolean isRight = isRightFace(me, mb, face);
|
||||
if(isRight) {
|
||||
res.add(new GaugeBounds(me, mb, face));
|
||||
}
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
static boolean isRightFace(BlockCoord me, BlockCoord[] mb, ForgeDirection dir) {
|
||||
|
||||
if(me == null || contains(mb, me.getLocation(dir))) {
|
||||
return false;
|
||||
}
|
||||
if(mb == null) {
|
||||
return true;
|
||||
}
|
||||
Vector4d uPlane = RenderUtil.getUPlaneForFace(dir);
|
||||
|
||||
int myRightVal = (int) uPlane.x * me.x + (int) uPlane.y * me.y + (int) uPlane.z * me.z;
|
||||
int max = myRightVal;
|
||||
for (BlockCoord bc : mb) {
|
||||
int val = (int) uPlane.x * bc.x + (int) uPlane.y * bc.y + (int) uPlane.z * bc.z;
|
||||
if(val > max) {
|
||||
max = val;
|
||||
}
|
||||
}
|
||||
return myRightVal == max;
|
||||
}
|
||||
|
||||
private static boolean contains(BlockCoord[] mb, BlockCoord location) {
|
||||
if(mb == null) {
|
||||
return false;
|
||||
}
|
||||
for (BlockCoord bc : mb) {
|
||||
if(location.equals(bc)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
final BoundingBox bb;
|
||||
final VInfo vInfo;
|
||||
final ForgeDirection face;
|
||||
|
||||
GaugeBounds(BlockCoord me, BlockCoord[] mb, ForgeDirection face) {
|
||||
this.face = face;
|
||||
vInfo = getVPosForFace(me, mb, face);
|
||||
|
||||
Vector4d uPlane = RenderUtil.getUPlaneForFace(face);
|
||||
float scaleX = uPlane.x != 0 ? 0.25f : 1;
|
||||
float scaleY = uPlane.y != 0 ? 0.25f : 1;
|
||||
float scaleZ = uPlane.z != 0 ? 0.25f : 1;
|
||||
bb = BoundingBox.UNIT_CUBE.scale(scaleX, scaleY, scaleZ);
|
||||
}
|
||||
|
||||
Vector2f getMinMaxU(Icon icon) {
|
||||
VPos yPos = vInfo.pos;
|
||||
float uWidth = icon.getMaxU() - icon.getMinU();
|
||||
float uOffset = yPos.uOffset * uWidth;
|
||||
float minU = icon.getMinU() + uOffset;
|
||||
float maxU = minU + (uWidth * 0.25f);
|
||||
return new Vector2f(minU, maxU);
|
||||
}
|
||||
|
||||
private VInfo getVPosForFace(BlockCoord me, BlockCoord[] mb, ForgeDirection face) {
|
||||
int maxY = me.y;
|
||||
int minY = me.y;
|
||||
int vHeight = 1;
|
||||
for (BlockCoord bc : mb) {
|
||||
if(bc.x == me.x && bc.z == me.z && !containsLocaction(mb, bc.getLocation(face))) {
|
||||
maxY = Math.max(maxY, bc.y);
|
||||
minY = Math.min(minY, bc.y);
|
||||
}
|
||||
}
|
||||
if(maxY == me.y && minY == me.y) {
|
||||
return new VInfo(VPos.SINGLE_BLOCK, 1, 0);
|
||||
}
|
||||
int height = maxY - minY + 1;
|
||||
if(maxY > me.y) {
|
||||
return me.y > minY ? new VInfo(VPos.MIDDLE, height, me.y - minY) : new VInfo(VPos.BOTTOM, height, 0);
|
||||
}
|
||||
return new VInfo(VPos.TOP, height, height - 1);
|
||||
}
|
||||
|
||||
private boolean containsLocaction(BlockCoord[] mb, BlockCoord location) {
|
||||
for (BlockCoord bc : mb) {
|
||||
if(location.equals(bc)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
enum VPos {
|
||||
|
||||
SINGLE_BLOCK(0, 10, 3),
|
||||
BOTTOM(0.5f, 13, 3),
|
||||
MIDDLE(0.75f, 16, 0),
|
||||
TOP(0.25f, 13, 0);
|
||||
|
||||
final float uOffset;
|
||||
final int numFillPixels;
|
||||
final int fillOffset;
|
||||
|
||||
private VPos(float uOffset, int numFillPixels, int fillOffset) {
|
||||
this.uOffset = uOffset;
|
||||
this.numFillPixels = numFillPixels;
|
||||
this.fillOffset = fillOffset;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static class VInfo {
|
||||
VPos pos;
|
||||
int verticalHeight;
|
||||
int index;
|
||||
|
||||
VInfo(VPos pos, int verticalHeight, int index) {
|
||||
this.pos = pos;
|
||||
this.verticalHeight = verticalHeight;
|
||||
this.index = index;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -78,6 +78,8 @@ public class TileCapacitorBank extends TileEntity implements IInternalPowerRecep
|
||||
|
||||
private final ItemStack[] inventory;
|
||||
|
||||
private List<GaugeBounds> gaugeBounds;
|
||||
|
||||
public TileCapacitorBank() {
|
||||
inventory = new ItemStack[4];
|
||||
storedEnergy = 0;
|
||||
@@ -158,6 +160,13 @@ public class TileCapacitorBank extends TileEntity implements IInternalPowerRecep
|
||||
|
||||
}
|
||||
|
||||
public List<GaugeBounds> getGaugeBounds() {
|
||||
if(gaugeBounds == null) {
|
||||
gaugeBounds = GaugeBounds.calculateGaugeBounds(new BlockCoord(this), multiblock);
|
||||
}
|
||||
return gaugeBounds;
|
||||
}
|
||||
|
||||
private boolean chargeItems(float stored) {
|
||||
boolean chargedItem = false;
|
||||
float available = Math.min(maxIO, stored);
|
||||
@@ -887,6 +896,8 @@ public class TileCapacitorBank extends TileEntity implements IInternalPowerRecep
|
||||
inventory[slot] = ItemStack.loadItemStackFromNBT(itemStack);
|
||||
}
|
||||
}
|
||||
|
||||
gaugeBounds = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -12,6 +12,8 @@ import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.machine.painter.PainterUtil;
|
||||
import crazypants.enderio.machine.painter.TileEntityCustomBlock;
|
||||
import crazypants.render.CustomCubeRenderer;
|
||||
import crazypants.render.CustomCubeRenderer.DefaultTextureCallback;
|
||||
import crazypants.render.RenderUtil;
|
||||
|
||||
public class FusedQuartzRenderer implements ISimpleBlockRenderingHandler {
|
||||
@@ -38,17 +40,15 @@ public class FusedQuartzRenderer implements ISimpleBlockRenderingHandler {
|
||||
@Override
|
||||
public boolean renderWorldBlock(IBlockAccess blockAccess, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
|
||||
if(renderPass == 0) {
|
||||
RenderUtil.setTesselatorBrightness(blockAccess, x, y, z);
|
||||
|
||||
} else {
|
||||
|
||||
TileEntityCustomBlock tecb = null;
|
||||
TileEntity te = blockAccess.getBlockTileEntity(x, y, z);
|
||||
if(te instanceof TileEntityCustomBlock) {
|
||||
tecb = (TileEntityCustomBlock) te;
|
||||
}
|
||||
renderFrame(blockAccess, x, y, z, tecb, false);
|
||||
} else {
|
||||
renderer.setOverrideBlockTexture(EnderIO.blockFusedQuartz.realBlockIcon);
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
renderer.clearOverrideBlockTexture();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -64,13 +64,29 @@ public class FusedQuartzRenderer implements ISimpleBlockRenderingHandler {
|
||||
}
|
||||
|
||||
private void renderFrame(IBlockAccess blockAccess, int x, int y, int z, TileEntityCustomBlock tecb, boolean forceAllEdges) {
|
||||
Icon texture = EnderIO.blockFusedQuartz.getIcon(0, 0);
|
||||
for (ForgeDirection face : ForgeDirection.VALID_DIRECTIONS) {
|
||||
if(tecb != null && tecb.getSourceBlockId() > 0) {
|
||||
texture = tecb.getSourceBlock().getIcon(face.ordinal(), tecb.getSourceBlockMetadata());
|
||||
|
||||
if(blockAccess == null) {
|
||||
//No lighting
|
||||
Icon texture = EnderIO.blockFusedQuartz.getIcon(0, 0);
|
||||
for (ForgeDirection face : ForgeDirection.VALID_DIRECTIONS) {
|
||||
if(tecb != null && tecb.getSourceBlockId() > 0) {
|
||||
texture = tecb.getSourceBlock().getIcon(face.ordinal(), tecb.getSourceBlockMetadata());
|
||||
}
|
||||
RenderUtil.renderConnectedTextureFace(blockAccess, x, y, z, face, texture, forceAllEdges);
|
||||
}
|
||||
RenderUtil.renderConnectedTextureFace(blockAccess, x, y, z, face, texture, forceAllEdges);
|
||||
return;
|
||||
}
|
||||
|
||||
CustomCubeRenderer.instance.setOverrideTexture(EnderIO.blockFusedQuartz.realBlockIcon);
|
||||
|
||||
if(tecb != null && tecb.getSourceBlock() != null) {
|
||||
CustomCubeRenderer.instance.renderBlock(blockAccess, EnderIO.blockFusedQuartz, x, y, z,
|
||||
new DefaultTextureCallback(tecb.getSourceBlock(), tecb.getSourceBlockMetadata()), false);
|
||||
} else {
|
||||
CustomCubeRenderer.instance.renderBlock(blockAccess, EnderIO.blockFusedQuartz, x, y, z, EnderIO.blockAlloySmelter.getBlockTextureFromSide(3), false);
|
||||
}
|
||||
|
||||
CustomCubeRenderer.instance.setOverrideTexture(null);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -167,7 +167,7 @@ public final class BoundingBox {
|
||||
|
||||
/**
|
||||
* Returns the vertices of the corners for the specified face in counter
|
||||
* clockwise order.
|
||||
* clockwise order, starting with the top left.
|
||||
*
|
||||
* @param face
|
||||
* @return
|
||||
@@ -176,28 +176,28 @@ public final class BoundingBox {
|
||||
List<Vector3f> result = new ArrayList<Vector3f>(4);
|
||||
switch (face) {
|
||||
case NORTH:
|
||||
result.add(new Vector3f(maxX, minY, minZ));
|
||||
result.add(new Vector3f(minX, minY, minZ));
|
||||
result.add(new Vector3f(minX, maxY, minZ));
|
||||
result.add(new Vector3f(maxX, maxY, minZ));
|
||||
result.add(new Vector3f(maxX, minY, minZ));
|
||||
result.add(new Vector3f(minX, minY, minZ));
|
||||
break;
|
||||
case SOUTH:
|
||||
result.add(new Vector3f(minX, maxY, maxZ));
|
||||
result.add(new Vector3f(minX, minY, maxZ));
|
||||
result.add(new Vector3f(maxX, minY, maxZ));
|
||||
result.add(new Vector3f(maxX, maxY, maxZ));
|
||||
result.add(new Vector3f(minX, maxY, maxZ));
|
||||
break;
|
||||
case EAST:
|
||||
result.add(new Vector3f(maxX, maxY, minZ));
|
||||
result.add(new Vector3f(maxX, maxY, maxZ));
|
||||
result.add(new Vector3f(maxX, minY, maxZ));
|
||||
result.add(new Vector3f(maxX, minY, minZ));
|
||||
result.add(new Vector3f(maxX, maxY, minZ));
|
||||
result.add(new Vector3f(maxX, maxY, maxZ));
|
||||
break;
|
||||
case WEST:
|
||||
result.add(new Vector3f(minX, minY, minZ));
|
||||
result.add(new Vector3f(minX, minY, maxZ));
|
||||
result.add(new Vector3f(minX, maxY, maxZ));
|
||||
result.add(new Vector3f(minX, maxY, minZ));
|
||||
result.add(new Vector3f(minX, minY, minZ));
|
||||
result.add(new Vector3f(minX, minY, maxZ));
|
||||
break;
|
||||
case UP:
|
||||
result.add(new Vector3f(maxX, maxY, maxZ));
|
||||
@@ -208,10 +208,62 @@ public final class BoundingBox {
|
||||
case DOWN:
|
||||
case UNKNOWN:
|
||||
default:
|
||||
result.add(new Vector3f(minX, minY, maxZ));
|
||||
result.add(new Vector3f(minX, minY, minZ));
|
||||
result.add(new Vector3f(maxX, minY, minZ));
|
||||
result.add(new Vector3f(maxX, minY, maxZ));
|
||||
result.add(new Vector3f(minX, minY, maxZ));
|
||||
break;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the vertices of the corners for the specified face in counter
|
||||
* clockwise order, starting with the top left.
|
||||
*
|
||||
* @param face
|
||||
* @return
|
||||
*/
|
||||
public List<Vector3d> getCornersForFaceD(ForgeDirection face) {
|
||||
List<Vector3d> result = new ArrayList<Vector3d>(4);
|
||||
switch (face) {
|
||||
case NORTH:
|
||||
result.add(new Vector3d(minX, maxY, minZ));
|
||||
result.add(new Vector3d(maxX, maxY, minZ));
|
||||
result.add(new Vector3d(maxX, minY, minZ));
|
||||
result.add(new Vector3d(minX, minY, minZ));
|
||||
break;
|
||||
case SOUTH:
|
||||
result.add(new Vector3d(minX, maxY, maxZ));
|
||||
result.add(new Vector3d(minX, minY, maxZ));
|
||||
result.add(new Vector3d(maxX, minY, maxZ));
|
||||
result.add(new Vector3d(maxX, maxY, maxZ));
|
||||
break;
|
||||
case EAST:
|
||||
result.add(new Vector3d(maxX, minY, maxZ));
|
||||
result.add(new Vector3d(maxX, minY, minZ));
|
||||
result.add(new Vector3d(maxX, maxY, minZ));
|
||||
result.add(new Vector3d(maxX, maxY, maxZ));
|
||||
break;
|
||||
case WEST:
|
||||
result.add(new Vector3d(minX, maxY, maxZ));
|
||||
result.add(new Vector3d(minX, maxY, minZ));
|
||||
result.add(new Vector3d(minX, minY, minZ));
|
||||
result.add(new Vector3d(minX, minY, maxZ));
|
||||
break;
|
||||
case UP:
|
||||
result.add(new Vector3d(maxX, maxY, maxZ));
|
||||
result.add(new Vector3d(maxX, maxY, minZ));
|
||||
result.add(new Vector3d(minX, maxY, minZ));
|
||||
result.add(new Vector3d(minX, maxY, maxZ));
|
||||
break;
|
||||
case DOWN:
|
||||
case UNKNOWN:
|
||||
default:
|
||||
result.add(new Vector3d(minX, minY, maxZ));
|
||||
result.add(new Vector3d(minX, minY, minZ));
|
||||
result.add(new Vector3d(maxX, minY, minZ));
|
||||
result.add(new Vector3d(maxX, minY, maxZ));
|
||||
break;
|
||||
}
|
||||
return result;
|
||||
|
||||
@@ -0,0 +1,535 @@
|
||||
package crazypants.render;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import crazypants.util.BlockCoord;
|
||||
import crazypants.util.ForgeDirectionOffsets;
|
||||
import crazypants.vecmath.Vector2f;
|
||||
import crazypants.vecmath.Vector3d;
|
||||
import crazypants.vecmath.Vector3f;
|
||||
import crazypants.vecmath.Vector4f;
|
||||
import crazypants.vecmath.Vertex;
|
||||
|
||||
public class CustomCubeRenderer {
|
||||
|
||||
private static final Tessellator DEFAULT_TES = Tessellator.instance;
|
||||
|
||||
private static final MockTesselator BUF_TES = new MockTesselator();
|
||||
|
||||
public static final CustomCubeRenderer instance = new CustomCubeRenderer();
|
||||
|
||||
private InnerRenderBlocks rb = null;
|
||||
|
||||
private Icon overrideTexture;
|
||||
|
||||
public void renderBlock(IBlockAccess ba, Block par1Block, int par2, int par3, int par4, Icon border, boolean forceAllEdges) {
|
||||
renderBlock(ba, par1Block, par2, par3, par4, new DefaultTextureCallback(border), forceAllEdges);
|
||||
}
|
||||
|
||||
public void renderBlock(IBlockAccess ba, Block par1Block, int par2, int par3, int par4, TextureCallback borderCallback, boolean forceAllEdges) {
|
||||
if(rb == null) {
|
||||
rb = new InnerRenderBlocks(ba);
|
||||
}
|
||||
rb.forceAllEdges = forceAllEdges;
|
||||
rb.blockAccess = ba;
|
||||
rb.setRenderBoundsFromBlock(par1Block);
|
||||
rb.setBorderTextureCallback(borderCallback);
|
||||
try {
|
||||
rb.setTesselatorEnabled(false);
|
||||
rb.renderStandardBlock(par1Block, par2, par3, par4);
|
||||
} finally {
|
||||
rb.setBorderTextureCallback(null);
|
||||
rb.setTesselatorEnabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
public Icon getOverrideTexture() {
|
||||
return overrideTexture;
|
||||
}
|
||||
|
||||
public void setOverrideTexture(Icon overrideTexture) {
|
||||
this.overrideTexture = overrideTexture;
|
||||
}
|
||||
|
||||
public static interface TextureCallback {
|
||||
|
||||
public Icon getTextureForFace(ForgeDirection dir);
|
||||
}
|
||||
|
||||
public static class DefaultTextureCallback implements TextureCallback {
|
||||
|
||||
private final Icon tex;
|
||||
|
||||
private final Block block;
|
||||
private final int meta;
|
||||
|
||||
public DefaultTextureCallback(Icon borderTex) {
|
||||
this.tex = borderTex;
|
||||
block = null;
|
||||
meta = 0;
|
||||
}
|
||||
|
||||
public DefaultTextureCallback(Block block, int meta) {
|
||||
tex = null;
|
||||
this.block = block;
|
||||
this.meta = meta;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getTextureForFace(ForgeDirection dir) {
|
||||
if(tex != null) {
|
||||
return tex;
|
||||
}
|
||||
if(block != null) {
|
||||
return block.getIcon(dir.ordinal(), meta);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private class InnerRenderBlocks extends RenderBlocks {
|
||||
|
||||
boolean forceAllEdges = false;
|
||||
boolean translateToXYZ = true;
|
||||
private TextureCallback texCallback;
|
||||
|
||||
private InnerRenderBlocks(IBlockAccess par1iBlockAccess) {
|
||||
super(par1iBlockAccess);
|
||||
}
|
||||
|
||||
public void setBorderTextureCallback(TextureCallback borderCallback) {
|
||||
this.texCallback = borderCallback;
|
||||
}
|
||||
|
||||
void setTesselatorEnabled(boolean enabled) {
|
||||
if(enabled) {
|
||||
Tessellator.instance = DEFAULT_TES;
|
||||
} else {
|
||||
Tessellator.instance = BUF_TES;
|
||||
}
|
||||
}
|
||||
|
||||
private void resetTesForFace() {
|
||||
BUF_TES.reset();
|
||||
}
|
||||
|
||||
private void renderFace(ForgeDirection face, Block par1Block, double x, double y, double z, Icon texture) {
|
||||
|
||||
renderFaceToBuffer(face, par1Block, x, y, z, overrideTexture == null ? texture : overrideTexture);
|
||||
List<Vertex> refVertices = BUF_TES.getVertices();
|
||||
|
||||
List<Vertex> finalVerts = new ArrayList<Vertex>();
|
||||
finalVerts.addAll(refVertices);
|
||||
|
||||
Icon borderTex = texCallback == null ? null : texCallback.getTextureForFace(face);
|
||||
if(borderTex != null) {
|
||||
|
||||
texture = borderTex;
|
||||
List<ForgeDirection> edges;
|
||||
if(forceAllEdges) {
|
||||
edges = RenderUtil.getEdgesForFace(face);
|
||||
} else {
|
||||
edges = RenderUtil.getNonConectedEdgesForFace(blockAccess, (int) x, (int) y, (int) z, face);
|
||||
}
|
||||
|
||||
List<ForgeDirection> allEdges = RenderUtil.getEdgesForFace(face);
|
||||
|
||||
float scaleFactor = 15f / 16f;
|
||||
Vector2f uv = new Vector2f();
|
||||
|
||||
//for each that needs a border, add a geom for the border and move in the 'centre' of the face
|
||||
//so there is no overlap
|
||||
for (ForgeDirection edge : edges) {
|
||||
|
||||
//We need to move the 'centre' of the face so it doesn't overlap with the border
|
||||
moveCorners(refVertices, edge, 1 - scaleFactor, face);
|
||||
|
||||
//Now create the geometry for this edge of the border
|
||||
float xLen = 1 - Math.abs(edge.offsetX) * scaleFactor;
|
||||
float yLen = 1 - Math.abs(edge.offsetY) * scaleFactor;
|
||||
float zLen = 1 - Math.abs(edge.offsetZ) * scaleFactor;
|
||||
|
||||
BoundingBox bb = BoundingBox.UNIT_CUBE.scale(xLen, yLen, zLen);
|
||||
|
||||
List<Vector3d> corners = bb.getCornersForFaceD(face);
|
||||
for (Vector3d corner : corners) {
|
||||
if(translateToXYZ) {
|
||||
corner.x += x;
|
||||
corner.y += y;
|
||||
corner.z += z;
|
||||
}
|
||||
corner.x += (float) (edge.offsetX * 0.5) - Math.signum(edge.offsetX) * xLen / 2f;
|
||||
corner.y += (float) (edge.offsetY * 0.5) - Math.signum(edge.offsetY) * yLen / 2f;
|
||||
corner.z += (float) (edge.offsetZ * 0.5) - Math.signum(edge.offsetZ) * zLen / 2f;
|
||||
}
|
||||
|
||||
int[] indices = new int[] { 0, 1, 2, 3 };
|
||||
for (int index : indices) {
|
||||
Vector3d corner = corners.get(index);
|
||||
if(translateToXYZ) {
|
||||
RenderUtil.getUvForCorner(uv, corner, (int) x, (int) y, (int) z, face, texture);
|
||||
} else {
|
||||
RenderUtil.getUvForCorner(uv, corner, 0, 0, 0, face, texture);
|
||||
}
|
||||
Vertex vertex = new Vertex();
|
||||
vertex.xyz.set(corner);
|
||||
vertex.uv = new Vector2f(uv);
|
||||
applyLighting(vertex, corner);
|
||||
finalVerts.add(vertex);
|
||||
}
|
||||
}
|
||||
|
||||
//move in corners
|
||||
// Vector3d sideVec = new Vector3d();
|
||||
// sideVec.cross(ForgeDirectionOffsets.forDir(face), ForgeDirectionOffsets.forDir(edge));
|
||||
// moveCornerVec(corners, sideVec, scaleFactor, face);
|
||||
// sideVec.negate();
|
||||
// moveCornerVec(corners, sideVec, scaleFactor, face);
|
||||
|
||||
for (int i = 0; i < allEdges.size(); i++) {
|
||||
ForgeDirection dir = allEdges.get(i);
|
||||
ForgeDirection dir2 = i + 1 < allEdges.size() ? allEdges.get(i + 1) : allEdges.get(0);
|
||||
if(needsCorner(dir, dir2, edges, face, par1Block, x, y, z)) {
|
||||
|
||||
Vertex v = new Vertex();
|
||||
v.uv = new Vector2f();
|
||||
v.xyz.set(ForgeDirectionOffsets.forDir(dir));
|
||||
v.xyz.add(ForgeDirectionOffsets.forDir(dir2));
|
||||
//TODO: dodgy hack to just move the corner forward a bit
|
||||
v.xyz.add(ForgeDirectionOffsets.offsetScaled(face, 0.001f));
|
||||
v.xyz.x = Math.max(-0.001, v.xyz.x);
|
||||
v.xyz.y = Math.max(-0.001, v.xyz.y);
|
||||
v.xyz.z = Math.max(-0.001, v.xyz.z);
|
||||
|
||||
if(ForgeDirectionOffsets.isPositiveOffset(face)) {
|
||||
v.xyz.add(ForgeDirectionOffsets.forDir(face));
|
||||
}
|
||||
|
||||
if(translateToXYZ) {
|
||||
v.xyz.x += x;
|
||||
v.xyz.y += y;
|
||||
v.xyz.z += z;
|
||||
RenderUtil.getUvForCorner(v.uv, v.xyz, (int) x, (int) y, (int) z, face, texture);
|
||||
} else {
|
||||
RenderUtil.getUvForCorner(v.uv, v.xyz, 0, 0, 0, face, texture);
|
||||
}
|
||||
applyLighting(v, v.xyz);
|
||||
|
||||
finalVerts.add(v);
|
||||
|
||||
Vector3d corner = new Vector3d(v.xyz);
|
||||
if(ForgeDirectionOffsets.isPositiveOffset(face)) {
|
||||
addVertexForCorner(face, x, y, z, texture, translateToXYZ, finalVerts, dir2, null, corner);
|
||||
addVertexForCorner(face, x, y, z, texture, translateToXYZ, finalVerts, dir, dir2, corner);
|
||||
addVertexForCorner(face, x, y, z, texture, translateToXYZ, finalVerts, dir, null, corner);
|
||||
} else {
|
||||
addVertexForCorner(face, x, y, z, texture, translateToXYZ, finalVerts, dir, null, corner);
|
||||
addVertexForCorner(face, x, y, z, texture, translateToXYZ, finalVerts, dir, dir2, corner);
|
||||
addVertexForCorner(face, x, y, z, texture, translateToXYZ, finalVerts, dir2, null, corner);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
RenderUtil.addVerticesToTessellator(finalVerts, DEFAULT_TES);
|
||||
}
|
||||
|
||||
private Vertex getClosestVertex(List<Vertex> vertices, Vector3d corner) {
|
||||
Vertex result = null;
|
||||
double d2 = Double.MAX_VALUE;
|
||||
for (Vertex v : vertices) {
|
||||
double tmp = corner.distanceSquared(v.xyz);
|
||||
if(tmp <= d2) {
|
||||
result = v;
|
||||
d2 = tmp;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private void addVertexForCorner(ForgeDirection face, double x, double y, double z, Icon texture, boolean translateToXYZ, List<Vertex> vertices,
|
||||
ForgeDirection dir, ForgeDirection dir2, Vector3d corner) {
|
||||
float scale = 1 / 16f;
|
||||
Vertex vert = new Vertex();
|
||||
vert.uv = new Vector2f();
|
||||
vert.xyz.set(corner);
|
||||
vert.xyz.sub(ForgeDirectionOffsets.offsetScaled(dir, scale));
|
||||
if(dir2 != null) {
|
||||
vert.xyz.sub(ForgeDirectionOffsets.offsetScaled(dir2, scale));
|
||||
}
|
||||
if(translateToXYZ) {
|
||||
RenderUtil.getUvForCorner(vert.uv, vert.xyz, (int) x, (int) y, (int) z, face, texture);
|
||||
} else {
|
||||
RenderUtil.getUvForCorner(vert.uv, vert.xyz, 0, 0, 0, face, texture);
|
||||
}
|
||||
applyLighting(vert, corner);
|
||||
vertices.add(vert);
|
||||
}
|
||||
|
||||
private void applyLighting(Vertex vert, Vector3d samplePoint) {
|
||||
Vertex closest = getClosestVertex(BUF_TES.getVertices(), samplePoint);
|
||||
vert.setBrightness(closest.brightness);
|
||||
Vector4f col = closest.getColor();
|
||||
if(col != null) {
|
||||
vert.setColor(col);
|
||||
}
|
||||
}
|
||||
|
||||
// private int interpolateBrightness(float u, float v, int bl, int br, int tl, int tr) {
|
||||
// //(1 - yfrac) * [(1 - xfrac)*s00 + xfrac*s01] + yfrac * [(1 - xfrac)*s10 + xfrac*s11]
|
||||
// float res = (1 - v) * ((1 - u) * bl + u * tl) + v * ((1 - u) * br + u * tr);
|
||||
// return (int) res;
|
||||
// }
|
||||
|
||||
private boolean needsCorner(ForgeDirection dir, ForgeDirection dir2, List<ForgeDirection> edges, ForgeDirection face,
|
||||
Block par1Block, double x, double y,
|
||||
double z) {
|
||||
|
||||
if(edges.contains(dir) || edges.contains(dir2)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
BlockCoord bc = new BlockCoord((int) x, (int) y, (int) z);
|
||||
BlockCoord testLoc = bc.getLocation(dir);
|
||||
if(RenderUtil.getNonConectedEdgesForFace(blockAccess, testLoc.x, testLoc.y, testLoc.z, face).contains(dir2)) {
|
||||
return true;
|
||||
}
|
||||
testLoc = bc.getLocation(dir2);
|
||||
if(RenderUtil.getNonConectedEdgesForFace(blockAccess, testLoc.x, testLoc.y, testLoc.z, face).contains(dir)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private void moveCornerVec(List<Vector3d> corners, Vector3d edge, float scaleFactor, ForgeDirection face) {
|
||||
int[] indices = getClosestVec(edge, corners, face);
|
||||
corners.get(indices[0]).x -= scaleFactor * edge.x;
|
||||
corners.get(indices[1]).x -= scaleFactor * edge.x;
|
||||
corners.get(indices[0]).y -= scaleFactor * edge.y;
|
||||
corners.get(indices[1]).y -= scaleFactor * edge.y;
|
||||
corners.get(indices[0]).z -= scaleFactor * edge.z;
|
||||
corners.get(indices[1]).z -= scaleFactor * edge.z;
|
||||
}
|
||||
|
||||
private void moveCorners(List<Vertex> vertices, ForgeDirection edge, float scaleFactor, ForgeDirection face) {
|
||||
int[] indices = getClosest(edge, vertices, face);
|
||||
vertices.get(indices[0]).xyz.x -= scaleFactor * edge.offsetX;
|
||||
vertices.get(indices[1]).xyz.x -= scaleFactor * edge.offsetX;
|
||||
vertices.get(indices[0]).xyz.y -= scaleFactor * edge.offsetY;
|
||||
vertices.get(indices[1]).xyz.y -= scaleFactor * edge.offsetY;
|
||||
vertices.get(indices[0]).xyz.z -= scaleFactor * edge.offsetZ;
|
||||
vertices.get(indices[1]).xyz.z -= scaleFactor * edge.offsetZ;
|
||||
}
|
||||
|
||||
private int[] getClosest(ForgeDirection edge, List<Vertex> vertices, ForgeDirection face) {
|
||||
int[] res = new int[] { -1, -1 };
|
||||
boolean highest = edge.offsetX > 0 || edge.offsetY > 0 || edge.offsetZ > 0;
|
||||
double minMax = highest ? -Double.MAX_VALUE : Double.MAX_VALUE;
|
||||
int index = 0;
|
||||
for (Vertex v : vertices) {
|
||||
double val = get(v.xyz, edge);
|
||||
if(highest ? val >= minMax : val <= minMax) {
|
||||
if(val != minMax) {
|
||||
res[0] = index;
|
||||
} else {
|
||||
res[1] = index;
|
||||
}
|
||||
minMax = val;
|
||||
}
|
||||
index++;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
private int[] getClosestVec(Vector3d edge, List<Vector3d> corners, ForgeDirection face) {
|
||||
int[] res = new int[] { -1, -1 };
|
||||
boolean highest = edge.x > 0 || edge.y > 0 || edge.z > 0;
|
||||
double minMax = highest ? -Double.MAX_VALUE : Double.MAX_VALUE;
|
||||
int index = 0;
|
||||
for (Vector3d v : corners) {
|
||||
double val = get(v, edge);
|
||||
if(highest ? val >= minMax : val <= minMax) {
|
||||
if(val != minMax) {
|
||||
res[0] = index;
|
||||
} else {
|
||||
res[1] = index;
|
||||
}
|
||||
minMax = val;
|
||||
}
|
||||
index++;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
private double get(Vector3d xyz, ForgeDirection edge) {
|
||||
if(edge == ForgeDirection.EAST || edge == ForgeDirection.WEST) {
|
||||
return xyz.x;
|
||||
}
|
||||
if(edge == ForgeDirection.UP || edge == ForgeDirection.DOWN) {
|
||||
return xyz.y;
|
||||
}
|
||||
return xyz.z;
|
||||
}
|
||||
|
||||
private double get(Vector3d xyz, Vector3d edge) {
|
||||
if(Math.abs(edge.x) > 0.5) {
|
||||
return xyz.x;
|
||||
}
|
||||
if(Math.abs(edge.y) > 0.5) {
|
||||
return xyz.y;
|
||||
}
|
||||
return xyz.z;
|
||||
}
|
||||
|
||||
private void renderFaceToBuffer(ForgeDirection face, Block par1Block, double par2, double par4, double par6, Icon par8Icon) {
|
||||
setTesselatorEnabled(false);
|
||||
BUF_TES.reset();
|
||||
switch (face) {
|
||||
case DOWN:
|
||||
super.renderFaceYNeg(par1Block, par2, par4, par6, par8Icon);
|
||||
break;
|
||||
case EAST:
|
||||
super.renderFaceXPos(par1Block, par2, par4, par6, par8Icon);
|
||||
break;
|
||||
case NORTH:
|
||||
super.renderFaceZNeg(par1Block, par2, par4, par6, par8Icon);
|
||||
break;
|
||||
case SOUTH:
|
||||
super.renderFaceZPos(par1Block, par2, par4, par6, par8Icon);
|
||||
break;
|
||||
case UP:
|
||||
super.renderFaceYPos(par1Block, par2, par4, par6, par8Icon);
|
||||
break;
|
||||
case WEST:
|
||||
super.renderFaceXNeg(par1Block, par2, par4, par6, par8Icon);
|
||||
break;
|
||||
case UNKNOWN:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderFaceYNeg(Block par1Block, double par2, double par4, double par6, Icon par8Icon) {
|
||||
renderFace(ForgeDirection.DOWN, par1Block, par2, par4, par6, par8Icon);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderFaceYPos(Block par1Block, double par2, double par4, double par6, Icon par8Icon) {
|
||||
renderFace(ForgeDirection.UP, par1Block, par2, par4, par6, par8Icon);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderFaceZNeg(Block par1Block, double par2, double par4, double par6, Icon par8Icon) {
|
||||
renderFace(ForgeDirection.NORTH, par1Block, par2, par4, par6, par8Icon);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderFaceZPos(Block par1Block, double par2, double par4, double par6, Icon par8Icon) {
|
||||
renderFace(ForgeDirection.SOUTH, par1Block, par2, par4, par6, par8Icon);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderFaceXNeg(Block par1Block, double par2, double par4, double par6, Icon par8Icon) {
|
||||
renderFace(ForgeDirection.WEST, par1Block, par2, par4, par6, par8Icon);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderFaceXPos(Block par1Block, double par2, double par4, double par6, Icon par8Icon) {
|
||||
renderFace(ForgeDirection.EAST, par1Block, par2, par4, par6, par8Icon);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static class MockTesselator extends Tessellator {
|
||||
|
||||
private final List<Vertex> vertices = new ArrayList<Vertex>();
|
||||
|
||||
private boolean hasTexture;
|
||||
private double textureU;
|
||||
private double textureV;
|
||||
private boolean hasBrightness;
|
||||
private int brightness;
|
||||
private boolean hasColor;
|
||||
private Vector4f color;
|
||||
private boolean hasNormals;
|
||||
private Vector3f normal;
|
||||
|
||||
public List<Vertex> getVertices() {
|
||||
return vertices;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTextureUV(double par1, double par3) {
|
||||
super.setTextureUV(par1, par3);
|
||||
this.hasTexture = true;
|
||||
this.textureU = par1;
|
||||
this.textureV = par3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBrightness(int par1) {
|
||||
super.setBrightness(par1);
|
||||
this.hasBrightness = true;
|
||||
this.brightness = par1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the RGBA values for the color. Also clamps them to 0-255.
|
||||
*/
|
||||
@Override
|
||||
public void setColorRGBA(int r, int g, int b, int a) {
|
||||
super.setColorRGBA(r, g, b, a);
|
||||
hasColor = true;
|
||||
color = ColorUtil.toFloat(new Color(r, g, b, a));
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the normal for the current draw call.
|
||||
*/
|
||||
@Override
|
||||
public void setNormal(float par1, float par2, float par3) {
|
||||
super.setNormal(par1, par2, par3);
|
||||
hasNormals = true;
|
||||
normal = new Vector3f(par1, par2, par3);
|
||||
}
|
||||
|
||||
public void reset() {
|
||||
hasNormals = false;
|
||||
this.hasColor = false;
|
||||
this.hasTexture = false;
|
||||
this.hasBrightness = false;
|
||||
vertices.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addVertex(double x, double y, double z) {
|
||||
Vertex v = new Vertex();
|
||||
v.setXYZ(x, y, z);
|
||||
if(hasTexture) {
|
||||
v.setUV(textureU, textureV);
|
||||
}
|
||||
if(hasBrightness) {
|
||||
v.setBrightness(brightness);
|
||||
}
|
||||
if(this.hasColor) {
|
||||
v.setColor(this.color);
|
||||
}
|
||||
if(hasNormals) {
|
||||
v.setNormal(normal);
|
||||
}
|
||||
vertices.add(v);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -31,10 +31,11 @@ import org.lwjgl.opengl.GL11;
|
||||
import crazypants.util.BlockCoord;
|
||||
import crazypants.vecmath.Matrix4d;
|
||||
import crazypants.vecmath.VecmathUtil;
|
||||
import crazypants.vecmath.Vector2d;
|
||||
import crazypants.vecmath.Vector2f;
|
||||
import crazypants.vecmath.Vector3d;
|
||||
import crazypants.vecmath.Vector3f;
|
||||
import crazypants.vecmath.Vector4d;
|
||||
import crazypants.vecmath.Vertex;
|
||||
|
||||
public class RenderUtil {
|
||||
|
||||
@@ -159,27 +160,56 @@ public class RenderUtil {
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
}
|
||||
|
||||
/**
|
||||
* left, bottom, right, top
|
||||
*
|
||||
* @param face
|
||||
* @return
|
||||
*/
|
||||
public static List<ForgeDirection> getEdgesForFace(ForgeDirection face) {
|
||||
List<ForgeDirection> result = new ArrayList<ForgeDirection>(4);
|
||||
if(face.offsetY != 0) {
|
||||
result.add(EAST);
|
||||
result.add(WEST);
|
||||
result.add(NORTH);
|
||||
result.add(EAST);
|
||||
result.add(SOUTH);
|
||||
result.add(WEST);
|
||||
|
||||
} else if(face.offsetX != 0) {
|
||||
result.add(DOWN);
|
||||
result.add(UP);
|
||||
result.add(SOUTH);
|
||||
result.add(UP);
|
||||
result.add(NORTH);
|
||||
} else {
|
||||
result.add(UP);
|
||||
result.add(DOWN);
|
||||
result.add(WEST);
|
||||
result.add(UP);
|
||||
result.add(EAST);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public static void addVerticesToTesselator(List<Vertex> vertices) {
|
||||
addVerticesToTessellator(vertices, Tessellator.instance);
|
||||
}
|
||||
|
||||
public static void addVerticesToTessellator(List<Vertex> vertices, Tessellator tes) {
|
||||
for (Vertex v : vertices) {
|
||||
if(v.brightness != -1) {
|
||||
tes.setBrightness(v.brightness);
|
||||
}
|
||||
if(v.color != null) {
|
||||
tes.setColorRGBA_F(v.r(), v.g(), v.b(), v.a());
|
||||
}
|
||||
if(v.uv != null) {
|
||||
tes.setTextureUV(v.u(), v.v());
|
||||
}
|
||||
if(v.normal != null) {
|
||||
tes.setNormal(v.nx(), v.ny(), v.nz());
|
||||
}
|
||||
tes.addVertex(v.x(), v.y(), v.z());
|
||||
}
|
||||
}
|
||||
|
||||
public static void renderConnectedTextureFace(IBlockAccess blockAccess, int x, int y, int z, ForgeDirection face, Icon texture, boolean forceAllEdges) {
|
||||
renderConnectedTextureFace(blockAccess, x, y, z, face, texture, forceAllEdges, true, true);
|
||||
}
|
||||
@@ -218,7 +248,7 @@ public class RenderUtil {
|
||||
}
|
||||
|
||||
float scaleFactor = 15f / 16f;
|
||||
Vector2d uv = new Vector2d();
|
||||
Vector2f uv = new Vector2f();
|
||||
for (ForgeDirection edge : edges) {
|
||||
|
||||
float xLen = 1 - Math.abs(edge.offsetX) * scaleFactor;
|
||||
@@ -279,7 +309,7 @@ public class RenderUtil {
|
||||
return result;
|
||||
}
|
||||
|
||||
public static void getUvForCorner(Vector2d uv, Vector3d corner, int x, int y, int z, ForgeDirection face, Icon icon) {
|
||||
public static void getUvForCorner(Vector2f uv, Vector3d corner, int x, int y, int z, ForgeDirection face, Icon icon) {
|
||||
if(icon == null) {
|
||||
return;
|
||||
}
|
||||
@@ -289,14 +319,20 @@ public class RenderUtil {
|
||||
p.y -= y;
|
||||
p.z -= z;
|
||||
|
||||
float uWidth = icon.getMaxU() - icon.getMinU();
|
||||
float vWidth = icon.getMaxV() - icon.getMinV();
|
||||
float uWidth = 1;
|
||||
float vWidth = 1;
|
||||
if(icon != null) {
|
||||
uWidth = icon.getMaxU() - icon.getMinU();
|
||||
vWidth = icon.getMaxV() - icon.getMinV();
|
||||
}
|
||||
|
||||
uv.x = VecmathUtil.distanceFromPointToPlane(getUPlaneForFace(face), p);
|
||||
uv.y = VecmathUtil.distanceFromPointToPlane(getVPlaneForFace(face), p);
|
||||
uv.x = (float) VecmathUtil.distanceFromPointToPlane(getUPlaneForFace(face), p);
|
||||
uv.y = (float) VecmathUtil.distanceFromPointToPlane(getVPlaneForFace(face), p);
|
||||
|
||||
uv.x = icon.getMinU() + (uv.x * uWidth);
|
||||
uv.y = icon.getMinV() + (uv.y * vWidth);
|
||||
if(icon != null) {
|
||||
uv.x = icon.getMinU() + (uv.x * uWidth);
|
||||
uv.y = icon.getMinV() + (uv.y * vWidth);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -27,6 +27,20 @@ public final class ForgeDirectionOffsets {
|
||||
return res;
|
||||
}
|
||||
|
||||
public ForgeDirection closest(float x, float y, float z) {
|
||||
float ax = Math.abs(x);
|
||||
float ay = Math.abs(y);
|
||||
float az = Math.abs(z);
|
||||
|
||||
if(ax >= ay && ax >= az) {
|
||||
return x > 0 ? ForgeDirection.EAST : ForgeDirection.WEST;
|
||||
}
|
||||
if(ay >= ax && ay >= az) {
|
||||
return y > 0 ? ForgeDirection.UP : ForgeDirection.DOWN;
|
||||
}
|
||||
return z > 0 ? ForgeDirection.SOUTH : ForgeDirection.NORTH;
|
||||
}
|
||||
|
||||
private ForgeDirectionOffsets() {
|
||||
}
|
||||
|
||||
|
||||
@@ -32,6 +32,10 @@ public class Vector3d {
|
||||
this.z = z;
|
||||
}
|
||||
|
||||
public void set(Vector3f v) {
|
||||
set(v.x, v.y, v.z);
|
||||
}
|
||||
|
||||
public void set(Vector3d vec) {
|
||||
x = vec.x;
|
||||
y = vec.y;
|
||||
@@ -44,7 +48,7 @@ public class Vector3d {
|
||||
z += vec.z;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public Vector3d add(Vector3f vec) {
|
||||
x += vec.x;
|
||||
y += vec.y;
|
||||
@@ -57,11 +61,11 @@ public class Vector3d {
|
||||
y -= vec.y;
|
||||
z -= vec.z;
|
||||
}
|
||||
|
||||
|
||||
public void sub(Vector3f vec) {
|
||||
x -= vec.x;
|
||||
y -= vec.y;
|
||||
z -= vec.z;
|
||||
z -= vec.z;
|
||||
}
|
||||
|
||||
public Vector3d negate() {
|
||||
@@ -123,6 +127,4 @@ public class Vector3d {
|
||||
z = Math.abs(z);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -49,7 +49,7 @@ public class Vector3f {
|
||||
y += vec.y;
|
||||
z += vec.z;
|
||||
}
|
||||
|
||||
|
||||
public void add(Vector3d vec) {
|
||||
x += vec.x;
|
||||
y += vec.y;
|
||||
@@ -61,11 +61,11 @@ public class Vector3f {
|
||||
y -= vec.y;
|
||||
z -= vec.z;
|
||||
}
|
||||
|
||||
|
||||
public void sub(Vector3d vec) {
|
||||
x -= vec.x;
|
||||
y -= vec.y;
|
||||
z -= vec.z;
|
||||
z -= vec.z;
|
||||
}
|
||||
|
||||
public void negate() {
|
||||
@@ -104,5 +104,8 @@ public class Vector3f {
|
||||
return "Vector3f(" + x + ", " + y + ", " + z + ")";
|
||||
}
|
||||
|
||||
|
||||
public Vector3d asVector3d() {
|
||||
return new Vector3d(x, y, z);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,23 +2,34 @@ package crazypants.vecmath;
|
||||
|
||||
public class Vertex {
|
||||
|
||||
public final Vector3d xyz = new Vector3d();
|
||||
public final Vector2f uv = new Vector2f();
|
||||
public final Vector3f normal = new Vector3f();
|
||||
public Vector3d xyz = new Vector3d();
|
||||
public Vector2f uv = null;
|
||||
public Vector3f normal = null;
|
||||
public Vector4f color = null;
|
||||
|
||||
public int brightness = -1;
|
||||
|
||||
public Vertex() {
|
||||
}
|
||||
|
||||
public Vertex(Vertex other) {
|
||||
xyz.set(other.xyz);
|
||||
uv.set(other.uv);
|
||||
normal.set(other.normal);
|
||||
if(other.uv != null) {
|
||||
uv = new Vector2f(other.uv);
|
||||
}
|
||||
if(other.normal != null) {
|
||||
normal = new Vector3f(other.normal);
|
||||
}
|
||||
if(other.color != null) {
|
||||
color = new Vector4f(other.color);
|
||||
}
|
||||
brightness = other.brightness;
|
||||
}
|
||||
|
||||
public Vertex(Vector3d xyz, Vector3f normal, Vector2f uv) {
|
||||
this.xyz.set(xyz);
|
||||
this.normal.set(normal);
|
||||
this.uv.set(uv);
|
||||
this.normal = new Vector3f(normal);
|
||||
this.uv = new Vector2f(uv);
|
||||
}
|
||||
|
||||
public void setXYZ(double x, double y, double z) {
|
||||
@@ -26,14 +37,41 @@ public class Vertex {
|
||||
}
|
||||
|
||||
public void setUV(double u, double v) {
|
||||
uv.set(u, v);
|
||||
if(uv == null) {
|
||||
uv = new Vector2f(u, v);
|
||||
} else {
|
||||
uv.set(u, v);
|
||||
}
|
||||
}
|
||||
|
||||
public void setNormal(double x, double y, double z) {
|
||||
if(normal == null) {
|
||||
normal = new Vector3f();
|
||||
}
|
||||
normal.set((float) x, (float) y, (float) z);
|
||||
normal.normalize();
|
||||
}
|
||||
|
||||
public void setNormal(Vector3f normal2) {
|
||||
if(normal2 == null) {
|
||||
normal = null;
|
||||
return;
|
||||
}
|
||||
setNormal(normal2.x, normal2.y, normal2.z);
|
||||
}
|
||||
|
||||
public void setBrightness(int brightness) {
|
||||
this.brightness = brightness;
|
||||
}
|
||||
|
||||
public Vector4f getColor() {
|
||||
return color;
|
||||
}
|
||||
|
||||
public void setColor(Vector4f color) {
|
||||
this.color = color;
|
||||
}
|
||||
|
||||
public void transform(Matrix4d xform) {
|
||||
xform.transform(xyz);
|
||||
xform.transformNormal(normal);
|
||||
@@ -75,9 +113,25 @@ public class Vertex {
|
||||
return uv.y;
|
||||
}
|
||||
|
||||
public float r() {
|
||||
return color.x;
|
||||
}
|
||||
|
||||
public float g() {
|
||||
return color.y;
|
||||
}
|
||||
|
||||
public float b() {
|
||||
return color.z;
|
||||
}
|
||||
|
||||
public float a() {
|
||||
return color.w;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Vertex [xyz=" + xyz + ", uv=" + uv + "]";
|
||||
return "Vertex [xyz=" + xyz + ", uv=" + uv + ", normal=" + normal + ", color=" + color + ", brightness=" + brightness + "]";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
//*** Ender IO *****//
|
||||
|
||||
//Power
|
||||
@@ -62,7 +61,7 @@ enderio.powderEnder=Enderperlenpulver
|
||||
enderio.itemBasicCapacitor=Kondensator
|
||||
enderio.basicCapacitor=Basiskondensator
|
||||
enderio.activatedCapacitor=Doppelschichtkondensator
|
||||
enderio.enderCapacitor=Octadischer Kondensator
|
||||
enderio.enderCapacitor=Oktadischer Kondensator
|
||||
|
||||
|
||||
//Machines
|
||||
@@ -194,18 +193,3 @@ enderio.gui.conduit.redstone.signalColor=Signalfarbe
|
||||
enderio.gui.conduit.redstone.color=Farbe
|
||||
|
||||
enderio.gui.conduit.fluid.autoExtract=Auto-Extrahieren
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
//*** Ender IO *****//
|
||||
|
||||
//Power
|
||||
@@ -194,19 +193,3 @@ enderio.gui.conduit.redstone.signalColor=Signal Color
|
||||
enderio.gui.conduit.redstone.color=Color
|
||||
|
||||
enderio.gui.conduit.fluid.autoExtract=Auto Extract
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,195 @@
|
||||
//*** Ender IO *****//
|
||||
|
||||
//Power
|
||||
enderio.power.mj=MJ
|
||||
enderio.power.rf=RF
|
||||
enderio.power.tick=/t
|
||||
enderio.power.maxOutput=Sortie Max
|
||||
|
||||
//Ender IO / Enderface
|
||||
enderio.blockEnderIo=Ender IO
|
||||
enderio.itemEnderface=Masque d'Ender
|
||||
|
||||
//Conduits
|
||||
enderio.blockConduitBundle=Faisceau de Conduits
|
||||
enderio.blockConduitFacade=Façade
|
||||
enderio.itemConduitFacade=Façade
|
||||
|
||||
enderio.itemPowerConduit=Conduit d'énergie
|
||||
enderio.itemPowerConduitEnhanced=Conduit d'énergie Amélioré
|
||||
enderio.itemPowerConduitEnder=Conduit d'énergie de l'Ender
|
||||
|
||||
enderio.itemRedstoneConduit=Conduit de Redstone
|
||||
enderio.itemRedstoneConduitSwitch=Interrupteur Redstone
|
||||
enderio.itemRedstoneConduitInsulated=Conduit de Redstone isolé
|
||||
|
||||
enderio.itemLiquidConduit=Conduit pour fluides
|
||||
|
||||
enderio.itemItemConduit=Tuyau pour objet
|
||||
enderio.itemItemConduitEmpowered=Tuyau pour objet Avancé
|
||||
|
||||
//Materials
|
||||
enderio.itemMaterial=Matériaux
|
||||
enderio.silicon=Silicium
|
||||
enderio.conduitBinder=Jonction
|
||||
enderio.binderComposite=Jonction Composite
|
||||
enderio.phasedIronNugget=Pépite de fer Palpitante
|
||||
|
||||
enderio.itemMachinePart=Pièces Détachées
|
||||
enderio.blockFusedQuartz=Quartz uni
|
||||
enderio.itemFusedQuartzFrame=Cadre de Quartz uni
|
||||
enderio.itemPowderIngot=Poudre & Lingots
|
||||
|
||||
//Alloys
|
||||
enderio.itemAlloy=Alliage
|
||||
enderio.electricalSteel=Acier Électrique
|
||||
enderio.energeticAlloy=Alliage Énergetique
|
||||
enderio.phasedGold=Alliage Étincelant
|
||||
enderio.redstoneAlloy=Alliage de Redstone
|
||||
enderio.conductiveIron=Fer conducteur
|
||||
enderio.phasedIron=Fer Étincelant
|
||||
|
||||
//Powder / Ingot
|
||||
enderio.powderCoal=Poudre de charbon
|
||||
enderio.powderIron=Poudre de Fer
|
||||
enderio.powderGold=Poudre d'Or
|
||||
enderio.powderCopper=Poudre de Cuivre
|
||||
enderio.powderTin=Poudre d'Étain
|
||||
enderio.powderEnder=Poudre de Perle du Néant
|
||||
|
||||
//Capacitors
|
||||
enderio.itemBasicCapacitor=Condensateur
|
||||
enderio.basicCapacitor=Condensateur de base
|
||||
enderio.activatedCapacitor=Condensateur Double-Couche
|
||||
enderio.enderCapacitor=Condensateur Octadique
|
||||
|
||||
|
||||
//Machines
|
||||
enderio.blockStirlingGenerator=Générateur Stirling
|
||||
enderio.blockReservoir=Réservoir
|
||||
enderio.blockAlloySmelter=Fonderie
|
||||
enderio.blockSolarPanel=Cellule Photovoltaïque
|
||||
enderio.blockElectricLight=Lampe électrique
|
||||
enderio.blockCapacitorBank=Batterie de condensateurs
|
||||
enderio.blockCrusher=Broyeur SAG
|
||||
enderio.blockHyperCube=Émetteur-Récepteur Dimensionnel
|
||||
enderio.blockPowerMonitor=Moniteur d'énergie
|
||||
|
||||
//Painter
|
||||
enderio.blockPainter=Machine à Enduction
|
||||
enderio.blockCustomFence=Barrière peinte
|
||||
enderio.blockCustomFenceGate=porte peinte
|
||||
enderio.blockCustomWall=Mur Peint
|
||||
enderio.blockCustomStair=Escaliers peints
|
||||
enderio.blockCustomSlab=Dalle peinte
|
||||
enderio.blockCustomDoubleSlab=Dalle peinte
|
||||
|
||||
//Items
|
||||
enderio.itemYetaWrench=Clé Yeta
|
||||
enderio.itemMJReader=Lecteur MJ
|
||||
|
||||
enderio.itemEnderface.wrongDimension=Le bloc EnderIO est dans une autre dimension.
|
||||
enderio.itemEnderface.tooFar=Le bloc EnderIO est trop loin.
|
||||
enderio.itemEnderface.destroyed=Le bloc EnderIO a été détruit.
|
||||
enderio.itemEnderface.noSync=Le Masque d'Ender n'est pas synchronisé avec l'EnderIO.
|
||||
|
||||
|
||||
//------GUI
|
||||
|
||||
//General
|
||||
enderio.color.black=Noir
|
||||
enderio.color.red=Rouge
|
||||
enderio.color.green=Vert
|
||||
enderio.color.brown=Marron
|
||||
enderio.color.blue=Bleu
|
||||
enderio.color.purple=Violet
|
||||
enderio.color.cyan=Cyan
|
||||
enderio.color.lightGray=Gris Clair
|
||||
enderio.color.gray=Gris
|
||||
enderio.color.pink=Rose
|
||||
enderio.color.lime=Citron Vert
|
||||
enderio.color.yellow=Jaune
|
||||
enderio.color.lightBlue=Bleu Clair
|
||||
enderio.color.magenta=Magenta
|
||||
enderio.color.orange=Orange
|
||||
enderio.color.white=Blanc
|
||||
|
||||
enderio.gui.enabled=Activé
|
||||
enderio.gui.disabled=Désactivé
|
||||
enderio.gui.send=Envoyer
|
||||
enderio.gui.recieve=Recevoir
|
||||
enderio.gui.sendRecieve=Envoyer & Recevoir
|
||||
|
||||
//Redstone controls
|
||||
enderio.gui.tooltip.redstoneControlMode=Mode Redstone
|
||||
enderio.gui.tooltip.redstoneControlMode.ignore=Toujours Actif
|
||||
enderio.gui.tooltip.redstoneControlMode.on=Actif avec signal
|
||||
enderio.gui.tooltip.redstoneControlMode.off=Actif sans signal
|
||||
enderio.gui.tooltip.redstoneControlMode.never=Jamais Actif
|
||||
|
||||
//Power Monitor
|
||||
enderio.gui.powerMonitor.engineControl=Contrôle du Moteur
|
||||
enderio.gui.powerMonitor.emit=Émettre
|
||||
enderio.gui.powerMonitor.engineSection1=Émettre un signal si stockage moins
|
||||
enderio.gui.powerMonitor.engineSection2=que
|
||||
enderio.gui.powerMonitor.engineSection3=% plein.
|
||||
enderio.gui.powerMonitor.engineSection4= Stop si stockage plus grand que
|
||||
enderio.gui.powerMonitor.engineSection5=ou égal à
|
||||
enderio.gui.powerMonitor.of=de
|
||||
enderio.gui.powerMonitor.monHeading1=Stockage Tuyau
|
||||
enderio.gui.powerMonitor.monHeading2=Stockage Batterie de condensateurs
|
||||
enderio.gui.powerMonitor.monHeading3=Stockage des Machines
|
||||
enderio.gui.powerMonitor.monHeading4=Sortie moyenne sur 5 secondes
|
||||
enderio.gui.powerMonitor.monHeading5=Entrée moyenne sur 5 secondes
|
||||
|
||||
//MJ Reader
|
||||
enderio.gui.mjReader.networkHeading=Réseau Électrique
|
||||
enderio.gui.mjReader.conduitBuffer=Stockage Interne
|
||||
enderio.gui.mjReader.requestRange=Demande par tick
|
||||
enderio.gui.mjReader.currentRequest=Demande Actuelle
|
||||
|
||||
//CapacitorBank
|
||||
enderio.gui.capBank.inputRs=Mode Redstone Entrée
|
||||
enderio.gui.capBank.outputRs=Mode Redstone Sortie
|
||||
enderio.gui.capBank.maxIo=Max E/S
|
||||
enderio.gui.capBank.maxInput=Entrée Max
|
||||
enderio.gui.capBank.maxOutput=Sortie Max
|
||||
|
||||
//Transceiver
|
||||
enderio.gui.trans.publicChannel=Canal Public
|
||||
enderio.gui.trans.privateChannel=Canal Privé
|
||||
enderio.gui.trans.deleteChannel=Suppr. Canal
|
||||
enderio.gui.trans.activateChannel=Activer Canal
|
||||
enderio.gui.trans.powerMode=Mode Énergie
|
||||
enderio.gui.trans.fluidMode=Mode Fluides
|
||||
enderio.gui.trans.itemMode=Mode Objets
|
||||
enderio.gui.trans.publicHeading=Public
|
||||
enderio.gui.trans.privateHeading=Privé
|
||||
|
||||
//conduits
|
||||
enderio.gui.conduit.ioMode=Mode
|
||||
enderio.gui.conduit.ioMode.inOut=Entrée / Sortie
|
||||
enderio.gui.conduit.ioMode.input=Extraire
|
||||
enderio.gui.conduit.ioMode.output=Insérer
|
||||
enderio.gui.conduit.ioMode.disabled=Désactivé
|
||||
enderio.gui.conduit.ioMode.notSet=Par Défaut
|
||||
|
||||
enderio.gui.conduit.item.sigCol=Couleur du signal
|
||||
enderio.gui.conduit.item.channel=Canal
|
||||
enderio.gui.conduit.item.ignoreMetaData=Meta Data Ignorées
|
||||
enderio.gui.conduit.item.matchMetaData=Meta Data Égales
|
||||
enderio.gui.conduit.item.whitelist=Liste Blanche
|
||||
enderio.gui.conduit.item.blacklist=Liste Noire
|
||||
enderio.gui.conduit.item.stickyEnabled=Mode Collant activé|les objets sélectionnés|ne seront envoyés qu'ici ou| aux autres Sorties Collantes.
|
||||
enderio.gui.conduit.item.stickyDisbaled=Mode Collant désactivé
|
||||
enderio.gui.conduit.item.ignoreNBT=Données NBT Ignorées
|
||||
enderio.gui.conduit.item.matchNBT=Données NBT Égales
|
||||
enderio.gui.conduit.item.oreDicEnabled=Ore Dictionary Activé
|
||||
enderio.gui.conduit.item.oreDicDisabled=Ore Dictionary Désactivé
|
||||
enderio.gui.conduit.item.selfFeedEnabled=Auto Alimentation Activée
|
||||
enderio.gui.conduit.item.selfFeedDisabled=Auto Alimentation Désactivée
|
||||
|
||||
enderio.gui.conduit.redstone.signalColor=Couleur du Signal
|
||||
enderio.gui.conduit.redstone.color=Couleur
|
||||
|
||||
enderio.gui.conduit.fluid.autoExtract=Extract. Auto
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 218 B After Width: | Height: | Size: 381 B |
Reference in new issue
Block a user