Skip to content

Commit

Permalink
Add option to disable action detection
Browse files Browse the repository at this point in the history
  • Loading branch information
NikitaCartes committed Nov 12, 2023
1 parent a6d053f commit c720da9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ detect-advancement-action=true
# Default: true
detect-rotation=true

# Whether or not to detect player action (hitting, breaking blocks or moving) as motility.
# Default: true
detect-action=true

# Whether or not to hide sessile players in the player tab list.
# Default: false
hide-sessile-in-tab-list=false
Expand Down
1 change: 1 addition & 0 deletions src/main/java/net/bytzo/sessility/SessilityProperties.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public class SessilityProperties extends Settings<SessilityProperties> {
public final boolean hideSessileInServerList = this.get("hide-sessile-in-server-list", false);
public final boolean detectAdvancementAction = this.get("detect-advancement-action", true);
public final boolean detectRotation = this.get("detect-rotation", true);
public final boolean detectAction = this.get("detect-action", true);

public SessilityProperties(Properties properties) {
super(properties);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,10 @@ private void postTick(CallbackInfo callbackInfo) {

@Inject(method = "resetLastActionTime()V", at = @At("HEAD"))
private void preResetLastActionTime(CallbackInfo callbackInfo) {
// If action is taken, make the player not sessile.
this.setSessile(false);
if (Sessility.settings().properties().detectAction) {
// If action is taken, make the player not sessile.
this.setSessile(false);
}
}

@Inject(method = "getTabListDisplayName()Lnet/minecraft/network/chat/Component;", at = @At("RETURN"), cancellable = true)
Expand Down

0 comments on commit c720da9

Please sign in to comment.