1.21.6 dev
Co-authored-by: Bjarne Koll <git@lynxplay.dev> Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com> Co-authored-by: Jason Penilla <11360596+jpenilla@users.noreply.github.com> Co-authored-by: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com> Co-authored-by: Noah van der Aa <ndvdaa@gmail.com> Co-authored-by: Owen1212055 <23108066+Owen1212055@users.noreply.github.com> Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com>
This commit is contained in:
committed by
Nassim Jahnke
parent
39203a65e0
commit
a24f9b204c
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/projectile/AbstractArrow.java
|
||||
+++ b/net/minecraft/world/entity/projectile/AbstractArrow.java
|
||||
@@ -93,7 +_,14 @@
|
||||
@@ -90,7 +_,14 @@
|
||||
ItemStack pickupItemStack,
|
||||
@Nullable ItemStack firedFromWeapon
|
||||
) {
|
||||
@@ -15,7 +15,7 @@
|
||||
this.pickupItemStack = pickupItemStack.copy();
|
||||
this.applyComponentsFromItemStack(pickupItemStack);
|
||||
Unit unit = pickupItemStack.remove(DataComponents.INTANGIBLE_PROJECTILE);
|
||||
@@ -118,8 +_,8 @@
|
||||
@@ -115,8 +_,8 @@
|
||||
protected AbstractArrow(
|
||||
EntityType<? extends AbstractArrow> entityType, LivingEntity owner, Level level, ItemStack pickupItemStack, @Nullable ItemStack firedFromWeapon
|
||||
) {
|
||||
@@ -26,7 +26,7 @@
|
||||
}
|
||||
|
||||
public void setSoundEvent(SoundEvent soundEvent) {
|
||||
@@ -214,6 +_,7 @@
|
||||
@@ -211,6 +_,7 @@
|
||||
this.setSharedFlagOnFire(this.getRemainingFireTicks() > 0);
|
||||
}
|
||||
} else {
|
||||
@@ -34,7 +34,7 @@
|
||||
this.inGroundTime = 0;
|
||||
Vec3 vec31 = this.position();
|
||||
if (this.isInWater()) {
|
||||
@@ -280,12 +_,12 @@
|
||||
@@ -277,12 +_,12 @@
|
||||
|
||||
if (entityHitResult == null) {
|
||||
if (this.isAlive() && hitResult.getType() != HitResult.Type.MISS) {
|
||||
@@ -49,7 +49,7 @@
|
||||
this.hasImpulse = true;
|
||||
if (this.getPierceLevel() > 0 && projectileDeflection == ProjectileDeflection.NONE) {
|
||||
continue;
|
||||
@@ -318,13 +_,26 @@
|
||||
@@ -315,13 +_,26 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
}
|
||||
|
||||
private void startFalling() {
|
||||
@@ -357,8 +_,8 @@
|
||||
@@ -354,8 +_,8 @@
|
||||
|
||||
protected void tickDespawn() {
|
||||
this.life++;
|
||||
@@ -88,7 +88,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -392,9 +_,9 @@
|
||||
@@ -389,9 +_,9 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -100,7 +100,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -421,7 +_,7 @@
|
||||
@@ -418,7 +_,7 @@
|
||||
}
|
||||
|
||||
if (this.piercingIgnoreEntityIds.size() >= this.getPierceLevel() + 1) {
|
||||
@@ -109,7 +109,7 @@
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -437,10 +_,16 @@
|
||||
@@ -434,10 +_,16 @@
|
||||
livingEntity.setLastHurtMob(entity);
|
||||
}
|
||||
|
||||
@@ -127,7 +127,7 @@
|
||||
}
|
||||
|
||||
if (entity.hurtOrSimulate(damageSource, ceil)) {
|
||||
@@ -478,7 +_,7 @@
|
||||
@@ -475,7 +_,7 @@
|
||||
|
||||
this.playSound(this.soundEvent, 1.0F, 1.2F / (this.random.nextFloat() * 0.2F + 0.9F));
|
||||
if (this.getPierceLevel() <= 0) {
|
||||
@@ -136,7 +136,7 @@
|
||||
}
|
||||
} else {
|
||||
entity.setRemainingFireTicks(remainingFireTicks);
|
||||
@@ -489,7 +_,7 @@
|
||||
@@ -486,7 +_,7 @@
|
||||
this.spawnAtLocation(serverLevel2, this.getPickupItem(), 0.1F);
|
||||
}
|
||||
|
||||
@@ -145,7 +145,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -502,7 +_,7 @@
|
||||
@@ -499,7 +_,7 @@
|
||||
double max = Math.max(0.0, 1.0 - entity.getAttributeValue(Attributes.KNOCKBACK_RESISTANCE));
|
||||
Vec3 vec3 = this.getDeltaMovement().multiply(1.0, 0.0, 1.0).normalize().scale(d * 0.6 * max);
|
||||
if (vec3.lengthSqr() > 0.0) {
|
||||
@@ -154,7 +154,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -610,7 +_,14 @@
|
||||
@@ -605,7 +_,14 @@
|
||||
|
||||
@Override
|
||||
public void setOwner(@Nullable Entity entity) {
|
||||
@@ -169,7 +169,7 @@
|
||||
|
||||
this.pickup = switch (entity) {
|
||||
case Player player when this.pickup == AbstractArrow.Pickup.DISALLOWED -> AbstractArrow.Pickup.ALLOWED;
|
||||
@@ -622,9 +_,22 @@
|
||||
@@ -617,9 +_,22 @@
|
||||
@Override
|
||||
public void playerTouch(Player entity) {
|
||||
if (!this.level().isClientSide && (this.isInGround() || this.isNoPhysics()) && this.shakeTime <= 0) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/projectile/AbstractHurtingProjectile.java
|
||||
+++ b/net/minecraft/world/entity/projectile/AbstractHurtingProjectile.java
|
||||
@@ -19,6 +_,8 @@
|
||||
@@ -20,6 +_,8 @@
|
||||
public static final double INITAL_ACCELERATION_POWER = 0.1;
|
||||
public static final double DEFLECTION_SCALE = 0.5;
|
||||
public double accelerationPower = 0.1;
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
protected AbstractHurtingProjectile(EntityType<? extends AbstractHurtingProjectile> entityType, Level level) {
|
||||
super(entityType, level);
|
||||
@@ -83,12 +_,12 @@
|
||||
@@ -84,12 +_,12 @@
|
||||
}
|
||||
|
||||
if (hitResultOnMoveVector.getType() != HitResult.Type.MISS && this.isAlive()) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/projectile/AbstractThrownPotion.java
|
||||
+++ b/net/minecraft/world/entity/projectile/AbstractThrownPotion.java
|
||||
@@ -70,54 +_,95 @@
|
||||
@@ -67,54 +_,95 @@
|
||||
@Override
|
||||
protected void onHit(HitResult result) {
|
||||
super.onHit(result);
|
||||
@@ -8,7 +8,7 @@
|
||||
+ this.splash(result);
|
||||
+ }
|
||||
+
|
||||
+ public void splash(@Nullable HitResult result) {
|
||||
+ public void splash(HitResult result) {
|
||||
+ // Paper end - More projectile API
|
||||
if (this.level() instanceof ServerLevel serverLevel) {
|
||||
ItemStack item = this.getItem();
|
||||
@@ -17,10 +17,10 @@
|
||||
if (potionContents.is(Potions.WATER)) {
|
||||
- this.onHitAsWater(serverLevel);
|
||||
- } else if (potionContents.hasEffects()) {
|
||||
- this.onHitAsPotion(serverLevel, item, result.getType() == HitResult.Type.ENTITY ? ((EntityHitResult)result).getEntity() : null);
|
||||
- this.onHitAsPotion(serverLevel, item, result);
|
||||
+ showParticles = this.onHitAsWater(serverLevel, result); // Paper - Fix potions splash events
|
||||
+ } else if (true || potionContents.hasEffects()) { // CraftBukkit - Call event even if no effects to apply
|
||||
+ showParticles = this.onHitAsPotion(serverLevel, item, result != null && result.getType() == HitResult.Type.ENTITY ? ((EntityHitResult)result).getEntity() : null, result); // Paper - pass HitResult
|
||||
+ showParticles = this.onHitAsPotion(serverLevel, item, result); // Paper - pass HitResult
|
||||
}
|
||||
|
||||
+ if (showParticles) { // Paper - Fix potions splash events
|
||||
@@ -35,7 +35,7 @@
|
||||
- private void onHitAsWater(ServerLevel level) {
|
||||
+ private static final Predicate<LivingEntity> APPLY_WATER_GET_ENTITIES_PREDICATE = AbstractThrownPotion.WATER_SENSITIVE_OR_ON_FIRE.or(Axolotl.class::isInstance); // Paper - Fix potions splash events
|
||||
+
|
||||
+ private boolean onHitAsWater(ServerLevel level, @Nullable HitResult result) { // Paper - Fix potions splash events
|
||||
+ private boolean onHitAsWater(ServerLevel level, HitResult result) { // Paper - Fix potions splash events
|
||||
AABB aabb = this.getBoundingBox().inflate(4.0, 2.0, 4.0);
|
||||
|
||||
- for (LivingEntity livingEntity : this.level().getEntitiesOfClass(LivingEntity.class, aabb, WATER_SENSITIVE_OR_ON_FIRE)) {
|
||||
@@ -85,8 +85,8 @@
|
||||
+ return !event.isCancelled(); // Paper - Fix potions splash events
|
||||
}
|
||||
|
||||
- protected abstract void onHitAsPotion(ServerLevel level, ItemStack stack, @Nullable Entity entity);
|
||||
+ protected abstract boolean onHitAsPotion(ServerLevel level, ItemStack stack, @Nullable Entity entity, @Nullable HitResult hitResult); // Paper - Pass HitResult // Paper - Fix potions splash events & More Projectile API
|
||||
- protected abstract void onHitAsPotion(ServerLevel level, ItemStack stack, HitResult hitResult);
|
||||
+ protected abstract boolean onHitAsPotion(ServerLevel level, ItemStack stack, HitResult hitResult); // Paper - Fix potions splash events & More Projectile API
|
||||
|
||||
private void dowseFire(BlockPos pos) {
|
||||
BlockState blockState = this.level().getBlockState(pos);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/projectile/EvokerFangs.java
|
||||
+++ b/net/minecraft/world/entity/projectile/EvokerFangs.java
|
||||
@@ -107,7 +_,7 @@
|
||||
@@ -97,7 +_,7 @@
|
||||
}
|
||||
|
||||
if (--this.lifeTicks < 0) {
|
||||
@@ -9,7 +9,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -116,7 +_,7 @@
|
||||
@@ -106,7 +_,7 @@
|
||||
LivingEntity owner = this.getOwner();
|
||||
if (target.isAlive() && !target.isInvulnerable() && target != owner) {
|
||||
if (owner == null) {
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
--- a/net/minecraft/world/entity/projectile/EyeOfEnder.java
|
||||
+++ b/net/minecraft/world/entity/projectile/EyeOfEnder.java
|
||||
@@ -73,6 +_,12 @@
|
||||
@@ -72,6 +_,12 @@
|
||||
}
|
||||
|
||||
public void signalTo(BlockPos pos) {
|
||||
public void signalTo(Vec3 pos) {
|
||||
+ // Paper start - Change EnderEye target without changing other things
|
||||
+ this.signalTo(pos, true);
|
||||
+ }
|
||||
+
|
||||
+ public void signalTo(BlockPos pos, boolean update) {
|
||||
+ public void signalTo(Vec3 pos, boolean update) {
|
||||
+ // Paper end - Change EnderEye target without changing other things
|
||||
double d = pos.getX();
|
||||
int y = pos.getY();
|
||||
double d1 = pos.getZ();
|
||||
@@ -89,8 +_,10 @@
|
||||
this.tz = d1;
|
||||
Vec3 vec3 = pos.subtract(this.position());
|
||||
double d = vec3.horizontalDistance();
|
||||
if (d > 12.0) {
|
||||
@@ -80,8 +_,10 @@
|
||||
this.target = pos;
|
||||
}
|
||||
|
||||
+ if (update) { // Paper - Change EnderEye target without changing other things
|
||||
@@ -24,7 +24,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -164,7 +_,7 @@
|
||||
@@ -102,7 +_,7 @@
|
||||
this.life++;
|
||||
if (this.life > 80 && !this.level().isClientSide) {
|
||||
this.playSound(SoundEvents.ENDER_EYE_DEATH, 1.0F, 1.0F);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/projectile/FireworkRocketEntity.java
|
||||
+++ b/net/minecraft/world/entity/projectile/FireworkRocketEntity.java
|
||||
@@ -50,6 +_,7 @@
|
||||
@@ -48,6 +_,7 @@
|
||||
public int lifetime = 0;
|
||||
@Nullable
|
||||
public LivingEntity attachedToEntity;
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
public FireworkRocketEntity(EntityType<? extends FireworkRocketEntity> entityType, Level level) {
|
||||
super(entityType, level);
|
||||
@@ -165,7 +_,7 @@
|
||||
@@ -163,7 +_,7 @@
|
||||
}
|
||||
|
||||
if (!this.noPhysics && this.isAlive() && hitResultOnMoveVector.getType() != HitResult.Type.MISS) {
|
||||
@@ -17,7 +17,7 @@
|
||||
this.hasImpulse = true;
|
||||
}
|
||||
|
||||
@@ -189,7 +_,11 @@
|
||||
@@ -187,7 +_,11 @@
|
||||
}
|
||||
|
||||
if (this.life > this.lifetime && this.level() instanceof ServerLevel serverLevel) {
|
||||
@@ -30,7 +30,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -197,14 +_,18 @@
|
||||
@@ -195,14 +_,18 @@
|
||||
level.broadcastEntityEvent(this, (byte)17);
|
||||
this.gameEvent(GameEvent.EXPLODE, this.getOwner());
|
||||
this.dealExplosionDamage(level);
|
||||
@@ -51,7 +51,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -213,7 +_,11 @@
|
||||
@@ -211,7 +_,11 @@
|
||||
BlockPos blockPos = new BlockPos(result.getBlockPos());
|
||||
this.level().getBlockState(blockPos).entityInside(this.level(), blockPos, this, InsideBlockEffectApplier.NOOP);
|
||||
if (this.level() instanceof ServerLevel serverLevel && this.hasExplosion()) {
|
||||
@@ -64,19 +64,19 @@
|
||||
}
|
||||
|
||||
super.onHitBlock(result);
|
||||
@@ -286,6 +_,7 @@
|
||||
RegistryOps<Tag> registryOps = this.registryAccess().createSerializationContext(NbtOps.INSTANCE);
|
||||
compound.store("FireworksItem", ItemStack.CODEC, registryOps, this.getItem());
|
||||
compound.putBoolean("ShotAtAngle", this.entityData.get(DATA_SHOT_AT_ANGLE));
|
||||
+ compound.storeNullable("SpawningEntity", net.minecraft.core.UUIDUtil.CODEC, this.spawningEntity); // Paper
|
||||
@@ -283,6 +_,7 @@
|
||||
output.putInt("LifeTime", this.lifetime);
|
||||
output.store("FireworksItem", ItemStack.CODEC, this.getItem());
|
||||
output.putBoolean("ShotAtAngle", this.entityData.get(DATA_SHOT_AT_ANGLE));
|
||||
+ output.storeNullable("SpawningEntity", net.minecraft.core.UUIDUtil.CODEC, this.spawningEntity); // Paper
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -296,6 +_,7 @@
|
||||
RegistryOps<Tag> registryOps = this.registryAccess().createSerializationContext(NbtOps.INSTANCE);
|
||||
this.entityData.set(DATA_ID_FIREWORKS_ITEM, compound.read("FireworksItem", ItemStack.CODEC, registryOps).orElse(getDefaultItem()));
|
||||
this.entityData.set(DATA_SHOT_AT_ANGLE, compound.getBooleanOr("ShotAtAngle", false));
|
||||
+ this.spawningEntity = compound.read("SpawningEntity", net.minecraft.core.UUIDUtil.CODEC).orElse(null); // Paper
|
||||
@@ -292,6 +_,7 @@
|
||||
this.lifetime = input.getIntOr("LifeTime", 0);
|
||||
this.entityData.set(DATA_ID_FIREWORKS_ITEM, input.read("FireworksItem", ItemStack.CODEC).orElse(getDefaultItem()));
|
||||
this.entityData.set(DATA_SHOT_AT_ANGLE, input.getBooleanOr("ShotAtAngle", false));
|
||||
+ this.spawningEntity = input.read("SpawningEntity", net.minecraft.core.UUIDUtil.CODEC).orElse(null); // Paper
|
||||
}
|
||||
|
||||
private List<FireworkExplosion> getExplosions() {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
--- a/net/minecraft/world/entity/projectile/FishingHook.java
|
||||
+++ b/net/minecraft/world/entity/projectile/FishingHook.java
|
||||
@@ -66,10 +_,26 @@
|
||||
private final int luck;
|
||||
@@ -70,10 +_,26 @@
|
||||
private final int lureSpeed;
|
||||
private final InterpolationHandler interpolationHandler = new InterpolationHandler(this);
|
||||
|
||||
+ // CraftBukkit start - Extra variables to enable modification of fishing wait time, values are minecraft defaults
|
||||
+ public int minWaitTime = 100;
|
||||
@@ -27,7 +27,7 @@
|
||||
}
|
||||
|
||||
public FishingHook(EntityType<? extends FishingHook> entityType, Level level) {
|
||||
@@ -143,12 +_,12 @@
|
||||
@@ -154,12 +_,12 @@
|
||||
super.tick();
|
||||
Player playerOwner = this.getPlayerOwner();
|
||||
if (playerOwner == null) {
|
||||
@@ -42,7 +42,7 @@
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
@@ -166,12 +_,14 @@
|
||||
@@ -177,12 +_,14 @@
|
||||
if (this.currentState == FishingHook.FishHookState.FLYING) {
|
||||
if (this.hookedIn != null) {
|
||||
this.setDeltaMovement(Vec3.ZERO);
|
||||
@@ -57,7 +57,7 @@
|
||||
this.currentState = FishingHook.FishHookState.BOBBING;
|
||||
return;
|
||||
}
|
||||
@@ -184,6 +_,7 @@
|
||||
@@ -195,6 +_,7 @@
|
||||
this.setPos(this.hookedIn.getX(), this.hookedIn.getY(0.8), this.hookedIn.getZ());
|
||||
} else {
|
||||
this.setHookedEntity(null);
|
||||
@@ -65,7 +65,7 @@
|
||||
this.currentState = FishingHook.FishHookState.FLYING;
|
||||
}
|
||||
}
|
||||
@@ -247,14 +_,14 @@
|
||||
@@ -258,14 +_,14 @@
|
||||
if (!player.isRemoved() && player.isAlive() && (isFishingRod || isFishingRod1) && !(this.distanceToSqr(player) > 1024.0)) {
|
||||
return false;
|
||||
} else {
|
||||
@@ -82,7 +82,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -285,11 +_,11 @@
|
||||
@@ -296,11 +_,11 @@
|
||||
ServerLevel serverLevel = (ServerLevel)this.level();
|
||||
int i = 1;
|
||||
BlockPos blockPos = pos.above();
|
||||
@@ -96,7 +96,7 @@
|
||||
i--;
|
||||
}
|
||||
|
||||
@@ -299,6 +_,10 @@
|
||||
@@ -310,6 +_,10 @@
|
||||
this.timeUntilLured = 0;
|
||||
this.timeUntilHooked = 0;
|
||||
this.getEntityData().set(DATA_BITING, false);
|
||||
@@ -107,7 +107,7 @@
|
||||
}
|
||||
} else if (this.timeUntilHooked > 0) {
|
||||
this.timeUntilHooked -= i;
|
||||
@@ -322,6 +_,12 @@
|
||||
@@ -333,6 +_,12 @@
|
||||
serverLevel.sendParticles(ParticleTypes.FISHING, d, d1, d2, 0, -f2, 0.01, f1, 1.0);
|
||||
}
|
||||
} else {
|
||||
@@ -120,7 +120,7 @@
|
||||
this.playSound(SoundEvents.FISHING_BOBBER_SPLASH, 0.25F, 1.0F + (this.random.nextFloat() - this.random.nextFloat()) * 0.4F);
|
||||
double d3 = this.getY() + 0.5;
|
||||
serverLevel.sendParticles(
|
||||
@@ -373,14 +_,31 @@
|
||||
@@ -384,14 +_,31 @@
|
||||
}
|
||||
|
||||
if (this.timeUntilLured <= 0) {
|
||||
@@ -156,8 +156,8 @@
|
||||
|
||||
public boolean calculateOpenWater(BlockPos pos) {
|
||||
FishingHook.OpenWaterType openWaterType = FishingHook.OpenWaterType.INVALID;
|
||||
@@ -439,15 +_,31 @@
|
||||
public void readAdditionalSaveData(CompoundTag compound) {
|
||||
@@ -450,15 +_,31 @@
|
||||
protected void readAdditionalSaveData(ValueInput input) {
|
||||
}
|
||||
|
||||
+
|
||||
@@ -188,7 +188,7 @@
|
||||
} else if (this.nibble > 0) {
|
||||
LootParams lootParams = new LootParams.Builder((ServerLevel)this.level())
|
||||
.withParameter(LootContextParams.ORIGIN, this.position())
|
||||
@@ -461,18 +_,27 @@
|
||||
@@ -472,18 +_,27 @@
|
||||
|
||||
for (ItemStack itemStack : randomItems) {
|
||||
ItemEntity itemEntity = new ItemEntity(this.level(), this.getX(), this.getY(), this.getZ(), itemStack);
|
||||
@@ -215,14 +215,14 @@
|
||||
+ playerOwner.level()
|
||||
+ .addFreshEntity(
|
||||
+ new ExperienceOrb(
|
||||
+ playerOwner.level(), playerOwner.getX(), playerOwner.getY() + 0.5, playerOwner.getZ() + 0.5, playerFishEvent.getExpToDrop(), org.bukkit.entity.ExperienceOrb.SpawnReason.FISHING, this.getPlayerOwner(), this // Paper
|
||||
+ playerOwner.level(), new net.minecraft.world.phys.Vec3(playerOwner.getX(), playerOwner.getY() + 0.5, playerOwner.getZ() + 0.5), net.minecraft.world.phys.Vec3.ZERO, playerFishEvent.getExpToDrop(), org.bukkit.entity.ExperienceOrb.SpawnReason.FISHING, this.getPlayerOwner(), this // Paper
|
||||
+ )
|
||||
+ );
|
||||
+ }
|
||||
if (itemStack.is(ItemTags.FISHES)) {
|
||||
playerOwner.awardStat(Stats.FISH_CAUGHT, 1);
|
||||
}
|
||||
@@ -482,10 +_,24 @@
|
||||
@@ -493,10 +_,24 @@
|
||||
}
|
||||
|
||||
if (this.onGround()) {
|
||||
@@ -248,7 +248,7 @@
|
||||
return i;
|
||||
} else {
|
||||
return 0;
|
||||
@@ -515,9 +_,9 @@
|
||||
@@ -526,9 +_,9 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -260,7 +260,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -565,7 +_,7 @@
|
||||
@@ -576,7 +_,7 @@
|
||||
if (this.getPlayerOwner() == null) {
|
||||
int data = packet.getData();
|
||||
LOGGER.error("Failed to recreate fishing hook on client. {} (id: {}) is not a valid owner.", this.level().getEntity(data), data);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/projectile/LargeFireball.java
|
||||
+++ b/net/minecraft/world/entity/projectile/LargeFireball.java
|
||||
@@ -19,11 +_,13 @@
|
||||
@@ -20,11 +_,13 @@
|
||||
|
||||
public LargeFireball(EntityType<? extends LargeFireball> entityType, Level level) {
|
||||
super(entityType, level);
|
||||
@@ -14,7 +14,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -31,8 +_,13 @@
|
||||
@@ -32,8 +_,13 @@
|
||||
super.onHit(result);
|
||||
if (this.level() instanceof ServerLevel serverLevel) {
|
||||
boolean _boolean = serverLevel.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING);
|
||||
@@ -30,11 +30,11 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,6 +_,6 @@
|
||||
@@ -58,6 +_,6 @@
|
||||
@Override
|
||||
public void readAdditionalSaveData(CompoundTag compound) {
|
||||
super.readAdditionalSaveData(compound);
|
||||
- this.explosionPower = compound.getByteOr("ExplosionPower", (byte)1);
|
||||
+ this.bukkitYield = this.explosionPower = compound.getByteOr("ExplosionPower", (byte)1); // CraftBukkit - set bukkitYield when setting explosionPower
|
||||
protected void readAdditionalSaveData(ValueInput input) {
|
||||
super.readAdditionalSaveData(input);
|
||||
- this.explosionPower = input.getByteOr("ExplosionPower", (byte)1);
|
||||
+ this.bukkitYield = this.explosionPower = input.getByteOr("ExplosionPower", (byte)1); // CraftBukkit - set bukkitYield when setting explosionPower
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/projectile/Projectile.java
|
||||
+++ b/net/minecraft/world/entity/projectile/Projectile.java
|
||||
@@ -47,6 +_,7 @@
|
||||
@@ -44,6 +_,7 @@
|
||||
public boolean hasBeenShot = false;
|
||||
@Nullable
|
||||
private Entity lastDeflectedBy;
|
||||
@@ -8,18 +8,11 @@
|
||||
|
||||
Projectile(EntityType<? extends Projectile> entityType, Level level) {
|
||||
super(entityType, level);
|
||||
@@ -57,15 +_,36 @@
|
||||
this.ownerUUID = owner.getUUID();
|
||||
this.cachedOwner = owner;
|
||||
}
|
||||
@@ -55,7 +_,20 @@
|
||||
|
||||
public void setOwner(@Nullable Entity owner) {
|
||||
this.setOwner(owner != null ? new EntityReference<>(owner) : null);
|
||||
- }
|
||||
+ // Paper start - Refresh ProjectileSource for projectiles
|
||||
+ else {
|
||||
+ this.ownerUUID = null;
|
||||
+ this.cachedOwner = null;
|
||||
+ this.projectileSource = null;
|
||||
+ }
|
||||
+ // Paper end - Refresh ProjectileSource for projectiles
|
||||
+ this.refreshProjectileSource(false); // Paper
|
||||
+ }
|
||||
+
|
||||
@@ -28,7 +21,8 @@
|
||||
+ if (fillCache) {
|
||||
+ this.getOwner();
|
||||
+ }
|
||||
+ if (this.cachedOwner != null && !this.cachedOwner.isRemoved() && this.projectileSource == null && this.cachedOwner.getBukkitEntity() instanceof org.bukkit.projectiles.ProjectileSource projSource) {
|
||||
+ Entity owner = this.getOwner();
|
||||
+ if (owner != null && this.projectileSource == null && owner.getBukkitEntity() instanceof org.bukkit.projectiles.ProjectileSource projSource) {
|
||||
+ this.projectileSource = projSource;
|
||||
+ }
|
||||
+ }
|
||||
@@ -36,25 +30,15 @@
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public Entity getOwner() {
|
||||
if (this.cachedOwner != null && !this.cachedOwner.isRemoved()) {
|
||||
+ this.refreshProjectileSource(false); // Paper - Refresh ProjectileSource for projectiles
|
||||
return this.cachedOwner;
|
||||
} else if (this.ownerUUID != null) {
|
||||
this.cachedOwner = this.findOwner(this.ownerUUID);
|
||||
+ this.refreshProjectileSource(false); // Paper - Refresh ProjectileSource for projectiles
|
||||
return this.cachedOwner;
|
||||
} else {
|
||||
return null;
|
||||
@@ -98,6 +_,7 @@
|
||||
@@ -84,6 +_,7 @@
|
||||
@Override
|
||||
protected void readAdditionalSaveData(CompoundTag compound) {
|
||||
this.setOwnerThroughUUID(compound.read("Owner", UUIDUtil.CODEC).orElse(null));
|
||||
+ if (this instanceof ThrownEnderpearl && this.level().paperConfig().fixes.disableUnloadedChunkEnderpearlExploit && this.level().paperConfig().misc.legacyEnderPearlBehavior) { this.ownerUUID = null; } // Paper - Reset pearls when they stop being ticked; Don't store shooter name for pearls to block enderpearl travel exploit
|
||||
this.leftOwner = compound.getBooleanOr("LeftOwner", false);
|
||||
this.hasBeenShot = compound.getBooleanOr("HasBeenShot", false);
|
||||
protected void readAdditionalSaveData(ValueInput input) {
|
||||
this.setOwner(EntityReference.read(input, "Owner"));
|
||||
+ if (this instanceof ThrownEnderpearl && this.level().paperConfig().fixes.disableUnloadedChunkEnderpearlExploit && this.level().paperConfig().misc.legacyEnderPearlBehavior) { this.owner = null; } // Paper - Reset pearls when they stop being ticked; Don't store shooter name for pearls to block enderpearl travel exploit
|
||||
this.leftOwner = input.getBooleanOr("LeftOwner", false);
|
||||
this.hasBeenShot = input.getBooleanOr("HasBeenShot", false);
|
||||
}
|
||||
@@ -173,7 +_,14 @@
|
||||
@@ -151,7 +_,14 @@
|
||||
float f2 = Mth.cos(y * (float) (Math.PI / 180.0)) * Mth.cos(x * (float) (Math.PI / 180.0));
|
||||
this.shoot(f, f1, f2, velocity, inaccuracy);
|
||||
Vec3 knownMovement = shooter.getKnownMovement();
|
||||
@@ -69,7 +53,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -193,7 +_,12 @@
|
||||
@@ -171,7 +_,12 @@
|
||||
public static <T extends Projectile> T spawnProjectileFromRotation(
|
||||
Projectile.ProjectileFactory<T> factory, ServerLevel level, ItemStack spawnedFrom, LivingEntity owner, float z, float velocity, float innaccuracy
|
||||
) {
|
||||
@@ -83,7 +67,7 @@
|
||||
factory.create(level, owner, spawnedFrom),
|
||||
level,
|
||||
spawnedFrom,
|
||||
@@ -218,7 +_,13 @@
|
||||
@@ -196,7 +_,13 @@
|
||||
public static <T extends Projectile> T spawnProjectileUsingShoot(
|
||||
T projectile, ServerLevel level, ItemStack spawnedFrom, double x, double y, double z, float velocity, float inaccuracy
|
||||
) {
|
||||
@@ -98,7 +82,7 @@
|
||||
}
|
||||
|
||||
public static <T extends Projectile> T spawnProjectile(T projectile, ServerLevel level, ItemStack spawnedFrom) {
|
||||
@@ -226,11 +_,46 @@
|
||||
@@ -204,11 +_,46 @@
|
||||
}
|
||||
|
||||
public static <T extends Projectile> T spawnProjectile(T projectile, ServerLevel level, ItemStack stack, Consumer<T> adapter) {
|
||||
@@ -149,7 +133,7 @@
|
||||
|
||||
public void applyOnProjectileSpawned(ServerLevel level, ItemStack spawnedFrom) {
|
||||
EnchantmentHelper.onProjectileSpawned(level, spawnedFrom, this, item -> {});
|
||||
@@ -242,6 +_,17 @@
|
||||
@@ -220,6 +_,17 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -167,7 +151,7 @@
|
||||
protected ProjectileDeflection hitTargetOrDeflectSelf(HitResult hitResult) {
|
||||
if (hitResult.getType() == HitResult.Type.ENTITY) {
|
||||
EntityHitResult entityHitResult = (EntityHitResult)hitResult;
|
||||
@@ -273,7 +_,13 @@
|
||||
@@ -251,7 +_,13 @@
|
||||
public boolean deflect(ProjectileDeflection deflection, @Nullable Entity entity, @Nullable Entity owner, boolean deflectedByPlayer) {
|
||||
deflection.deflect(this, entity, this.random);
|
||||
if (!this.level().isClientSide) {
|
||||
@@ -182,7 +166,7 @@
|
||||
this.onDeflection(entity, deflectedByPlayer);
|
||||
}
|
||||
|
||||
@@ -309,15 +_,35 @@
|
||||
@@ -287,15 +_,35 @@
|
||||
}
|
||||
|
||||
protected void onHitBlock(BlockHitResult result) {
|
||||
@@ -218,7 +202,7 @@
|
||||
return owner == null || this.leftOwner || !owner.isPassengerOfSameVehicle(target);
|
||||
}
|
||||
}
|
||||
@@ -330,13 +_,7 @@
|
||||
@@ -308,13 +_,7 @@
|
||||
}
|
||||
|
||||
protected static float lerpRotation(float currentRotation, float targetRotation) {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
--- a/net/minecraft/world/entity/projectile/ShulkerBullet.java
|
||||
+++ b/net/minecraft/world/entity/projectile/ShulkerBullet.java
|
||||
@@ -58,7 +_,21 @@
|
||||
this.finalTarget = finalTarget;
|
||||
@@ -57,7 +_,21 @@
|
||||
this.finalTarget = new EntityReference<>(finalTarget);
|
||||
this.currentMoveDirection = Direction.UP;
|
||||
this.selectNextMoveDirection(axis);
|
||||
this.selectNextMoveDirection(axis, finalTarget);
|
||||
- }
|
||||
+ this.projectileSource = shooter.getBukkitLivingEntity(); // CraftBukkit
|
||||
+ }
|
||||
@@ -11,19 +11,19 @@
|
||||
+ // CraftBukkit start
|
||||
+ @Nullable
|
||||
+ public Entity getTarget() {
|
||||
+ return this.finalTarget;
|
||||
+ return EntityReference.get(this.finalTarget, this.level(), Entity.class);
|
||||
+ }
|
||||
+
|
||||
+ public void setTarget(@Nullable Entity finalTarget) {
|
||||
+ this.finalTarget = finalTarget;
|
||||
+ this.finalTarget = finalTarget == null ? null : new net.minecraft.world.entity.EntityReference<>(finalTarget);
|
||||
+ this.currentMoveDirection = Direction.UP;
|
||||
+ this.selectNextMoveDirection(Direction.Axis.X);
|
||||
+ this.selectNextMoveDirection(Direction.Axis.X, finalTarget);
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
|
||||
@Override
|
||||
public SoundSource getSoundSource() {
|
||||
@@ -180,7 +_,7 @@
|
||||
@@ -179,7 +_,7 @@
|
||||
@Override
|
||||
public void checkDespawn() {
|
||||
if (this.level().getDifficulty() == Difficulty.PEACEFUL) {
|
||||
@@ -32,7 +32,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -226,7 +_,7 @@
|
||||
@@ -223,7 +_,7 @@
|
||||
}
|
||||
|
||||
if (hitResult != null && this.isAlive() && hitResult.getType() != HitResult.Type.MISS) {
|
||||
@@ -41,7 +41,7 @@
|
||||
}
|
||||
|
||||
ProjectileUtil.rotateTowardsMovement(this, 0.5F);
|
||||
@@ -299,7 +_,7 @@
|
||||
@@ -296,7 +_,7 @@
|
||||
}
|
||||
|
||||
if (entity instanceof LivingEntity livingEntity1) {
|
||||
@@ -50,7 +50,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -312,14 +_,20 @@
|
||||
@@ -309,14 +_,20 @@
|
||||
}
|
||||
|
||||
private void destroy() {
|
||||
@@ -73,7 +73,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -334,9 +_,14 @@
|
||||
@@ -331,9 +_,14 @@
|
||||
|
||||
@Override
|
||||
public boolean hurtServer(ServerLevel level, DamageSource damageSource, float amount) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/projectile/SpectralArrow.java
|
||||
+++ b/net/minecraft/world/entity/projectile/SpectralArrow.java
|
||||
@@ -39,7 +_,7 @@
|
||||
@@ -40,7 +_,7 @@
|
||||
protected void doPostHurtEffects(LivingEntity living) {
|
||||
super.doPostHurtEffects(living);
|
||||
MobEffectInstance mobEffectInstance = new MobEffectInstance(MobEffects.GLOWING, this.duration, 0);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/projectile/ThrownEnderpearl.java
|
||||
+++ b/net/minecraft/world/entity/projectile/ThrownEnderpearl.java
|
||||
@@ -122,11 +_,18 @@
|
||||
@@ -119,11 +_,18 @@
|
||||
Vec3 vec3 = this.oldPosition();
|
||||
if (owner instanceof ServerPlayer serverPlayer) {
|
||||
if (serverPlayer.connection.isAcceptingMessages()) {
|
||||
@@ -20,7 +20,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -134,15 +_,17 @@
|
||||
@@ -131,15 +_,17 @@
|
||||
owner.setPortalCooldown();
|
||||
}
|
||||
|
||||
@@ -39,12 +39,12 @@
|
||||
if (serverPlayer1 != null) {
|
||||
serverPlayer1.resetFallDistance();
|
||||
serverPlayer1.resetCurrentImpulseContext();
|
||||
- serverPlayer1.hurtServer(serverPlayer.serverLevel(), this.damageSources().enderPearl(), 5.0F);
|
||||
+ serverPlayer1.hurtServer(serverPlayer.serverLevel(), this.damageSources().enderPearl().eventEntityDamager(this), 5.0F); // CraftBukkit // Paper - fix DamageSource API
|
||||
- serverPlayer1.hurtServer(serverPlayer.level(), this.damageSources().enderPearl(), 5.0F);
|
||||
+ serverPlayer1.hurtServer(serverPlayer.level(), this.damageSources().enderPearl().eventEntityDamager(this), 5.0F); // CraftBukkit // Paper - fix DamageSource API
|
||||
}
|
||||
|
||||
this.playSound(serverLevel, vec3);
|
||||
@@ -158,9 +_,9 @@
|
||||
@@ -155,9 +_,9 @@
|
||||
this.playSound(serverLevel, vec3);
|
||||
}
|
||||
|
||||
@@ -56,16 +56,16 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -181,7 +_,7 @@
|
||||
@@ -178,7 +_,7 @@
|
||||
if (owner instanceof ServerPlayer serverPlayer
|
||||
&& !owner.isAlive()
|
||||
&& serverPlayer.serverLevel().getGameRules().getBoolean(GameRules.RULE_ENDER_PEARLS_VANISH_ON_DEATH)) {
|
||||
&& serverPlayer.level().getGameRules().getBoolean(GameRules.RULE_ENDER_PEARLS_VANISH_ON_DEATH)) {
|
||||
- this.discard();
|
||||
+ this.discard(org.bukkit.event.entity.EntityRemoveEvent.Cause.DESPAWN); // CraftBukkit - add Bukkit remove cause
|
||||
} else {
|
||||
super.tick();
|
||||
}
|
||||
@@ -208,7 +_,7 @@
|
||||
@@ -205,7 +_,7 @@
|
||||
public Entity teleport(TeleportTransition teleportTransition) {
|
||||
Entity entity = super.teleport(teleportTransition);
|
||||
if (entity != null) {
|
||||
@@ -74,7 +74,7 @@
|
||||
}
|
||||
|
||||
return entity;
|
||||
@@ -216,7 +_,7 @@
|
||||
@@ -213,7 +_,7 @@
|
||||
|
||||
@Override
|
||||
public boolean canTeleport(Level fromLevel, Level toLevel) {
|
||||
|
||||
@@ -1,22 +1,32 @@
|
||||
--- a/net/minecraft/world/entity/projectile/ThrownExperienceBottle.java
|
||||
+++ b/net/minecraft/world/entity/projectile/ThrownExperienceBottle.java
|
||||
@@ -37,10 +_,17 @@
|
||||
@@ -39,16 +_,25 @@
|
||||
protected void onHit(HitResult result) {
|
||||
super.onHit(result);
|
||||
if (this.level() instanceof ServerLevel) {
|
||||
- this.level().levelEvent(2002, this.blockPosition(), -13083194);
|
||||
if (this.level() instanceof ServerLevel serverLevel) {
|
||||
- serverLevel.levelEvent(2002, this.blockPosition(), -13083194);
|
||||
+ // CraftBukkit - moved to after event
|
||||
int i = 3 + this.level().random.nextInt(5) + this.level().random.nextInt(5);
|
||||
- ExperienceOrb.award((ServerLevel)this.level(), result.getLocation(), i);
|
||||
- this.discard();
|
||||
+ // CraftBukkit start
|
||||
int i = 3 + serverLevel.random.nextInt(5) + serverLevel.random.nextInt(5);
|
||||
+ // Paper start - exp bottle event
|
||||
+ org.bukkit.event.entity.ExpBottleEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callExpBottleEvent(this, result, i);
|
||||
+ i = event.getExperience();
|
||||
+ // Paper end - exp bottle event
|
||||
if (result instanceof BlockHitResult blockHitResult) {
|
||||
Vec3 unitVec3 = blockHitResult.getDirection().getUnitVec3();
|
||||
- ExperienceOrb.awardWithDirection(serverLevel, result.getLocation(), unitVec3, i);
|
||||
+ ExperienceOrb.awardWithDirection(serverLevel, result.getLocation(), unitVec3, i, org.bukkit.entity.ExperienceOrb.SpawnReason.EXP_BOTTLE, this.getOwner(), this); // Paper
|
||||
} else {
|
||||
- ExperienceOrb.awardWithDirection(serverLevel, result.getLocation(), this.getDeltaMovement().scale(-1.0), i);
|
||||
- }
|
||||
+ ExperienceOrb.awardWithDirection(serverLevel, result.getLocation(), this.getDeltaMovement().scale(-1.0), i, org.bukkit.entity.ExperienceOrb.SpawnReason.EXP_BOTTLE, this.getOwner(), this); // Paper
|
||||
+ }
|
||||
+ // Paper start - exp bottle event
|
||||
+ if (event.getShowEffect()) {
|
||||
+ this.level().levelEvent(net.minecraft.world.level.block.LevelEvent.PARTICLES_SPELL_POTION_SPLASH, this.blockPosition(), net.minecraft.world.item.alchemy.PotionContents.BASE_POTION_COLOR);
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
+ ExperienceOrb.award((ServerLevel)this.level(), result.getLocation(), i, org.bukkit.entity.ExperienceOrb.SpawnReason.EXP_BOTTLE, this.getOwner(), this); // Paper
|
||||
+ // Paper end - exp bottle event
|
||||
|
||||
- this.discard();
|
||||
+ this.discard(org.bukkit.event.entity.EntityRemoveEvent.Cause.HIT); // CraftBukkit - add Bukkit remove cause
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
--- a/net/minecraft/world/entity/projectile/ThrownLingeringPotion.java
|
||||
+++ b/net/minecraft/world/entity/projectile/ThrownLingeringPotion.java
|
||||
@@ -30,7 +_,7 @@
|
||||
@@ -29,7 +_,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
- public void onHitAsPotion(ServerLevel level, ItemStack stack, @Nullable Entity entity) {
|
||||
+ public boolean onHitAsPotion(ServerLevel level, ItemStack stack, @Nullable Entity entity, @Nullable net.minecraft.world.phys.HitResult hitResult) { // Paper - Pass HitResult // Paper - More projectile API
|
||||
- public void onHitAsPotion(ServerLevel level, ItemStack stack, HitResult hitResult) {
|
||||
+ public boolean onHitAsPotion(ServerLevel level, ItemStack stack, HitResult hitResult) { // Paper - More projectile API
|
||||
AreaEffectCloud areaEffectCloud = new AreaEffectCloud(this.level(), this.getX(), this.getY(), this.getZ());
|
||||
if (this.getOwner() instanceof LivingEntity livingEntity) {
|
||||
areaEffectCloud.setOwner(livingEntity);
|
||||
@@ -42,6 +_,15 @@
|
||||
@@ -41,6 +_,15 @@
|
||||
areaEffectCloud.setWaitTime(10);
|
||||
areaEffectCloud.setRadiusPerTick(-areaEffectCloud.getRadius() / areaEffectCloud.getDuration());
|
||||
areaEffectCloud.applyComponentsFromItemStack(stack);
|
||||
|
||||
@@ -1,31 +1,28 @@
|
||||
--- a/net/minecraft/world/entity/projectile/ThrownSplashPotion.java
|
||||
+++ b/net/minecraft/world/entity/projectile/ThrownSplashPotion.java
|
||||
@@ -36,12 +_,13 @@
|
||||
@@ -36,13 +_,14 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
- public void onHitAsPotion(ServerLevel level, ItemStack stack, @Nullable Entity entity) {
|
||||
+ public boolean onHitAsPotion(ServerLevel level, ItemStack stack, @Nullable Entity entity, @Nullable net.minecraft.world.phys.HitResult hitResult) { // Paper - Add HitResult parameter // Paper - More projectile API
|
||||
- public void onHitAsPotion(ServerLevel level, ItemStack stack, HitResult hitResult) {
|
||||
+ public boolean onHitAsPotion(ServerLevel level, ItemStack stack, HitResult hitResult) { // Paper - More projectile API
|
||||
PotionContents potionContents = stack.getOrDefault(DataComponents.POTION_CONTENTS, PotionContents.EMPTY);
|
||||
float orDefault = stack.getOrDefault(DataComponents.POTION_DURATION_SCALE, 1.0F);
|
||||
Iterable<MobEffectInstance> allEffects = potionContents.getAllEffects();
|
||||
AABB aabb = this.getBoundingBox().inflate(4.0, 2.0, 4.0);
|
||||
List<LivingEntity> entitiesOfClass = this.level().getEntitiesOfClass(LivingEntity.class, aabb);
|
||||
AABB aabb = this.getBoundingBox().move(hitResult.getLocation().subtract(this.position()));
|
||||
AABB aabb1 = aabb.inflate(4.0, 2.0, 4.0);
|
||||
List<LivingEntity> entitiesOfClass = this.level().getEntitiesOfClass(LivingEntity.class, aabb1);
|
||||
+ java.util.Map<org.bukkit.entity.LivingEntity, Double> affected = new java.util.HashMap<>(); // CraftBukkit
|
||||
float f = ProjectileUtil.computeMargin(this);
|
||||
if (!entitiesOfClass.isEmpty()) {
|
||||
Entity effectSource = this.getEffectSource();
|
||||
|
||||
@@ -50,12 +_,31 @@
|
||||
double d = this.distanceToSqr(livingEntity);
|
||||
@@ -51,8 +_,25 @@
|
||||
if (livingEntity.isAffectedByPotions()) {
|
||||
double d = aabb.distanceToSqr(livingEntity.getBoundingBox().inflate(f));
|
||||
if (d < 16.0) {
|
||||
double d1;
|
||||
+ // Paper - diff on change, used when calling the splash event for water splash potions
|
||||
if (livingEntity == entity) {
|
||||
d1 = 1.0;
|
||||
} else {
|
||||
d1 = 1.0 - Math.sqrt(d) / 4.0;
|
||||
}
|
||||
|
||||
- double d1 = 1.0 - Math.sqrt(d) / 4.0;
|
||||
-
|
||||
+ double d1 = 1.0 - Math.sqrt(d) / 4.0; // Paper - diff on change, used when calling the splash event for water splash potions
|
||||
+ // CraftBukkit start
|
||||
+ affected.put(livingEntity.getBukkitLivingEntity(), d1);
|
||||
+ }
|
||||
@@ -47,7 +44,7 @@
|
||||
for (MobEffectInstance mobEffectInstance : allEffects) {
|
||||
Holder<MobEffect> effect = mobEffectInstance.getEffect();
|
||||
if (effect.value().isInstantenous()) {
|
||||
@@ -66,7 +_,7 @@
|
||||
@@ -63,7 +_,7 @@
|
||||
effect, i, mobEffectInstance.getAmplifier(), mobEffectInstance.isAmbient(), mobEffectInstance.isVisible()
|
||||
);
|
||||
if (!mobEffectInstance1.endsWithin(20)) {
|
||||
@@ -56,7 +53,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -74,5 +_,6 @@
|
||||
@@ -71,5 +_,6 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/projectile/ThrownTrident.java
|
||||
+++ b/net/minecraft/world/entity/projectile/ThrownTrident.java
|
||||
@@ -33,16 +_,19 @@
|
||||
@@ -34,16 +_,19 @@
|
||||
|
||||
public ThrownTrident(EntityType<? extends ThrownTrident> entityType, Level level) {
|
||||
super(entityType, level);
|
||||
@@ -20,7 +20,7 @@
|
||||
this.entityData.set(ID_LOYALTY, this.getLoyaltyFromItem(pickupItemStack));
|
||||
this.entityData.set(ID_FOIL, pickupItemStack.hasFoil());
|
||||
}
|
||||
@@ -68,10 +_,10 @@
|
||||
@@ -69,10 +_,10 @@
|
||||
this.spawnAtLocation(serverLevel, this.getPickupItem(), 0.1F);
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -100,6 +_,20 @@
|
||||
@@ -101,6 +_,20 @@
|
||||
return this.entityData.get(ID_FOIL);
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
@Nullable
|
||||
@Override
|
||||
protected EntityHitResult findHitEntity(Vec3 startVec, Vec3 endVec) {
|
||||
@@ -109,7 +_,7 @@
|
||||
@@ -110,7 +_,7 @@
|
||||
@Override
|
||||
protected void onHitEntity(EntityHitResult result) {
|
||||
Entity entity = result.getEntity();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/projectile/WitherSkull.java
|
||||
+++ b/net/minecraft/world/entity/projectile/WitherSkull.java
|
||||
@@ -66,11 +_,11 @@
|
||||
@@ -67,11 +_,11 @@
|
||||
if (var8.isAlive()) {
|
||||
EnchantmentHelper.doPostAttackEffects(serverLevel, var8, damageSource);
|
||||
} else {
|
||||
@@ -14,7 +14,7 @@
|
||||
}
|
||||
|
||||
if (flag && var8 instanceof LivingEntity livingEntityx) {
|
||||
@@ -82,7 +_,7 @@
|
||||
@@ -83,7 +_,7 @@
|
||||
}
|
||||
|
||||
if (i > 0) {
|
||||
@@ -23,7 +23,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -92,8 +_,13 @@
|
||||
@@ -93,8 +_,13 @@
|
||||
protected void onHit(HitResult result) {
|
||||
super.onHit(result);
|
||||
if (!this.level().isClientSide) {
|
||||
|
||||
Reference in New Issue
Block a user