use of cpw.mods.fml.relauncher.SideOnly in project LogisticsPipes by RS485.
the class HSTubeCurve method addCollisionBoxesToList.
@Override
@SideOnly(Side.CLIENT)
@SuppressWarnings({ "unchecked", "rawtypes" })
public void addCollisionBoxesToList(List arraylist, AxisAlignedBB axisalignedbb) {
double x = getX();
double y = getY();
double z = getZ();
double angle = 0;
double addOne = 0;
double addTwo = 0;
if (orientation.getRenderOrientation() == TurnDirection.NORTH_EAST) {
angle = 3 * Math.PI / 2;
addOne = LPConstants.PIPE_MAX_POS;
addTwo = LPConstants.PIPE_MIN_POS;
z -= 2;
x += 1;
} else if (orientation.getRenderOrientation() == TurnDirection.EAST_SOUTH) {
angle = 2 * Math.PI / 2;
addOne = LPConstants.PIPE_MIN_POS;
addTwo = LPConstants.PIPE_MAX_POS;
x += 3;
z += 1;
} else if (orientation.getRenderOrientation() == TurnDirection.SOUTH_WEST) {
angle = Math.PI / 2;
addOne = LPConstants.PIPE_MAX_POS;
addTwo = LPConstants.PIPE_MIN_POS;
z += 3;
} else if (orientation.getRenderOrientation() == TurnDirection.WEST_NORTH) {
angle = 0;
addOne = LPConstants.PIPE_MIN_POS;
addTwo = LPConstants.PIPE_MAX_POS;
x -= 2;
}
for (int i = 0; i < 49; i++) {
double xOne = x;
double yMin = y + LPConstants.PIPE_MIN_POS;
double zOne = z;
double xTwo = x;
double yMax = y + LPConstants.PIPE_MAX_POS;
double zTwo = z;
xOne += (2 + addOne) * Math.sin(angle + (2 * Math.PI / 200 * (i)));
zOne += (2 + addOne) * Math.cos(angle + (2 * Math.PI / 200 * (i + 2)));
xTwo += (2 + addTwo) * Math.sin(angle + (2 * Math.PI / 200 * (i + 1)));
zTwo += (2 + addTwo) * Math.cos(angle + (2 * Math.PI / 200 * (i)));
AxisAlignedBB box = AxisAlignedBB.getBoundingBox(Math.min(xOne, xTwo), yMin, Math.min(zOne, zTwo), Math.max(xOne, xTwo), yMax, Math.max(zOne, zTwo));
if (box != null && (axisalignedbb == null || axisalignedbb.intersectsWith(box))) {
arraylist.add(box);
}
}
}
use of cpw.mods.fml.relauncher.SideOnly in project LogisticsPipes by RS485.
the class ForestryProxy method getIconIndexForAlleleId.
/**
* Used to get an icon index for a given allele.
*
* @param uid
* The uid String of the allele to get icon index for.
* @param phase
* special phase of the bee.
*/
@Override
@SideOnly(Side.CLIENT)
public IIcon getIconIndexForAlleleId(String uid, int phase) {
IAllele bSpecies = forestry.api.genetics.AlleleManager.alleleRegistry.getAllele(uid);
if (!(bSpecies instanceof IAlleleBeeSpecies)) {
bSpecies = root.getDefaultTemplate()[forestry.api.apiculture.EnumBeeChromosome.SPECIES.ordinal()];
}
IAlleleBeeSpecies species = (IAlleleBeeSpecies) bSpecies;
return species.getIcon(EnumBeeType.DRONE, phase);
}
use of cpw.mods.fml.relauncher.SideOnly in project LogisticsPipes by RS485.
the class ThermalDynamicsProxy method renderPipeConnections.
@Override
@SideOnly(Side.CLIENT)
public void renderPipeConnections(LogisticsTileGenericPipe pipeTile, RenderBlocks renderer) {
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
if (pipeTile.renderState.pipeConnectionMatrix.isTDConnected(dir)) {
IconTransformation texture = connectionTextureBasic;
if (pipeTile.renderState.textureMatrix.isRouted()) {
if (pipeTile.renderState.textureMatrix.isRoutedInDir(dir)) {
texture = connectionTextureActive;
} else {
texture = connectionTextureInactive;
}
}
double move = 0.25;
Translation localTranslation = new Translation(pipeTile.xCoord + 0.5D + dir.offsetX * move, pipeTile.yCoord + 0.5D + dir.offsetY * move, pipeTile.zCoord + 0.5D + dir.offsetZ * move);
RenderDuct.modelConnection[2][dir.ordinal()].render(new CCRenderState.IVertexOperation[] { localTranslation, texture });
}
}
}
use of cpw.mods.fml.relauncher.SideOnly in project Engine by VoltzEngine-Project.
the class VEProviderSmokeStream method displayEffect.
@Override
@SideOnly(Side.CLIENT)
public void displayEffect(World world, double x, double y, double z, double mx, double my, double mz, boolean movementIsEndpoint, NBTTagCompound otherData) {
Color color = Color.gray;
int lifeTicks = 2;
if (otherData != null) {
//load life timer for particle
if (otherData.hasKey("lifeTime")) {
lifeTicks = otherData.getInteger("lifeTime");
}
//Load color
if (otherData.hasKey("red")) {
color = new Color(otherData.getInteger("red"), otherData.getInteger("green"), otherData.getInteger("blue"));
} else if (otherData.hasKey("color")) {
color = new Color(otherData.getInteger("color"));
}
}
FxBeam laser = new FxBeam(SharedAssets.NOISE_TEXTURE, world, new Pos(x, y, z), new Pos(mx, my, mz), color, lifeTicks);
FMLClientHandler.instance().getClient().effectRenderer.addEffect(laser);
}
use of cpw.mods.fml.relauncher.SideOnly in project ICBM-Classic by BuiltBrokenModding.
the class TileCamouflage method renderStatic.
@Override
@SideOnly(Side.CLIENT)
public boolean renderStatic(RenderBlocks renderer, Pos pos, int pass) {
Block block = getMimicBlock() != null ? getMimicBlock() : getBlockType();
//Render mimic block
BlockWrapper wrapper = new BlockWrapper(block);
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
Block block2 = world().getBlock(xi() + dir.offsetX, yi() + dir.offsetY, zi() + dir.offsetZ);
wrapper.setRenderSide(dir, block2 != getBlockType() && !canRenderSide(dir));
}
boolean rendered = renderer.renderStandardBlock(wrapper, xi(), yi(), zi());
//Render see though sides
if (renderSides != 0) {
//Render outside
wrapper = new BlockWrapper(useGlassRender ? Blocks.glass : Blocks.vine);
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
wrapper.setRenderSide(dir, canRenderSide(dir));
}
if (renderer.renderStandardBlock(wrapper, xi(), yi(), zi())) {
rendered = true;
}
//Render inside
renderer.renderFromInside = true;
renderer.setRenderBounds(.01, .01, .01, .99, .99, .99);
wrapper = new BlockWrapper(useGlassRender ? Blocks.glass : Blocks.vine);
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
Block block2 = world().getBlock(xi() + dir.offsetX, yi() + dir.offsetY, zi() + dir.offsetZ);
wrapper.setRenderSide(dir, block2 != getBlockType());
}
if (renderer.renderStandardBlock(wrapper, xi(), yi(), zi())) {
rendered = true;
}
renderer.renderFromInside = false;
//TODO add border frame
}
return rendered;
}
Aggregations