10
10
import galena .oreganized .network .packet .GargoyleParticlePacket ;
11
11
import galena .oreganized .world .ScaredOfGargoyleGoal ;
12
12
import net .minecraft .core .BlockPos ;
13
+ import net .minecraft .core .Direction ;
13
14
import net .minecraft .core .particles .ParticleOptions ;
14
15
import net .minecraft .core .particles .ParticleTypes ;
15
16
import net .minecraft .nbt .CompoundTag ;
19
20
import net .minecraft .util .valueproviders .UniformInt ;
20
21
import net .minecraft .world .InteractionResult ;
21
22
import net .minecraft .world .entity .Entity ;
22
- import net .minecraft .world .entity .LivingEntity ;
23
23
import net .minecraft .world .entity .Mob ;
24
24
import net .minecraft .world .entity .MobType ;
25
25
import net .minecraft .world .entity .player .Player ;
26
26
import net .minecraft .world .item .ItemStack ;
27
27
import net .minecraft .world .level .Level ;
28
- import net .minecraft .world .level .block .Block ;
29
28
import net .minecraft .world .level .block .entity .BlockEntity ;
30
29
import net .minecraft .world .level .block .state .BlockState ;
31
30
import net .minecraft .world .phys .AABB ;
32
31
import net .minecraft .world .phys .Vec3 ;
33
32
import net .minecraftforge .network .PacketDistributor ;
34
- import org .checkerframework .checker .units .qual .C ;
35
33
import org .jetbrains .annotations .Nullable ;
36
34
37
35
import java .util .Collection ;
@@ -47,8 +45,17 @@ public class GargoyleBlockEntity extends BlockEntity {
47
45
48
46
private ParticleOptions drippingFluid ;
49
47
48
+ private final Direction fluidOffset ;
49
+
50
50
public GargoyleBlockEntity (BlockPos pos , BlockState state ) {
51
51
super (OBlockEntities .GARGOYLE .get (), pos , state );
52
+ var attachment = state .getValue (GargoyleBlock .ATTACHMENT );
53
+ var facing = state .getValue (GargoyleBlock .FACING );
54
+ if (attachment == GargoyleBlock .AttachmentType .FLOOR ) {
55
+ fluidOffset = Direction .DOWN ;
56
+ } else {
57
+ fluidOffset = facing ;
58
+ }
52
59
}
53
60
54
61
private static Collection <Mob > getTargets (Level level , BlockPos pos ) {
@@ -89,13 +96,21 @@ public static void tick(Level level, BlockPos pos, BlockState state, GargoyleBlo
89
96
90
97
private void updateDripParticles (Level level , BlockPos pos , BlockState state ) {
91
98
for (int i = 1 ; i <= 2 ; i ++) {
92
- var targetPos = pos .below ( i );
99
+ var targetPos = pos .relative ( fluidOffset , i );
93
100
var targetState = level .getBlockState (targetPos );
94
101
var fluid = targetState .getFluidState ();
95
102
if (!fluid .isEmpty ()) {
96
103
drippingFluid = fluid .getDripParticle ();
97
104
return ;
98
105
}
106
+
107
+ if (!targetState .isRedstoneConductor (level , pos )) {
108
+ break ;
109
+ }
110
+
111
+ if (!targetState .isFaceSturdy (level , pos , Direction .UP ) || !targetState .isFaceSturdy (level , pos , Direction .DOWN )) {
112
+ break ;
113
+ }
99
114
}
100
115
101
116
if (level .isRainingAt (pos .above ())) {
0 commit comments