1
1
package com .uraneptus .sullysmod .common .blocks ;
2
2
3
- import com .uraneptus .sullysmod .core .registry .SMBlocks ;
4
3
import net .minecraft .core .BlockPos ;
5
- import net .minecraft .core .particles .ParticleTypes ;
6
- import net .minecraft .server .level .ServerLevel ;
7
- import net .minecraft .util .Mth ;
8
- import net .minecraft .util .RandomSource ;
9
4
import net .minecraft .world .entity .Entity ;
10
5
import net .minecraft .world .entity .LivingEntity ;
11
- import net .minecraft .world .entity .Mob ;
12
- import net .minecraft .world .entity .ai .targeting .TargetingConditions ;
13
- import net .minecraft .world .entity .player .Player ;
14
6
import net .minecraft .world .level .BlockGetter ;
15
7
import net .minecraft .world .level .Level ;
16
8
import net .minecraft .world .level .LightLayer ;
17
9
import net .minecraft .world .level .block .HalfTransparentBlock ;
18
10
import net .minecraft .world .level .block .state .BlockState ;
19
- import net .minecraft .world .phys .Vec3 ;
20
11
import net .minecraft .world .phys .shapes .CollisionContext ;
21
12
import net .minecraft .world .phys .shapes .EntityCollisionContext ;
22
13
import net .minecraft .world .phys .shapes .Shapes ;
23
14
import net .minecraft .world .phys .shapes .VoxelShape ;
24
15
25
- import java .util .ArrayList ;
26
-
27
16
public class AmberBlock extends HalfTransparentBlock {
28
17
29
18
private static final VoxelShape MELTING_COLLISION_SHAPE = Shapes .box (0.0D , 0.0D , 0.0D , 1.0D , (double )0.0F , 1.0D );
@@ -48,40 +37,7 @@ public VoxelShape getCollisionShape(BlockState pState, BlockGetter pLevel, Block
48
37
return Shapes .block ();
49
38
}
50
39
51
-
52
-
53
- @ Override
54
- public void randomTick (BlockState pState , ServerLevel pLevel , BlockPos pPos , RandomSource pRandom ) {
55
- BlockPos blockPos = new BlockPos (pPos .getX (), pPos .getY () + 1 , pPos .getZ ());
56
- if (pLevel .getBrightness (LightLayer .BLOCK , blockPos ) > 11 ) {
57
- System .out .println ("BRIGHT" );
58
- }
59
- }
60
-
61
- public void onRemove (BlockState pState , Level pLevel , BlockPos pPos , BlockState pNewState , boolean pIsMoving ) {
62
-
63
- Entity entity = pLevel .getNearestEntity (new ArrayList <>(), TargetingConditions .DEFAULT , null , pPos .getX (), pPos .getY (), pPos .getZ ());
64
- if (entity instanceof Mob mob ) {
65
- mob .setNoAi (false );
66
- }
67
- if (ENTITY_STUCK instanceof Mob mob ) {
68
- mob .setNoAi (false );
69
- }
70
- System .out .println ("AMBER BROKE" );
71
- super .onRemove (pState , pLevel , pPos , pNewState , pIsMoving );
72
- }
73
-
74
- public void stepOn (Level pLevel , BlockPos pPos , BlockState pState , Entity pEntity ) {
75
- BlockPos blockPos = new BlockPos (pPos .getX (), pPos .getY () + 1 , pPos .getZ ());
76
- if (pLevel .getBrightness (LightLayer .BLOCK , blockPos ) > 11 ) {
77
- if (pEntity instanceof LivingEntity ) {
78
- System .out .println ("BRIGHT STEP" );
79
- //pEntity.teleportTo(pPos.getX(), pPos.getY() - 0.5F, pPos.getZ());
80
- }
81
- }
82
-
83
- super .stepOn (pLevel , pPos , pState , pEntity );
84
- }
40
+ /*
85
41
86
42
public void entityInside(BlockState pState, Level pLevel, BlockPos pPos, Entity pEntity) {
87
43
if (!(pEntity instanceof LivingEntity) || pEntity.getFeetBlockState().is(this)) {
@@ -106,4 +62,6 @@ public void entityInside(BlockState pState, Level pLevel, BlockPos pPos, Entity
106
62
}
107
63
}
108
64
}
65
+
66
+ */
109
67
}
0 commit comments