mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-25 02:17:35 +01:00
Take into account if the shooter is a player before considering pvp mode for projectiles. Fixes BUKKIT-3058
This commit is contained in:
parent
1040a81334
commit
0c16afd6e0
@ -219,7 +219,7 @@ public class EntityArrow extends Entity implements IProjectile {
|
|||||||
|
|
||||||
// CraftBukkit start - moved damage call
|
// CraftBukkit start - moved damage call
|
||||||
if (movingobjectposition.entity.damageEntity(damagesource, i1)) {
|
if (movingobjectposition.entity.damageEntity(damagesource, i1)) {
|
||||||
if (this.isBurning() && (!(movingobjectposition.entity instanceof EntityPlayer) || this.world.pvpMode)) { // CraftBukkit - abide by pvp setting if destination is a player.
|
if (this.isBurning() && (!(movingobjectposition.entity instanceof EntityPlayer) || !(this.shooter instanceof EntityPlayer) || this.world.pvpMode)) { // CraftBukkit - abide by pvp setting if destination is a player.
|
||||||
EntityCombustByEntityEvent combustEvent = new EntityCombustByEntityEvent(this.getBukkitEntity(), entity.getBukkitEntity(), 5);
|
EntityCombustByEntityEvent combustEvent = new EntityCombustByEntityEvent(this.getBukkitEntity(), entity.getBukkitEntity(), 5);
|
||||||
org.bukkit.Bukkit.getPluginManager().callEvent(combustEvent);
|
org.bukkit.Bukkit.getPluginManager().callEvent(combustEvent);
|
||||||
|
|
||||||
|
@ -107,8 +107,8 @@ public class EntityPotion extends EntityProjectile {
|
|||||||
MobEffect mobeffect = (MobEffect) iterator1.next();
|
MobEffect mobeffect = (MobEffect) iterator1.next();
|
||||||
int i = mobeffect.getEffectId();
|
int i = mobeffect.getEffectId();
|
||||||
|
|
||||||
// CraftBukkit start - abide by PVP settings
|
// CraftBukkit start - abide by PVP settings - for players only!
|
||||||
if (!this.world.pvpMode && entityliving instanceof EntityPlayer && entityliving != this.getShooter()) {
|
if (!this.world.pvpMode && this.getShooter() instanceof EntityPlayer && entityliving instanceof EntityPlayer && entityliving != this.getShooter()) {
|
||||||
// Block SLOWER_MOVEMENT, SLOWER_DIG, HARM, BLINDNESS, HUNGER, WEAKNESS and POISON potions
|
// Block SLOWER_MOVEMENT, SLOWER_DIG, HARM, BLINDNESS, HUNGER, WEAKNESS and POISON potions
|
||||||
if (i == 2 || i == 4 || i == 7 || i == 15 || i == 17 || i == 18 || i == 19) continue;
|
if (i == 2 || i == 4 || i == 7 || i == 15 || i == 17 || i == 18 || i == 19) continue;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user