@@ -36,6 +36,7 @@ public class SitService {
3636 private final double baseOffset ;
3737 private final HashMap <UUID , GSeat > seats = new HashMap <>();
3838 private final HashMap <Block , Set <GSeat >> blockSeats = new HashMap <>();
39+ private final HashSet <UUID > entityBlocked = new HashSet <>();
3940 private int sitUsageCount = 0 ;
4041 private long sitUsageNanoTime = 0 ;
4142
@@ -56,18 +57,22 @@ public SitService(GSitMain gSitMain) {
5657
5758 public boolean isBlockWithSeat (Block block ) { return blockSeats .containsKey (block ); }
5859
60+ public boolean isEntityBlocked (Entity entity ) { return entityBlocked .contains (entity .getUniqueId ()); }
61+
5962 public Set <GSeat > getSeatsByBlock (Block block ) { return blockSeats .getOrDefault (block , Collections .emptySet ()); }
6063
6164 public boolean kickSeatEntitiesFromBlock (Block block , LivingEntity entity ) {
6265 if (!isBlockWithSeat (block )) return true ;
63- if (!gSitMain .getPermissionService ().hasPermission (entity , "Kick.Sit" )) return false ;
66+ if (!gSitMain .getPermissionService ().hasPermission (entity , "Kick.Sit" , "Kick.*" )) return false ;
6467 for (GSeat seat : getSeatsByBlock (block )) if (!removeSeat (seat , GStopReason .KICKED )) return false ;
6568 return true ;
6669 }
6770
6871 public GSeat createSeat (Block block , LivingEntity entity ) { return createSeat (block , entity , true , 0d , 0d , 0d , entity .getLocation ().getYaw (), gSitMain .getConfigService ().CENTER_BLOCK ); }
6972
7073 public GSeat createSeat (Block block , LivingEntity entity , boolean canRotate , double xOffset , double yOffset , double zOffset , float seatRotation , boolean sitInBlockCenter ) {
74+ if (entityBlocked .contains (entity .getUniqueId ())) return null ;
75+
7176 Location returnLocation = entity .getLocation ();
7277 Location seatLocation = getSeatLocation (block , returnLocation , xOffset , yOffset , zOffset , sitInBlockCenter );
7378 if (!gSitMain .getEntityUtil ().isSitLocationValid (seatLocation )) return null ;
@@ -148,6 +153,8 @@ public void handleSafeSeatDismount(GSeat seat) {
148153
149154 Location returnLocation = gSitMain .getConfigService ().GET_UP_RETURN ? seat .getReturnLocation () : upLocation ;
150155
156+ if (entity .isValid ()) entityBlocked .add (entity .getUniqueId ());
157+
151158 gSitMain .getTaskService ().runDelayed (() -> {
152159 Location entityLocation = entity .getLocation ();
153160
@@ -156,7 +163,9 @@ public void handleSafeSeatDismount(GSeat seat) {
156163
157164 if (seat .getSeatEntity ().isValid ()) gSitMain .getEntityUtil ().setEntityLocation (seat .getSeatEntity (), returnLocation );
158165 if (entity .isValid ()) gSitMain .getEntityUtil ().setEntityLocation (entity , returnLocation );
159- }, 0 );
166+
167+ entityBlocked .remove (entity .getUniqueId ());
168+ }, returnLocation , 1 );
160169 }
161170
162171 public GSeat createStairSeatForEntity (Block block , LivingEntity entity ) {
0 commit comments