1
0
mirror of https://github.com/GeyserMC/Geyser.git synced 2026-01-04 15:31:36 +00:00

Update configurate branch

This commit is contained in:
onebeastchris
2025-02-28 18:46:18 +01:00
parent 42f135f85b
commit cd447899a9
5 changed files with 19 additions and 17 deletions

View File

@@ -61,9 +61,9 @@ public final class ConfigLoader {
GitHub: https://github.com/GeyserMC/Geyser
Discord: https://discord.gg/geysermc
Wiki: https://wiki.geysermc.org/
Wiki: https://geysermc.org/wiki
NOTICE: See https://wiki.geysermc.org/geyser/setup/ for the setup guide. Many video tutorials are outdated.
NOTICE: See https://geysermc.org/wiki/geyser/setup/ for the setup guide. Many video tutorials are outdated.
In most cases, especially with server hosting providers, further hosting-specific configuration is required.
--------------------------------""";

View File

@@ -65,20 +65,21 @@ public class CreativeItemRegistryPopulator {
static List<CreativeItemGroup> readCreativeItemGroups(ItemRegistryPopulator.PaletteVersion palette, List<CreativeItemData> creativeItemData) {
GeyserBootstrap bootstrap = GeyserImpl.getInstance().getBootstrap();
JsonNode creativeItemEntries;
JsonArray creativeItemEntries;
try (InputStream stream = bootstrap.getResourceOrThrow(String.format("bedrock/creative_items.%s.json", palette.version()))) {
creativeItemEntries = GeyserImpl.JSON_MAPPER.readTree(stream).get("groups");
creativeItemEntries = JsonUtils.fromJson(stream).getAsJsonArray("groups");
} catch (Exception e) {
throw new AssertionError("Unable to load creative item groups", e);
}
List<CreativeItemGroup> creativeItemGroups = new ArrayList<>();
for (JsonNode creativeItemEntry : creativeItemEntries) {
CreativeItemCategory category = CreativeItemCategory.valueOf(creativeItemEntry.get("category").asText().toUpperCase(Locale.ROOT));
String name = creativeItemEntry.get("name").asText();
for (JsonElement creativeItemEntry : creativeItemEntries) {
JsonObject creativeItemEntryObject = creativeItemEntry.getAsJsonObject();
CreativeItemCategory category = CreativeItemCategory.valueOf(creativeItemEntryObject.get("category").getAsString().toUpperCase(Locale.ROOT));
String name = creativeItemEntryObject.get("name").getAsString();
JsonNode icon = creativeItemEntry.get("icon");
String identifier = icon.get("id").asText();
JsonElement icon = creativeItemEntryObject.get("icon");
String identifier = icon.getAsJsonObject().get("id").getAsString();
ItemData itemData;
if (identifier.equals("minecraft:air")) {
@@ -115,7 +116,8 @@ public class CreativeItemRegistryPopulator {
continue;
}
int groupId = ((JsonObject) itemNode).get("groupId") != null ? itemNode.getAsInt("groupId") : 0;
var groupIdElement = itemNode.getAsJsonObject().get("groupId");
int groupId = groupIdElement != null ? groupIdElement.getAsInt() : 0;
itemConsumer.accept(itemBuilder, groupId);
}

View File

@@ -787,7 +787,7 @@ public class GeyserSession implements GeyserConnection, GeyserCommandSource {
upstream.sendPacket(playStatusPacket);
SetCommandsEnabledPacket setCommandsEnabledPacket = new SetCommandsEnabledPacket();
setCommandsEnabledPacket.setCommandsEnabled(!geyser.getConfig().isXboxAchievementsEnabled());
setCommandsEnabledPacket.setCommandsEnabled(!geyser.config().xboxAchievementsEnabled());
upstream.sendPacket(setCommandsEnabledPacket);
UpdateAttributesPacket attributesPacket = new UpdateAttributesPacket();

View File

@@ -112,7 +112,7 @@ public class GeyserSessionAdapter extends SessionAdapter {
ClientIntentionPacket intentionPacket = event.getPacket();
String address;
if (geyser.getConfig().getRemote().isForwardHost()) {
if (geyser.config().java().forwardHostname()) {
address = clientData.getServerAddress().split(":")[0];
} else {
address = intentionPacket.getHostname();
@@ -174,7 +174,7 @@ public class GeyserSessionAdapter extends SessionAdapter {
customDisconnectMessage = GeyserLocale.getPlayerLocaleString("geyser.network.remote.authentication_type_mismatch", locale);
// Explain that they may be looking for Floodgate.
geyser.getLogger().warning(GeyserLocale.getLocaleStringLog(
geyser.getPlatformType() == PlatformType.STANDALONE ?
geyser.platformType() == PlatformType.STANDALONE ?
"geyser.network.remote.floodgate_explanation_standalone"
: "geyser.network.remote.floodgate_explanation_plugin",
Constants.FLOODGATE_DOWNLOAD_LOCATION
@@ -182,7 +182,7 @@ public class GeyserSessionAdapter extends SessionAdapter {
} else {
// Likely that Floodgate is not configured correctly.
customDisconnectMessage = GeyserLocale.getPlayerLocaleString("geyser.network.remote.floodgate_login_error", locale);
if (geyser.getPlatformType() == PlatformType.STANDALONE) {
if (geyser.platformType() == PlatformType.STANDALONE) {
geyser.getLogger().warning(GeyserLocale.getLocaleStringLog("geyser.network.remote.floodgate_login_error_standalone"));
}
}
@@ -205,7 +205,7 @@ public class GeyserSessionAdapter extends SessionAdapter {
} else {
GeyserImpl.getInstance().getLogger().error("An exception occurred: ", cause);
}
if (geyser.getConfig().isDebugMode()) {
if (geyser.config().debugMode()) {
cause.printStackTrace();
}
}
@@ -235,7 +235,7 @@ public class GeyserSessionAdapter extends SessionAdapter {
(event.getPacketClass() != null ? "(" + event.getPacketClass().getSimpleName() + ") " : "") +
event.getCause().getMessage())
);
if (geyser.getConfig().isDebugMode())
if (geyser.config().debugMode())
event.getCause().printStackTrace();
event.setSuppress(true);
}

View File

@@ -68,7 +68,7 @@ public final class BundleCache {
if (session.getTagCache().is(ItemTag.BUNDLES, itemStack)) {
if (itemStack.getBundleData() != null) {
session.getGeyser().getLogger().warning("Stack has bundle data already! It should not!");
if (session.getGeyser().getConfig().isDebugMode()) {
if (session.getGeyser().getLogger().isDebug()) {
session.getGeyser().getLogger().debug("Player: " + session.javaUsername());
session.getGeyser().getLogger().debug("Stack: " + itemStack);
}