1
0
mirror of https://github.com/GeyserMC/Geyser.git synced 2025-12-19 14:59:27 +00:00

Fix cocoa beans, rename shouldSkipSaving to skipSaving in the SessionAcceptCodeOfConductEvent

This commit is contained in:
onebeastchris
2025-10-11 15:26:41 +02:00
parent 4558576e73
commit 1a02b91293
3 changed files with 8 additions and 8 deletions

View File

@@ -42,7 +42,7 @@ import org.geysermc.geyser.api.event.java.ServerCodeOfConductEvent;
*/
public class SessionAcceptCodeOfConductEvent extends ConnectionEvent {
private final String codeOfConduct;
private boolean wasSavedElsewhere = false;
private boolean skipSaving = false;
public SessionAcceptCodeOfConductEvent(@NonNull GeyserConnection connection, String codeOfConduct) {
super(connection);
@@ -61,15 +61,15 @@ public class SessionAcceptCodeOfConductEvent extends ConnectionEvent {
* @return {@code true} if Geyser should not save the acceptance of the code of conduct in its own cache (through a JSON file), because it was saved elsewhere
* @since 2.9.0
*/
public boolean wasSavedElsewhere() {
return wasSavedElsewhere;
public boolean shouldSkipSaving() {
return skipSaving;
}
/**
* Sets {@link SessionAcceptCodeOfConductEvent#wasSavedElsewhere()} to {@code true}.
* Sets {@link SessionAcceptCodeOfConductEvent#shouldSkipSaving()} to {@code true}.
* @since 2.9.0
*/
public void savedElsewhere() {
this.wasSavedElsewhere = true;
public void skipSaving() {
this.skipSaving = true;
}
}

View File

@@ -81,7 +81,7 @@ public class CodeOfConductManager {
public void saveCodeOfConductAccepted(GeyserSession session, String codeOfConduct) {
SessionAcceptCodeOfConductEvent event = new SessionAcceptCodeOfConductEvent(session, codeOfConduct);
session.getGeyser().getEventBus().fire(event);
if (!event.wasSavedElsewhere()) {
if (!event.shouldSkipSaving()) {
playerAcceptedCodeOfConducts.put(session.xuid(), codeOfConduct.hashCode());
dirty = true;
}