use of net.minecraft.util.EnumFacing in project AgriCraft by AgriCraft.
the class RenderChannel method renderWoodChannel.
protected void renderWoodChannel(ITessellator tessellator, IBlockState state, TextureAtlasSprite icon) {
final AgriSideMetaMatrix connections = new AgriSideMetaMatrix();
connections.readFromBlockState(state);
this.renderBottom(tessellator, icon);
for (EnumFacing side : EnumFacing.HORIZONTALS) {
this.renderSide(tessellator, state, side, connections.get(side), icon);
}
}
use of net.minecraft.util.EnumFacing in project AgriCraft by AgriCraft.
the class RenderPeripheral method renderChasis.
private void renderChasis(ITessellator tessellator) {
// Fetch Icons
final TextureAtlasSprite iconTop = getIcon(TEXTURE_TOP);
final TextureAtlasSprite iconSide = getIcon(TEXTURE_SIDE);
final TextureAtlasSprite iconBottom = getIcon(TEXTURE_BOTTOM);
final TextureAtlasSprite iconInside = getIcon(TEXTURE_INNER);
// Render Top
tessellator.drawScaledFace(0, 0, 16, 16, EnumFacing.UP, iconTop, 16);
tessellator.drawScaledFace(0, 0, 16, 16, EnumFacing.DOWN, iconTop, 14);
// Render Bottom
tessellator.drawScaledFace(0, 0, 16, 16, EnumFacing.UP, iconInside, 2);
tessellator.drawScaledFace(0, 0, 16, 16, EnumFacing.DOWN, iconBottom, 0);
// Render Sides - Don't Ask Why This Works...
for (EnumFacing side : EnumFacing.HORIZONTALS) {
// Push Matrix
tessellator.pushMatrix();
// Rotate The Block
rotateBlock(tessellator, side);
// Render Outer Face
tessellator.drawScaledFace(0, 0, 16, 16, EnumFacing.NORTH, iconSide, 0);
// Render Inner Face
tessellator.drawScaledFaceDouble(0, 0, 16, 16, EnumFacing.NORTH, iconInside, 4);
// Pop Matrix
tessellator.popMatrix();
}
}
use of net.minecraft.util.EnumFacing in project AgriCraft by AgriCraft.
the class RenderPeripheral method renderProbe.
private void renderProbe(ITessellator tessellator) {
// Create Quads, If Needed
if (probeQuads == null) {
probeQuads = MODEL_PERIPHERAL.getBakedQuads(tessellator.getVertexFormat(), getIcon(TEXTURE_PROBE));
}
// Add Probe Quads
for (EnumFacing side : EnumFacing.HORIZONTALS) {
// Push Matrix
tessellator.pushMatrix();
// Rotate The Block
rotateBlock(tessellator, side);
// Add probe for the side.
tessellator.addQuads(probeQuads);
// Pop Matrix
tessellator.popMatrix();
}
}
use of net.minecraft.util.EnumFacing in project AgriCraft by AgriCraft.
the class RenderWaterPad method renderWorldBlockStatic.
@Override
public void renderWorldBlockStatic(ITessellator tessellator, IBlockState state, BlockWaterPad block, EnumFacing side) {
// Icon
final TextureAtlasSprite matIcon = BaseIcons.DIRT.getIcon();
final TextureAtlasSprite waterIcon = BaseIcons.WATER_STILL.getIcon();
// Draw Base
renderBase(tessellator, matIcon);
// Get Connections.
final AgriSideMetaMatrix connections = new AgriSideMetaMatrix();
connections.readFromBlockState(state);
// Render Sides
for (EnumFacing dir : EnumFacing.HORIZONTALS) {
if (connections.get(dir) < 1) {
renderSide(tessellator, dir, matIcon);
}
}
// Render Water
if (AgriProperties.POWERED.getValue(state)) {
renderWater(tessellator, waterIcon);
}
}
use of net.minecraft.util.EnumFacing in project AgriCraft by AgriCraft.
the class TileEntityPeripheral method update.
@Override
public void update() {
if (mayAnalyze) {
if (this.hasSpecimen() && !isSpecimenAnalyzed()) {
super.update();
} else {
reset();
}
}
if (this.getWorld().isRemote) {
if (updateCheck == 0) {
checkSides();
}
for (EnumFacing dir : VALID_DIRECTIONS) {
int timer = timers.get(dir);
timer = timer + (isSideActive(dir) ? 1 : -1);
timer = timer < 0 ? 0 : timer;
timer = timer > MAX ? MAX : timer;
timers.put(dir, timer);
}
updateCheck = (updateCheck + 1) % 1200;
}
}
Aggregations