public TooltipBuilder addDrawSpeed() {
   float speed = ProjectileLauncherNBT.from(stack).drawSpeed;
   // convert speed per tick to seconds drawtime
   if (stack.getItem() instanceof BowCore) {
     speed = (float) ((BowCore) stack.getItem()).getDrawTime() / (20f * speed);
   }
   tips.add(BowMaterialStats.formatDrawspeed(speed));
   return this;
 }
Example #2
0
  @Override
  public ProjectileLauncherNBT buildTagData(List<Material> materials) {
    ProjectileLauncherNBT data = new ProjectileLauncherNBT();
    HeadMaterialStats head1 = materials.get(1).getStatsOrUnknown(MaterialTypes.HEAD);
    HeadMaterialStats head2 = materials.get(2).getStatsOrUnknown(MaterialTypes.HEAD);
    ExtraMaterialStats grip = materials.get(3).getStatsOrUnknown(MaterialTypes.EXTRA);
    BowMaterialStats limb1 = materials.get(1).getStatsOrUnknown(MaterialTypes.BOW);
    BowMaterialStats limb2 = materials.get(2).getStatsOrUnknown(MaterialTypes.BOW);
    BowStringMaterialStats bowstring = materials.get(0).getStatsOrUnknown(MaterialTypes.BOWSTRING);

    data.head(head1, head2);
    data.limb(limb1, limb2);
    data.extra(grip);
    data.bowstring(bowstring);
    // data.handle();

    data.durability *= DURABILITY_MODIFIER;

    return data;
  }
 public TooltipBuilder addProjectileBonusDamage() {
   tips.add(BowMaterialStats.formatDamage(ProjectileLauncherNBT.from(stack).bonusDamage));
   return this;
 }
 public TooltipBuilder addRange() {
   tips.add(BowMaterialStats.formatRange(ProjectileLauncherNBT.from(stack).range));
   return this;
 }