@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/projectile/EntityArrow.java
|
||||
+++ b/net/minecraft/world/entity/projectile/EntityArrow.java
|
||||
@@ -49,6 +49,13 @@
|
||||
@@ -52,6 +52,13 @@
|
||||
import net.minecraft.world.phys.Vec3D;
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
public abstract class EntityArrow extends IProjectile {
|
||||
|
||||
private static final double ARROW_BASE_DAMAGE = 2.0D;
|
||||
@@ -225,7 +232,7 @@
|
||||
@@ -242,7 +249,7 @@
|
||||
}
|
||||
|
||||
if (object != null && !flag) {
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
this.hasImpulse = true;
|
||||
if (projectiledeflection != ProjectileDeflection.NONE) {
|
||||
@@ -316,7 +323,7 @@
|
||||
@@ -333,7 +340,7 @@
|
||||
protected void tickDespawn() {
|
||||
++this.life;
|
||||
if (this.life >= 1200) {
|
||||
@@ -32,7 +32,7 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -349,7 +356,7 @@
|
||||
@@ -380,7 +387,7 @@
|
||||
}
|
||||
|
||||
if (this.piercingIgnoreEntityIds.size() >= this.getPierceLevel() + 1) {
|
||||
@@ -41,13 +41,13 @@
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -378,7 +385,13 @@
|
||||
@@ -401,7 +408,13 @@
|
||||
int k = entity.getRemainingFireTicks();
|
||||
|
||||
if (this.isOnFire() && !flag) {
|
||||
- entity.igniteForSeconds(5);
|
||||
- entity.igniteForSeconds(5.0F);
|
||||
+ // CraftBukkit start
|
||||
+ EntityCombustByEntityEvent combustEvent = new EntityCombustByEntityEvent(this.getBukkitEntity(), entity.getBukkitEntity(), 5);
|
||||
+ EntityCombustByEntityEvent combustEvent = new EntityCombustByEntityEvent(this.getBukkitEntity(), entity.getBukkitEntity(), 5.0F);
|
||||
+ org.bukkit.Bukkit.getPluginManager().callEvent(combustEvent);
|
||||
+ if (!combustEvent.isCancelled()) {
|
||||
+ entity.igniteForSeconds(combustEvent.getDuration(), false);
|
||||
@@ -56,7 +56,7 @@
|
||||
}
|
||||
|
||||
if (entity.hurt(damagesource, (float) i)) {
|
||||
@@ -429,7 +442,7 @@
|
||||
@@ -447,7 +460,7 @@
|
||||
|
||||
this.playSound(this.soundEvent, 1.0F, 1.2F / (this.random.nextFloat() * 0.2F + 0.9F));
|
||||
if (this.getPierceLevel() <= 0) {
|
||||
@@ -65,7 +65,7 @@
|
||||
}
|
||||
} else {
|
||||
entity.setRemainingFireTicks(k);
|
||||
@@ -440,7 +453,7 @@
|
||||
@@ -458,7 +471,7 @@
|
||||
this.spawnAtLocation(this.getPickupItem(), 0.1F);
|
||||
}
|
||||
|
||||
@@ -74,7 +74,56 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -547,9 +560,24 @@
|
||||
@@ -614,7 +627,7 @@
|
||||
}
|
||||
|
||||
if (nbttagcompound.contains("weapon", 10)) {
|
||||
- this.firedFromWeapon = (ItemStack) ItemStack.parse(this.registryAccess(), nbttagcompound.getCompound("weapon")).orElse((Object) null);
|
||||
+ this.firedFromWeapon = (ItemStack) ItemStack.parse(this.registryAccess(), nbttagcompound.getCompound("weapon")).orElse(null); // CraftBukkit - decompile error
|
||||
} else {
|
||||
this.firedFromWeapon = null;
|
||||
}
|
||||
@@ -630,17 +643,10 @@
|
||||
EntityArrow.PickupStatus entityarrow_pickupstatus;
|
||||
|
||||
label16:
|
||||
- while(true) {
|
||||
- //$FF: b0->value
|
||||
- //0->net/minecraft/world/entity/player/EntityHuman
|
||||
- //1->net/minecraft/world/entity/OminousItemSpawner
|
||||
- switch (entity1.typeSwitch<invokedynamic>(entity1, b0)) {
|
||||
- case -1:
|
||||
- default:
|
||||
- entityarrow_pickupstatus = this.pickup;
|
||||
- break label16;
|
||||
- case 0:
|
||||
- EntityHuman entityhuman = (EntityHuman)entity1;
|
||||
+ // CraftBukkit start - decompile error
|
||||
+ while (true) {
|
||||
+ switch (entity1) {
|
||||
+ case EntityHuman entityhuman:
|
||||
|
||||
if (this.pickup != EntityArrow.PickupStatus.DISALLOWED) {
|
||||
b0 = 1;
|
||||
@@ -649,12 +655,15 @@
|
||||
|
||||
entityarrow_pickupstatus = EntityArrow.PickupStatus.ALLOWED;
|
||||
break label16;
|
||||
- case 1:
|
||||
- OminousItemSpawner ominousitemspawner = (OminousItemSpawner)entity1;
|
||||
+ case OminousItemSpawner ominousitemspawner:
|
||||
|
||||
entityarrow_pickupstatus = EntityArrow.PickupStatus.DISALLOWED;
|
||||
break label16;
|
||||
+ default:
|
||||
+ entityarrow_pickupstatus = this.pickup;
|
||||
+ break label16;
|
||||
}
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
|
||||
this.pickup = entityarrow_pickupstatus;
|
||||
@@ -663,9 +672,24 @@
|
||||
@Override
|
||||
public void playerTouch(EntityHuman entityhuman) {
|
||||
if (!this.level().isClientSide && (this.inGround || this.isNoPhysics()) && this.shakeTime <= 0) {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
--- a/net/minecraft/world/entity/projectile/EntityDragonFireball.java
|
||||
+++ b/net/minecraft/world/entity/projectile/EntityDragonFireball.java
|
||||
@@ -15,6 +15,10 @@
|
||||
import net.minecraft.world.phys.MovingObjectPosition;
|
||||
@@ -16,6 +16,10 @@
|
||||
import net.minecraft.world.phys.MovingObjectPositionEntity;
|
||||
import net.minecraft.world.phys.Vec3D;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import org.bukkit.event.entity.EntityRemoveEvent;
|
||||
@@ -11,7 +11,7 @@
|
||||
public class EntityDragonFireball extends EntityFireball {
|
||||
|
||||
public static final float SPLASH_RANGE = 4.0F;
|
||||
@@ -61,7 +65,7 @@
|
||||
@@ -62,7 +66,7 @@
|
||||
|
||||
this.level().levelEvent(2006, this.blockPosition(), this.isSilent() ? -1 : 1);
|
||||
this.level().addFreshEntity(entityareaeffectcloud);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/projectile/EntityEgg.java
|
||||
+++ b/net/minecraft/world/entity/projectile/EntityEgg.java
|
||||
@@ -11,6 +11,16 @@
|
||||
@@ -12,6 +12,16 @@
|
||||
import net.minecraft.world.phys.MovingObjectPosition;
|
||||
import net.minecraft.world.phys.MovingObjectPositionEntity;
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
+
|
||||
public class EntityEgg extends EntityProjectileThrowable {
|
||||
|
||||
public EntityEgg(EntityTypes<? extends EntityEgg> entitytypes, World world) {
|
||||
@@ -47,26 +57,53 @@
|
||||
private static final EntitySize ZERO_SIZED_DIMENSIONS = EntitySize.fixed(0.0F, 0.0F);
|
||||
@@ -50,30 +60,58 @@
|
||||
protected void onHit(MovingObjectPosition movingobjectposition) {
|
||||
super.onHit(movingobjectposition);
|
||||
if (!this.level().isClientSide) {
|
||||
@@ -59,14 +59,18 @@
|
||||
|
||||
if (entitychicken != null) {
|
||||
- entitychicken.setAge(-24000);
|
||||
- entitychicken.moveTo(this.getX(), this.getY(), this.getZ(), this.getYRot(), 0.0F);
|
||||
- this.level().addFreshEntity(entitychicken);
|
||||
+ // CraftBukkit start
|
||||
+ if (entitychicken.getBukkitEntity() instanceof Ageable) {
|
||||
+ ((Ageable) entitychicken.getBukkitEntity()).setBaby();
|
||||
+ }
|
||||
+ this.level().addFreshEntity(entitychicken, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.EGG);
|
||||
+ // CraftBukkit end
|
||||
entitychicken.moveTo(this.getX(), this.getY(), this.getZ(), this.getYRot(), 0.0F);
|
||||
if (!entitychicken.fudgePositionAfterSizeChange(EntityEgg.ZERO_SIZED_DIMENSIONS)) {
|
||||
break;
|
||||
}
|
||||
|
||||
- this.level().addFreshEntity(entitychicken);
|
||||
+ this.level().addFreshEntity(entitychicken, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.EGG); // CraftBukkit
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
--- a/net/minecraft/world/entity/projectile/EntityEnderPearl.java
|
||||
+++ b/net/minecraft/world/entity/projectile/EntityEnderPearl.java
|
||||
@@ -18,6 +18,13 @@
|
||||
import net.minecraft.world.phys.MovingObjectPosition;
|
||||
@@ -21,6 +21,13 @@
|
||||
import net.minecraft.world.phys.MovingObjectPositionEntity;
|
||||
import net.minecraft.world.phys.Vec3D;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import org.bukkit.Bukkit;
|
||||
+import net.minecraft.world.level.dimension.WorldDimension;
|
||||
+import org.bukkit.event.entity.CreatureSpawnEvent;
|
||||
+import org.bukkit.event.entity.EntityRemoveEvent;
|
||||
+import org.bukkit.event.player.PlayerTeleportEvent;
|
||||
@@ -14,64 +14,51 @@
|
||||
public class EntityEnderPearl extends EntityProjectileThrowable {
|
||||
|
||||
public EntityEnderPearl(EntityTypes<? extends EntityEnderPearl> entitytypes, World world) {
|
||||
@@ -54,23 +61,34 @@
|
||||
EntityPlayer entityplayer = (EntityPlayer) entity;
|
||||
@@ -65,19 +72,26 @@
|
||||
EntityPlayer entityplayer = (EntityPlayer) entity;
|
||||
|
||||
if (entityplayer.connection.isAcceptingMessages() && entityplayer.level() == this.level() && !entityplayer.isSleeping()) {
|
||||
- if (this.random.nextFloat() < 0.05F && this.level().getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING)) {
|
||||
- EntityEndermite entityendermite = (EntityEndermite) EntityTypes.ENDERMITE.create(this.level());
|
||||
+ // CraftBukkit start - Fire PlayerTeleportEvent
|
||||
+ org.bukkit.craftbukkit.entity.CraftPlayer player = entityplayer.getBukkitEntity();
|
||||
+ org.bukkit.Location location = getBukkitEntity().getLocation();
|
||||
+ location.setPitch(player.getLocation().getPitch());
|
||||
+ location.setYaw(player.getLocation().getYaw());
|
||||
|
||||
- if (entityendermite != null) {
|
||||
- entityendermite.moveTo(entity.getX(), entity.getY(), entity.getZ(), entity.getYRot(), entity.getXRot());
|
||||
- this.level().addFreshEntity(entityendermite);
|
||||
+ PlayerTeleportEvent teleEvent = new PlayerTeleportEvent(player, player.getLocation(), location, PlayerTeleportEvent.TeleportCause.ENDER_PEARL);
|
||||
+ Bukkit.getPluginManager().callEvent(teleEvent);
|
||||
+
|
||||
+ if (!teleEvent.isCancelled() && entityplayer.connection.isAcceptingMessages()) {
|
||||
+ if (this.random.nextFloat() < 0.05F && this.level().getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING)) {
|
||||
+ EntityEndermite entityendermite = (EntityEndermite) EntityTypes.ENDERMITE.create(this.level());
|
||||
+
|
||||
+ if (entityendermite != null) {
|
||||
+ entityendermite.moveTo(entity.getX(), entity.getY(), entity.getZ(), entity.getYRot(), entity.getXRot());
|
||||
+ this.level().addFreshEntity(entityendermite, CreatureSpawnEvent.SpawnReason.ENDER_PEARL);
|
||||
if (entityplayer.connection.isAcceptingMessages()) {
|
||||
+ // CraftBukkit start
|
||||
+ Entity tp = entity.changeDimension(new DimensionTransition(worldserver, this.position(), entity.getDeltaMovement(), entity.getYRot(), entity.getXRot(), DimensionTransition.DO_NOTHING, PlayerTeleportEvent.TeleportCause.ENDER_PEARL));
|
||||
+ if (tp == null) {
|
||||
+ this.discard(EntityRemoveEvent.Cause.HIT);
|
||||
+ return;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
if (this.random.nextFloat() < 0.05F && worldserver.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING)) {
|
||||
EntityEndermite entityendermite = (EntityEndermite) EntityTypes.ENDERMITE.create(worldserver);
|
||||
|
||||
if (entityendermite != null) {
|
||||
entityendermite.moveTo(entity.getX(), entity.getY(), entity.getZ(), entity.getYRot(), entity.getXRot());
|
||||
- worldserver.addFreshEntity(entityendermite);
|
||||
+ worldserver.addFreshEntity(entityendermite, CreatureSpawnEvent.SpawnReason.ENDER_PEARL);
|
||||
}
|
||||
}
|
||||
|
||||
- entity.changeDimension(new DimensionTransition(worldserver, this.position(), entity.getDeltaMovement(), entity.getYRot(), entity.getXRot(), DimensionTransition.DO_NOTHING));
|
||||
+ // entity.changeDimension(new DimensionTransition(worldserver, this.position(), entity.getDeltaMovement(), entity.getYRot(), entity.getXRot(), DimensionTransition.DO_NOTHING)); // CraftBukkit - moved up
|
||||
entity.resetFallDistance();
|
||||
entityplayer.resetCurrentImpulseContext();
|
||||
- entity.hurt(this.damageSources().fall(), 5.0F);
|
||||
+ entity.hurt(this.damageSources().fall().customEntityDamager(this), 5.0F); // CraftBukkit
|
||||
this.playSound(worldserver, this.position());
|
||||
}
|
||||
- }
|
||||
} else {
|
||||
@@ -86,11 +100,11 @@
|
||||
this.playSound(worldserver, this.position());
|
||||
}
|
||||
|
||||
- if (entity.isPassenger()) {
|
||||
- entityplayer.dismountTo(this.getX(), this.getY(), this.getZ());
|
||||
- } else {
|
||||
- entity.teleportTo(this.getX(), this.getY(), this.getZ());
|
||||
- }
|
||||
+ if (entity.isPassenger()) {
|
||||
+ entity.stopRiding();
|
||||
+ }
|
||||
|
||||
- entity.resetFallDistance();
|
||||
- entity.hurt(this.damageSources().fall(), 5.0F);
|
||||
+ entityplayer.connection.teleport(teleEvent.getTo());
|
||||
+ entity.resetFallDistance();
|
||||
+ entity.hurt(this.damageSources().fall().customEntityDamager(this), 5.0F); // CraftBukkit
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
this.level().playSound((EntityHuman) null, this.getX(), this.getY(), this.getZ(), SoundEffects.PLAYER_TELEPORT, SoundCategory.PLAYERS);
|
||||
- this.discard();
|
||||
+ this.discard(EntityRemoveEvent.Cause.HIT); // CraftBukkit - add Bukkit remove cause
|
||||
return;
|
||||
}
|
||||
} else if (entity != null) {
|
||||
@@ -78,7 +96,7 @@
|
||||
entity.resetFallDistance();
|
||||
|
||||
- this.discard();
|
||||
+ this.discard(EntityRemoveEvent.Cause.HIT); // CraftBukkit - add Bukkit remove cause
|
||||
return;
|
||||
}
|
||||
|
||||
- this.discard();
|
||||
+ this.discard(EntityRemoveEvent.Cause.HIT); // CraftBukkit - add Bukkit remove cause
|
||||
}
|
||||
|
||||
}
|
||||
@@ -88,7 +106,7 @@
|
||||
@@ -116,7 +130,7 @@
|
||||
Entity entity = this.getOwner();
|
||||
|
||||
if (entity instanceof EntityPlayer && !entity.isAlive() && this.level().getGameRules().getBoolean(GameRules.RULE_ENDER_PEARLS_VANISH_ON_DEATH)) {
|
||||
@@ -80,12 +67,12 @@
|
||||
} else {
|
||||
super.tick();
|
||||
}
|
||||
@@ -100,7 +118,7 @@
|
||||
public Entity changeDimension(WorldServer worldserver) {
|
||||
Entity entity = this.getOwner();
|
||||
@@ -129,7 +143,7 @@
|
||||
|
||||
- if (entity != null && entity.level().dimension() != worldserver.dimension()) {
|
||||
+ if (entity != null && worldserver != null && entity.level().dimension() != worldserver.dimension()) { // CraftBukkit - SPIGOT-6113
|
||||
this.setOwner((Entity) null);
|
||||
}
|
||||
@Override
|
||||
public boolean canChangeDimensions(World world, World world1) {
|
||||
- if (world.dimension() == World.END) {
|
||||
+ if (world.getTypeKey() == WorldDimension.END) { // CraftBukkit
|
||||
Entity entity = this.getOwner();
|
||||
|
||||
if (entity instanceof EntityPlayer) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
--- a/net/minecraft/world/entity/projectile/EntityEvokerFangs.java
|
||||
+++ b/net/minecraft/world/entity/projectile/EntityEvokerFangs.java
|
||||
@@ -15,6 +15,10 @@
|
||||
import net.minecraft.world.entity.TraceableEntity;
|
||||
@@ -17,6 +17,10 @@
|
||||
import net.minecraft.world.item.enchantment.EnchantmentManager;
|
||||
import net.minecraft.world.level.World;
|
||||
|
||||
+// CraftBukkit start
|
||||
@@ -11,7 +11,7 @@
|
||||
public class EntityEvokerFangs extends Entity implements TraceableEntity {
|
||||
|
||||
public static final int ATTACK_DURATION = 20;
|
||||
@@ -119,7 +123,7 @@
|
||||
@@ -121,7 +125,7 @@
|
||||
}
|
||||
|
||||
if (--this.lifeTicks < 0) {
|
||||
@@ -20,7 +20,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -130,7 +134,7 @@
|
||||
@@ -132,7 +136,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
|
||||
@@ -18,6 +18,11 @@
|
||||
@@ -18,11 +18,18 @@
|
||||
import net.minecraft.world.phys.MovingObjectPosition;
|
||||
import net.minecraft.world.phys.Vec3D;
|
||||
|
||||
@@ -11,17 +11,15 @@
|
||||
+
|
||||
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;
|
||||
public static final double INITAL_ACCELERATION_POWER = 0.1D;
|
||||
public static final double DEFLECTION_SCALE = 0.5D;
|
||||
public double accelerationPower;
|
||||
+ public float bukkitYield = 1; // CraftBukkit
|
||||
+ public boolean isIncendiary = true; // CraftBukkit
|
||||
|
||||
protected EntityFireball(EntityTypes<? extends EntityFireball> entitytypes, World world) {
|
||||
super(entitytypes, world);
|
||||
@@ -72,7 +79,7 @@
|
||||
@@ -71,7 +78,7 @@
|
||||
Entity entity = this.getOwner();
|
||||
|
||||
if (!this.level().isClientSide && (entity != null && entity.isRemoved() || !this.level().hasChunkAt(this.blockPosition()))) {
|
||||
@@ -30,7 +28,7 @@
|
||||
} else {
|
||||
super.tick();
|
||||
if (this.shouldBurn()) {
|
||||
@@ -82,7 +89,13 @@
|
||||
@@ -81,7 +88,13 @@
|
||||
MovingObjectPosition movingobjectposition = ProjectileHelper.getHitResultOnMoveVector(this, this::canHitEntity, this.getClipType());
|
||||
|
||||
if (movingobjectposition.getType() != MovingObjectPosition.EnumMovingObjectType.MISS) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/projectile/EntityFireballFireball.java
|
||||
+++ b/net/minecraft/world/entity/projectile/EntityFireballFireball.java
|
||||
@@ -56,7 +56,12 @@
|
||||
@@ -58,7 +58,12 @@
|
||||
public void readAdditionalSaveData(NBTTagCompound nbttagcompound) {
|
||||
super.readAdditionalSaveData(nbttagcompound);
|
||||
if (nbttagcompound.contains("Item", 10)) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/projectile/EntityFireworks.java
|
||||
+++ b/net/minecraft/world/entity/projectile/EntityFireworks.java
|
||||
@@ -30,6 +30,10 @@
|
||||
@@ -32,6 +32,10 @@
|
||||
import net.minecraft.world.phys.MovingObjectPositionEntity;
|
||||
import net.minecraft.world.phys.Vec3D;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
public class EntityFireworks extends IProjectile implements ItemSupplier {
|
||||
|
||||
public static final DataWatcherObject<ItemStack> DATA_ID_FIREWORKS_ITEM = DataWatcher.defineId(EntityFireworks.class, DataWatcherRegistry.ITEM_STACK);
|
||||
@@ -146,7 +150,7 @@
|
||||
@@ -148,7 +152,7 @@
|
||||
MovingObjectPosition movingobjectposition = ProjectileHelper.getHitResultOnMoveVector(this, this::canHitEntity);
|
||||
|
||||
if (!this.noPhysics) {
|
||||
@@ -20,7 +20,7 @@
|
||||
this.hasImpulse = true;
|
||||
}
|
||||
|
||||
@@ -161,7 +165,11 @@
|
||||
@@ -163,7 +167,11 @@
|
||||
}
|
||||
|
||||
if (!this.level().isClientSide && this.life > this.lifetime) {
|
||||
@@ -33,7 +33,7 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -170,14 +178,18 @@
|
||||
@@ -172,14 +180,18 @@
|
||||
this.level().broadcastEntityEvent(this, (byte) 17);
|
||||
this.gameEvent(GameEvent.EXPLODE, this.getOwner());
|
||||
this.dealExplosionDamage();
|
||||
@@ -54,7 +54,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -187,7 +199,11 @@
|
||||
@@ -189,7 +201,11 @@
|
||||
|
||||
this.level().getBlockState(blockposition).entityInside(this.level(), blockposition, this);
|
||||
if (!this.level().isClientSide() && this.hasExplosion()) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/projectile/EntityFishingHook.java
|
||||
+++ b/net/minecraft/world/entity/projectile/EntityFishingHook.java
|
||||
@@ -46,6 +46,13 @@
|
||||
@@ -47,6 +47,13 @@
|
||||
import net.minecraft.world.phys.Vec3D;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
public class EntityFishingHook extends IProjectile {
|
||||
|
||||
private static final Logger LOGGER = LogUtils.getLogger();
|
||||
@@ -67,6 +74,18 @@
|
||||
@@ -68,6 +75,18 @@
|
||||
private final int luck;
|
||||
private final int lureSpeed;
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
private EntityFishingHook(EntityTypes<? extends EntityFishingHook> entitytypes, World world, int i, int j) {
|
||||
super(entitytypes, world);
|
||||
this.syncronizedRandom = RandomSource.create();
|
||||
@@ -147,12 +166,12 @@
|
||||
@@ -148,12 +167,12 @@
|
||||
EntityHuman entityhuman = this.getPlayerOwner();
|
||||
|
||||
if (entityhuman == null) {
|
||||
@@ -48,7 +48,7 @@
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
@@ -253,7 +272,7 @@
|
||||
@@ -254,7 +273,7 @@
|
||||
if (!entityhuman.isRemoved() && entityhuman.isAlive() && (flag || flag1) && this.distanceToSqr((Entity) entityhuman) <= 1024.0D) {
|
||||
return false;
|
||||
} else {
|
||||
@@ -57,7 +57,7 @@
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -261,7 +280,7 @@
|
||||
@@ -262,7 +281,7 @@
|
||||
private void checkCollision() {
|
||||
MovingObjectPosition movingobjectposition = ProjectileHelper.getHitResultOnMoveVector(this, this::canHitEntity);
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -294,11 +313,11 @@
|
||||
@@ -295,11 +314,11 @@
|
||||
int i = 1;
|
||||
BlockPosition blockposition1 = blockposition.above();
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
--i;
|
||||
}
|
||||
|
||||
@@ -308,6 +327,10 @@
|
||||
@@ -309,6 +328,10 @@
|
||||
this.timeUntilLured = 0;
|
||||
this.timeUntilHooked = 0;
|
||||
this.getEntityData().set(EntityFishingHook.DATA_BITING, false);
|
||||
@@ -91,7 +91,7 @@
|
||||
}
|
||||
} else {
|
||||
float f;
|
||||
@@ -341,6 +364,13 @@
|
||||
@@ -342,6 +365,13 @@
|
||||
worldserver.sendParticles(Particles.FISHING, d0, d1, d2, 0, (double) (-f4), 0.01D, (double) f3, 1.0D);
|
||||
}
|
||||
} else {
|
||||
@@ -105,7 +105,7 @@
|
||||
this.playSound(SoundEffects.FISHING_BOBBER_SPLASH, 0.25F, 1.0F + (this.random.nextFloat() - this.random.nextFloat()) * 0.4F);
|
||||
double d3 = this.getY() + 0.5D;
|
||||
|
||||
@@ -373,12 +403,16 @@
|
||||
@@ -374,12 +404,16 @@
|
||||
}
|
||||
|
||||
if (this.timeUntilLured <= 0) {
|
||||
@@ -118,15 +118,15 @@
|
||||
}
|
||||
} else {
|
||||
- this.timeUntilLured = MathHelper.nextInt(this.random, 100, 600);
|
||||
- this.timeUntilLured -= this.lureSpeed * 20 * 5;
|
||||
- this.timeUntilLured -= this.lureSpeed;
|
||||
+ // CraftBukkit start - logic to modify fishing wait time
|
||||
+ this.timeUntilLured = MathHelper.nextInt(this.random, this.minWaitTime, this.maxWaitTime);
|
||||
+ this.timeUntilLured -= (this.applyLure) ? this.lureSpeed * 20 * 5 : 0;
|
||||
+ this.timeUntilLured -= (this.applyLure) ? this.lureSpeed : 0;
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
}
|
||||
|
||||
@@ -446,6 +480,14 @@
|
||||
@@ -447,6 +481,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);
|
||||
@@ -461,6 +503,15 @@
|
||||
@@ -462,6 +504,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();
|
||||
@@ -468,7 +519,11 @@
|
||||
@@ -469,7 +520,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);
|
||||
}
|
||||
@@ -478,10 +533,27 @@
|
||||
@@ -479,10 +534,27 @@
|
||||
}
|
||||
|
||||
if (this.onGround()) {
|
||||
@@ -199,7 +199,7 @@
|
||||
return i;
|
||||
} else {
|
||||
return 0;
|
||||
@@ -514,8 +586,15 @@
|
||||
@@ -515,8 +587,15 @@
|
||||
|
||||
@Override
|
||||
public void remove(Entity.RemovalReason entity_removalreason) {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
--- a/net/minecraft/world/entity/projectile/EntityLargeFireball.java
|
||||
+++ b/net/minecraft/world/entity/projectile/EntityLargeFireball.java
|
||||
@@ -9,17 +9,24 @@
|
||||
import net.minecraft.world.phys.MovingObjectPosition;
|
||||
@@ -13,17 +13,24 @@
|
||||
import net.minecraft.world.phys.MovingObjectPositionEntity;
|
||||
import net.minecraft.world.phys.Vec3D;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import org.bukkit.event.entity.EntityRemoveEvent;
|
||||
@@ -18,14 +18,14 @@
|
||||
+ isIncendiary = this.level().getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING); // CraftBukkit
|
||||
}
|
||||
|
||||
public EntityLargeFireball(World world, EntityLiving entityliving, double d0, double d1, double d2, int i) {
|
||||
super(EntityTypes.FIREBALL, entityliving, d0, d1, d2, world);
|
||||
public EntityLargeFireball(World world, EntityLiving entityliving, Vec3D vec3d, int i) {
|
||||
super(EntityTypes.FIREBALL, entityliving, vec3d, world);
|
||||
this.explosionPower = i;
|
||||
+ isIncendiary = this.level().getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING); // CraftBukkit
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -28,8 +35,16 @@
|
||||
@@ -32,8 +39,16 @@
|
||||
if (!this.level().isClientSide) {
|
||||
boolean flag = this.level().getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING);
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -59,7 +74,8 @@
|
||||
@@ -63,7 +78,8 @@
|
||||
public void readAdditionalSaveData(NBTTagCompound nbttagcompound) {
|
||||
super.readAdditionalSaveData(nbttagcompound);
|
||||
if (nbttagcompound.contains("ExplosionPower", 99)) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/projectile/EntityLlamaSpit.java
|
||||
+++ b/net/minecraft/world/entity/projectile/EntityLlamaSpit.java
|
||||
@@ -15,6 +15,10 @@
|
||||
@@ -18,6 +18,10 @@
|
||||
import net.minecraft.world.phys.MovingObjectPositionEntity;
|
||||
import net.minecraft.world.phys.Vec3D;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
public class EntityLlamaSpit extends IProjectile {
|
||||
|
||||
public EntityLlamaSpit(EntityTypes<? extends EntityLlamaSpit> entitytypes, World world) {
|
||||
@@ -38,7 +42,7 @@
|
||||
@@ -41,7 +45,7 @@
|
||||
Vec3D vec3d = this.getDeltaMovement();
|
||||
MovingObjectPosition movingobjectposition = ProjectileHelper.getHitResultOnMoveVector(this, this::canHitEntity);
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
double d0 = this.getX() + vec3d.x;
|
||||
double d1 = this.getY() + vec3d.y;
|
||||
double d2 = this.getZ() + vec3d.z;
|
||||
@@ -47,9 +51,9 @@
|
||||
@@ -50,9 +54,9 @@
|
||||
float f = 0.99F;
|
||||
|
||||
if (this.level().getBlockStates(this.getBoundingBox()).noneMatch(BlockBase.BlockData::isAir)) {
|
||||
@@ -32,7 +32,7 @@
|
||||
} else {
|
||||
this.setDeltaMovement(vec3d.scale(0.9900000095367432D));
|
||||
this.applyGravity();
|
||||
@@ -72,7 +76,7 @@
|
||||
@@ -86,7 +90,7 @@
|
||||
protected void onHitBlock(MovingObjectPositionBlock movingobjectpositionblock) {
|
||||
super.onHitBlock(movingobjectpositionblock);
|
||||
if (!this.level().isClientSide) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/projectile/EntityPotion.java
|
||||
+++ b/net/minecraft/world/entity/projectile/EntityPotion.java
|
||||
@@ -32,6 +32,18 @@
|
||||
@@ -34,6 +34,18 @@
|
||||
import net.minecraft.world.phys.MovingObjectPositionBlock;
|
||||
import net.minecraft.world.phys.MovingObjectPositionEntity;
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
public class EntityPotion extends EntityProjectileThrowable implements ItemSupplier {
|
||||
|
||||
public static final double SPLASH_RANGE = 4.0D;
|
||||
@@ -96,18 +108,18 @@
|
||||
@@ -98,18 +110,18 @@
|
||||
|
||||
if (potioncontents.is(Potions.WATER)) {
|
||||
this.applyWater();
|
||||
@@ -42,7 +42,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -142,9 +154,10 @@
|
||||
@@ -144,9 +156,10 @@
|
||||
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
|
||||
if (!list.isEmpty()) {
|
||||
Entity entity1 = this.getEffectSource();
|
||||
@@ -165,24 +178,50 @@
|
||||
@@ -167,24 +180,50 @@
|
||||
d1 = 1.0D - Math.sqrt(d0) / 4.0D;
|
||||
}
|
||||
|
||||
@@ -120,7 +120,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -191,7 +230,7 @@
|
||||
@@ -193,7 +232,7 @@
|
||||
|
||||
}
|
||||
|
||||
@@ -129,7 +129,7 @@
|
||||
EntityAreaEffectCloud entityareaeffectcloud = new EntityAreaEffectCloud(this.level(), this.getX(), this.getY(), this.getZ());
|
||||
Entity entity = this.getOwner();
|
||||
|
||||
@@ -204,7 +243,14 @@
|
||||
@@ -206,7 +245,14 @@
|
||||
entityareaeffectcloud.setWaitTime(10);
|
||||
entityareaeffectcloud.setRadiusPerTick(-entityareaeffectcloud.getRadius() / (float) entityareaeffectcloud.getDuration());
|
||||
entityareaeffectcloud.setPotionContents(potioncontents);
|
||||
@@ -145,7 +145,7 @@
|
||||
}
|
||||
|
||||
public boolean isLingering() {
|
||||
@@ -215,13 +261,25 @@
|
||||
@@ -217,13 +263,25 @@
|
||||
IBlockData iblockdata = this.level().getBlockState(blockposition);
|
||||
|
||||
if (iblockdata.is(TagsBlock.FIRE)) {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
--- a/net/minecraft/world/entity/projectile/EntityProjectile.java
|
||||
+++ b/net/minecraft/world/entity/projectile/EntityProjectile.java
|
||||
@@ -66,7 +66,7 @@
|
||||
}
|
||||
@@ -46,7 +46,7 @@
|
||||
MovingObjectPosition movingobjectposition = ProjectileHelper.getHitResultOnMoveVector(this, this::canHitEntity);
|
||||
|
||||
if (movingobjectposition.getType() != MovingObjectPosition.EnumMovingObjectType.MISS && !flag) {
|
||||
if (movingobjectposition.getType() != MovingObjectPosition.EnumMovingObjectType.MISS) {
|
||||
- this.hitTargetOrDeflectSelf(movingobjectposition);
|
||||
+ this.preHitTargetOrDeflectSelf(movingobjectposition); // CraftBukkit - projectile hit event
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/projectile/EntityShulkerBullet.java
|
||||
+++ b/net/minecraft/world/entity/projectile/EntityShulkerBullet.java
|
||||
@@ -31,6 +31,10 @@
|
||||
@@ -32,6 +32,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;
|
||||
@@ -59,8 +63,21 @@
|
||||
@@ -60,8 +64,21 @@
|
||||
this.finalTarget = entity;
|
||||
this.currentMoveDirection = EnumDirection.UP;
|
||||
this.selectNextMoveDirection(enumdirection_enumaxis);
|
||||
@@ -33,7 +33,7 @@
|
||||
@Override
|
||||
public SoundCategory getSoundSource() {
|
||||
return SoundCategory.HOSTILE;
|
||||
@@ -193,7 +210,7 @@
|
||||
@@ -194,7 +211,7 @@
|
||||
@Override
|
||||
public void checkDespawn() {
|
||||
if (this.level().getDifficulty() == EnumDifficulty.PEACEFUL) {
|
||||
@@ -42,7 +42,7 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -229,7 +246,7 @@
|
||||
@@ -230,7 +247,7 @@
|
||||
MovingObjectPosition movingobjectposition = ProjectileHelper.getHitResultOnMoveVector(this, this::canHitEntity);
|
||||
|
||||
if (movingobjectposition.getType() != MovingObjectPosition.EnumMovingObjectType.MISS) {
|
||||
@@ -51,7 +51,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -298,7 +315,7 @@
|
||||
@@ -307,7 +324,7 @@
|
||||
if (entity instanceof EntityLiving) {
|
||||
EntityLiving entityliving1 = (EntityLiving) entity;
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -312,14 +329,20 @@
|
||||
@@ -321,14 +338,20 @@
|
||||
}
|
||||
|
||||
private void destroy() {
|
||||
@@ -83,7 +83,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -329,10 +352,15 @@
|
||||
@@ -338,10 +361,15 @@
|
||||
|
||||
@Override
|
||||
public boolean hurt(DamageSource damagesource, float f) {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
--- a/net/minecraft/world/entity/projectile/EntitySmallFireball.java
|
||||
+++ b/net/minecraft/world/entity/projectile/EntitySmallFireball.java
|
||||
@@ -13,6 +13,11 @@
|
||||
import net.minecraft.world.phys.MovingObjectPositionBlock;
|
||||
@@ -16,6 +16,11 @@
|
||||
import net.minecraft.world.phys.MovingObjectPositionEntity;
|
||||
import net.minecraft.world.phys.Vec3D;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import org.bukkit.event.entity.EntityCombustByEntityEvent;
|
||||
@@ -12,10 +12,10 @@
|
||||
public class EntitySmallFireball extends EntityFireballFireball {
|
||||
|
||||
public EntitySmallFireball(EntityTypes<? extends EntitySmallFireball> entitytypes, World world) {
|
||||
@@ -21,6 +26,11 @@
|
||||
@@ -24,6 +29,11 @@
|
||||
|
||||
public EntitySmallFireball(World world, EntityLiving entityliving, double d0, double d1, double d2) {
|
||||
super(EntityTypes.SMALL_FIREBALL, entityliving, d0, d1, d2, world);
|
||||
public EntitySmallFireball(World world, EntityLiving entityliving, Vec3D vec3d) {
|
||||
super(EntityTypes.SMALL_FIREBALL, entityliving, vec3d, world);
|
||||
+ // CraftBukkit start
|
||||
+ if (this.getOwner() != null && this.getOwner() instanceof EntityInsentient) {
|
||||
+ isIncendiary = this.level().getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING);
|
||||
@@ -23,24 +23,24 @@
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
|
||||
public EntitySmallFireball(World world, double d0, double d1, double d2, double d3, double d4, double d5) {
|
||||
@@ -35,7 +45,14 @@
|
||||
public EntitySmallFireball(World world, double d0, double d1, double d2, Vec3D vec3d) {
|
||||
@@ -40,7 +50,14 @@
|
||||
Entity entity1 = this.getOwner();
|
||||
int i = entity.getRemainingFireTicks();
|
||||
|
||||
- entity.igniteForSeconds(5);
|
||||
- entity.igniteForSeconds(5.0F);
|
||||
+ // CraftBukkit start - Entity damage by entity event + combust event
|
||||
+ EntityCombustByEntityEvent event = new EntityCombustByEntityEvent((org.bukkit.entity.Projectile) this.getBukkitEntity(), entity.getBukkitEntity(), 5);
|
||||
+ EntityCombustByEntityEvent event = new EntityCombustByEntityEvent((org.bukkit.entity.Projectile) this.getBukkitEntity(), entity.getBukkitEntity(), 5.0F);
|
||||
+ entity.level().getCraftServer().getPluginManager().callEvent(event);
|
||||
+
|
||||
+ if (!event.isCancelled()) {
|
||||
+ entity.igniteForSeconds(event.getDuration(), false);
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
if (!entity.hurt(this.damageSources().fireball(this, entity1), 5.0F)) {
|
||||
entity.setRemainingFireTicks(i);
|
||||
} else if (entity1 instanceof EntityLiving) {
|
||||
@@ -51,10 +68,10 @@
|
||||
DamageSource damagesource = this.damageSources().fireball(this, entity1);
|
||||
|
||||
if (!entity.hurt(damagesource, 5.0F)) {
|
||||
@@ -58,10 +75,10 @@
|
||||
if (!this.level().isClientSide) {
|
||||
Entity entity = this.getOwner();
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
this.level().setBlockAndUpdate(blockposition, BlockFireAbstract.getState(this.level(), blockposition));
|
||||
}
|
||||
}
|
||||
@@ -66,7 +83,7 @@
|
||||
@@ -73,7 +90,7 @@
|
||||
protected void onHit(MovingObjectPosition movingobjectposition) {
|
||||
super.onHit(movingobjectposition);
|
||||
if (!this.level().isClientSide) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/projectile/EntitySpectralArrow.java
|
||||
+++ b/net/minecraft/world/entity/projectile/EntitySpectralArrow.java
|
||||
@@ -40,7 +40,7 @@
|
||||
@@ -41,7 +41,7 @@
|
||||
super.doPostHurtEffects(entityliving);
|
||||
MobEffect mobeffect = new MobEffect(MobEffects.GLOWING, this.duration, 0);
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/projectile/EntityThrownTrident.java
|
||||
+++ b/net/minecraft/world/entity/projectile/EntityThrownTrident.java
|
||||
@@ -23,6 +23,10 @@
|
||||
@@ -24,6 +24,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);
|
||||
@@ -68,7 +72,7 @@
|
||||
@@ -69,7 +73,7 @@
|
||||
this.spawnAtLocation(this.getPickupItem(), 0.1F);
|
||||
}
|
||||
|
||||
@@ -20,12 +20,12 @@
|
||||
} else {
|
||||
this.setNoPhysics(true);
|
||||
Vec3D vec3d = entity.getEyePosition().subtract(this.position());
|
||||
@@ -152,7 +156,7 @@
|
||||
if (entitylightning != null) {
|
||||
entitylightning.moveTo(Vec3D.atBottomCenterOf(blockposition));
|
||||
entitylightning.setCause(entity1 instanceof EntityPlayer ? (EntityPlayer) entity1 : null);
|
||||
- this.level().addFreshEntity(entitylightning);
|
||||
+ ((WorldServer) this.level()).strikeLightning(entitylightning, org.bukkit.event.weather.LightningStrikeEvent.Cause.TRIDENT); // CraftBukkit
|
||||
soundeffect = SoundEffects.TRIDENT_THUNDER;
|
||||
f1 = 5.0F;
|
||||
}
|
||||
@@ -129,7 +133,7 @@
|
||||
|
||||
world = this.level();
|
||||
if (world instanceof WorldServer) {
|
||||
- worldserver = (WorldServer) world;
|
||||
+ WorldServer worldserver = (WorldServer) world; // CraftBukkit - decompile error
|
||||
EnchantmentManager.doPostAttackEffectsWithItemSource(worldserver, entity, damagesource, this.getWeaponItem());
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/projectile/EntityTippedArrow.java
|
||||
+++ b/net/minecraft/world/entity/projectile/EntityTippedArrow.java
|
||||
@@ -118,7 +118,7 @@
|
||||
@@ -119,7 +119,7 @@
|
||||
mobeffect = (MobEffect) iterator.next();
|
||||
entityliving.addEffect(new MobEffect(mobeffect.getEffect(), Math.max(mobeffect.mapDuration((i) -> {
|
||||
return i / 8;
|
||||
@@ -9,7 +9,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -126,7 +126,7 @@
|
||||
@@ -127,7 +127,7 @@
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
mobeffect = (MobEffect) iterator.next();
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
--- a/net/minecraft/world/entity/projectile/EntityWitherSkull.java
|
||||
+++ b/net/minecraft/world/entity/projectile/EntityWitherSkull.java
|
||||
@@ -21,6 +21,11 @@
|
||||
import net.minecraft.world.phys.MovingObjectPosition;
|
||||
@@ -24,6 +24,11 @@
|
||||
import net.minecraft.world.phys.MovingObjectPositionEntity;
|
||||
import net.minecraft.world.phys.Vec3D;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import org.bukkit.event.entity.EntityRemoveEvent;
|
||||
@@ -12,16 +12,16 @@
|
||||
public class EntityWitherSkull extends EntityFireball {
|
||||
|
||||
private static final DataWatcherObject<Boolean> DATA_DANGEROUS = DataWatcher.defineId(EntityWitherSkull.class, DataWatcherRegistry.BOOLEAN);
|
||||
@@ -64,7 +69,7 @@
|
||||
@@ -69,7 +74,7 @@
|
||||
if (entity.isAlive()) {
|
||||
this.doEnchantDamageEffects(entityliving, entity);
|
||||
EnchantmentManager.doPostAttackEffects(worldserver, entity, damagesource);
|
||||
} else {
|
||||
- entityliving.heal(5.0F);
|
||||
+ entityliving.heal(5.0F, org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason.WITHER); // CraftBukkit
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -82,7 +87,7 @@
|
||||
@@ -86,7 +91,7 @@
|
||||
}
|
||||
|
||||
if (b0 > 0) {
|
||||
@@ -30,7 +30,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,8 +98,16 @@
|
||||
@@ -97,8 +102,16 @@
|
||||
protected void onHit(MovingObjectPosition movingobjectposition) {
|
||||
super.onHit(movingobjectposition);
|
||||
if (!this.level().isClientSide) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/projectile/IProjectile.java
|
||||
+++ b/net/minecraft/world/entity/projectile/IProjectile.java
|
||||
@@ -26,6 +26,10 @@
|
||||
@@ -30,6 +30,10 @@
|
||||
import net.minecraft.world.phys.MovingObjectPositionEntity;
|
||||
import net.minecraft.world.phys.Vec3D;
|
||||
|
||||
@@ -11,9 +11,9 @@
|
||||
public abstract class IProjectile extends Entity implements TraceableEntity {
|
||||
|
||||
@Nullable
|
||||
@@ -35,6 +39,10 @@
|
||||
private boolean leftOwner;
|
||||
private boolean hasBeenShot;
|
||||
@@ -41,6 +45,10 @@
|
||||
@Nullable
|
||||
private Entity lastDeflectedBy;
|
||||
|
||||
+ // CraftBukkit start
|
||||
+ private boolean hitCancelled = false;
|
||||
@@ -22,7 +22,7 @@
|
||||
IProjectile(EntityTypes<? extends IProjectile> entitytypes, World world) {
|
||||
super(entitytypes, world);
|
||||
}
|
||||
@@ -44,6 +52,7 @@
|
||||
@@ -50,6 +58,7 @@
|
||||
this.ownerUUID = entity.getUUID();
|
||||
this.cachedOwner = entity;
|
||||
}
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
}
|
||||
|
||||
@@ -170,6 +179,17 @@
|
||||
@@ -177,6 +186,17 @@
|
||||
this.setDeltaMovement(this.getDeltaMovement().add(vec3d.x, entity.onGround() ? 0.0D : vec3d.y, vec3d.z));
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
protected ProjectileDeflection hitTargetOrDeflectSelf(MovingObjectPosition movingobjectposition) {
|
||||
if (movingobjectposition.getType() == MovingObjectPosition.EnumMovingObjectType.ENTITY) {
|
||||
MovingObjectPositionEntity movingobjectpositionentity = (MovingObjectPositionEntity) movingobjectposition;
|
||||
@@ -225,6 +245,11 @@
|
||||
@@ -237,6 +257,11 @@
|
||||
protected void onHitEntity(MovingObjectPositionEntity movingobjectpositionentity) {}
|
||||
|
||||
protected void onHitBlock(MovingObjectPositionBlock movingobjectpositionblock) {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
--- 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;
|
||||
@@ -25,6 +25,10 @@
|
||||
import net.minecraft.world.phys.MovingObjectPositionEntity;
|
||||
import net.minecraft.world.phys.Vec3D;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import org.bukkit.event.entity.EntityRemoveEvent;
|
||||
@@ -10,17 +10,17 @@
|
||||
+
|
||||
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();
|
||||
public static final ExplosionDamageCalculator EXPLOSION_DAMAGE_CALCULATOR = new SimpleExplosionDamageCalculator(true, false, Optional.empty(), BuiltInRegistries.BLOCK.getTag(TagsBlock.BLOCKS_WIND_CHARGE_EXPLOSIONS).map(Function.identity()));
|
||||
@@ -113,7 +117,7 @@
|
||||
Vec3D vec3d1 = movingobjectpositionblock.getLocation().add(vec3d);
|
||||
|
||||
this.explode(vec3d1);
|
||||
- this.discard();
|
||||
+ this.discard(EntityRemoveEvent.Cause.HIT); // CraftBukkit - add Bukkit remove cause
|
||||
}
|
||||
|
||||
}
|
||||
@@ -104,7 +108,7 @@
|
||||
@@ -122,7 +126,7 @@
|
||||
protected void onHit(MovingObjectPosition movingobjectposition) {
|
||||
super.onHit(movingobjectposition);
|
||||
if (!this.level().isClientSide) {
|
||||
@@ -29,10 +29,10 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -139,7 +143,7 @@
|
||||
@@ -157,7 +161,7 @@
|
||||
public void tick() {
|
||||
if (!this.level().isClientSide && this.getBlockY() > this.level().getMaxBuildHeight() + 30) {
|
||||
this.explode();
|
||||
this.explode(this.position());
|
||||
- this.discard();
|
||||
+ this.discard(EntityRemoveEvent.Cause.OUT_OF_WORLD); // CraftBukkit - add Bukkit remove cause
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user