2018-07-20 14:04:37 +08:00
|
|
|
--- a/net/minecraft/server/TileEntityConduit.java
|
|
|
|
+++ b/net/minecraft/server/TileEntityConduit.java
|
2018-08-28 19:00:24 +08:00
|
|
|
@@ -7,6 +7,10 @@
|
|
|
|
import java.util.UUID;
|
|
|
|
import java.util.function.Predicate;
|
|
|
|
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 {
|
|
|
|
|
|
|
|
@@ -152,7 +156,7 @@
|
2018-07-20 14:04:37 +08:00
|
|
|
EntityHuman entityhuman = (EntityHuman) iterator.next();
|
|
|
|
|
|
|
|
if (this.position.m(new BlockPosition(entityhuman)) <= (double) j && entityhuman.ao()) {
|
|
|
|
- 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
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-08-28 19:00:24 +08:00
|
|
|
@@ -169,8 +173,8 @@
|
2018-10-23 03:00:00 +08:00
|
|
|
this.target = this.l();
|
2018-07-20 14:04:37 +08:00
|
|
|
this.k = null;
|
2018-10-23 03:00:00 +08:00
|
|
|
} else if (this.target == null) {
|
2018-07-20 14:04:37 +08:00
|
|
|
- List list = this.world.a(EntityLiving.class, this.k(), (entityliving) -> {
|
|
|
|
- return entityliving instanceof IMonster && entityliving.ao();
|
|
|
|
+ List list = this.world.a(EntityLiving.class, this.k(), (Predicate<EntityLiving>) (entitylivingx) -> { // CraftBukkit - decompile error
|
|
|
|
+ return entitylivingx instanceof IMonster && entitylivingx.ao(); // CraftBukkit - decompile error
|
|
|
|
});
|
|
|
|
|
|
|
|
if (!list.isEmpty()) {
|
2018-08-28 19:00:24 +08:00
|
|
|
@@ -181,8 +185,13 @@
|
|
|
|
}
|
|
|
|
|
2018-10-23 03:00:00 +08:00
|
|
|
if (this.target != null) {
|
|
|
|
- this.world.a((EntityHuman) null, this.target.locX, this.target.locY, this.target.locZ, SoundEffects.BLOCK_CONDUIT_ATTACK_TARGET, SoundCategory.BLOCKS, 1.0F, 1.0F);
|
|
|
|
- this.target.damageEntity(DamageSource.MAGIC, 4.0F);
|
2018-08-28 19:00:24 +08:00
|
|
|
+ // CraftBukkit start
|
|
|
|
+ CraftEventFactory.blockDamage = CraftBlock.at(this.world, this.position);
|
2018-10-23 03:00:00 +08:00
|
|
|
+ if (this.target.damageEntity(DamageSource.MAGIC, 4.0F)) {
|
|
|
|
+ this.world.a((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 19:00:24 +08:00
|
|
|
+ }
|
|
|
|
+ CraftEventFactory.blockDamage = null;
|
|
|
|
+ // CraftBukkit end
|
|
|
|
}
|
|
|
|
|
2018-10-23 03:00:00 +08:00
|
|
|
if (entityliving != this.target) {
|
2018-08-28 19:00:24 +08:00
|
|
|
@@ -215,7 +224,7 @@
|
2018-07-20 14:04:37 +08:00
|
|
|
|
|
|
|
@Nullable
|
|
|
|
private EntityLiving l() {
|
|
|
|
- List list = this.world.a(EntityLiving.class, this.k(), (entityliving) -> {
|
|
|
|
+ List list = this.world.a(EntityLiving.class, this.k(), (Predicate<EntityLiving>) (entityliving) -> { // CraftBukkit - decompile error
|
|
|
|
return entityliving.getUniqueID().equals(this.k);
|
|
|
|
});
|
|
|
|
|