use of com.enderio.core.common.vecmath.Vector3f in project EnderIO by SleepyTrousers.
the class PoweredSpawnerSpecialRenderer method renderTileEntity.
@Override
protected void renderTileEntity(@Nonnull TilePoweredSpawner te, @Nonnull IBlockState blockState, float partialTicks, int destroyStage) {
renderMob(te, partialTicks);
if (!te.getNotification().isEmpty()) {
float offset = 0;
for (SpawnerNotification note : te.getNotification()) {
RenderUtil.drawBillboardedText(new Vector3f(0.5, 1.5 + offset, 0.5), note.getDisplayString(), 0.25f);
offset += 0.375f;
}
}
}
use of com.enderio.core.common.vecmath.Vector3f in project EnderIO by SleepyTrousers.
the class FarmingStationSpecialRenderer method renderTileEntity.
@Override
protected void renderTileEntity(@Nonnull TileFarmStation te, @Nonnull IBlockState blockState, float partialTicks, int destroyStage) {
float offset = 0;
for (FarmNotification note : te.getNotification()) {
RenderUtil.drawBillboardedText(new Vector3f(0.5, 1.5 + offset, 0.5), EnderIO.lang.localizeExact(note.getUnlocalizedName()), 0.25f);
offset += 0.375f;
}
}
use of com.enderio.core.common.vecmath.Vector3f in project EnderIO by SleepyTrousers.
the class BlockElectricLight method getBoundingBox.
@Override
@Nonnull
public AxisAlignedBB getBoundingBox(@Nonnull IBlockState state, @Nonnull IBlockAccess source, @Nonnull BlockPos pos) {
EnumFacing onFace = EnumFacing.DOWN;
TileEntity te = source.getTileEntity(pos);
if (te instanceof TileElectricLight) {
onFace = ((TileElectricLight) te).getFace();
}
Vector3f min = new Vector3f();
Vector3f max = new Vector3f();
switch(onFace) {
case UP:
min.set(BLOCK_EDGE_MIN, 1F - BLOCK_HEIGHT, BLOCK_EDGE_MIN);
max.set(BLOCK_EDGE_MAX, 1F, BLOCK_EDGE_MAX);
break;
case DOWN:
min.set(BLOCK_EDGE_MIN, 0.0F, BLOCK_EDGE_MIN);
max.set(BLOCK_EDGE_MAX, BLOCK_HEIGHT, BLOCK_EDGE_MAX);
break;
case EAST:
min.set(1 - BLOCK_HEIGHT, BLOCK_EDGE_MIN, BLOCK_EDGE_MIN);
max.set(1, BLOCK_EDGE_MAX, BLOCK_EDGE_MAX);
break;
case WEST:
min.set(0, BLOCK_EDGE_MIN, BLOCK_EDGE_MIN);
max.set(BLOCK_HEIGHT, BLOCK_EDGE_MAX, BLOCK_EDGE_MAX);
break;
case NORTH:
min.set(BLOCK_EDGE_MIN, BLOCK_EDGE_MIN, 0);
max.set(BLOCK_EDGE_MAX, BLOCK_EDGE_MAX, BLOCK_HEIGHT);
break;
case SOUTH:
min.set(BLOCK_EDGE_MIN, BLOCK_EDGE_MIN, 1 - BLOCK_HEIGHT);
max.set(BLOCK_EDGE_MAX, BLOCK_EDGE_MAX, 1);
break;
default:
min.set(BLOCK_EDGE_MIN, 0.0F, BLOCK_EDGE_MIN);
max.set(BLOCK_EDGE_MAX, BLOCK_HEIGHT, BLOCK_EDGE_MAX);
break;
}
return new AxisAlignedBB(min.x, min.y, min.z, max.x, max.y, max.z);
}
use of com.enderio.core.common.vecmath.Vector3f in project EnderIO by SleepyTrousers.
the class TravelEntitySpecialRenderer method renderLabel.
private void renderLabel(String toRender, double globalScale, boolean highlight) {
if (toRender != null && toRender.trim().length() > 0) {
GlStateManager.color(1, 1, 1, 1);
Vector4f bgCol = RenderUtil.DEFAULT_TEXT_BG_COL;
if (highlight) {
bgCol = new Vector4f(selectedColor.x, selectedColor.y, selectedColor.z, selectedColor.w);
}
GlStateManager.pushMatrix();
GlStateManager.translate(0.5f, 0.5f, 0.5f);
GlStateManager.scale(globalScale, globalScale, globalScale);
Vector3f pos = new Vector3f(0, 1.2f, 0);
float size = 0.5f;
RenderUtil.drawBillboardedText(pos, toRender, size, bgCol);
GL11.glPopMatrix();
}
}
Aggregations