3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-11-03 14:50:19 +01:00

Add config option for enabling achievements (#1504)

* Add config option for enabling achievements

* Disabled achievements by default and added warning about commands being disabled

* Update config.yml

* Rename achievements-enabled to xbox-achievements-enabled for clarity

Co-authored-by: Camotoy <20743703+DoctorMacc@users.noreply.github.com>
Dieser Commit ist enthalten in:
rtm516 2020-11-07 00:52:09 +00:00 committet von GitHub
Ursprung 0e15aa7441
Commit a6cc28ee80
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23
4 geänderte Dateien mit 12 neuen und 2 gelöschten Zeilen

Datei anzeigen

@ -81,6 +81,8 @@ public interface GeyserConfiguration {
boolean isForceResourcePacks(); boolean isForceResourcePacks();
boolean isXboxAchievementsEnabled();
int getCacheImages(); int getCacheImages();
IMetricsInfo getMetrics(); IMetricsInfo getMetrics();

Datei anzeigen

@ -107,6 +107,9 @@ public abstract class GeyserJacksonConfiguration implements GeyserConfiguration
@JsonProperty("force-resource-packs") @JsonProperty("force-resource-packs")
private boolean forceResourcePacks = true; private boolean forceResourcePacks = true;
@JsonProperty("xbox-achievements-enabled")
private boolean xboxAchievementsEnabled = false;
private MetricsInfo metrics = new MetricsInfo(); private MetricsInfo metrics = new MetricsInfo();
@Getter @Getter

Datei anzeigen

@ -634,7 +634,7 @@ public class GeyserSession implements CommandSender {
startGamePacket.setLevelGameType(GameType.SURVIVAL); startGamePacket.setLevelGameType(GameType.SURVIVAL);
startGamePacket.setDifficulty(1); startGamePacket.setDifficulty(1);
startGamePacket.setDefaultSpawn(Vector3i.ZERO); startGamePacket.setDefaultSpawn(Vector3i.ZERO);
startGamePacket.setAchievementsDisabled(true); startGamePacket.setAchievementsDisabled(!connector.getConfig().isXboxAchievementsEnabled());
startGamePacket.setCurrentTick(-1); startGamePacket.setCurrentTick(-1);
startGamePacket.setEduEditionOffers(0); startGamePacket.setEduEditionOffers(0);
startGamePacket.setEduFeaturesEnabled(false); startGamePacket.setEduFeaturesEnabled(false);
@ -645,7 +645,7 @@ public class GeyserSession implements CommandSender {
startGamePacket.getGamerules().add(new GameRuleData<>("showcoordinates", true)); startGamePacket.getGamerules().add(new GameRuleData<>("showcoordinates", true));
startGamePacket.setPlatformBroadcastMode(GamePublishSetting.PUBLIC); startGamePacket.setPlatformBroadcastMode(GamePublishSetting.PUBLIC);
startGamePacket.setXblBroadcastMode(GamePublishSetting.PUBLIC); startGamePacket.setXblBroadcastMode(GamePublishSetting.PUBLIC);
startGamePacket.setCommandsEnabled(true); startGamePacket.setCommandsEnabled(!connector.getConfig().isXboxAchievementsEnabled());
startGamePacket.setTexturePacksRequired(false); startGamePacket.setTexturePacksRequired(false);
startGamePacket.setBonusChestEnabled(false); startGamePacket.setBonusChestEnabled(false);
startGamePacket.setStartingWithMap(false); startGamePacket.setStartingWithMap(false);

Datei anzeigen

@ -117,6 +117,11 @@ above-bedrock-nether-building: false
# want to download the resource packs # want to download the resource packs
force-resource-packs: true force-resource-packs: true
# Allows Xbox achievements to be unlocked.
# This disables certain commands so the Bedrock client can't to "cheat" to get them.
# Commands such as /gamemode and /give will not work from Bedrock with this enabled
xbox-achievements-enabled: false
# bStats is a stat tracker that is entirely anonymous and tracks only basic information # bStats is a stat tracker that is entirely anonymous and tracks only basic information
# about Geyser, such as how many people are online, how many servers are using Geyser, # about Geyser, such as how many people are online, how many servers are using Geyser,
# what OS is being used, etc. You can learn more about bStats here: https://bstats.org/. # what OS is being used, etc. You can learn more about bStats here: https://bstats.org/.