mirror of
https://github.com/Oth3r/Sit.git
synced 2025-09-20 00:13:21 +02:00
Merge branch '1.20.6' into 1.20.4
# Conflicts: # gradle.properties # src/main/java/one/oth3r/sit/utl/Events.java
This commit is contained in:
commit
f7f67633e6
65 changed files with 950 additions and 521 deletions
|
@ -54,7 +54,7 @@ public class Events {
|
|||
ClientPlayerEntity player = client.player;
|
||||
|
||||
while (config__key.wasPressed()) {
|
||||
client.setScreen(new ConfigScreen(client.currentScreen));
|
||||
client.setScreen(SitClient.getConfigScreen(client.currentScreen));
|
||||
}
|
||||
|
||||
/// anything below uses the player object, make sure it's not null
|
||||
|
@ -181,7 +181,19 @@ public class Events {
|
|||
if (player == null || player.isSpectator()) return ActionResult.PASS;
|
||||
|
||||
// consume if sitting, if not pass
|
||||
return Logic.sit(player,hitResult.getBlockPos(),hitResult) ? ActionResult.CONSUME : ActionResult.PASS;
|
||||
ActionResult result = Logic.canSit(player,hitResult.getBlockPos(),hitResult) ? ActionResult.CONSUME : ActionResult.PASS;
|
||||
// todo test
|
||||
if (result.equals(ActionResult.CONSUME)) {
|
||||
try {
|
||||
CommandDispatcher<ServerCommandSource> dispatcher = Data.getServer().getCommandSource().getDispatcher();
|
||||
ParseResults<ServerCommandSource> parse = dispatcher.parse("sit", player.getCommandSource());
|
||||
dispatcher.execute(parse);
|
||||
} catch (CommandSyntaxException e) {
|
||||
Data.LOGGER.error("Error executing sit command for player {}", player.getName().getString());
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
});
|
||||
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue