use of net.minecraftforge.fml.relauncher.SideOnly in project minecolonies by Minecolonies.
the class Pathfinding method debugDrawNode.
@SideOnly(Side.CLIENT)
private static void debugDrawNode(@NotNull final Node n, final float r, final float g, final float b) {
GlStateManager.pushMatrix();
GlStateManager.translate((double) n.pos.getX() + 0.375, (double) n.pos.getY() + 0.375, (double) n.pos.getZ() + 0.375);
final Entity entity = Minecraft.getMinecraft().getRenderViewEntity();
final double dx = n.pos.getX() - entity.posX;
final double dy = n.pos.getY() - entity.posY;
final double dz = n.pos.getZ() - entity.posZ;
if (Math.sqrt(dx * dx + dy * dy + dz * dz) <= 5D) {
renderDebugText(n);
}
GlStateManager.scale(0.25D, 0.25D, 0.25D);
final Tessellator tessellator = Tessellator.getInstance();
final VertexBuffer vertexBuffer = tessellator.getBuffer();
vertexBuffer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION);
GlStateManager.color(r, g, b);
// X+
vertexBuffer.pos(1.0, 0.0, 0.0).endVertex();
vertexBuffer.pos(1.0, 1.0, 0.0).endVertex();
vertexBuffer.pos(1.0, 1.0, 1.0).endVertex();
vertexBuffer.pos(1.0, 0.0, 1.0).endVertex();
// X-
vertexBuffer.pos(0.0, 0.0, 1.0).endVertex();
vertexBuffer.pos(0.0, 1.0, 1.0).endVertex();
vertexBuffer.pos(0.0, 1.0, 0.0).endVertex();
vertexBuffer.pos(0.0, 0.0, 0.0).endVertex();
// Z-
vertexBuffer.pos(0.0, 0.0, 0.0).endVertex();
vertexBuffer.pos(0.0, 1.0, 0.0).endVertex();
vertexBuffer.pos(1.0, 1.0, 0.0).endVertex();
vertexBuffer.pos(1.0, 0.0, 0.0).endVertex();
// Z+
vertexBuffer.pos(1.0, 0.0, 1.0).endVertex();
vertexBuffer.pos(1.0, 1.0, 1.0).endVertex();
vertexBuffer.pos(0.0, 1.0, 1.0).endVertex();
vertexBuffer.pos(0.0, 0.0, 1.0).endVertex();
// Y+
vertexBuffer.pos(1.0, 1.0, 1.0).endVertex();
vertexBuffer.pos(1.0, 1.0, 0.0).endVertex();
vertexBuffer.pos(0.0, 1.0, 0.0).endVertex();
vertexBuffer.pos(0.0, 1.0, 1.0).endVertex();
// Y-
vertexBuffer.pos(0.0, 0.0, 1.0).endVertex();
vertexBuffer.pos(0.0, 0.0, 0.0).endVertex();
vertexBuffer.pos(1.0, 0.0, 0.0).endVertex();
vertexBuffer.pos(1.0, 0.0, 1.0).endVertex();
tessellator.draw();
if (n.parent != null) {
final double pdx = n.parent.pos.getX() - n.pos.getX() + 0.125;
final double pdy = n.parent.pos.getY() - n.pos.getY() + 0.125;
final double pdz = n.parent.pos.getZ() - n.pos.getZ() + 0.125;
vertexBuffer.begin(GL11.GL_LINES, DefaultVertexFormats.POSITION_COLOR);
vertexBuffer.pos(0.5D, 0.5D, 0.5D).color(0.75F, 0.75F, 0.75F, 1.0F).endVertex();
vertexBuffer.pos(pdx / 0.25, pdy / 0.25, pdz / 0.25).color(0.75F, 0.75F, 0.75F, 1.0F).endVertex();
tessellator.draw();
}
GlStateManager.popMatrix();
}
use of net.minecraftforge.fml.relauncher.SideOnly in project minecolonies by Minecolonies.
the class EventHandler method onDebugOverlay.
/**
* Event when the debug screen is opened. Event gets called by displayed
* text on the screen, we only need it when f3 is clicked.
*
* @param event {@link net.minecraftforge.client.event.RenderGameOverlayEvent.Text}
*/
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void onDebugOverlay(final RenderGameOverlayEvent.Text event) {
if (FMLCommonHandler.instance().getEffectiveSide().isClient()) {
final Minecraft mc = Minecraft.getMinecraft();
if (mc.gameSettings.showDebugInfo) {
final WorldClient world = mc.world;
final EntityPlayerSP player = mc.player;
IColony colony = ColonyManager.getIColony(world, player.getPosition());
final double minDistance = ColonyManager.getMinimumDistanceBetweenTownHalls();
if (colony == null) {
colony = ColonyManager.getClosestIColony(world, player.getPosition());
if (colony == null || Math.sqrt(colony.getDistanceSquared(player.getPosition())) > 2 * minDistance) {
event.getLeft().add(LanguageHandler.format("com.minecolonies.coremod.gui.debugScreen.noCloseColony"));
return;
}
event.getLeft().add(LanguageHandler.format("com.minecolonies.coremod.gui.debugScreen.nextColony", (int) Math.sqrt(colony.getDistanceSquared(player.getPosition())), minDistance));
return;
}
event.getLeft().add(colony.getName() + " : " + LanguageHandler.format("com.minecolonies.coremod.gui.debugScreen.blocksFromCenter", (int) Math.sqrt(colony.getDistanceSquared(player.getPosition()))));
}
}
}
use of net.minecraftforge.fml.relauncher.SideOnly in project ConvenientAdditions by Necr0.
the class ItemMobCatcher method addInformation.
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, EntityPlayer player, List<String> tooltip, boolean advanced) {
super.addInformation(stack, player, tooltip, advanced);
tooltip.add(Helper.localize("tooltip." + ModConstants.Mod.MODID + ":" + ModConstants.ItemNames.mobCatcher + ".strength", type.captureStrength));
tooltip.add(Helper.localize("tooltip." + ModConstants.Mod.MODID + ":" + ModConstants.ItemNames.mobCatcher + ".hostile", type.captureHostile ? Helper.localize(ModConstants.Mod.MODID + ":yes") : Helper.localize(ModConstants.Mod.MODID + ":no")));
tooltip.add(Helper.localize("tooltip." + ModConstants.Mod.MODID + ":" + ModConstants.ItemNames.mobCatcher + ".boss", type.captureBoss ? Helper.localize(ModConstants.Mod.MODID + ":yes") : Helper.localize(ModConstants.Mod.MODID + ":no")));
if (isHoldingMob(stack)) {
EntityEntry entry = ForgeRegistries.ENTITIES.getValue(new ResourceLocation(getEntityId(stack)));
if (entry != null)
tooltip.add(Helper.localize("tooltip." + ModConstants.Mod.MODID + ":mobCatcherHoldingEntity", Helper.localize("entity." + entry.getName() + ".name")));
else
tooltip.add(Helper.localize("tooltip." + ModConstants.Mod.MODID + ":mobCatcherHoldingEntity", "?"));
} else
tooltip.add(Helper.localize("tooltip." + ModConstants.Mod.MODID + ":mobCatcherHoldingEntity", Helper.localize(ModConstants.Mod.MODID + ":none")));
}
use of net.minecraftforge.fml.relauncher.SideOnly in project ConvenientAdditions by Necr0.
the class PacketExtendedExplosion method onClientReceive.
@SideOnly(Side.CLIENT)
public void onClientReceive(PacketExtendedExplosion message, MessageContext ctx) {
ExtendedExplosion explosion = new ExtendedExplosion(Helper.getClientWorld(), null, message.posX, message.posY, message.posZ, message.strength, message.affectedBlockPositions);
explosion.doExplosionB(true);
Helper.getClientPlayer().addVelocity(message.getMotionX(), (double) message.getMotionY(), (double) message.getMotionZ());
}
use of net.minecraftforge.fml.relauncher.SideOnly in project VoodooCraft by Mod-DevCafeTeam.
the class VCBlocks method registerTileEntityRenders.
@SideOnly(Side.CLIENT)
public static void registerTileEntityRenders() {
//Register TESRs
regTESR(TileDollPedestal.class, new TileDollPedestalRender());
regTESR(TileTotem.class, new TileTotemRender());
}
Aggregations