@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/projectile/EntityArrow.java
|
||||
+++ b/net/minecraft/world/entity/projectile/EntityArrow.java
|
||||
@@ -47,6 +47,13 @@
|
||||
@@ -49,6 +49,13 @@
|
||||
import net.minecraft.world.phys.Vec3D;
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
|
||||
@@ -14,16 +14,16 @@
|
||||
public abstract class EntityArrow extends IProjectile {
|
||||
|
||||
private static final double ARROW_BASE_DAMAGE = 2.0D;
|
||||
@@ -219,7 +226,7 @@
|
||||
@@ -225,7 +232,7 @@
|
||||
}
|
||||
|
||||
if (object != null && !flag) {
|
||||
- this.onHit((MovingObjectPosition) object);
|
||||
+ this.preOnHit((MovingObjectPosition) object); // CraftBukkit - projectile hit event
|
||||
this.hasImpulse = true;
|
||||
}
|
||||
- ProjectileDeflection projectiledeflection = this.hitTargetOrDeflectSelf((MovingObjectPosition) object);
|
||||
+ ProjectileDeflection projectiledeflection = this.preHitTargetOrDeflectSelf((MovingObjectPosition) object); // CraftBukkit - projectile hit event
|
||||
|
||||
@@ -304,7 +311,7 @@
|
||||
this.hasImpulse = true;
|
||||
if (projectiledeflection != ProjectileDeflection.NONE) {
|
||||
@@ -316,7 +323,7 @@
|
||||
protected void tickDespawn() {
|
||||
++this.life;
|
||||
if (this.life >= 1200) {
|
||||
@@ -32,7 +32,7 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -337,7 +344,7 @@
|
||||
@@ -349,7 +356,7 @@
|
||||
}
|
||||
|
||||
if (this.piercingIgnoreEntityIds.size() >= this.getPierceLevel() + 1) {
|
||||
@@ -41,31 +41,31 @@
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -367,7 +374,13 @@
|
||||
boolean flag1 = entity.getType().is(TagsEntity.DEFLECTS_ARROWS);
|
||||
@@ -378,7 +385,13 @@
|
||||
int k = entity.getRemainingFireTicks();
|
||||
|
||||
if (this.isOnFire() && !flag && !flag1) {
|
||||
- entity.setSecondsOnFire(5);
|
||||
if (this.isOnFire() && !flag) {
|
||||
- entity.igniteForSeconds(5);
|
||||
+ // CraftBukkit start
|
||||
+ EntityCombustByEntityEvent combustEvent = new EntityCombustByEntityEvent(this.getBukkitEntity(), entity.getBukkitEntity(), 5);
|
||||
+ org.bukkit.Bukkit.getPluginManager().callEvent(combustEvent);
|
||||
+ if (!combustEvent.isCancelled()) {
|
||||
+ entity.setSecondsOnFire(combustEvent.getDuration(), false);
|
||||
+ entity.igniteForSeconds(combustEvent.getDuration(), false);
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
|
||||
if (entity.hurt(damagesource, (float) i)) {
|
||||
@@ -418,7 +431,7 @@
|
||||
@@ -429,7 +442,7 @@
|
||||
|
||||
this.playSound(this.soundEvent, 1.0F, 1.2F / (this.random.nextFloat() * 0.2F + 0.9F));
|
||||
if (this.getPierceLevel() <= 0) {
|
||||
- this.discard();
|
||||
+ this.discard(EntityRemoveEvent.Cause.HIT); // CraftBukkit - add Bukkit remove cause
|
||||
}
|
||||
} else if (flag1) {
|
||||
this.deflect();
|
||||
@@ -432,7 +445,7 @@
|
||||
} else {
|
||||
entity.setRemainingFireTicks(k);
|
||||
@@ -440,7 +453,7 @@
|
||||
this.spawnAtLocation(this.getPickupItem(), 0.1F);
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -545,9 +558,24 @@
|
||||
@@ -547,9 +560,24 @@
|
||||
@Override
|
||||
public void playerTouch(EntityHuman entityhuman) {
|
||||
if (!this.level().isClientSide && (this.inGround || this.isNoPhysics()) && this.shakeTime <= 0) {
|
||||
|
||||
@@ -11,16 +11,7 @@
|
||||
public class EntityEnderSignal extends Entity implements ItemSupplier {
|
||||
|
||||
private static final DataWatcherObject<ItemStack> DATA_ITEM_STACK = DataWatcher.defineId(EntityEnderSignal.class, DataWatcherRegistry.ITEM_STACK);
|
||||
@@ -35,7 +39,7 @@
|
||||
}
|
||||
|
||||
public void setItem(ItemStack itemstack) {
|
||||
- if (!itemstack.is(Items.ENDER_EYE) || itemstack.hasTag()) {
|
||||
+ if (true || !itemstack.is(Items.ENDER_EYE) || itemstack.hasTag()) { // CraftBukkit - always allow item changing
|
||||
this.getEntityData().set(EntityEnderSignal.DATA_ITEM_STACK, itemstack.copyWithCount(1));
|
||||
}
|
||||
|
||||
@@ -150,7 +154,7 @@
|
||||
@@ -146,7 +150,7 @@
|
||||
++this.life;
|
||||
if (this.life > 80 && !this.level().isClientSide) {
|
||||
this.playSound(SoundEffects.ENDER_EYE_DEATH, 1.0F, 1.0F);
|
||||
@@ -29,12 +20,17 @@
|
||||
if (this.surviveAfterDeath) {
|
||||
this.level().addFreshEntity(new EntityItem(this.level(), this.getX(), this.getY(), this.getZ(), this.getItem()));
|
||||
} else {
|
||||
@@ -177,7 +181,7 @@
|
||||
public void readAdditionalSaveData(NBTTagCompound nbttagcompound) {
|
||||
ItemStack itemstack = ItemStack.of(nbttagcompound.getCompound("Item"));
|
||||
|
||||
- this.setItem(itemstack);
|
||||
+ if (!itemstack.isEmpty()) this.setItem(itemstack); // CraftBukkit - SPIGOT-6103 summon, see also SPIGOT-5474
|
||||
}
|
||||
|
||||
@@ -167,7 +171,12 @@
|
||||
@Override
|
||||
public void readAdditionalSaveData(NBTTagCompound nbttagcompound) {
|
||||
if (nbttagcompound.contains("Item", 10)) {
|
||||
- this.setItem((ItemStack) ItemStack.parse(this.registryAccess(), nbttagcompound.getCompound("Item")).orElse(this.getDefaultItem()));
|
||||
+ // CraftBukkit start - SPIGOT-6103 summon, see also SPIGOT-5474
|
||||
+ ItemStack itemstack = (ItemStack) ItemStack.parse(this.registryAccess(), nbttagcompound.getCompound("Item")).orElse(this.getDefaultItem());
|
||||
+ if (!itemstack.isEmpty()) {
|
||||
+ this.setItem(itemstack);
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
} else {
|
||||
this.setItem(this.getDefaultItem());
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/projectile/EntityEvokerFangs.java
|
||||
+++ b/net/minecraft/world/entity/projectile/EntityEvokerFangs.java
|
||||
@@ -14,6 +14,10 @@
|
||||
@@ -15,6 +15,10 @@
|
||||
import net.minecraft.world.entity.TraceableEntity;
|
||||
import net.minecraft.world.level.World;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
public class EntityEvokerFangs extends Entity implements TraceableEntity {
|
||||
|
||||
public static final int ATTACK_DURATION = 20;
|
||||
@@ -118,7 +122,7 @@
|
||||
@@ -119,7 +123,7 @@
|
||||
}
|
||||
|
||||
if (--this.lifeTicks < 0) {
|
||||
@@ -20,7 +20,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -129,7 +133,7 @@
|
||||
@@ -130,7 +134,7 @@
|
||||
|
||||
if (entityliving.isAlive() && !entityliving.isInvulnerable() && entityliving != entityliving1) {
|
||||
if (entityliving1 == null) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/projectile/EntityFireball.java
|
||||
+++ b/net/minecraft/world/entity/projectile/EntityFireball.java
|
||||
@@ -17,11 +17,18 @@
|
||||
@@ -18,6 +18,11 @@
|
||||
import net.minecraft.world.phys.MovingObjectPosition;
|
||||
import net.minecraft.world.phys.Vec3D;
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
+
|
||||
public abstract class EntityFireball extends IProjectile {
|
||||
|
||||
public static final double ATTACK_DEFLECTION_SCALE = 0.1D;
|
||||
@@ -25,6 +30,8 @@
|
||||
public double xPower;
|
||||
public double yPower;
|
||||
public double zPower;
|
||||
@@ -19,20 +21,7 @@
|
||||
|
||||
protected EntityFireball(EntityTypes<? extends EntityFireball> entitytypes, World world) {
|
||||
super(entitytypes, world);
|
||||
@@ -36,6 +43,12 @@
|
||||
this(entitytypes, world);
|
||||
this.moveTo(d0, d1, d2, this.getYRot(), this.getXRot());
|
||||
this.reapplyPosition();
|
||||
+ // CraftBukkit start - Added setDirection method
|
||||
+ this.setDirection(d3, d4, d5);
|
||||
+ }
|
||||
+
|
||||
+ public void setDirection(double d3, double d4, double d5) {
|
||||
+ // CraftBukkit end
|
||||
double d6 = Math.sqrt(d3 * d3 + d4 * d4 + d5 * d5);
|
||||
|
||||
if (d6 != 0.0D) {
|
||||
@@ -76,7 +89,7 @@
|
||||
@@ -72,7 +79,7 @@
|
||||
Entity entity = this.getOwner();
|
||||
|
||||
if (!this.level().isClientSide && (entity != null && entity.isRemoved() || !this.level().hasChunkAt(this.blockPosition()))) {
|
||||
@@ -41,12 +30,12 @@
|
||||
} else {
|
||||
super.tick();
|
||||
if (this.shouldBurn()) {
|
||||
@@ -86,7 +99,13 @@
|
||||
@@ -82,7 +89,13 @@
|
||||
MovingObjectPosition movingobjectposition = ProjectileHelper.getHitResultOnMoveVector(this, this::canHitEntity, this.getClipType());
|
||||
|
||||
if (movingobjectposition.getType() != MovingObjectPosition.EnumMovingObjectType.MISS) {
|
||||
- this.onHit(movingobjectposition);
|
||||
+ this.preOnHit(movingobjectposition); // CraftBukkit - projectile hit event
|
||||
- this.hitTargetOrDeflectSelf(movingobjectposition);
|
||||
+ this.preHitTargetOrDeflectSelf(movingobjectposition); // CraftBukkit - projectile hit event
|
||||
+
|
||||
+ // CraftBukkit start - Fire ProjectileHitEvent
|
||||
+ if (this.isRemoved()) {
|
||||
@@ -56,15 +45,3 @@
|
||||
}
|
||||
|
||||
this.checkInsideBlocks();
|
||||
@@ -184,6 +203,11 @@
|
||||
|
||||
if (entity != null) {
|
||||
if (!this.level().isClientSide) {
|
||||
+ // CraftBukkit start
|
||||
+ if (CraftEventFactory.handleNonLivingEntityDamageEvent(this, damagesource, f, false)) {
|
||||
+ return false;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
Vec3D vec3d = entity.getLookAngle();
|
||||
|
||||
this.setDeltaMovement(vec3d);
|
||||
|
||||
@@ -1,10 +1,16 @@
|
||||
--- a/net/minecraft/world/entity/projectile/EntityFireballFireball.java
|
||||
+++ b/net/minecraft/world/entity/projectile/EntityFireballFireball.java
|
||||
@@ -65,6 +65,6 @@
|
||||
@@ -56,7 +56,12 @@
|
||||
public void readAdditionalSaveData(NBTTagCompound nbttagcompound) {
|
||||
super.readAdditionalSaveData(nbttagcompound);
|
||||
ItemStack itemstack = ItemStack.of(nbttagcompound.getCompound("Item"));
|
||||
|
||||
- this.setItem(itemstack);
|
||||
+ if (!itemstack.isEmpty()) this.setItem(itemstack); // CraftBukkit - SPIGOT-5474 probably came from bugged earlier versions
|
||||
}
|
||||
}
|
||||
if (nbttagcompound.contains("Item", 10)) {
|
||||
- this.setItem((ItemStack) ItemStack.parse(this.registryAccess(), nbttagcompound.getCompound("Item")).orElse(this.getDefaultItem()));
|
||||
+ // CraftBukkit start - SPIGOT-5474 probably came from bugged earlier versions
|
||||
+ ItemStack itemstack = (ItemStack) ItemStack.parse(this.registryAccess(), nbttagcompound.getCompound("Item")).orElse(this.getDefaultItem());
|
||||
+ if (!itemstack.isEmpty()) {
|
||||
+ this.setItem(itemstack);
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
} else {
|
||||
this.setItem(this.getDefaultItem());
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/projectile/EntityFireworks.java
|
||||
+++ b/net/minecraft/world/entity/projectile/EntityFireworks.java
|
||||
@@ -28,6 +28,10 @@
|
||||
@@ -30,6 +30,10 @@
|
||||
import net.minecraft.world.phys.MovingObjectPositionEntity;
|
||||
import net.minecraft.world.phys.Vec3D;
|
||||
|
||||
@@ -11,16 +11,16 @@
|
||||
public class EntityFireworks extends IProjectile implements ItemSupplier {
|
||||
|
||||
public static final DataWatcherObject<ItemStack> DATA_ID_FIREWORKS_ITEM = DataWatcher.defineId(EntityFireworks.class, DataWatcherRegistry.ITEM_STACK);
|
||||
@@ -143,7 +147,7 @@
|
||||
@@ -146,7 +150,7 @@
|
||||
MovingObjectPosition movingobjectposition = ProjectileHelper.getHitResultOnMoveVector(this, this::canHitEntity);
|
||||
|
||||
if (!this.noPhysics) {
|
||||
- this.onHit(movingobjectposition);
|
||||
+ this.preOnHit(movingobjectposition); // CraftBukkit - projectile hit event
|
||||
- this.hitTargetOrDeflectSelf(movingobjectposition);
|
||||
+ this.preHitTargetOrDeflectSelf(movingobjectposition); // CraftBukkit - projectile hit event
|
||||
this.hasImpulse = true;
|
||||
}
|
||||
|
||||
@@ -158,7 +162,11 @@
|
||||
@@ -161,7 +165,11 @@
|
||||
}
|
||||
|
||||
if (!this.level().isClientSide && this.life > this.lifetime) {
|
||||
@@ -33,7 +33,7 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -167,14 +175,18 @@
|
||||
@@ -170,14 +178,18 @@
|
||||
this.level().broadcastEntityEvent(this, (byte) 17);
|
||||
this.gameEvent(GameEvent.EXPLODE, this.getOwner());
|
||||
this.dealExplosionDamage();
|
||||
@@ -54,7 +54,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -184,7 +196,11 @@
|
||||
@@ -187,7 +199,11 @@
|
||||
|
||||
this.level().getBlockState(blockposition).entityInside(this.level(), blockposition, this);
|
||||
if (!this.level().isClientSide() && this.hasExplosion()) {
|
||||
|
||||
@@ -61,8 +61,8 @@
|
||||
private void checkCollision() {
|
||||
MovingObjectPosition movingobjectposition = ProjectileHelper.getHitResultOnMoveVector(this, this::canHitEntity);
|
||||
|
||||
- this.onHit(movingobjectposition);
|
||||
+ this.preOnHit(movingobjectposition); // CraftBukkit - projectile hit event
|
||||
- this.hitTargetOrDeflectSelf(movingobjectposition);
|
||||
+ this.preHitTargetOrDeflectSelf(movingobjectposition); // CraftBukkit - projectile hit event
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -126,7 +126,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -445,6 +479,14 @@
|
||||
@@ -446,6 +480,14 @@
|
||||
int i = 0;
|
||||
|
||||
if (this.hookedIn != null) {
|
||||
@@ -141,7 +141,7 @@
|
||||
this.pullEntity(this.hookedIn);
|
||||
CriterionTriggers.FISHING_ROD_HOOKED.trigger((EntityPlayer) entityhuman, itemstack, this, Collections.emptyList());
|
||||
this.level().broadcastEntityEvent(this, (byte) 31);
|
||||
@@ -460,6 +502,15 @@
|
||||
@@ -461,6 +503,15 @@
|
||||
while (iterator.hasNext()) {
|
||||
ItemStack itemstack1 = (ItemStack) iterator.next();
|
||||
EntityItem entityitem = new EntityItem(this.level(), this.getX(), this.getY(), this.getZ(), itemstack1);
|
||||
@@ -157,7 +157,7 @@
|
||||
double d0 = entityhuman.getX() - this.getX();
|
||||
double d1 = entityhuman.getY() - this.getY();
|
||||
double d2 = entityhuman.getZ() - this.getZ();
|
||||
@@ -467,7 +518,11 @@
|
||||
@@ -468,7 +519,11 @@
|
||||
|
||||
entityitem.setDeltaMovement(d0 * 0.1D, d1 * 0.1D + Math.sqrt(Math.sqrt(d0 * d0 + d1 * d1 + d2 * d2)) * 0.08D, d2 * 0.1D);
|
||||
this.level().addFreshEntity(entityitem);
|
||||
@@ -170,7 +170,7 @@
|
||||
if (itemstack1.is(TagsItem.FISHES)) {
|
||||
entityhuman.awardStat(StatisticList.FISH_CAUGHT, 1);
|
||||
}
|
||||
@@ -477,10 +532,27 @@
|
||||
@@ -478,10 +533,27 @@
|
||||
}
|
||||
|
||||
if (this.onGround()) {
|
||||
@@ -199,7 +199,7 @@
|
||||
return i;
|
||||
} else {
|
||||
return 0;
|
||||
@@ -513,8 +585,15 @@
|
||||
@@ -514,8 +586,15 @@
|
||||
|
||||
@Override
|
||||
public void remove(Entity.RemovalReason entity_removalreason) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/projectile/EntityLlamaSpit.java
|
||||
+++ b/net/minecraft/world/entity/projectile/EntityLlamaSpit.java
|
||||
@@ -14,6 +14,10 @@
|
||||
@@ -15,6 +15,10 @@
|
||||
import net.minecraft.world.phys.MovingObjectPositionEntity;
|
||||
import net.minecraft.world.phys.Vec3D;
|
||||
|
||||
@@ -11,17 +11,17 @@
|
||||
public class EntityLlamaSpit extends IProjectile {
|
||||
|
||||
public EntityLlamaSpit(EntityTypes<? extends EntityLlamaSpit> entitytypes, World world) {
|
||||
@@ -32,7 +36,7 @@
|
||||
@@ -38,7 +42,7 @@
|
||||
Vec3D vec3d = this.getDeltaMovement();
|
||||
MovingObjectPosition movingobjectposition = ProjectileHelper.getHitResultOnMoveVector(this, this::canHitEntity);
|
||||
|
||||
- this.onHit(movingobjectposition);
|
||||
+ this.preOnHit(movingobjectposition); // CraftBukkit - projectile hit event
|
||||
- this.hitTargetOrDeflectSelf(movingobjectposition);
|
||||
+ this.preHitTargetOrDeflectSelf(movingobjectposition); // CraftBukkit - projectile hit event
|
||||
double d0 = this.getX() + vec3d.x;
|
||||
double d1 = this.getY() + vec3d.y;
|
||||
double d2 = this.getZ() + vec3d.z;
|
||||
@@ -42,9 +46,9 @@
|
||||
float f1 = 0.06F;
|
||||
@@ -47,9 +51,9 @@
|
||||
float f = 0.99F;
|
||||
|
||||
if (this.level().getBlockStates(this.getBoundingBox()).noneMatch(BlockBase.BlockData::isAir)) {
|
||||
- this.discard();
|
||||
@@ -31,7 +31,7 @@
|
||||
+ this.discard(EntityRemoveEvent.Cause.DESPAWN); // CraftBukkit - add Bukkit remove cause
|
||||
} else {
|
||||
this.setDeltaMovement(vec3d.scale(0.9900000095367432D));
|
||||
if (!this.isNoGravity()) {
|
||||
this.applyGravity();
|
||||
@@ -72,7 +76,7 @@
|
||||
protected void onHitBlock(MovingObjectPositionBlock movingobjectpositionblock) {
|
||||
super.onHitBlock(movingobjectpositionblock);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/projectile/EntityPotion.java
|
||||
+++ b/net/minecraft/world/entity/projectile/EntityPotion.java
|
||||
@@ -31,6 +31,18 @@
|
||||
@@ -32,6 +32,18 @@
|
||||
import net.minecraft.world.phys.MovingObjectPositionBlock;
|
||||
import net.minecraft.world.phys.MovingObjectPositionEntity;
|
||||
|
||||
@@ -19,46 +19,46 @@
|
||||
public class EntityPotion extends EntityProjectileThrowable implements ItemSupplier {
|
||||
|
||||
public static final double SPLASH_RANGE = 4.0D;
|
||||
@@ -99,18 +111,18 @@
|
||||
@@ -96,18 +108,18 @@
|
||||
|
||||
if (flag) {
|
||||
if (potioncontents.is(Potions.WATER)) {
|
||||
this.applyWater();
|
||||
- } else if (!list.isEmpty()) {
|
||||
+ } else if (true || !list.isEmpty()) { // CraftBukkit - Call event even if no effects to apply
|
||||
- } else if (potioncontents.hasEffects()) {
|
||||
+ } else if (true || potioncontents.hasEffects()) { // CraftBukkit - Call event even if no effects to apply
|
||||
if (this.isLingering()) {
|
||||
- this.makeAreaOfEffectCloud(itemstack, potionregistry);
|
||||
+ this.makeAreaOfEffectCloud(itemstack, potionregistry, movingobjectposition); // CraftBukkit - Pass MovingObjectPosition
|
||||
- this.makeAreaOfEffectCloud(potioncontents);
|
||||
+ this.makeAreaOfEffectCloud(potioncontents, movingobjectposition); // CraftBukkit - Pass MovingObjectPosition
|
||||
} else {
|
||||
- this.applySplash(list, movingobjectposition.getType() == MovingObjectPosition.EnumMovingObjectType.ENTITY ? ((MovingObjectPositionEntity) movingobjectposition).getEntity() : null);
|
||||
+ this.applySplash(list, movingobjectposition.getType() == MovingObjectPosition.EnumMovingObjectType.ENTITY ? ((MovingObjectPositionEntity) movingobjectposition).getEntity() : null, movingobjectposition); // CraftBukkit - Pass MovingObjectPosition
|
||||
- this.applySplash(potioncontents.getAllEffects(), movingobjectposition.getType() == MovingObjectPosition.EnumMovingObjectType.ENTITY ? ((MovingObjectPositionEntity) movingobjectposition).getEntity() : null);
|
||||
+ this.applySplash(potioncontents.getAllEffects(), movingobjectposition.getType() == MovingObjectPosition.EnumMovingObjectType.ENTITY ? ((MovingObjectPositionEntity) movingobjectposition).getEntity() : null, movingobjectposition); // CraftBukkit - Pass MovingObjectPosition
|
||||
}
|
||||
}
|
||||
|
||||
int i = potionregistry.hasInstantEffects() ? 2007 : 2002;
|
||||
int i = potioncontents.potion().isPresent() && ((PotionRegistry) ((Holder) potioncontents.potion().get()).value()).hasInstantEffects() ? 2007 : 2002;
|
||||
|
||||
this.level().levelEvent(i, this.blockPosition(), PotionUtil.getColor(itemstack));
|
||||
this.level().levelEvent(i, this.blockPosition(), potioncontents.getColor());
|
||||
- this.discard();
|
||||
+ this.discard(EntityRemoveEvent.Cause.HIT); // CraftBukkit - add Bukkit remove cause
|
||||
}
|
||||
}
|
||||
|
||||
@@ -145,9 +157,10 @@
|
||||
@@ -142,9 +154,10 @@
|
||||
|
||||
}
|
||||
|
||||
- private void applySplash(List<MobEffect> list, @Nullable Entity entity) {
|
||||
+ private void applySplash(List<MobEffect> list, @Nullable Entity entity, MovingObjectPosition position) { // CraftBukkit - Pass MovingObjectPosition
|
||||
- private void applySplash(Iterable<MobEffect> iterable, @Nullable Entity entity) {
|
||||
+ private void applySplash(Iterable<MobEffect> iterable, @Nullable Entity entity, MovingObjectPosition position) { // CraftBukkit - Pass MovingObjectPosition
|
||||
AxisAlignedBB axisalignedbb = this.getBoundingBox().inflate(4.0D, 2.0D, 4.0D);
|
||||
List<EntityLiving> list1 = this.level().getEntitiesOfClass(EntityLiving.class, axisalignedbb);
|
||||
List<EntityLiving> list = this.level().getEntitiesOfClass(EntityLiving.class, axisalignedbb);
|
||||
+ Map<LivingEntity, Double> affected = new HashMap<LivingEntity, Double>(); // CraftBukkit
|
||||
|
||||
if (!list1.isEmpty()) {
|
||||
if (!list.isEmpty()) {
|
||||
Entity entity1 = this.getEffectSource();
|
||||
@@ -168,24 +181,49 @@
|
||||
@@ -165,24 +178,50 @@
|
||||
d1 = 1.0D - Math.sqrt(d0) / 4.0D;
|
||||
}
|
||||
|
||||
- Iterator iterator1 = list.iterator();
|
||||
- Iterator iterator1 = iterable.iterator();
|
||||
+ // CraftBukkit start
|
||||
+ affected.put((LivingEntity) entityliving.getBukkitEntity(), d1);
|
||||
+ }
|
||||
@@ -68,7 +68,7 @@
|
||||
|
||||
- while (iterator1.hasNext()) {
|
||||
- MobEffect mobeffect = (MobEffect) iterator1.next();
|
||||
- MobEffectList mobeffectlist = mobeffect.getEffect();
|
||||
- Holder<MobEffectList> holder = mobeffect.getEffect();
|
||||
+ org.bukkit.event.entity.PotionSplashEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callPotionSplashEvent(this, position, affected);
|
||||
+ if (!event.isCancelled() && list != null && !list.isEmpty()) { // do not process effects if there are no effects to process
|
||||
+ Entity entity1 = this.getEffectSource();
|
||||
@@ -77,13 +77,13 @@
|
||||
+ continue;
|
||||
+ }
|
||||
|
||||
- if (mobeffectlist.isInstantenous()) {
|
||||
- mobeffectlist.applyInstantenousEffect(this, this.getOwner(), entityliving, mobeffect.getAmplifier(), d1);
|
||||
- if (((MobEffectList) holder.value()).isInstantenous()) {
|
||||
- ((MobEffectList) holder.value()).applyInstantenousEffect(this, this.getOwner(), entityliving, mobeffect.getAmplifier(), d1);
|
||||
- } else {
|
||||
- int i = mobeffect.mapDuration((j) -> {
|
||||
- return (int) (d1 * (double) j + 0.5D);
|
||||
- });
|
||||
- MobEffect mobeffect1 = new MobEffect(mobeffectlist, i, mobeffect.getAmplifier(), mobeffect.isAmbient(), mobeffect.isVisible());
|
||||
- MobEffect mobeffect1 = new MobEffect(holder, i, mobeffect.getAmplifier(), mobeffect.isAmbient(), mobeffect.isVisible());
|
||||
+ EntityLiving entityliving = ((CraftLivingEntity) victim).getHandle();
|
||||
+ double d1 = event.getIntensity(victim);
|
||||
+ // CraftBukkit end
|
||||
@@ -92,13 +92,14 @@
|
||||
- entityliving.addEffect(mobeffect1, entity1);
|
||||
- }
|
||||
- }
|
||||
+ Iterator iterator1 = list.iterator();
|
||||
+ Iterator iterator1 = iterable.iterator();
|
||||
+
|
||||
+ while (iterator1.hasNext()) {
|
||||
+ MobEffect mobeffect = (MobEffect) iterator1.next();
|
||||
+ MobEffectList mobeffectlist = mobeffect.getEffect();
|
||||
+ Holder<MobEffectList> holder = mobeffect.getEffect();
|
||||
+ // CraftBukkit start - Abide by PVP settings - for players only!
|
||||
+ if (!this.level().pvpMode && this.getOwner() instanceof EntityPlayer && entityliving instanceof EntityPlayer && entityliving != this.getOwner()) {
|
||||
+ MobEffectList mobeffectlist = (MobEffectList) holder.value();
|
||||
+ if (mobeffectlist == MobEffects.MOVEMENT_SLOWDOWN || mobeffectlist == MobEffects.DIG_SLOWDOWN || mobeffectlist == MobEffects.HARM || mobeffectlist == MobEffects.BLINDNESS
|
||||
+ || mobeffectlist == MobEffects.HUNGER || mobeffectlist == MobEffects.WEAKNESS || mobeffectlist == MobEffects.POISON) {
|
||||
+ continue;
|
||||
@@ -106,32 +107,32 @@
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
+
|
||||
+ if (mobeffectlist.isInstantenous()) {
|
||||
+ mobeffectlist.applyInstantenousEffect(this, this.getOwner(), entityliving, mobeffect.getAmplifier(), d1);
|
||||
+ if (((MobEffectList) holder.value()).isInstantenous()) {
|
||||
+ ((MobEffectList) holder.value()).applyInstantenousEffect(this, this.getOwner(), entityliving, mobeffect.getAmplifier(), d1);
|
||||
+ } else {
|
||||
+ int i = mobeffect.mapDuration((j) -> {
|
||||
+ return (int) (d1 * (double) j + 0.5D);
|
||||
+ });
|
||||
+ MobEffect mobeffect1 = new MobEffect(mobeffectlist, i, mobeffect.getAmplifier(), mobeffect.isAmbient(), mobeffect.isVisible());
|
||||
+ MobEffect mobeffect1 = new MobEffect(holder, i, mobeffect.getAmplifier(), mobeffect.isAmbient(), mobeffect.isVisible());
|
||||
+
|
||||
+ if (!mobeffect1.endsWithin(20)) {
|
||||
+ entityliving.addEffect(mobeffect1, entity1, org.bukkit.event.entity.EntityPotionEffectEvent.Cause.POTION_SPLASH); // CraftBukkit
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -194,7 +232,7 @@
|
||||
@@ -191,7 +230,7 @@
|
||||
|
||||
}
|
||||
|
||||
- private void makeAreaOfEffectCloud(ItemStack itemstack, PotionRegistry potionregistry) {
|
||||
+ private void makeAreaOfEffectCloud(ItemStack itemstack, PotionRegistry potionregistry, MovingObjectPosition position) { // CraftBukkit - Pass MovingObjectPosition
|
||||
- private void makeAreaOfEffectCloud(PotionContents potioncontents) {
|
||||
+ private void makeAreaOfEffectCloud(PotionContents potioncontents, MovingObjectPosition position) { // CraftBukkit - Pass MovingObjectPosition
|
||||
EntityAreaEffectCloud entityareaeffectcloud = new EntityAreaEffectCloud(this.level(), this.getX(), this.getY(), this.getZ());
|
||||
Entity entity = this.getOwner();
|
||||
|
||||
@@ -221,7 +259,14 @@
|
||||
entityareaeffectcloud.setFixedColor(nbttagcompound.getInt("CustomPotionColor"));
|
||||
}
|
||||
|
||||
@@ -204,7 +243,14 @@
|
||||
entityareaeffectcloud.setWaitTime(10);
|
||||
entityareaeffectcloud.setRadiusPerTick(-entityareaeffectcloud.getRadius() / (float) entityareaeffectcloud.getDuration());
|
||||
entityareaeffectcloud.setPotionContents(potioncontents);
|
||||
- this.level().addFreshEntity(entityareaeffectcloud);
|
||||
+ // CraftBukkit start
|
||||
+ org.bukkit.event.entity.LingeringPotionSplashEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callLingeringPotionSplashEvent(this, position, entityareaeffectcloud);
|
||||
@@ -144,7 +145,7 @@
|
||||
}
|
||||
|
||||
public boolean isLingering() {
|
||||
@@ -232,13 +277,25 @@
|
||||
@@ -215,13 +261,25 @@
|
||||
IBlockData iblockdata = this.level().getBlockState(blockposition);
|
||||
|
||||
if (iblockdata.is(TagsBlock.FIRE)) {
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
}
|
||||
|
||||
if (movingobjectposition.getType() != MovingObjectPosition.EnumMovingObjectType.MISS && !flag) {
|
||||
- this.onHit(movingobjectposition);
|
||||
+ this.preOnHit(movingobjectposition); // CraftBukkit - projectile hit event
|
||||
- this.hitTargetOrDeflectSelf(movingobjectposition);
|
||||
+ this.preHitTargetOrDeflectSelf(movingobjectposition); // CraftBukkit - projectile hit event
|
||||
}
|
||||
|
||||
this.checkInsideBlocks();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/projectile/EntityProjectileThrowable.java
|
||||
+++ b/net/minecraft/world/entity/projectile/EntityProjectileThrowable.java
|
||||
@@ -35,6 +35,12 @@
|
||||
@@ -32,6 +32,12 @@
|
||||
|
||||
protected abstract Item getDefaultItem();
|
||||
|
||||
@@ -10,6 +10,6 @@
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
+
|
||||
public ItemStack getItemRaw() {
|
||||
@Override
|
||||
public ItemStack getItem() {
|
||||
return (ItemStack) this.getEntityData().get(EntityProjectileThrowable.DATA_ITEM_STACK);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/projectile/EntityShulkerBullet.java
|
||||
+++ b/net/minecraft/world/entity/projectile/EntityShulkerBullet.java
|
||||
@@ -29,6 +29,10 @@
|
||||
@@ -31,6 +31,10 @@
|
||||
import net.minecraft.world.phys.MovingObjectPositionEntity;
|
||||
import net.minecraft.world.phys.Vec3D;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
public class EntityShulkerBullet extends IProjectile {
|
||||
|
||||
private static final double SPEED = 0.15D;
|
||||
@@ -60,8 +64,21 @@
|
||||
@@ -59,8 +63,21 @@
|
||||
this.finalTarget = entity;
|
||||
this.currentMoveDirection = EnumDirection.UP;
|
||||
this.selectNextMoveDirection(enumdirection_enumaxis);
|
||||
@@ -33,7 +33,7 @@
|
||||
@Override
|
||||
public SoundCategory getSoundSource() {
|
||||
return SoundCategory.HOSTILE;
|
||||
@@ -194,7 +211,7 @@
|
||||
@@ -193,7 +210,7 @@
|
||||
@Override
|
||||
public void checkDespawn() {
|
||||
if (this.level().getDifficulty() == EnumDifficulty.PEACEFUL) {
|
||||
@@ -42,16 +42,16 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -225,7 +242,7 @@
|
||||
@@ -229,7 +246,7 @@
|
||||
MovingObjectPosition movingobjectposition = ProjectileHelper.getHitResultOnMoveVector(this, this::canHitEntity);
|
||||
|
||||
if (movingobjectposition.getType() != MovingObjectPosition.EnumMovingObjectType.MISS) {
|
||||
- this.onHit(movingobjectposition);
|
||||
+ this.preOnHit(movingobjectposition); // CraftBukkit - projectile hit event
|
||||
- this.hitTargetOrDeflectSelf(movingobjectposition);
|
||||
+ this.preHitTargetOrDeflectSelf(movingobjectposition); // CraftBukkit - projectile hit event
|
||||
}
|
||||
}
|
||||
|
||||
@@ -294,7 +311,7 @@
|
||||
@@ -298,7 +315,7 @@
|
||||
if (entity instanceof EntityLiving) {
|
||||
EntityLiving entityliving1 = (EntityLiving) entity;
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -308,14 +325,20 @@
|
||||
@@ -312,14 +329,20 @@
|
||||
}
|
||||
|
||||
private void destroy() {
|
||||
@@ -72,7 +72,7 @@
|
||||
+ private void destroy(EntityRemoveEvent.Cause cause) {
|
||||
+ this.discard(cause);
|
||||
+ // CraftBukkit end
|
||||
this.level().gameEvent(GameEvent.ENTITY_DAMAGE, this.position(), GameEvent.a.of((Entity) this));
|
||||
this.level().gameEvent((Holder) GameEvent.ENTITY_DAMAGE, this.position(), GameEvent.a.of((Entity) this));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -83,7 +83,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -325,10 +348,15 @@
|
||||
@@ -329,10 +352,15 @@
|
||||
|
||||
@Override
|
||||
public boolean hurt(DamageSource damagesource, float f) {
|
||||
|
||||
@@ -28,13 +28,13 @@
|
||||
Entity entity1 = this.getOwner();
|
||||
int i = entity.getRemainingFireTicks();
|
||||
|
||||
- entity.setSecondsOnFire(5);
|
||||
- entity.igniteForSeconds(5);
|
||||
+ // CraftBukkit start - Entity damage by entity event + combust event
|
||||
+ EntityCombustByEntityEvent event = new EntityCombustByEntityEvent((org.bukkit.entity.Projectile) this.getBukkitEntity(), entity.getBukkitEntity(), 5);
|
||||
+ entity.level().getCraftServer().getPluginManager().callEvent(event);
|
||||
+
|
||||
+ if (!event.isCancelled()) {
|
||||
+ entity.setSecondsOnFire(event.getDuration(), false);
|
||||
+ entity.igniteForSeconds(event.getDuration(), false);
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
if (!entity.hurt(this.damageSources().fireball(this, entity1), 5.0F)) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/projectile/EntitySpectralArrow.java
|
||||
+++ b/net/minecraft/world/entity/projectile/EntitySpectralArrow.java
|
||||
@@ -41,7 +41,7 @@
|
||||
@@ -40,7 +40,7 @@
|
||||
super.doPostHurtEffects(entityliving);
|
||||
MobEffect mobeffect = new MobEffect(MobEffects.GLOWING, this.duration, 0);
|
||||
|
||||
|
||||
@@ -15,16 +15,16 @@
|
||||
protected void onHit(MovingObjectPosition movingobjectposition) {
|
||||
super.onHit(movingobjectposition);
|
||||
if (this.level() instanceof WorldServer) {
|
||||
- this.level().levelEvent(2002, this.blockPosition(), PotionUtil.getColor(Potions.WATER));
|
||||
- this.level().levelEvent(2002, this.blockPosition(), PotionContents.getColor(Potions.WATER));
|
||||
+ // CraftBukkit - moved to after event
|
||||
+ // this.level().levelEvent(2002, this.blockPosition(), PotionUtil.getColor(Potions.WATER));
|
||||
+ // this.level().levelEvent(2002, this.blockPosition(), PotionContents.getColor(Potions.WATER));
|
||||
int i = 3 + this.level().random.nextInt(5) + this.level().random.nextInt(5);
|
||||
|
||||
+ // CraftBukkit start
|
||||
+ org.bukkit.event.entity.ExpBottleEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callExpBottleEvent(this, movingobjectposition, i);
|
||||
+ i = event.getExperience();
|
||||
+ if (event.getShowEffect()) {
|
||||
+ this.level().levelEvent(2002, this.blockPosition(), PotionUtil.getColor(Potions.WATER));
|
||||
+ this.level().levelEvent(2002, this.blockPosition(), PotionContents.getColor(Potions.WATER));
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
+
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/projectile/EntityThrownTrident.java
|
||||
+++ b/net/minecraft/world/entity/projectile/EntityThrownTrident.java
|
||||
@@ -24,6 +24,10 @@
|
||||
@@ -23,6 +23,10 @@
|
||||
import net.minecraft.world.phys.MovingObjectPositionEntity;
|
||||
import net.minecraft.world.phys.Vec3D;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
public class EntityThrownTrident extends EntityArrow {
|
||||
|
||||
private static final DataWatcherObject<Byte> ID_LOYALTY = DataWatcher.defineId(EntityThrownTrident.class, DataWatcherRegistry.BYTE);
|
||||
@@ -64,7 +68,7 @@
|
||||
@@ -68,7 +72,7 @@
|
||||
this.spawnAtLocation(this.getPickupItem(), 0.1F);
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
} else {
|
||||
this.setNoPhysics(true);
|
||||
Vec3D vec3d = entity.getEyePosition().subtract(this.position());
|
||||
@@ -153,7 +157,7 @@
|
||||
@@ -152,7 +156,7 @@
|
||||
if (entitylightning != null) {
|
||||
entitylightning.moveTo(Vec3D.atBottomCenterOf(blockposition));
|
||||
entitylightning.setCause(entity1 instanceof EntityPlayer ? (EntityPlayer) entity1 : null);
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
--- a/net/minecraft/world/entity/projectile/EntityTippedArrow.java
|
||||
+++ b/net/minecraft/world/entity/projectile/EntityTippedArrow.java
|
||||
@@ -213,7 +213,7 @@
|
||||
mobeffect = (MobEffect) iterator.next();
|
||||
entityliving.addEffect(new MobEffect(mobeffect.getEffect(), Math.max(mobeffect.mapDuration((i) -> {
|
||||
return i / 8;
|
||||
- }), 1), mobeffect.getAmplifier(), mobeffect.isAmbient(), mobeffect.isVisible()), entity);
|
||||
+ }), 1), mobeffect.getAmplifier(), mobeffect.isAmbient(), mobeffect.isVisible()), entity, org.bukkit.event.entity.EntityPotionEffectEvent.Cause.ARROW); // CraftBukkit
|
||||
}
|
||||
|
||||
if (!this.effects.isEmpty()) {
|
||||
@@ -221,7 +221,7 @@
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
@@ -118,7 +118,7 @@
|
||||
mobeffect = (MobEffect) iterator.next();
|
||||
- entityliving.addEffect(mobeffect, entity);
|
||||
+ entityliving.addEffect(mobeffect, entity, org.bukkit.event.entity.EntityPotionEffectEvent.Cause.ARROW); // CraftBukkit
|
||||
entityliving.addEffect(new MobEffect(mobeffect.getEffect(), Math.max(mobeffect.mapDuration((i) -> {
|
||||
return i / 8;
|
||||
- }), 1), mobeffect.getAmplifier(), mobeffect.isAmbient(), mobeffect.isVisible()), entity);
|
||||
+ }), 1), mobeffect.getAmplifier(), mobeffect.isAmbient(), mobeffect.isVisible()), entity, org.bukkit.event.entity.EntityPotionEffectEvent.Cause.ARROW); // CraftBukkit
|
||||
}
|
||||
}
|
||||
|
||||
@@ -126,7 +126,7 @@
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
mobeffect = (MobEffect) iterator.next();
|
||||
- entityliving.addEffect(mobeffect, entity);
|
||||
+ entityliving.addEffect(mobeffect, entity, org.bukkit.event.entity.EntityPotionEffectEvent.Cause.ARROW); // CraftBukkit
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/projectile/IProjectile.java
|
||||
+++ b/net/minecraft/world/entity/projectile/IProjectile.java
|
||||
@@ -25,6 +25,10 @@
|
||||
@@ -26,6 +26,10 @@
|
||||
import net.minecraft.world.phys.MovingObjectPositionEntity;
|
||||
import net.minecraft.world.phys.Vec3D;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
public abstract class IProjectile extends Entity implements TraceableEntity {
|
||||
|
||||
@Nullable
|
||||
@@ -34,6 +38,10 @@
|
||||
@@ -35,6 +39,10 @@
|
||||
private boolean leftOwner;
|
||||
private boolean hasBeenShot;
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
IProjectile(EntityTypes<? extends IProjectile> entitytypes, World world) {
|
||||
super(entitytypes, world);
|
||||
}
|
||||
@@ -43,6 +51,7 @@
|
||||
@@ -44,6 +52,7 @@
|
||||
this.ownerUUID = entity.getUUID();
|
||||
this.cachedOwner = entity;
|
||||
}
|
||||
@@ -30,24 +30,25 @@
|
||||
|
||||
}
|
||||
|
||||
@@ -167,6 +176,16 @@
|
||||
@@ -170,6 +179,17 @@
|
||||
this.setDeltaMovement(this.getDeltaMovement().add(vec3d.x, entity.onGround() ? 0.0D : vec3d.y, vec3d.z));
|
||||
}
|
||||
|
||||
+ // CraftBukkit start - call projectile hit event
|
||||
+ protected void preOnHit(MovingObjectPosition movingobjectposition) {
|
||||
+ protected ProjectileDeflection preHitTargetOrDeflectSelf(MovingObjectPosition movingobjectposition) {
|
||||
+ org.bukkit.event.entity.ProjectileHitEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callProjectileHitEvent(this, movingobjectposition);
|
||||
+ this.hitCancelled = event != null && event.isCancelled();
|
||||
+ if (movingobjectposition.getType() == MovingObjectPosition.EnumMovingObjectType.BLOCK || !this.hitCancelled) {
|
||||
+ this.onHit(movingobjectposition);
|
||||
+ return this.hitTargetOrDeflectSelf(movingobjectposition);
|
||||
+ }
|
||||
+ return ProjectileDeflection.NONE;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
+
|
||||
protected void onHit(MovingObjectPosition movingobjectposition) {
|
||||
MovingObjectPosition.EnumMovingObjectType movingobjectposition_enummovingobjecttype = movingobjectposition.getType();
|
||||
|
||||
@@ -187,6 +206,11 @@
|
||||
protected ProjectileDeflection hitTargetOrDeflectSelf(MovingObjectPosition movingobjectposition) {
|
||||
if (movingobjectposition.getType() == MovingObjectPosition.EnumMovingObjectType.ENTITY) {
|
||||
MovingObjectPositionEntity movingobjectpositionentity = (MovingObjectPositionEntity) movingobjectposition;
|
||||
@@ -225,6 +245,11 @@
|
||||
protected void onHitEntity(MovingObjectPositionEntity movingobjectpositionentity) {}
|
||||
|
||||
protected void onHitBlock(MovingObjectPositionBlock movingobjectpositionblock) {
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
--- a/net/minecraft/world/entity/projectile/WindCharge.java
|
||||
+++ b/net/minecraft/world/entity/projectile/WindCharge.java
|
||||
@@ -22,6 +22,10 @@
|
||||
import net.minecraft.world.phys.MovingObjectPositionBlock;
|
||||
import net.minecraft.world.phys.MovingObjectPositionEntity;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import org.bukkit.event.entity.EntityRemoveEvent;
|
||||
+// CraftBukkit end
|
||||
+
|
||||
public class WindCharge extends EntityFireball implements ItemSupplier {
|
||||
|
||||
public static final WindCharge.a EXPLOSION_DAMAGE_CALCULATOR = new WindCharge.a();
|
||||
@@ -81,7 +85,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- private void explode() {
|
||||
+ public void explode() { // PAIL private -> public
|
||||
this.level().explode(this, (DamageSource) null, WindCharge.EXPLOSION_DAMAGE_CALCULATOR, this.getX(), this.getY(), this.getZ(), (float) (3.0D + this.random.nextDouble()), false, World.a.BLOW, Particles.GUST, Particles.GUST_EMITTER, SoundEffects.WIND_BURST);
|
||||
}
|
||||
|
||||
@@ -89,14 +93,14 @@
|
||||
protected void onHitBlock(MovingObjectPositionBlock movingobjectpositionblock) {
|
||||
super.onHitBlock(movingobjectpositionblock);
|
||||
this.explode();
|
||||
- this.discard();
|
||||
+ this.discard(EntityRemoveEvent.Cause.HIT); // CraftBukkit - add Bukkit remove cause
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onHit(MovingObjectPosition movingobjectposition) {
|
||||
super.onHit(movingobjectposition);
|
||||
if (!this.level().isClientSide) {
|
||||
- this.discard();
|
||||
+ this.discard(EntityRemoveEvent.Cause.HIT); // CraftBukkit - add Bukkit remove cause
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
--- a/net/minecraft/world/entity/projectile/windcharge/AbstractWindCharge.java
|
||||
+++ b/net/minecraft/world/entity/projectile/windcharge/AbstractWindCharge.java
|
||||
@@ -22,6 +22,10 @@
|
||||
import net.minecraft.world.phys.MovingObjectPositionBlock;
|
||||
import net.minecraft.world.phys.MovingObjectPositionEntity;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import org.bukkit.event.entity.EntityRemoveEvent;
|
||||
+// CraftBukkit end
|
||||
+
|
||||
public abstract class AbstractWindCharge extends EntityFireball implements ItemSupplier {
|
||||
|
||||
public static final AbstractWindCharge.a EXPLOSION_DAMAGE_CALCULATOR = new AbstractWindCharge.a();
|
||||
@@ -95,7 +99,7 @@
|
||||
super.onHitBlock(movingobjectpositionblock);
|
||||
if (!this.level().isClientSide) {
|
||||
this.explode();
|
||||
- this.discard();
|
||||
+ this.discard(EntityRemoveEvent.Cause.HIT); // CraftBukkit - add Bukkit remove cause
|
||||
}
|
||||
|
||||
}
|
||||
@@ -104,7 +108,7 @@
|
||||
protected void onHit(MovingObjectPosition movingobjectposition) {
|
||||
super.onHit(movingobjectposition);
|
||||
if (!this.level().isClientSide) {
|
||||
- this.discard();
|
||||
+ this.discard(EntityRemoveEvent.Cause.HIT); // CraftBukkit - add Bukkit remove cause
|
||||
}
|
||||
|
||||
}
|
||||
@@ -139,7 +143,7 @@
|
||||
public void tick() {
|
||||
if (!this.level().isClientSide && this.getBlockY() > this.level().getMaxBuildHeight() + 30) {
|
||||
this.explode();
|
||||
- this.discard();
|
||||
+ this.discard(EntityRemoveEvent.Cause.OUT_OF_WORLD); // CraftBukkit - add Bukkit remove cause
|
||||
} else {
|
||||
super.tick();
|
||||
}
|
||||
Reference in New Issue
Block a user