use of cpw.mods.fml.relauncher.SideOnly in project NyaSamaRailway by NSDN.
the class MinecartBase method func_70495_a.
@Override
@SideOnly(Side.CLIENT)
public Vec3 func_70495_a(double doubleX, double doubleY, double doubleZ, double v) {
int x = MathHelper.floor_double(doubleX);
int y = MathHelper.floor_double(doubleY);
int z = MathHelper.floor_double(doubleZ);
if (!BlockRailBase.func_150049_b_(this.worldObj, x, y, z) && BlockRailBase.func_150049_b_(this.worldObj, x, y - 1, z)) {
--y;
}
Block block = this.worldObj.getBlock(x, y, z);
if (!BlockRailBase.func_150051_a(block)) {
return null;
} else {
int l = ((BlockRailBase) block).getBasicRailMetadata(worldObj, this, x, y, z);
doubleY = (double) y;
if (l >= 2 && l <= 5) {
doubleY = (double) (y + 1);
}
int[][] aint = matrix[l];
double d4 = (double) (aint[1][0] - aint[0][0]);
double d5 = (double) (aint[1][2] - aint[0][2]);
double d6 = Math.sqrt(d4 * d4 + d5 * d5);
d4 /= d6;
d5 /= d6;
doubleX += d4 * v;
doubleZ += d5 * v;
if (aint[0][1] != 0 && MathHelper.floor_double(doubleX) - x == aint[0][0] && MathHelper.floor_double(doubleZ) - z == aint[0][2]) {
doubleY += (double) aint[0][1];
} else if (aint[1][1] != 0 && MathHelper.floor_double(doubleX) - x == aint[1][0] && MathHelper.floor_double(doubleZ) - z == aint[1][2]) {
doubleY += (double) aint[1][1];
}
return this.func_70489_a(doubleX, doubleY, doubleZ);
}
}
use of cpw.mods.fml.relauncher.SideOnly in project LogisticsPipes by RS485.
the class LogisticsBlockGenericPipe method getSelectedBoundingBoxFromPool.
@Override
@SideOnly(Side.CLIENT)
public AxisAlignedBB getSelectedBoundingBoxFromPool(World world, int x, int y, int z) {
TileEntity tile = world.getTileEntity(x, y, z);
if (tile instanceof LogisticsTileGenericPipe && ((LogisticsTileGenericPipe) tile).pipe instanceof PipeBlockRequestTable) {
return AxisAlignedBB.getBoundingBox(x + 0.0, y + 0.0, z + 0.0, x + 1.0, y + 1.0, z + 1.0);
}
RaytraceResult rayTraceResult = null;
if (bypassPlayerTrace == null) {
rayTraceResult = doRayTrace(world, x, y, z, Minecraft.getMinecraft().thePlayer);
} else {
rayTraceResult = bypassPlayerTrace;
}
if (rayTraceResult != null && rayTraceResult.boundingBox != null) {
AxisAlignedBB box = rayTraceResult.boundingBox;
switch(rayTraceResult.hitPart) {
case Pluggable:
{
float scale = 0.001F;
box = box.expand(scale, scale, scale);
break;
}
case Pipe:
{
float scale = 0.001F;
box = box.expand(scale, scale, scale);
break;
}
}
return box.getOffsetBoundingBox(x, y, z);
}
return super.getSelectedBoundingBoxFromPool(world, x, y, z).expand(-0.85F, -0.85F, -0.85F);
}
use of cpw.mods.fml.relauncher.SideOnly in project LogisticsPipes by RS485.
the class LogisticsBlockGenericPipe method registerBlockIcons.
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister) {
LogisticsNewRenderPipe.registerTextures(iconRegister);
SimpleServiceLocator.thermalDynamicsProxy.registerTextures(iconRegister);
if (!skippedFirstIconRegister) {
skippedFirstIconRegister = true;
return;
}
for (Item i : LogisticsBlockGenericPipe.pipes.keySet()) {
CoreUnroutedPipe dummyPipe = LogisticsBlockGenericPipe.createPipe(i);
if (dummyPipe != null) {
dummyPipe.getIconProvider().registerIcons(iconRegister);
}
}
}
use of cpw.mods.fml.relauncher.SideOnly in project LogisticsPipes by RS485.
the class HSTubeSCurve method addCollisionBoxesToList.
@Override
@SideOnly(Side.CLIENT)
@SuppressWarnings({ "unchecked", "rawtypes" })
public void addCollisionBoxesToList(List arraylist, AxisAlignedBB axisalignedbb) {
if (boxes == null || boxes.isEmpty()) {
boxes = new ArrayList<>();
double x = getX();
double y = getY();
double z = getZ();
for (int i = -1; i < 54; i++) {
double xOne = x;
double yOne = y;
double zOne = z;
double xTwo = x;
double yTwo = y + 1;
double zTwo = z;
if (orientation.getRenderOrientation() == TurnSDirection.NORTH_INV || orientation.getRenderOrientation() == TurnSDirection.NORTH) {
zOne += 1;
zTwo += 1;
zOne -= 4.0F * (i - 4) / 50;
zTwo -= 4.0F * (i + 4) / 50;
xOne -= 1;
xTwo += 2;
} else if (orientation.getRenderOrientation() == TurnSDirection.EAST_INV || orientation.getRenderOrientation() == TurnSDirection.EAST) {
xOne += 4;
xTwo += 4;
xOne -= 4.0F * (i - 4) / 50;
xTwo -= 4.0F * (i + 4) / 50;
zOne -= 1;
zTwo += 2;
}
AxisAlignedBB box = SCurveTubeRenderer.getObjectBoundsAt(AxisAlignedBB.getBoundingBox(Math.min(xOne, xTwo), Math.min(yOne, yTwo), Math.min(zOne, zTwo), Math.max(xOne, xTwo), Math.max(yOne, yTwo), Math.max(zOne, zTwo)).getOffsetBoundingBox(-x, -y, -z), orientation);
if (box != null) {
LPPositionSet<DoubleCoordinates> lpBox = new LPPositionSet<>(DoubleCoordinates.class);
lpBox.addFrom(box);
DoubleCoordinates center = lpBox.getCenter();
box = AxisAlignedBB.getBoundingBox(center.getXCoord() - 0.3D, center.getYCoord() - 0.3D, center.getZCoord() - 0.3D, center.getXCoord() + 0.3D, center.getYCoord() + 0.3D, center.getZCoord() + 0.3D);
if (box != null) {
AxisAlignedBB cBox = getCompleteBox();
if (box.minX < cBox.minX) {
box.minX = cBox.minX;
}
if (box.minY < cBox.minY) {
box.minY = cBox.minY;
}
if (box.minZ < cBox.minZ) {
box.minZ = cBox.minZ;
}
if (box.maxX > cBox.maxX) {
box.maxX = cBox.maxX;
}
if (box.maxY > cBox.maxY) {
box.maxY = cBox.maxY;
}
if (box.maxZ > cBox.maxZ) {
box.maxZ = cBox.maxZ;
}
box = box.getOffsetBoundingBox(x, y, z);
boxes.add(box);
}
}
}
}
arraylist.addAll(boxes.stream().filter(box -> box != null && (axisalignedbb == null || axisalignedbb.intersectsWith(box))).collect(Collectors.toList()));
}
use of cpw.mods.fml.relauncher.SideOnly in project LogisticsPipes by RS485.
the class NEIProxy method renderItemToolTip.
@Override
@SideOnly(Side.CLIENT)
@SneakyThrows({ NoSuchFieldException.class, IllegalAccessException.class })
public boolean renderItemToolTip(int mousex, int mousey, List<String> msg, EnumChatFormatting rarityColor, ItemStack stack) {
if (!(Minecraft.getMinecraft().currentScreen instanceof GuiContainer)) {
return false;
}
GuiContainer window = (GuiContainer) Minecraft.getMinecraft().currentScreen;
List<String> tooltip = new LinkedList<String>();
FontRenderer font = GuiDraw.fontRenderer;
if (GuiContainerManager.shouldShowTooltip(window)) {
font = GuiContainerManager.getFontRenderer(stack);
if (stack != null) {
tooltip = msg;
}
for (IContainerTooltipHandler handler : (List<IContainerTooltipHandler>) ReflectionHelper.getPrivateField(List.class, GuiContainerManager.class, "instanceTooltipHandlers", GuiContainerManager.getManager())) {
tooltip = handler.handleItemTooltip(window, stack, mousex, mousey, tooltip);
}
}
if (tooltip.size() > 0) {
tooltip.set(0, tooltip.get(0) + "§h");
}
GuiDraw.drawMultilineTip(font, mousex + 12, mousey - 12, tooltip);
return true;
}
Aggregations