Add critical damage API
This commit is contained in:
@@ -49,7 +49,7 @@
|
||||
+ // CraftBukkit start - handle the owner before the rest of things
|
||||
+ this(type, x, y, z, world, stack, weapon, null);
|
||||
+ }
|
||||
+
|
||||
|
||||
+ protected AbstractArrow(EntityType<? extends AbstractArrow> entitytypes, double d0, double d1, double d2, Level world, ItemStack itemstack, @Nullable ItemStack itemstack1, @Nullable LivingEntity ownerEntity) {
|
||||
+ this(entitytypes, world);
|
||||
+ this.setOwner(ownerEntity);
|
||||
@@ -57,7 +57,7 @@
|
||||
+ this.pickupItemStack = itemstack.copy();
|
||||
+ this.setCustomName((Component) itemstack.get(DataComponents.CUSTOM_NAME));
|
||||
+ Unit unit = (Unit) itemstack.remove(DataComponents.INTANGIBLE_PROJECTILE);
|
||||
|
||||
+
|
||||
if (unit != null) {
|
||||
this.pickup = AbstractArrow.Pickup.CREATIVE_ONLY;
|
||||
}
|
||||
@@ -147,7 +147,12 @@
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -444,7 +469,13 @@
|
||||
@@ -440,11 +465,18 @@
|
||||
entityliving.setLastHurtMob(entity);
|
||||
}
|
||||
|
||||
+ if (this.isCritArrow()) damagesource = damagesource.critical(); // Paper - add critical damage API
|
||||
boolean flag = entity.getType() == EntityType.ENDERMAN;
|
||||
int k = entity.getRemainingFireTicks();
|
||||
|
||||
if (this.isOnFire() && !flag) {
|
||||
@@ -162,7 +167,7 @@
|
||||
}
|
||||
|
||||
if (entity.hurtOrSimulate(damagesource, (float) i)) {
|
||||
@@ -490,7 +521,7 @@
|
||||
@@ -490,7 +522,7 @@
|
||||
|
||||
this.playSound(this.soundEvent, 1.0F, 1.2F / (this.random.nextFloat() * 0.2F + 0.9F));
|
||||
if (this.getPierceLevel() <= 0) {
|
||||
@@ -171,7 +176,7 @@
|
||||
}
|
||||
} else {
|
||||
entity.setRemainingFireTicks(k);
|
||||
@@ -506,7 +537,7 @@
|
||||
@@ -506,7 +538,7 @@
|
||||
this.spawnAtLocation(worldserver2, this.getPickupItem(), 0.1F);
|
||||
}
|
||||
|
||||
@@ -180,7 +185,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -538,7 +569,7 @@
|
||||
@@ -538,7 +570,7 @@
|
||||
Vec3 vec3d = this.getDeltaMovement().multiply(1.0D, 0.0D, 1.0D).normalize().scale(d0 * 0.6D * d1);
|
||||
|
||||
if (vec3d.lengthSqr() > 0.0D) {
|
||||
@@ -189,7 +194,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -675,7 +706,7 @@
|
||||
@@ -675,7 +707,7 @@
|
||||
}
|
||||
|
||||
if (nbt.contains("weapon", 10)) {
|
||||
@@ -198,7 +203,7 @@
|
||||
} else {
|
||||
this.firedFromWeapon = null;
|
||||
}
|
||||
@@ -688,34 +719,31 @@
|
||||
@@ -688,34 +720,31 @@
|
||||
Entity entity1 = entity;
|
||||
byte b0 = 0;
|
||||
|
||||
@@ -245,7 +250,7 @@
|
||||
}
|
||||
|
||||
this.pickup = entityarrow_pickupstatus;
|
||||
@@ -724,9 +752,24 @@
|
||||
@@ -724,9 +753,24 @@
|
||||
@Override
|
||||
public void playerTouch(Player player) {
|
||||
if (!this.level().isClientSide && (this.isInGround() || this.isNoPhysics()) && this.shakeTime <= 0) {
|
||||
|
||||
Reference in New Issue
Block a user