Tabnine Logo
SwordCore
Code IndexAdd Tabnine to your IDE (free)

How to use
SwordCore
in
slimeknights.tconstruct.library.tools

Best Java code snippets using slimeknights.tconstruct.library.tools.SwordCore (Showing top 5 results out of 315)

origin: SlimeKnights/TinkersConstruct

public SwordCore(PartMaterialType... requiredComponents) {
 super(requiredComponents);
 // extended compatibility
 setHarvestLevel("sword", 0);
}
origin: SlimeKnights/TinkersConstruct

@Override
public boolean dealDamage(ItemStack stack, EntityLivingBase player, Entity entity, float damage) {
 // deal damage first
 boolean hit = super.dealDamage(stack, player, entity, damage);
 // and then sweep
 if(hit && !ToolHelper.isBroken(stack)) {
  // sweep code from EntityPlayer#attackTargetEntityWithCurrentItem()
  // basically: no crit, no sprinting and has to stand on the ground for sweep. Also has to move regularly slowly
  double d0 = (double) (player.distanceWalkedModified - player.prevDistanceWalkedModified);
  boolean flag = true;
  if(player instanceof EntityPlayer) {
   flag = ((EntityPlayer) player).getCooledAttackStrength(0.5F) > 0.9f;
  }
  boolean flag2 = player.fallDistance > 0.0F && !player.onGround && !player.isOnLadder() && !player.isInWater() && !player.isPotionActive(MobEffects.BLINDNESS) && !player.isRiding();
  if(flag && !player.isSprinting() && !flag2 && player.onGround && d0 < (double) player.getAIMoveSpeed()) {
   for(EntityLivingBase entitylivingbase : player.getEntityWorld().getEntitiesWithinAABB(EntityLivingBase.class, entity.getEntityBoundingBox().expand(1.0D, 0.25D, 1.0D))) {
    if(entitylivingbase != player && entitylivingbase != entity && !player.isOnSameTeam(entitylivingbase) && player.getDistanceSqToEntity(entitylivingbase) < 9.0D) {
     entitylivingbase.knockBack(player, 0.4F, (double) MathHelper.sin(player.rotationYaw * 0.017453292F), (double) (-MathHelper.cos(player.rotationYaw * 0.017453292F)));
     super.dealDamage(stack, player, entitylivingbase, 1f);
    }
   }
   player.getEntityWorld().playSound(null, player.posX, player.posY, player.posZ, SoundEvents.ENTITY_PLAYER_ATTACK_SWEEP, player.getSoundCategory(), 1.0F, 1.0F);
   if(player instanceof EntityPlayer) {
    ((EntityPlayer) player).spawnSweepParticles();
   }
  }
 }
 return hit;
}
origin: SlimeKnights/TinkersConstruct

 @Override
 public void addMaterialTraits(NBTTagCompound root, List<Material> materials) {
  super.addMaterialTraits(root, materials);

  // beheading "trait", 2 level -> 2 applications
  ModBeheading.CLEAVER_BEHEADING_MOD.apply(root);
  ModBeheading.CLEAVER_BEHEADING_MOD.apply(root);
 }
}
origin: SlimeKnights/TinkersConstruct

@Override
public boolean dealDamage(ItemStack stack, EntityLivingBase player, Entity entity, float damage) {
 boolean hit = super.dealDamage(stack, player, entity, damage);
 // cleaver slash particle
 if(hit && readyForSpecialAttack(player)) {
  TinkerTools.proxy.spawnAttackParticle(Particles.CLEAVER_ATTACK, player, 0.85d);
 }
 return hit;
}
origin: SlimeKnights/TinkersConstruct

@Override
public boolean dealDamage(ItemStack stack, EntityLivingBase player, Entity entity, float damage) {
 boolean hit = super.dealDamage(stack, player, entity, damage);
 // slash particle
 if(hit && readyForSpecialAttack(player)) {
  TinkerTools.proxy.spawnAttackParticle(Particles.LONGSWORD_ATTACK, player, 0.7d);
 }
 return hit;
}
slimeknights.tconstruct.library.toolsSwordCore

Most used methods

  • addMaterialTraits
  • dealDamage
  • setHarvestLevel

Popular in Java

  • Updating database using SQL prepared statement
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getExternalFilesDir (Context)
  • addToBackStack (FragmentTransaction)
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • Top Sublime Text plugins
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