@@ -1,6 +1,42 @@
|
||||
--- a/net/minecraft/world/level/block/entity/TileEntityConduit.java
|
||||
+++ b/net/minecraft/world/level/block/entity/TileEntityConduit.java
|
||||
@@ -201,7 +201,7 @@
|
||||
@@ -40,11 +40,11 @@
|
||||
private float activeRotation;
|
||||
private boolean isActive;
|
||||
private boolean isHunting;
|
||||
- private final List<BlockPosition> effectBlocks = Lists.newArrayList();
|
||||
+ public final List<BlockPosition> effectBlocks = Lists.newArrayList();
|
||||
@Nullable
|
||||
- private EntityLiving destroyTarget;
|
||||
+ public EntityLiving destroyTarget;
|
||||
@Nullable
|
||||
- private UUID destroyTargetUUID;
|
||||
+ public UUID destroyTargetUUID;
|
||||
private long nextAmbientSoundActivation;
|
||||
|
||||
public TileEntityConduit(BlockPosition blockposition, IBlockData iblockdata) {
|
||||
@@ -186,8 +186,20 @@
|
||||
}
|
||||
|
||||
private static void applyEffects(World world, BlockPosition blockposition, List<BlockPosition> list) {
|
||||
+ // CraftBukkit start
|
||||
+ applyEffects(world, blockposition, getRange(list));
|
||||
+ }
|
||||
+
|
||||
+ public static int getRange(List<BlockPosition> list) {
|
||||
+ // CraftBukkit end
|
||||
int i = list.size();
|
||||
int j = i / 7 * 16;
|
||||
+ // CraftBukkit start
|
||||
+ return j;
|
||||
+ }
|
||||
+
|
||||
+ private static void applyEffects(World world, BlockPosition blockposition, int j) { // j = effect range in blocks
|
||||
+ // CraftBukkit end
|
||||
int k = blockposition.getX();
|
||||
int l = blockposition.getY();
|
||||
int i1 = blockposition.getZ();
|
||||
@@ -201,7 +213,7 @@
|
||||
EntityHuman entityhuman = (EntityHuman) iterator.next();
|
||||
|
||||
if (blockposition.closerThan(entityhuman.blockPosition(), (double) j) && entityhuman.isInWaterOrRain()) {
|
||||
@@ -9,17 +45,41 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -230,8 +230,11 @@
|
||||
@@ -209,6 +221,12 @@
|
||||
}
|
||||
|
||||
private static void updateDestroyTarget(World world, BlockPosition blockposition, IBlockData iblockdata, List<BlockPosition> list, TileEntityConduit tileentityconduit) {
|
||||
+ // CraftBukkit start - add "damageTarget" boolean
|
||||
+ updateDestroyTarget(world, blockposition, iblockdata, list, tileentityconduit, true);
|
||||
+ }
|
||||
+
|
||||
+ public static void updateDestroyTarget(World world, BlockPosition blockposition, IBlockData iblockdata, List<BlockPosition> list, TileEntityConduit tileentityconduit, boolean damageTarget) {
|
||||
+ // CraftBukkit end
|
||||
EntityLiving entityliving = tileentityconduit.destroyTarget;
|
||||
int i = list.size();
|
||||
|
||||
@@ -229,9 +247,12 @@
|
||||
tileentityconduit.destroyTarget = null;
|
||||
}
|
||||
|
||||
if (tileentityconduit.destroyTarget != null) {
|
||||
- if (tileentityconduit.destroyTarget != null) {
|
||||
- world.playSound((EntityHuman) null, tileentityconduit.destroyTarget.getX(), tileentityconduit.destroyTarget.getY(), tileentityconduit.destroyTarget.getZ(), SoundEffects.CONDUIT_ATTACK_TARGET, SoundCategory.BLOCKS, 1.0F, 1.0F);
|
||||
- tileentityconduit.destroyTarget.hurt(world.damageSources().magic(), 4.0F);
|
||||
+ // CraftBukkit start
|
||||
+ if (tileentityconduit.destroyTarget.hurt(world.damageSources().magic().directBlock(world, blockposition), 4.0F)) { // CraftBukkit
|
||||
+ // CraftBukkit start
|
||||
+ if (damageTarget && tileentityconduit.destroyTarget != null) {
|
||||
+ if (tileentityconduit.destroyTarget.hurt(world.damageSources().magic().directBlock(world, blockposition), 4.0F)) {
|
||||
+ world.playSound(null, tileentityconduit.destroyTarget.getX(), tileentityconduit.destroyTarget.getY(), tileentityconduit.destroyTarget.getZ(), SoundEffects.CONDUIT_ATTACK_TARGET, SoundCategory.BLOCKS, 1.0F, 1.0F);
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
|
||||
if (entityliving != tileentityconduit.destroyTarget) {
|
||||
@@ -252,7 +273,7 @@
|
||||
|
||||
}
|
||||
|
||||
- private static AxisAlignedBB getDestroyRangeAABB(BlockPosition blockposition) {
|
||||
+ public static AxisAlignedBB getDestroyRangeAABB(BlockPosition blockposition) {
|
||||
int i = blockposition.getX();
|
||||
int j = blockposition.getY();
|
||||
int k = blockposition.getZ();
|
||||
|
||||
Reference in New Issue
Block a user