2018-07-20 08:04:37 +02:00
|
|
|
--- a/net/minecraft/server/TileEntityConduit.java
|
|
|
|
+++ b/net/minecraft/server/TileEntityConduit.java
|
2018-12-25 22:00:00 +01:00
|
|
|
@@ -6,6 +6,10 @@
|
|
|
|
import java.util.Random;
|
2018-08-28 13:00:24 +02:00
|
|
|
import java.util.UUID;
|
|
|
|
import javax.annotation.Nullable;
|
|
|
|
+// CraftBukkit start
|
|
|
|
+import org.bukkit.craftbukkit.block.CraftBlock;
|
|
|
|
+import org.bukkit.craftbukkit.event.CraftEventFactory;
|
|
|
|
+// CraftBukkit end
|
|
|
|
|
|
|
|
public class TileEntityConduit extends TileEntity implements ITickable {
|
|
|
|
|
2019-04-23 04:00:00 +02:00
|
|
|
@@ -158,7 +162,7 @@
|
2018-07-20 08:04:37 +02:00
|
|
|
EntityHuman entityhuman = (EntityHuman) iterator.next();
|
|
|
|
|
2019-04-23 04:00:00 +02:00
|
|
|
if (this.position.a((BaseBlockPosition) (new BlockPosition(entityhuman)), (double) j) && entityhuman.isInWaterOrRain()) {
|
2018-07-20 08:04:37 +02:00
|
|
|
- entityhuman.addEffect(new MobEffect(MobEffects.CONDUIT_POWER, 260, 0, true, true));
|
|
|
|
+ entityhuman.addEffect(new MobEffect(MobEffects.CONDUIT_POWER, 260, 0, true, true), org.bukkit.event.entity.EntityPotionEffectEvent.Cause.CONDUIT); // CraftBukkit
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-04-23 04:00:00 +02:00
|
|
|
@@ -175,7 +179,7 @@
|
2019-05-14 02:00:00 +02:00
|
|
|
this.target = this.x();
|
2018-07-20 08:04:37 +02:00
|
|
|
this.k = null;
|
2018-10-22 21:00:00 +02:00
|
|
|
} else if (this.target == null) {
|
2019-12-10 23:00:00 +01:00
|
|
|
- List<EntityLiving> list = this.world.a(EntityLiving.class, this.m(), (entityliving1) -> {
|
|
|
|
+ List<EntityLiving> list = this.world.a(EntityLiving.class, this.m(), (java.util.function.Predicate<EntityLiving>) (entityliving1) -> { // CraftBukkit - decompile error
|
2019-04-23 04:00:00 +02:00
|
|
|
return entityliving1 instanceof IMonster && entityliving1.isInWaterOrRain();
|
2018-07-20 08:04:37 +02:00
|
|
|
});
|
|
|
|
|
2019-04-23 04:00:00 +02:00
|
|
|
@@ -187,8 +191,13 @@
|
2018-08-28 13:00:24 +02:00
|
|
|
}
|
|
|
|
|
2018-10-22 21:00:00 +02:00
|
|
|
if (this.target != null) {
|
2019-12-10 23:00:00 +01:00
|
|
|
- this.world.playSound((EntityHuman) null, this.target.locX(), this.target.locY(), this.target.locZ(), SoundEffects.BLOCK_CONDUIT_ATTACK_TARGET, SoundCategory.BLOCKS, 1.0F, 1.0F);
|
2018-10-22 21:00:00 +02:00
|
|
|
- this.target.damageEntity(DamageSource.MAGIC, 4.0F);
|
2018-08-28 13:00:24 +02:00
|
|
|
+ // CraftBukkit start
|
|
|
|
+ CraftEventFactory.blockDamage = CraftBlock.at(this.world, this.position);
|
2018-10-22 21:00:00 +02:00
|
|
|
+ if (this.target.damageEntity(DamageSource.MAGIC, 4.0F)) {
|
2019-12-10 23:00:00 +01:00
|
|
|
+ this.world.playSound((EntityHuman) null, this.target.locX(), this.target.locY(), this.target.locZ(), SoundEffects.BLOCK_CONDUIT_ATTACK_TARGET, SoundCategory.BLOCKS, 1.0F, 1.0F);
|
2018-08-28 13:00:24 +02:00
|
|
|
+ }
|
|
|
|
+ CraftEventFactory.blockDamage = null;
|
|
|
|
+ // CraftBukkit end
|
|
|
|
}
|
|
|
|
|
2018-10-22 21:00:00 +02:00
|
|
|
if (entityliving != this.target) {
|
2019-04-23 04:00:00 +02:00
|
|
|
@@ -221,7 +230,7 @@
|
2018-07-20 08:04:37 +02:00
|
|
|
|
|
|
|
@Nullable
|
2019-05-14 02:00:00 +02:00
|
|
|
private EntityLiving x() {
|
2019-12-10 23:00:00 +01:00
|
|
|
- List<EntityLiving> list = this.world.a(EntityLiving.class, this.m(), (entityliving) -> {
|
|
|
|
+ List<EntityLiving> list = this.world.a(EntityLiving.class, this.m(), (java.util.function.Predicate<EntityLiving>) (entityliving) -> { // CraftBukkit - decompile error
|
2018-07-20 08:04:37 +02:00
|
|
|
return entityliving.getUniqueID().equals(this.k);
|
|
|
|
});
|
|
|
|
|