@@ -47,6 +47,11 @@ public void onStacksDropped(BlockState state, ServerWorld world, BlockPos pos, I
47
47
this .dropExperience (world , pos , i );
48
48
}
49
49
50
+ @ Override
51
+ public void onStateReplaced (BlockState state , World world , BlockPos pos , BlockState newState , boolean moved ) {
52
+ super .onStateReplaced (state , world , pos , newState , moved );
53
+ stopMotion (world ,pos );
54
+ }
50
55
51
56
@ Override
52
57
public BlockRenderType getRenderType (BlockState state ) {
@@ -56,6 +61,14 @@ public BlockRenderType getRenderType(BlockState state) {
56
61
public static void disarm (World world , BlockPos pos ) {
57
62
if (world .isClient ()) return ;
58
63
64
+ stopMotion (world ,pos );
65
+ world .setBlockState (pos , Blocks .SPRUCE_PLANKS .getDefaultState ());
66
+ world .playSound (null , pos , SoundEvents .BLOCK_BEACON_DEACTIVATE , SoundCategory .BLOCKS , 1 , 0.95f );
67
+
68
+ }
69
+
70
+ private static void stopMotion (World world , BlockPos pos )
71
+ {
59
72
DimensionIdProvider provider = (DimensionIdProvider ) world ;
60
73
ChunkPos chunkPos = world .getChunk (pos ).getPos ();
61
74
LoadedServerShip ship = (LoadedServerShip ) ValkyrienSkiesMod .getVsCore ().getHooks ().getCurrentShipServerWorld ().getLoadedShips ().getByChunkPos (chunkPos .x , chunkPos .z , provider .getDimensionId ());
@@ -65,9 +78,5 @@ public static void disarm(World world, BlockPos pos) {
65
78
seatedControllingPlayer .setCruise (false );
66
79
seatedControllingPlayer .setUpImpulse (0 );
67
80
ship .setAttachment (SeatedControllingPlayer .class , seatedControllingPlayer );
68
-
69
- world .setBlockState (pos , Blocks .SPRUCE_PLANKS .getDefaultState ());
70
- world .playSound (null , pos , SoundEvents .BLOCK_BEACON_DEACTIVATE , SoundCategory .BLOCKS , 1 , 0.95f );
71
-
72
81
}
73
82
}
0 commit comments