11package com .uraneptus .sullysmod .common .blocks ;
22
3- import com .uraneptus .sullysmod .core .registry .SMBlocks ;
43import 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 ;
94import net .minecraft .world .entity .Entity ;
105import 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 ;
146import net .minecraft .world .level .BlockGetter ;
157import net .minecraft .world .level .Level ;
168import net .minecraft .world .level .LightLayer ;
179import net .minecraft .world .level .block .HalfTransparentBlock ;
1810import net .minecraft .world .level .block .state .BlockState ;
19- import net .minecraft .world .phys .Vec3 ;
2011import net .minecraft .world .phys .shapes .CollisionContext ;
2112import net .minecraft .world .phys .shapes .EntityCollisionContext ;
2213import net .minecraft .world .phys .shapes .Shapes ;
2314import net .minecraft .world .phys .shapes .VoxelShape ;
2415
25- import java .util .ArrayList ;
26-
2716public class AmberBlock extends HalfTransparentBlock {
2817
2918 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
4837 return Shapes .block ();
4938 }
5039
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+ /*
8541
8642 public void entityInside(BlockState pState, Level pLevel, BlockPos pPos, Entity pEntity) {
8743 if (!(pEntity instanceof LivingEntity) || pEntity.getFeetBlockState().is(this)) {
@@ -106,4 +62,6 @@ public void entityInside(BlockState pState, Level pLevel, BlockPos pPos, Entity
10662 }
10763 }
10864 }
65+
66+ */
10967}
0 commit comments