congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
CustomHitBox
Code IndexAdd Tabnine to your IDE (free)

How to use
CustomHitBox
in
cofh.core.render.hitbox

Best Java code snippets using cofh.core.render.hitbox.CustomHitBox (Showing top 3 results out of 315)

origin: CoFH/ThermalDynamics

@Override
public CustomHitBox getCustomHitBox(int subHit, EntityPlayer thePlayer) {
  double v1 = getDuctType().isLargeTube() ? 0.075 : .3;
  double v = (1 - v1 * 2);
  CustomHitBox hb = new CustomHitBox(v, v, v, pos.getX() + v1, pos.getY() + v1, pos.getZ() + v1);
  for (int i = 0; i < 6; i++) {
    BlockDuct.ConnectionType renderConnectionType = getVisualConnectionType(i);
    if (renderConnectionType == BlockDuct.ConnectionType.DUCT) {
      hb.drawSide(i, true);
      hb.setSideLength(i, v1);
    } else if (renderConnectionType != BlockDuct.ConnectionType.NONE) {
      hb.drawSide(i, true);
      hb.setSideLength(i, .04);
    }
  }
  return hb;
}
origin: CoFH/CoFHCore

/**
 * Draws the selection box for the player. Args: entityPlayer, rayTraceHit, i, itemStack, partialTickTime
 */
public static void drawSelectionBox(EntityPlayer player, RayTraceResult rayTraceResult, float pTickTime, CustomHitBox customHitBox) {
  if (rayTraceResult.typeOfHit == Type.BLOCK) {
    GlStateManager.enableBlend();
    GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
    GlStateManager.color(0.0F, 0.0F, 0.0F, 0.4F);
    GlStateManager.glLineWidth(2.0F);
    GlStateManager.disableTexture2D();
    GlStateManager.depthMask(false);
    IBlockState state = player.world.getBlockState(rayTraceResult.getBlockPos());
    if (state.getMaterial() != Material.AIR) {
      //block.setBlockBoundsBasedOnState(thePlayer.worldObj, rayTraceResult.blockX, rayTraceResult.blockY, rayTraceResult.blockZ);
      double d0 = player.lastTickPosX + (player.posX - player.lastTickPosX) * pTickTime;
      double d1 = player.lastTickPosY + (player.posY - player.lastTickPosY) * pTickTime;
      double d2 = player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * pTickTime;
      drawOutlinedBoundingBox(customHitBox.addExtraSpace(extraSpace).offsetForDraw(-d0, -d1, -d2));
    }
    GlStateManager.depthMask(true);
    GlStateManager.enableTexture2D();
    GlStateManager.disableBlend();
  }
}
origin: CoFH/ThermalDynamics

private boolean doAttachmentHighlight(RayTraceResult target, EntityPlayer player, float partialTicks) {
  if (!(ItemHelper.getHeldStack(player).getItem() instanceof ItemAttachment) || target.typeOfHit != Type.BLOCK) {
    return false;
  }
  RayTracer.retraceBlock(player.world, player, target.getBlockPos());
  ItemStack stack = ItemHelper.getHeldStack(player);
  Attachment attachment = ItemAttachment.getAttachment(stack, player, player.world, target.getBlockPos(), target.sideHit);
  if (attachment == null || !attachment.canAddToTile(attachment.baseTile)) {
    return false;
  }
  Cuboid6 c = attachment.getCuboid();
  c.max.subtract(c.min);
  RenderHitbox.drawSelectionBox(player, target, partialTicks, new CustomHitBox(c.max.y, c.max.z, c.max.x, attachment.baseTile.x() + c.min.x, attachment.baseTile.y() + c.min.y, attachment.baseTile.z() + c.min.z));
  attachment.drawSelectionExtra(player, target, partialTicks);
  return true;
}
cofh.core.render.hitboxCustomHitBox

Most used methods

  • <init>
  • addExtraSpace
  • drawSide
  • offsetForDraw
  • setSideLength

Popular in Java

  • Start an intent from android
  • setContentView (Activity)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getSharedPreferences (Context)
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now