forked from GeyserMC/Geyser
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>
This commit is contained in:
parent
0e15aa7441
commit
a6cc28ee80
4 changed files with 12 additions and 2 deletions
|
@ -81,6 +81,8 @@ public interface GeyserConfiguration {
|
||||||
|
|
||||||
boolean isForceResourcePacks();
|
boolean isForceResourcePacks();
|
||||||
|
|
||||||
|
boolean isXboxAchievementsEnabled();
|
||||||
|
|
||||||
int getCacheImages();
|
int getCacheImages();
|
||||||
|
|
||||||
IMetricsInfo getMetrics();
|
IMetricsInfo getMetrics();
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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);
|
||||||
|
|
|
@ -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/.
|
||||||
|
|
Loading…
Reference in a new issue