Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class DiamondStaffItem extends AbstractStaffItem
- {
- public DiamondStaffItem(IItemTier tierIn, float attackSpeedIn, Properties properties) {
- super(tierIn, attackSpeedIn, properties);
- this.setDamage(2);
- this.setXpAmount(10);
- this.setVelocity(2.0F);
- this.setInnacuracy(1.5F);
- this.setStaffName("DIAMOND STAFF");
- this.setSpellSound(SoundInit.BASIC_MAGIC_SHOOT);
- this.setEmptySound(SoundEvents.BLOCK_DISPENSER_FAIL);
- }
- @Override
- public Entity getProjectile(LivingEntity shooter, ItemStack stack) {
- Multimap<Attribute, AttributeModifier> attributes = stack.getAttributeModifiers(EquipmentSlotType.MAINHAND);
- double total = 0.0D;
- AttributeModifier modifier;
- for (Iterator var5 = attributes.get(Attributes.ATTACK_SPEED).iterator(); var5.hasNext(); total += modifier.getAmount()) {
- modifier = (AttributeModifier) var5.next();
- }
- Vector3d vec3d = shooter.getLook(1.0F);
- Vector3f vec3f = new Vector3f(vec3d);
- DiamondBoltEntity diamondBolt = new DiamondBoltEntity(EntityTypeInit.DIAMOND_BOLT.get(), shooter, shooter.world, (total * this.getDamage()) * 0.5D);
- diamondBolt.setShooter(shooter);
- diamondBolt.shoot((double) vec3f.getX(), (double) vec3f.getY(), (double) vec3f.getZ(), this.getVelocity(), ((float) total * this.getInnacuracy()) * 0.5F);
- return diamondBolt;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement