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:
@@ -42,7 +42,7 @@ import org.geysermc.geyser.api.event.java.ServerCodeOfConductEvent;
|
|||||||
*/
|
*/
|
||||||
public class SessionAcceptCodeOfConductEvent extends ConnectionEvent {
|
public class SessionAcceptCodeOfConductEvent extends ConnectionEvent {
|
||||||
private final String codeOfConduct;
|
private final String codeOfConduct;
|
||||||
private boolean wasSavedElsewhere = false;
|
private boolean skipSaving = false;
|
||||||
|
|
||||||
public SessionAcceptCodeOfConductEvent(@NonNull GeyserConnection connection, String codeOfConduct) {
|
public SessionAcceptCodeOfConductEvent(@NonNull GeyserConnection connection, String codeOfConduct) {
|
||||||
super(connection);
|
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
|
* @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
|
* @since 2.9.0
|
||||||
*/
|
*/
|
||||||
public boolean wasSavedElsewhere() {
|
public boolean shouldSkipSaving() {
|
||||||
return wasSavedElsewhere;
|
return skipSaving;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets {@link SessionAcceptCodeOfConductEvent#wasSavedElsewhere()} to {@code true}.
|
* Sets {@link SessionAcceptCodeOfConductEvent#shouldSkipSaving()} to {@code true}.
|
||||||
* @since 2.9.0
|
* @since 2.9.0
|
||||||
*/
|
*/
|
||||||
public void savedElsewhere() {
|
public void skipSaving() {
|
||||||
this.wasSavedElsewhere = true;
|
this.skipSaving = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ public class CodeOfConductManager {
|
|||||||
public void saveCodeOfConductAccepted(GeyserSession session, String codeOfConduct) {
|
public void saveCodeOfConductAccepted(GeyserSession session, String codeOfConduct) {
|
||||||
SessionAcceptCodeOfConductEvent event = new SessionAcceptCodeOfConductEvent(session, codeOfConduct);
|
SessionAcceptCodeOfConductEvent event = new SessionAcceptCodeOfConductEvent(session, codeOfConduct);
|
||||||
session.getGeyser().getEventBus().fire(event);
|
session.getGeyser().getEventBus().fire(event);
|
||||||
if (!event.wasSavedElsewhere()) {
|
if (!event.shouldSkipSaving()) {
|
||||||
playerAcceptedCodeOfConducts.put(session.xuid(), codeOfConduct.hashCode());
|
playerAcceptedCodeOfConducts.put(session.xuid(), codeOfConduct.hashCode());
|
||||||
dirty = true;
|
dirty = true;
|
||||||
}
|
}
|
||||||
|
|||||||
Submodule core/src/main/resources/mappings updated: ae31e2284a...9bb4fc8e17
Reference in New Issue
Block a user