mirror of
https://github.com/GeyserMC/Geyser.git
synced 2025-12-19 14:59:27 +00:00
Bedrock 1.21.60 support, API 2.6.1
This commit is contained in:
@@ -36,9 +36,6 @@ public final class Constants {
|
||||
|
||||
public static final String FLOODGATE_DOWNLOAD_LOCATION = "https://geysermc.org/download#floodgate";
|
||||
public static final String GEYSER_DOWNLOAD_LOCATION = "https://geysermc.org/download";
|
||||
|
||||
@Deprecated
|
||||
static final String SAVED_REFRESH_TOKEN_FILE = "saved-refresh-tokens.json";
|
||||
static final String SAVED_AUTH_CHAINS_FILE = "saved-auth-chains.json";
|
||||
|
||||
public static final String GEYSER_CUSTOM_NAMESPACE = "geyser_custom";
|
||||
|
||||
@@ -29,7 +29,6 @@ import com.fasterxml.jackson.core.JsonParser;
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.google.gson.Gson;
|
||||
import io.netty.channel.epoll.Epoll;
|
||||
import io.netty.util.NettyRuntime;
|
||||
import io.netty.util.concurrent.DefaultThreadFactory;
|
||||
@@ -39,8 +38,6 @@ import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.format.NamedTextColor;
|
||||
import net.raphimc.minecraftauth.step.java.session.StepFullJavaSession;
|
||||
import net.raphimc.minecraftauth.step.msa.StepMsaToken;
|
||||
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
@@ -99,7 +96,6 @@ import org.geysermc.geyser.translator.text.MessageTranslator;
|
||||
import org.geysermc.geyser.util.AssetUtils;
|
||||
import org.geysermc.geyser.util.CooldownUtils;
|
||||
import org.geysermc.geyser.util.Metrics;
|
||||
import org.geysermc.geyser.util.MinecraftAuthLogger;
|
||||
import org.geysermc.geyser.util.NewsHandler;
|
||||
import org.geysermc.geyser.util.VersionCheckUtils;
|
||||
import org.geysermc.geyser.util.WebUtils;
|
||||
@@ -566,53 +562,6 @@ public class GeyserImpl implements GeyserApi, EventRegistrar {
|
||||
// May be written/read to on multiple threads from each GeyserSession as well as writing the config
|
||||
savedAuthChains = new ConcurrentHashMap<>();
|
||||
|
||||
// TODO Remove after a while - just a migration help
|
||||
//noinspection deprecation
|
||||
File refreshTokensFile = bootstrap.getSavedUserLoginsFolder().resolve(Constants.SAVED_REFRESH_TOKEN_FILE).toFile();
|
||||
if (refreshTokensFile.exists()) {
|
||||
logger.info("Migrating refresh tokens to auth chains...");
|
||||
TypeReference<Map<String, String>> type = new TypeReference<>() { };
|
||||
Map<String, String> refreshTokens = null;
|
||||
try {
|
||||
refreshTokens = JSON_MAPPER.readValue(refreshTokensFile, type);
|
||||
} catch (IOException e) {
|
||||
// ignored - we'll just delete this file :))
|
||||
}
|
||||
|
||||
if (refreshTokens != null) {
|
||||
List<String> validUsers = config.getSavedUserLogins();
|
||||
final Gson gson = new Gson();
|
||||
for (Map.Entry<String, String> entry : refreshTokens.entrySet()) {
|
||||
String user = entry.getKey();
|
||||
if (!validUsers.contains(user)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Migrate refresh tokens to auth chains
|
||||
try {
|
||||
StepFullJavaSession javaSession = PendingMicrosoftAuthentication.AUTH_FLOW.apply(false, 10);
|
||||
StepFullJavaSession.FullJavaSession fullJavaSession = javaSession.getFromInput(
|
||||
MinecraftAuthLogger.INSTANCE,
|
||||
PendingMicrosoftAuthentication.AUTH_CLIENT,
|
||||
new StepMsaToken.RefreshToken(entry.getValue())
|
||||
);
|
||||
|
||||
String authChain = gson.toJson(javaSession.toJson(fullJavaSession));
|
||||
savedAuthChains.put(user, authChain);
|
||||
} catch (Exception e) {
|
||||
GeyserImpl.getInstance().getLogger().warning("Could not migrate " + entry.getKey() + " to an auth chain! " +
|
||||
"They will need to sign in the next time they join Geyser.");
|
||||
}
|
||||
|
||||
// Ensure the new additions are written to the file
|
||||
scheduleAuthChainsWrite();
|
||||
}
|
||||
}
|
||||
|
||||
// Finally: Delete it. Goodbye!
|
||||
refreshTokensFile.delete();
|
||||
}
|
||||
|
||||
File authChainsFile = bootstrap.getSavedUserLoginsFolder().resolve(Constants.SAVED_AUTH_CHAINS_FILE).toFile();
|
||||
if (authChainsFile.exists()) {
|
||||
TypeReference<Map<String, String>> type = new TypeReference<>() { };
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
package org.geysermc.geyser.item;
|
||||
|
||||
import org.cloudburstmc.protocol.bedrock.data.definitions.ItemDefinition;
|
||||
import org.cloudburstmc.protocol.bedrock.data.inventory.ComponentItemData;
|
||||
|
||||
public record GeyserCustomMappingData(ComponentItemData componentItemData, ItemDefinition itemDefinition, String stringId, int integerId) {
|
||||
public record GeyserCustomMappingData(ItemDefinition itemDefinition, String stringId, int integerId) {
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@ import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
import org.cloudburstmc.protocol.bedrock.codec.BedrockCodec;
|
||||
import org.cloudburstmc.protocol.bedrock.codec.v748.Bedrock_v748;
|
||||
import org.cloudburstmc.protocol.bedrock.codec.v766.Bedrock_v766;
|
||||
import org.cloudburstmc.protocol.bedrock.codec.v776.Bedrock_v776;
|
||||
import org.cloudburstmc.protocol.bedrock.netty.codec.packet.BedrockPacketCodec;
|
||||
import org.geysermc.geyser.session.GeyserSession;
|
||||
import org.geysermc.mcprotocollib.protocol.codec.MinecraftCodec;
|
||||
@@ -47,8 +48,8 @@ public final class GameProtocol {
|
||||
* Default Bedrock codec that should act as a fallback. Should represent the latest available
|
||||
* release of the game that Geyser supports.
|
||||
*/
|
||||
public static final BedrockCodec DEFAULT_BEDROCK_CODEC = CodecProcessor.processCodec(Bedrock_v766.CODEC.toBuilder()
|
||||
.minecraftVersion("1.21.51")
|
||||
public static final BedrockCodec DEFAULT_BEDROCK_CODEC = CodecProcessor.processCodec(Bedrock_v776.CODEC.toBuilder()
|
||||
.minecraftVersion("1.21.60")
|
||||
.build());
|
||||
|
||||
/**
|
||||
@@ -66,9 +67,10 @@ public final class GameProtocol {
|
||||
SUPPORTED_BEDROCK_CODECS.add(CodecProcessor.processCodec(Bedrock_v748.CODEC.toBuilder()
|
||||
.minecraftVersion("1.21.40 - 1.21.44")
|
||||
.build()));
|
||||
SUPPORTED_BEDROCK_CODECS.add(DEFAULT_BEDROCK_CODEC.toBuilder()
|
||||
SUPPORTED_BEDROCK_CODECS.add(CodecProcessor.processCodec(Bedrock_v766.CODEC.toBuilder()
|
||||
.minecraftVersion("1.21.50 - 1.21.51")
|
||||
.build());
|
||||
.build()));
|
||||
SUPPORTED_BEDROCK_CODECS.add(DEFAULT_BEDROCK_CODEC);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -91,6 +93,10 @@ public final class GameProtocol {
|
||||
return session.getUpstream().getProtocolVersion() == Bedrock_v748.CODEC.getProtocolVersion();
|
||||
}
|
||||
|
||||
public static boolean isPreCreativeInventoryRewrite(int protocolVersion) {
|
||||
return protocolVersion < 776;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the {@link PacketCodec} for Minecraft: Java Edition.
|
||||
*
|
||||
|
||||
@@ -896,4 +896,14 @@ public class LoggingPacketHandler implements BedrockPacketHandler {
|
||||
public PacketSignal handle(TrimDataPacket packet) {
|
||||
return defaultHandler(packet);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public PacketSignal handle(MovementPredictionSyncPacket packet) {
|
||||
return defaultHandler(packet);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PacketSignal handle(ServerboundDiagnosticsPacket packet) {
|
||||
return defaultHandler(packet);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
|
||||
package org.geysermc.geyser.registry;
|
||||
|
||||
import org.cloudburstmc.protocol.bedrock.packet.ServerboundDiagnosticsPacket;
|
||||
import org.geysermc.mcprotocollib.protocol.packet.ingame.clientbound.ClientboundDelimiterPacket;
|
||||
import org.geysermc.mcprotocollib.protocol.packet.ingame.clientbound.ClientboundTabListPacket;
|
||||
import org.geysermc.mcprotocollib.protocol.packet.ingame.clientbound.level.ClientboundChunkBatchStartPacket;
|
||||
@@ -49,6 +50,7 @@ public class PacketTranslatorRegistry<T> extends AbstractMappedRegistry<Class<?
|
||||
IGNORED_PACKETS.add(ClientboundDelimiterPacket.class); // Not implemented, spams logs
|
||||
IGNORED_PACKETS.add(ClientboundLightUpdatePacket.class); // Light is handled on Bedrock for us
|
||||
IGNORED_PACKETS.add(ClientboundTabListPacket.class); // Cant be implemented in Bedrock
|
||||
IGNORED_PACKETS.add(ServerboundDiagnosticsPacket.class); // spammy
|
||||
}
|
||||
|
||||
protected PacketTranslatorRegistry() {
|
||||
|
||||
@@ -44,6 +44,7 @@ import org.cloudburstmc.nbt.NbtType;
|
||||
import org.cloudburstmc.nbt.NbtUtils;
|
||||
import org.cloudburstmc.protocol.bedrock.codec.v748.Bedrock_v748;
|
||||
import org.cloudburstmc.protocol.bedrock.codec.v766.Bedrock_v766;
|
||||
import org.cloudburstmc.protocol.bedrock.codec.v776.Bedrock_v776;
|
||||
import org.cloudburstmc.protocol.bedrock.data.BlockPropertyData;
|
||||
import org.cloudburstmc.protocol.bedrock.data.definitions.BlockDefinition;
|
||||
import org.geysermc.geyser.GeyserImpl;
|
||||
@@ -116,7 +117,40 @@ public final class BlockRegistryPopulator {
|
||||
private static void registerBedrockBlocks() {
|
||||
var blockMappers = ImmutableMap.<ObjectIntPair<String>, Remapper>builder()
|
||||
.put(ObjectIntPair.of("1_21_40", Bedrock_v748.CODEC.getProtocolVersion()), Conversion766_748::remapBlock)
|
||||
.put(ObjectIntPair.of("1_21_50", Bedrock_v766.CODEC.getProtocolVersion()), tag -> tag)
|
||||
.put(ObjectIntPair.of("1_21_50", Bedrock_v766.CODEC.getProtocolVersion()), tag -> tag) // TODO: Finish me
|
||||
.put(ObjectIntPair.of("1_21_60", Bedrock_v776.CODEC.getProtocolVersion()), tag -> {
|
||||
final String name = tag.getString("name");
|
||||
if (name.equals("minecraft:creaking_heart") && tag.getCompound("states").containsKey("active")) {
|
||||
NbtMapBuilder builder = tag.getCompound("states").toBuilder();
|
||||
builder.remove("active");
|
||||
builder.putString("creaking_heart_state", "awake");
|
||||
NbtMap states = builder.build();
|
||||
return tag.toBuilder().putCompound("states", states).build();
|
||||
}
|
||||
if ((name.endsWith("_door") || name.endsWith("fence_gate")) && tag.getCompound("states").containsKey("direction")) {
|
||||
NbtMapBuilder builder = tag.getCompound("states").toBuilder();
|
||||
Integer directionCardinality = (Integer) builder.remove("direction");
|
||||
switch (directionCardinality) {
|
||||
case 0:
|
||||
builder.putString("minecraft:cardinal_direction", "south");
|
||||
break;
|
||||
case 1:
|
||||
builder.putString("minecraft:cardinal_direction", "west");
|
||||
break;
|
||||
case 2:
|
||||
builder.putString( "minecraft:cardinal_direction" , "north");
|
||||
break;
|
||||
case 3:
|
||||
builder.putString("minecraft:cardinal_direction", "east");
|
||||
break;
|
||||
default:
|
||||
throw new AssertionError("Invalid direction: " + directionCardinality);
|
||||
}
|
||||
NbtMap states = builder.build();
|
||||
return tag.toBuilder().putCompound("states", states).build();
|
||||
}
|
||||
return tag;
|
||||
})
|
||||
.build();
|
||||
|
||||
// We can keep this strong as nothing should be garbage collected
|
||||
|
||||
@@ -31,6 +31,9 @@ import org.cloudburstmc.nbt.NbtMap;
|
||||
import org.cloudburstmc.nbt.NbtMapBuilder;
|
||||
import org.cloudburstmc.nbt.NbtUtils;
|
||||
import org.cloudburstmc.protocol.bedrock.data.definitions.ItemDefinition;
|
||||
import org.cloudburstmc.protocol.bedrock.data.inventory.CreativeItemCategory;
|
||||
import org.cloudburstmc.protocol.bedrock.data.inventory.CreativeItemData;
|
||||
import org.cloudburstmc.protocol.bedrock.data.inventory.CreativeItemGroup;
|
||||
import org.cloudburstmc.protocol.bedrock.data.inventory.ItemData;
|
||||
import org.geysermc.geyser.GeyserBootstrap;
|
||||
import org.geysermc.geyser.GeyserImpl;
|
||||
@@ -42,11 +45,13 @@ import org.geysermc.geyser.registry.type.GeyserMappingItem;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Base64;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.function.BiConsumer;
|
||||
import java.util.function.BiPredicate;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
public class CreativeItemRegistryPopulator {
|
||||
private static final List<BiPredicate<String, Integer>> JAVA_ONLY_ITEM_FILTER = List.of(
|
||||
@@ -54,7 +59,42 @@ public class CreativeItemRegistryPopulator {
|
||||
(identifier, data) -> identifier.equals("minecraft:empty_map") && data == 2
|
||||
);
|
||||
|
||||
static void populate(ItemRegistryPopulator.PaletteVersion palette, Map<String, ItemDefinition> definitions, Map<String, GeyserMappingItem> items, Consumer<ItemData.Builder> itemConsumer) {
|
||||
static List<CreativeItemGroup> readCreativeItemGroups(ItemRegistryPopulator.PaletteVersion palette, List<CreativeItemData> creativeItemData) {
|
||||
GeyserBootstrap bootstrap = GeyserImpl.getInstance().getBootstrap();
|
||||
|
||||
JsonNode creativeItemEntries;
|
||||
try (InputStream stream = bootstrap.getResourceOrThrow(String.format("bedrock/creative_items.%s.json", palette.version()))) {
|
||||
creativeItemEntries = GeyserImpl.JSON_MAPPER.readTree(stream).get("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();
|
||||
|
||||
JsonNode icon = creativeItemEntry.get("icon");
|
||||
String identifier = icon.get("id").asText();
|
||||
|
||||
ItemData itemData;
|
||||
if (identifier.equals("minecraft:air")) {
|
||||
itemData = ItemData.AIR;
|
||||
} else {
|
||||
itemData = creativeItemData.stream()
|
||||
.map(CreativeItemData::getItem)
|
||||
.filter(item -> item.getDefinition().getIdentifier().equals(identifier))
|
||||
.findFirst()
|
||||
.orElseThrow();
|
||||
}
|
||||
|
||||
creativeItemGroups.add(new CreativeItemGroup(category, name, itemData));
|
||||
}
|
||||
|
||||
return creativeItemGroups;
|
||||
}
|
||||
|
||||
static void populate(ItemRegistryPopulator.PaletteVersion palette, Map<String, ItemDefinition> definitions, Map<String, GeyserMappingItem> items, BiConsumer<ItemData.Builder, Integer> itemConsumer) {
|
||||
GeyserBootstrap bootstrap = GeyserImpl.getInstance().getBootstrap();
|
||||
|
||||
// Load creative items
|
||||
@@ -72,7 +112,9 @@ public class CreativeItemRegistryPopulator {
|
||||
continue;
|
||||
}
|
||||
|
||||
itemConsumer.accept(itemBuilder);
|
||||
int groupId = itemNode.get("groupId") != null ? itemNode.get("groupId").asInt() : 0;
|
||||
|
||||
itemConsumer.accept(itemBuilder, groupId);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,6 @@ import org.cloudburstmc.nbt.NbtMapBuilder;
|
||||
import org.cloudburstmc.nbt.NbtType;
|
||||
import org.cloudburstmc.protocol.bedrock.data.definitions.ItemDefinition;
|
||||
import org.cloudburstmc.protocol.bedrock.data.definitions.SimpleItemDefinition;
|
||||
import org.cloudburstmc.protocol.bedrock.data.inventory.ComponentItemData;
|
||||
import org.geysermc.geyser.GeyserImpl;
|
||||
import org.geysermc.geyser.api.item.custom.CustomItemData;
|
||||
import org.geysermc.geyser.api.item.custom.CustomRenderOffsets;
|
||||
@@ -106,12 +105,10 @@ public class CustomItemRegistryPopulator {
|
||||
}
|
||||
|
||||
public static GeyserCustomMappingData registerCustomItem(String customItemName, Item javaItem, GeyserMappingItem mapping, CustomItemData customItemData, int bedrockId, int protocolVersion) {
|
||||
ItemDefinition itemDefinition = new SimpleItemDefinition(customItemName, bedrockId, true);
|
||||
|
||||
NbtMapBuilder builder = createComponentNbt(customItemData, javaItem, mapping, customItemName, bedrockId, protocolVersion);
|
||||
ComponentItemData componentItemData = new ComponentItemData(customItemName, builder.build());
|
||||
ItemDefinition itemDefinition = new SimpleItemDefinition(customItemName, bedrockId, 1, true, builder.build());
|
||||
|
||||
return new GeyserCustomMappingData(componentItemData, itemDefinition, customItemName, bedrockId);
|
||||
return new GeyserCustomMappingData(itemDefinition, customItemName, bedrockId);
|
||||
}
|
||||
|
||||
static boolean initialCheck(String identifier, CustomItemData item, Map<String, GeyserMappingItem> mappings) {
|
||||
@@ -142,9 +139,11 @@ public class CustomItemRegistryPopulator {
|
||||
Item item = new Item(customIdentifier, Item.builder().components(components));
|
||||
Items.register(item, customItemData.javaId());
|
||||
|
||||
NbtMapBuilder builder = createComponentNbt(customItemData, customItemData.identifier(), customItemId,
|
||||
customItemData.isHat(), customItemData.displayHandheld(), protocolVersion);
|
||||
ItemMapping customItemMapping = ItemMapping.builder()
|
||||
.bedrockIdentifier(customIdentifier)
|
||||
.bedrockDefinition(new SimpleItemDefinition(customIdentifier, customItemId, true))
|
||||
.bedrockDefinition(new SimpleItemDefinition(customIdentifier, customItemId, 1, true, builder.build()))
|
||||
.bedrockData(0)
|
||||
.bedrockBlockDefinition(null)
|
||||
.toolType(customItemData.toolType())
|
||||
@@ -153,11 +152,7 @@ public class CustomItemRegistryPopulator {
|
||||
.javaItem(item)
|
||||
.build();
|
||||
|
||||
NbtMapBuilder builder = createComponentNbt(customItemData, customItemData.identifier(), customItemId,
|
||||
customItemData.isHat(), customItemData.displayHandheld(), protocolVersion);
|
||||
ComponentItemData componentItemData = new ComponentItemData(customIdentifier, builder.build());
|
||||
|
||||
return new NonVanillaItemRegistration(componentItemData, item, customItemMapping);
|
||||
return new NonVanillaItemRegistration(item, customItemMapping);
|
||||
}
|
||||
|
||||
private static NbtMapBuilder createComponentNbt(CustomItemData customItemData, Item javaItem, GeyserMappingItem mapping,
|
||||
|
||||
@@ -47,10 +47,12 @@ import org.cloudburstmc.nbt.NbtType;
|
||||
import org.cloudburstmc.nbt.NbtUtils;
|
||||
import org.cloudburstmc.protocol.bedrock.codec.v748.Bedrock_v748;
|
||||
import org.cloudburstmc.protocol.bedrock.codec.v766.Bedrock_v766;
|
||||
import org.cloudburstmc.protocol.bedrock.codec.v776.Bedrock_v776;
|
||||
import org.cloudburstmc.protocol.bedrock.data.definitions.BlockDefinition;
|
||||
import org.cloudburstmc.protocol.bedrock.data.definitions.ItemDefinition;
|
||||
import org.cloudburstmc.protocol.bedrock.data.definitions.SimpleItemDefinition;
|
||||
import org.cloudburstmc.protocol.bedrock.data.inventory.ComponentItemData;
|
||||
import org.cloudburstmc.protocol.bedrock.data.inventory.CreativeItemData;
|
||||
import org.cloudburstmc.protocol.bedrock.data.inventory.CreativeItemGroup;
|
||||
import org.cloudburstmc.protocol.bedrock.data.inventory.ItemData;
|
||||
import org.geysermc.geyser.Constants;
|
||||
import org.geysermc.geyser.GeyserBootstrap;
|
||||
@@ -68,6 +70,7 @@ import org.geysermc.geyser.item.components.Rarity;
|
||||
import org.geysermc.geyser.item.type.BlockItem;
|
||||
import org.geysermc.geyser.item.type.Item;
|
||||
import org.geysermc.geyser.level.block.property.Properties;
|
||||
import org.geysermc.geyser.network.GameProtocol;
|
||||
import org.geysermc.geyser.registry.BlockRegistries;
|
||||
import org.geysermc.geyser.registry.Registries;
|
||||
import org.geysermc.geyser.registry.type.BlockMappings;
|
||||
@@ -147,6 +150,7 @@ public class ItemRegistryPopulator {
|
||||
List<PaletteVersion> paletteVersions = new ArrayList<>(2);
|
||||
paletteVersions.add(new PaletteVersion("1_21_40", Bedrock_v748.CODEC.getProtocolVersion(), itemFallbacks, (item, mapping) -> mapping));
|
||||
paletteVersions.add(new PaletteVersion("1_21_50", Bedrock_v766.CODEC.getProtocolVersion()));
|
||||
paletteVersions.add(new PaletteVersion("1_21_60", Bedrock_v776.CODEC.getProtocolVersion()));
|
||||
|
||||
GeyserBootstrap bootstrap = GeyserImpl.getInstance().getBootstrap();
|
||||
|
||||
@@ -161,7 +165,8 @@ public class ItemRegistryPopulator {
|
||||
}
|
||||
|
||||
NbtMap vanillaComponents;
|
||||
try (InputStream stream = bootstrap.getResourceOrThrow("mappings/item_components.nbt")) {
|
||||
// TODO e.g. breeze rod icon does not load with our modified item components
|
||||
try (InputStream stream = bootstrap.getResourceOrThrow("bedrock/item_components.nbt")) {
|
||||
vanillaComponents = (NbtMap) NbtUtils.createGZIPReader(stream, true, true).readTag();
|
||||
} catch (Exception e) {
|
||||
throw new AssertionError("Unable to load Bedrock item components", e);
|
||||
@@ -195,7 +200,8 @@ public class ItemRegistryPopulator {
|
||||
|
||||
// Used for custom items
|
||||
int nextFreeBedrockId = 0;
|
||||
List<ComponentItemData> componentItemData = new ObjectArrayList<>();
|
||||
// TODO yeet
|
||||
List<ItemDefinition> componentItemData = new ObjectArrayList<>();
|
||||
|
||||
Int2ObjectMap<ItemDefinition> registry = new Int2ObjectOpenHashMap<>();
|
||||
Map<String, ItemDefinition> definitions = new Object2ObjectLinkedOpenHashMap<>();
|
||||
@@ -206,7 +212,15 @@ public class ItemRegistryPopulator {
|
||||
nextFreeBedrockId = id + 1;
|
||||
}
|
||||
|
||||
ItemDefinition definition = new SimpleItemDefinition(entry.getName().intern(), id, false);
|
||||
NbtMap components = null;
|
||||
if (entry.isComponentBased()) {
|
||||
components = vanillaComponents.getCompound(entry.getName());
|
||||
if (components == null) {
|
||||
throw new RuntimeException("Could not find vanilla components for vanilla component based item! " + entry.getName());
|
||||
}
|
||||
}
|
||||
|
||||
ItemDefinition definition = new SimpleItemDefinition(entry.getName().intern(), id, entry.getVersion(), entry.isComponentBased(), components);
|
||||
definitions.put(entry.getName(), definition);
|
||||
registry.put(definition.getRuntimeId(), definition);
|
||||
}
|
||||
@@ -222,7 +236,7 @@ public class ItemRegistryPopulator {
|
||||
// Temporary mapping to create stored items
|
||||
Map<Item, ItemMapping> javaItemToMapping = new Object2ObjectOpenHashMap<>();
|
||||
|
||||
List<ItemData> creativeItems = new ArrayList<>();
|
||||
List<CreativeItemData> creativeItems = new ArrayList<>();
|
||||
Set<String> noBlockDefinitions = new ObjectOpenHashSet<>();
|
||||
|
||||
// Fix: Usage of structure blocks/voids in recipes
|
||||
@@ -231,9 +245,9 @@ public class ItemRegistryPopulator {
|
||||
noBlockDefinitions.add("minecraft:structure_void");
|
||||
|
||||
AtomicInteger creativeNetId = new AtomicInteger();
|
||||
CreativeItemRegistryPopulator.populate(palette, definitions, items, itemBuilder -> {
|
||||
CreativeItemRegistryPopulator.populate(palette, definitions, items, (itemBuilder, groupId) -> {
|
||||
ItemData item = itemBuilder.netId(creativeNetId.incrementAndGet()).build();
|
||||
creativeItems.add(item);
|
||||
creativeItems.add(new CreativeItemData(item, item.getNetId(), groupId));
|
||||
|
||||
if (item.getBlockDefinition() != null) {
|
||||
String identifier = item.getDefinition().getIdentifier();
|
||||
@@ -255,6 +269,13 @@ public class ItemRegistryPopulator {
|
||||
}
|
||||
});
|
||||
|
||||
List<CreativeItemGroup> creativeItemGroups;
|
||||
if (GameProtocol.isPreCreativeInventoryRewrite(palette.protocolVersion)) {
|
||||
creativeItemGroups = new ArrayList<>();
|
||||
} else {
|
||||
creativeItemGroups = CreativeItemRegistryPopulator.readCreativeItemGroups(palette, creativeItems);
|
||||
}
|
||||
|
||||
BlockMappings blockMappings = BlockRegistries.BLOCKS.forVersion(palette.protocolVersion());
|
||||
|
||||
Set<Item> javaOnlyItems = new ObjectOpenHashSet<>();
|
||||
@@ -410,13 +431,13 @@ public class ItemRegistryPopulator {
|
||||
}
|
||||
|
||||
for (int j = 0; j < creativeItems.size(); j++) {
|
||||
ItemData itemData = creativeItems.get(j);
|
||||
if (itemData.getDefinition().equals(definition)) {
|
||||
if (itemData.getDamage() != 0) {
|
||||
CreativeItemData itemData = creativeItems.get(j);
|
||||
if (itemData.getItem().getDefinition().equals(definition)) {
|
||||
if (itemData.getItem().getDamage() != 0) {
|
||||
break;
|
||||
}
|
||||
|
||||
NbtMap states = ((GeyserBedrockBlock) itemData.getBlockDefinition()).getState().getCompound("states");
|
||||
NbtMap states = ((GeyserBedrockBlock) itemData.getItem().getBlockDefinition()).getState().getCompound("states");
|
||||
|
||||
boolean valid = true;
|
||||
for (Map.Entry<String, Object> nbtEntry : requiredBlockStates.entrySet()) {
|
||||
@@ -432,19 +453,25 @@ public class ItemRegistryPopulator {
|
||||
int customProtocolId = nextFreeBedrockId++;
|
||||
mappingItem = mappingItem.withBedrockData(customProtocolId);
|
||||
bedrockIdentifier = customBlockData.identifier();
|
||||
definition = new SimpleItemDefinition(bedrockIdentifier, customProtocolId, true);
|
||||
definition = new SimpleItemDefinition(bedrockIdentifier, customProtocolId, 1, false, null);
|
||||
registry.put(customProtocolId, definition);
|
||||
customBlockItemDefinitions.put(customBlockData, definition);
|
||||
customIdMappings.put(customProtocolId, bedrockIdentifier);
|
||||
|
||||
creativeItems.set(j, itemData.toBuilder()
|
||||
|
||||
CreativeItemData newData = new CreativeItemData(itemData.getItem().toBuilder()
|
||||
.definition(definition)
|
||||
.blockDefinition(bedrockBlock)
|
||||
.netId(itemData.getNetId())
|
||||
.count(1)
|
||||
.build());
|
||||
.build(), itemData.getNetId(), 0);
|
||||
|
||||
creativeItems.set(j, newData);
|
||||
} else {
|
||||
creativeItems.set(j, itemData.toBuilder().blockDefinition(bedrockBlock).build());
|
||||
CreativeItemData creativeItemData = new CreativeItemData(itemData.getItem().toBuilder()
|
||||
.blockDefinition(bedrockBlock)
|
||||
.build(), itemData.getNetId(), 0);
|
||||
|
||||
creativeItems.set(j, creativeItemData);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -494,16 +521,17 @@ public class ItemRegistryPopulator {
|
||||
);
|
||||
|
||||
if (customItem.creativeCategory().isPresent()) {
|
||||
creativeItems.add(ItemData.builder()
|
||||
CreativeItemData creativeItemData = new CreativeItemData(ItemData.builder()
|
||||
.netId(creativeNetId.incrementAndGet())
|
||||
.definition(customMapping.itemDefinition())
|
||||
.blockDefinition(null)
|
||||
.count(1)
|
||||
.build());
|
||||
.build(), creativeNetId.get(), customItem.creativeCategory().getAsInt());
|
||||
creativeItems.add(creativeItemData);
|
||||
}
|
||||
|
||||
// ComponentItemData - used to register some custom properties
|
||||
componentItemData.add(customMapping.componentItemData());
|
||||
componentItemData.add(customMapping.itemDefinition());
|
||||
customItemOptions.add(Pair.of(customItem.customItemOptions(), customMapping.itemDefinition()));
|
||||
registry.put(customMapping.integerId(), customMapping.itemDefinition());
|
||||
|
||||
@@ -564,9 +592,11 @@ public class ItemRegistryPopulator {
|
||||
|
||||
if (customItemsAllowed) {
|
||||
// Add furnace minecart
|
||||
ItemDefinition definition = new SimpleItemDefinition("geysermc:furnace_minecart", nextFreeBedrockId, true);
|
||||
int furnaceMinecartId = nextFreeBedrockId++;
|
||||
ItemDefinition definition = new SimpleItemDefinition("geysermc:furnace_minecart", furnaceMinecartId, 1, true, registerFurnaceMinecart(furnaceMinecartId));
|
||||
definitions.put("geysermc:furnace_minecart", definition);
|
||||
registry.put(definition.getRuntimeId(), definition);
|
||||
componentItemData.add(definition);
|
||||
|
||||
mappings.set(Items.FURNACE_MINECART.javaId(), ItemMapping.builder()
|
||||
.javaItem(Items.FURNACE_MINECART)
|
||||
@@ -577,13 +607,12 @@ public class ItemRegistryPopulator {
|
||||
.customItemOptions(Collections.emptyList()) // TODO check for custom items with furnace minecart
|
||||
.build());
|
||||
|
||||
creativeItems.add(ItemData.builder()
|
||||
.netId(creativeNetId.incrementAndGet())
|
||||
.definition(definition)
|
||||
.count(1)
|
||||
.build());
|
||||
|
||||
registerFurnaceMinecart(nextFreeBedrockId++, componentItemData, palette.protocolVersion);
|
||||
creativeItems.add(new CreativeItemData(ItemData.builder()
|
||||
.usingNetId(true)
|
||||
.netId(creativeNetId.incrementAndGet())
|
||||
.definition(definition)
|
||||
.count(1)
|
||||
.build(), creativeNetId.get(), 99)); // todo do not hardcode!
|
||||
|
||||
// Register any completely custom items given to us
|
||||
IntSet registeredJavaIds = new IntOpenHashSet(); // Used to check for duplicate item java ids
|
||||
@@ -598,7 +627,7 @@ public class ItemRegistryPopulator {
|
||||
int customItemId = nextFreeBedrockId++;
|
||||
NonVanillaItemRegistration registration = CustomItemRegistryPopulator.registerCustomItem(customItem, customItemId, palette.protocolVersion);
|
||||
|
||||
componentItemData.add(registration.componentItemData());
|
||||
componentItemData.add(registration.mapping().getBedrockDefinition());
|
||||
ItemMapping mapping = registration.mapping();
|
||||
Item javaItem = registration.javaItem();
|
||||
while (javaItem.javaId() >= mappings.size()) {
|
||||
@@ -609,34 +638,17 @@ public class ItemRegistryPopulator {
|
||||
registry.put(customItemId, mapping.getBedrockDefinition());
|
||||
|
||||
if (customItem.creativeCategory().isPresent()) {
|
||||
creativeItems.add(ItemData.builder()
|
||||
.definition(registration.mapping().getBedrockDefinition())
|
||||
.netId(creativeNetId.incrementAndGet())
|
||||
.count(1)
|
||||
.build());
|
||||
CreativeItemData creativeItemData = new CreativeItemData(ItemData.builder()
|
||||
.definition(registration.mapping().getBedrockDefinition())
|
||||
.netId(creativeNetId.incrementAndGet())
|
||||
.count(1)
|
||||
.build(), creativeNetId.get(), customItem.creativeCategory().getAsInt());
|
||||
|
||||
creativeItems.add(creativeItemData);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (Map.Entry<String, Object> entry : vanillaComponents.entrySet()) {
|
||||
String id = entry.getKey();
|
||||
ItemDefinition definition = definitions.get(id);
|
||||
if (definition == null) {
|
||||
// Newer item most likely
|
||||
GeyserImpl.getInstance().getLogger().debug(
|
||||
"Skipping vanilla component " + id + " for protocol " + palette.protocolVersion()
|
||||
);
|
||||
continue;
|
||||
}
|
||||
|
||||
NbtMapBuilder root = NbtMap.builder()
|
||||
.putString("name", id)
|
||||
.putInt("id", definition.getRuntimeId())
|
||||
.putCompound("components", (NbtMap) entry.getValue());
|
||||
|
||||
componentItemData.add(new ComponentItemData(id, root.build()));
|
||||
}
|
||||
|
||||
// Register the item forms of custom blocks
|
||||
if (BlockRegistries.CUSTOM_BLOCKS.get().length != 0) {
|
||||
for (CustomBlockData customBlock : BlockRegistries.CUSTOM_BLOCKS.get()) {
|
||||
@@ -654,7 +666,8 @@ public class ItemRegistryPopulator {
|
||||
int customProtocolId = nextFreeBedrockId++;
|
||||
String identifier = customBlock.identifier();
|
||||
|
||||
final ItemDefinition definition = new SimpleItemDefinition(identifier, customProtocolId, true);
|
||||
// TODO verify
|
||||
final ItemDefinition definition = new SimpleItemDefinition(identifier, customProtocolId, 1, false, null);
|
||||
registry.put(customProtocolId, definition);
|
||||
customBlockItemDefinitions.put(customBlock, definition);
|
||||
customIdMappings.put(customProtocolId, identifier);
|
||||
@@ -662,24 +675,26 @@ public class ItemRegistryPopulator {
|
||||
GeyserBedrockBlock bedrockBlock = blockMappings.getCustomBlockStateDefinitions().getOrDefault(customBlock.defaultBlockState(), null);
|
||||
|
||||
if (bedrockBlock != null && customBlock.includedInCreativeInventory()) {
|
||||
creativeItems.add(ItemData.builder()
|
||||
.definition(definition)
|
||||
.blockDefinition(bedrockBlock)
|
||||
.netId(creativeNetId.incrementAndGet())
|
||||
.count(1)
|
||||
.build());
|
||||
CreativeItemData creativeItemData = new CreativeItemData(ItemData.builder()
|
||||
.definition(definition)
|
||||
.blockDefinition(bedrockBlock)
|
||||
.netId(creativeNetId.incrementAndGet())
|
||||
.count(1)
|
||||
.build(), creativeNetId.get(), customBlock.creativeCategory().id());
|
||||
creativeItems.add(creativeItemData);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ItemMappings itemMappings = ItemMappings.builder()
|
||||
.items(mappings.toArray(new ItemMapping[0]))
|
||||
.creativeItems(creativeItems.toArray(new ItemData[0]))
|
||||
.creativeItems(creativeItems)
|
||||
.creativeItemGroups(creativeItemGroups)
|
||||
.itemDefinitions(registry)
|
||||
.componentItemData(componentItemData)
|
||||
.storedItems(new StoredItemMappings(javaItemToMapping))
|
||||
.javaOnlyItems(javaOnlyItems)
|
||||
.buckets(buckets)
|
||||
.componentItemData(componentItemData)
|
||||
.lightBlocks(lightBlocks)
|
||||
.lodestoneCompass(lodestoneEntry)
|
||||
.customIdMappings(customIdMappings)
|
||||
@@ -692,7 +707,7 @@ public class ItemRegistryPopulator {
|
||||
}
|
||||
}
|
||||
|
||||
private static void registerFurnaceMinecart(int nextFreeBedrockId, List<ComponentItemData> componentItemData, int protocolVersion) {
|
||||
private static NbtMap registerFurnaceMinecart(int nextFreeBedrockId) {
|
||||
NbtMapBuilder builder = NbtMap.builder();
|
||||
builder.putString("name", "geysermc:furnace_minecart")
|
||||
.putInt("id", nextFreeBedrockId);
|
||||
@@ -727,6 +742,6 @@ public class ItemRegistryPopulator {
|
||||
|
||||
componentBuilder.putCompound("item_properties", itemProperties.build());
|
||||
builder.putCompound("components", componentBuilder.build());
|
||||
componentItemData.add(new ComponentItemData("geysermc:furnace_minecart", builder.build()));
|
||||
return builder.build();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
* @author GeyserMC
|
||||
* @link https://github.com/GeyserMC/Geyser
|
||||
*/
|
||||
|
||||
package org.geysermc.geyser.registry.type;
|
||||
|
||||
import org.cloudburstmc.protocol.bedrock.data.definitions.ItemDefinition;
|
||||
import org.geysermc.geyser.item.type.Item;
|
||||
|
||||
/**
|
||||
* Implements ItemDefinition while also providing a reference to our item mappings.
|
||||
*/
|
||||
public record GeyserItemDefinition(Item javaItem, String identifier, boolean componentBased, int runtimeId) implements ItemDefinition {
|
||||
@Override
|
||||
public String getIdentifier() {
|
||||
return identifier;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isComponentBased() {
|
||||
return componentBased;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRuntimeId() {
|
||||
return runtimeId;
|
||||
}
|
||||
}
|
||||
@@ -32,7 +32,8 @@ import lombok.Value;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
import org.cloudburstmc.protocol.bedrock.data.definitions.ItemDefinition;
|
||||
import org.cloudburstmc.protocol.bedrock.data.inventory.ComponentItemData;
|
||||
import org.cloudburstmc.protocol.bedrock.data.inventory.CreativeItemData;
|
||||
import org.cloudburstmc.protocol.bedrock.data.inventory.CreativeItemGroup;
|
||||
import org.cloudburstmc.protocol.bedrock.data.inventory.ItemData;
|
||||
import org.cloudburstmc.protocol.common.DefinitionRegistry;
|
||||
import org.geysermc.geyser.GeyserImpl;
|
||||
@@ -61,7 +62,8 @@ public class ItemMappings implements DefinitionRegistry<ItemDefinition> {
|
||||
ItemMapping lodestoneCompass;
|
||||
Int2ObjectMap<ItemMapping> lightBlocks;
|
||||
|
||||
ItemData[] creativeItems;
|
||||
List<CreativeItemGroup> creativeItemGroups;
|
||||
List<CreativeItemData> creativeItems;
|
||||
Int2ObjectMap<ItemDefinition> itemDefinitions;
|
||||
|
||||
StoredItemMappings storedItems;
|
||||
@@ -70,7 +72,7 @@ public class ItemMappings implements DefinitionRegistry<ItemDefinition> {
|
||||
List<ItemDefinition> buckets;
|
||||
List<ItemDefinition> boats;
|
||||
|
||||
List<ComponentItemData> componentItemData;
|
||||
List<ItemDefinition> componentItemData; // TODO get rid of?
|
||||
Int2ObjectMap<String> customIdMappings;
|
||||
|
||||
Object2ObjectMap<CustomBlockData, ItemDefinition> customBlockItemDefinitions;
|
||||
|
||||
@@ -25,11 +25,10 @@
|
||||
|
||||
package org.geysermc.geyser.registry.type;
|
||||
|
||||
import org.cloudburstmc.protocol.bedrock.data.inventory.ComponentItemData;
|
||||
import org.geysermc.geyser.item.type.Item;
|
||||
|
||||
/**
|
||||
* The return data of a successful registration of a custom item.
|
||||
*/
|
||||
public record NonVanillaItemRegistration(ComponentItemData componentItemData, Item javaItem, ItemMapping mapping) {
|
||||
}
|
||||
public record NonVanillaItemRegistration(Item javaItem, ItemMapping mapping) {
|
||||
}
|
||||
|
||||
@@ -31,4 +31,6 @@ import lombok.Data;
|
||||
public class PaletteItem {
|
||||
String name;
|
||||
int id;
|
||||
}
|
||||
int version;
|
||||
boolean componentBased;
|
||||
}
|
||||
|
||||
@@ -147,6 +147,7 @@ import org.geysermc.geyser.item.type.BlockItem;
|
||||
import org.geysermc.geyser.level.BedrockDimension;
|
||||
import org.geysermc.geyser.level.JavaDimension;
|
||||
import org.geysermc.geyser.level.physics.CollisionManager;
|
||||
import org.geysermc.geyser.network.GameProtocol;
|
||||
import org.geysermc.geyser.network.netty.LocalSession;
|
||||
import org.geysermc.geyser.registry.Registries;
|
||||
import org.geysermc.geyser.registry.type.BlockMappings;
|
||||
@@ -739,10 +740,14 @@ public class GeyserSession implements GeyserConnection, GeyserCommandSource {
|
||||
sentSpawnPacket = true;
|
||||
syncEntityProperties();
|
||||
|
||||
if (GeyserImpl.getInstance().getConfig().isAddNonBedrockItems()) {
|
||||
if (GameProtocol.isPreCreativeInventoryRewrite(this.protocolVersion())) {
|
||||
ItemComponentPacket componentPacket = new ItemComponentPacket();
|
||||
componentPacket.getItems().addAll(itemMappings.getComponentItemData());
|
||||
upstream.sendPacket(componentPacket);
|
||||
} else {
|
||||
ItemComponentPacket componentPacket = new ItemComponentPacket();
|
||||
componentPacket.getItems().addAll(itemMappings.getItemDefinitions().values());
|
||||
upstream.sendPacket(componentPacket);
|
||||
}
|
||||
|
||||
ChunkUtils.sendEmptyChunks(this, playerEntity.getPosition().toInt(), 0, false);
|
||||
@@ -760,7 +765,8 @@ public class GeyserSession implements GeyserConnection, GeyserCommandSource {
|
||||
upstream.sendPacket(cameraPresetsPacket);
|
||||
|
||||
CreativeContentPacket creativePacket = new CreativeContentPacket();
|
||||
creativePacket.setContents(this.itemMappings.getCreativeItems());
|
||||
creativePacket.getContents().addAll(this.itemMappings.getCreativeItems());
|
||||
creativePacket.getGroups().addAll(this.itemMappings.getCreativeItemGroups());
|
||||
upstream.sendPacket(creativePacket);
|
||||
|
||||
PlayStatusPacket playStatusPacket = new PlayStatusPacket();
|
||||
@@ -1820,6 +1826,7 @@ public class GeyserSession implements GeyserConnection, GeyserCommandSource {
|
||||
abilityLayer.setFlySpeed(flySpeed);
|
||||
// https://github.com/GeyserMC/Geyser/issues/3139 as of 1.19.10
|
||||
abilityLayer.setWalkSpeed(walkSpeed == 0f ? 0.01f : walkSpeed);
|
||||
abilityLayer.setVerticalFlySpeed(1.0f);
|
||||
Collections.addAll(abilityLayer.getAbilitiesSet(), USED_ABILITIES);
|
||||
|
||||
updateAbilitiesPacket.getAbilityLayers().add(abilityLayer);
|
||||
|
||||
@@ -30,6 +30,7 @@ import it.unimi.dsi.fastutil.ints.IntOpenHashSet;
|
||||
import it.unimi.dsi.fastutil.ints.IntSet;
|
||||
import org.cloudburstmc.protocol.bedrock.data.inventory.ContainerId;
|
||||
import org.cloudburstmc.protocol.bedrock.data.inventory.ContainerSlotType;
|
||||
import org.cloudburstmc.protocol.bedrock.data.inventory.CreativeItemData;
|
||||
import org.cloudburstmc.protocol.bedrock.data.inventory.ItemData;
|
||||
import org.cloudburstmc.protocol.bedrock.data.inventory.itemstack.request.ItemStackRequest;
|
||||
import org.cloudburstmc.protocol.bedrock.data.inventory.itemstack.request.ItemStackRequestSlotData;
|
||||
@@ -63,6 +64,7 @@ import org.geysermc.mcprotocollib.protocol.packet.ingame.serverbound.inventory.S
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.function.IntFunction;
|
||||
|
||||
public class PlayerInventoryTranslator extends InventoryTranslator {
|
||||
@@ -437,13 +439,13 @@ public class PlayerInventoryTranslator extends InventoryTranslator {
|
||||
craftState = CraftState.RECIPE_ID;
|
||||
|
||||
int creativeId = creativeAction.getCreativeItemNetworkId() - 1;
|
||||
ItemData[] creativeItems = session.getItemMappings().getCreativeItems();
|
||||
if (creativeId < 0 || creativeId >= creativeItems.length) {
|
||||
List<CreativeItemData> creativeItems = session.getItemMappings().getCreativeItems();
|
||||
if (creativeId < 0 || creativeId >= creativeItems.size()) {
|
||||
return rejectRequest(request);
|
||||
}
|
||||
// Reference the creative items list we send to the client to know what it's asking of us
|
||||
ItemData creativeItem = creativeItems[creativeId];
|
||||
javaCreativeItem = ItemTranslator.translateToJava(session, creativeItem);
|
||||
CreativeItemData creativeItem = creativeItems.get(creativeId);
|
||||
javaCreativeItem = ItemTranslator.translateToJava(session, creativeItem.getItem());
|
||||
break;
|
||||
}
|
||||
case CRAFT_RESULTS_DEPRECATED: {
|
||||
|
||||
@@ -67,6 +67,12 @@ public class JavaCustomPayloadTranslator extends PacketTranslator<ClientboundCus
|
||||
session.ensureInEventLoop(() -> {
|
||||
byte[] data = packet.getData();
|
||||
|
||||
// If the data is empty, we just need to close the form
|
||||
if (data.length == 0) {
|
||||
session.closeForm();
|
||||
return;
|
||||
}
|
||||
|
||||
// receive: first byte is form type, second and third are the id, remaining is the form data
|
||||
// respond: first and second byte id, remaining is form response data
|
||||
|
||||
@@ -96,7 +102,6 @@ public class JavaCustomPayloadTranslator extends PacketTranslator<ClientboundCus
|
||||
});
|
||||
session.sendForm(form);
|
||||
});
|
||||
|
||||
} else if (channel.equals(PluginMessageChannels.TRANSFER)) {
|
||||
session.ensureInEventLoop(() -> {
|
||||
byte[] data = packet.getData();
|
||||
|
||||
Binary file not shown.
BIN
core/src/main/resources/bedrock/block_palette.1_21_60.nbt
Normal file
BIN
core/src/main/resources/bedrock/block_palette.1_21_60.nbt
Normal file
Binary file not shown.
8917
core/src/main/resources/bedrock/creative_items.1_21_60.json
Normal file
8917
core/src/main/resources/bedrock/creative_items.1_21_60.json
Normal file
File diff suppressed because it is too large
Load Diff
BIN
core/src/main/resources/bedrock/item_components.nbt
Normal file
BIN
core/src/main/resources/bedrock/item_components.nbt
Normal file
Binary file not shown.
829
core/src/main/resources/bedrock/item_tags.1_21_60.json
Normal file
829
core/src/main/resources/bedrock/item_tags.1_21_60.json
Normal file
@@ -0,0 +1,829 @@
|
||||
{
|
||||
"minecraft:arrow": [
|
||||
"minecraft:arrow"
|
||||
],
|
||||
"minecraft:banner": [
|
||||
"minecraft:banner"
|
||||
],
|
||||
"minecraft:boat": [
|
||||
"minecraft:pale_oak_chest_boat",
|
||||
"minecraft:cherry_chest_boat",
|
||||
"minecraft:oak_chest_boat",
|
||||
"minecraft:mangrove_boat",
|
||||
"minecraft:oak_boat",
|
||||
"minecraft:birch_boat",
|
||||
"minecraft:jungle_boat",
|
||||
"minecraft:spruce_boat",
|
||||
"minecraft:acacia_boat",
|
||||
"minecraft:dark_oak_boat",
|
||||
"minecraft:birch_chest_boat",
|
||||
"minecraft:jungle_chest_boat",
|
||||
"minecraft:spruce_chest_boat",
|
||||
"minecraft:acacia_chest_boat",
|
||||
"minecraft:dark_oak_chest_boat",
|
||||
"minecraft:mangrove_chest_boat",
|
||||
"minecraft:cherry_boat",
|
||||
"minecraft:bamboo_raft",
|
||||
"minecraft:bamboo_chest_raft",
|
||||
"minecraft:pale_oak_boat"
|
||||
],
|
||||
"minecraft:boats": [
|
||||
"minecraft:pale_oak_chest_boat",
|
||||
"minecraft:cherry_chest_boat",
|
||||
"minecraft:oak_chest_boat",
|
||||
"minecraft:mangrove_boat",
|
||||
"minecraft:oak_boat",
|
||||
"minecraft:birch_boat",
|
||||
"minecraft:jungle_boat",
|
||||
"minecraft:spruce_boat",
|
||||
"minecraft:acacia_boat",
|
||||
"minecraft:dark_oak_boat",
|
||||
"minecraft:birch_chest_boat",
|
||||
"minecraft:jungle_chest_boat",
|
||||
"minecraft:spruce_chest_boat",
|
||||
"minecraft:acacia_chest_boat",
|
||||
"minecraft:dark_oak_chest_boat",
|
||||
"minecraft:mangrove_chest_boat",
|
||||
"minecraft:cherry_boat",
|
||||
"minecraft:bamboo_raft",
|
||||
"minecraft:bamboo_chest_raft",
|
||||
"minecraft:pale_oak_boat"
|
||||
],
|
||||
"minecraft:bookshelf_books": [
|
||||
"minecraft:written_book",
|
||||
"minecraft:book",
|
||||
"minecraft:writable_book",
|
||||
"minecraft:enchanted_book"
|
||||
],
|
||||
"minecraft:chainmail_tier": [
|
||||
"minecraft:chainmail_helmet",
|
||||
"minecraft:chainmail_chestplate",
|
||||
"minecraft:chainmail_leggings",
|
||||
"minecraft:chainmail_boots"
|
||||
],
|
||||
"minecraft:coals": [
|
||||
"minecraft:coal",
|
||||
"minecraft:charcoal"
|
||||
],
|
||||
"minecraft:crimson_stems": [
|
||||
"minecraft:stripped_crimson_stem",
|
||||
"minecraft:crimson_hyphae",
|
||||
"minecraft:crimson_stem",
|
||||
"minecraft:stripped_crimson_hyphae"
|
||||
],
|
||||
"minecraft:decorated_pot_sherds": [
|
||||
"minecraft:skull_pottery_sherd",
|
||||
"minecraft:mourner_pottery_sherd",
|
||||
"minecraft:angler_pottery_sherd",
|
||||
"minecraft:prize_pottery_sherd",
|
||||
"minecraft:arms_up_pottery_sherd",
|
||||
"minecraft:burn_pottery_sherd",
|
||||
"minecraft:snort_pottery_sherd",
|
||||
"minecraft:brick",
|
||||
"minecraft:heartbreak_pottery_sherd",
|
||||
"minecraft:miner_pottery_sherd",
|
||||
"minecraft:brewer_pottery_sherd",
|
||||
"minecraft:plenty_pottery_sherd",
|
||||
"minecraft:scrape_pottery_sherd",
|
||||
"minecraft:howl_pottery_sherd",
|
||||
"minecraft:explorer_pottery_sherd",
|
||||
"minecraft:archer_pottery_sherd",
|
||||
"minecraft:blade_pottery_sherd",
|
||||
"minecraft:danger_pottery_sherd",
|
||||
"minecraft:flow_pottery_sherd",
|
||||
"minecraft:friend_pottery_sherd",
|
||||
"minecraft:guster_pottery_sherd",
|
||||
"minecraft:heart_pottery_sherd",
|
||||
"minecraft:sheaf_pottery_sherd",
|
||||
"minecraft:shelter_pottery_sherd"
|
||||
],
|
||||
"minecraft:diamond_tier": [
|
||||
"minecraft:diamond_sword",
|
||||
"minecraft:diamond_shovel",
|
||||
"minecraft:diamond_pickaxe",
|
||||
"minecraft:diamond_axe",
|
||||
"minecraft:mace",
|
||||
"minecraft:diamond_hoe",
|
||||
"minecraft:diamond_helmet",
|
||||
"minecraft:diamond_chestplate",
|
||||
"minecraft:diamond_leggings",
|
||||
"minecraft:diamond_boots"
|
||||
],
|
||||
"minecraft:digger": [
|
||||
"minecraft:iron_shovel",
|
||||
"minecraft:wooden_pickaxe",
|
||||
"minecraft:iron_pickaxe",
|
||||
"minecraft:iron_axe",
|
||||
"minecraft:wooden_shovel",
|
||||
"minecraft:wooden_axe",
|
||||
"minecraft:stone_shovel",
|
||||
"minecraft:stone_pickaxe",
|
||||
"minecraft:stone_axe",
|
||||
"minecraft:diamond_shovel",
|
||||
"minecraft:diamond_pickaxe",
|
||||
"minecraft:diamond_axe",
|
||||
"minecraft:golden_shovel",
|
||||
"minecraft:golden_pickaxe",
|
||||
"minecraft:golden_axe",
|
||||
"minecraft:wooden_hoe",
|
||||
"minecraft:stone_hoe",
|
||||
"minecraft:iron_hoe",
|
||||
"minecraft:diamond_hoe",
|
||||
"minecraft:golden_hoe",
|
||||
"minecraft:netherite_pickaxe",
|
||||
"minecraft:netherite_shovel",
|
||||
"minecraft:netherite_axe",
|
||||
"minecraft:netherite_hoe"
|
||||
],
|
||||
"minecraft:door": [
|
||||
"minecraft:weathered_copper_door",
|
||||
"minecraft:warped_door",
|
||||
"minecraft:wooden_door",
|
||||
"minecraft:jungle_door",
|
||||
"minecraft:waxed_weathered_copper_door",
|
||||
"minecraft:iron_door",
|
||||
"minecraft:mangrove_door",
|
||||
"minecraft:exposed_copper_door",
|
||||
"minecraft:bamboo_door",
|
||||
"minecraft:spruce_door",
|
||||
"minecraft:birch_door",
|
||||
"minecraft:acacia_door",
|
||||
"minecraft:dark_oak_door",
|
||||
"minecraft:crimson_door",
|
||||
"minecraft:cherry_door",
|
||||
"minecraft:copper_door",
|
||||
"minecraft:oxidized_copper_door",
|
||||
"minecraft:waxed_copper_door",
|
||||
"minecraft:waxed_exposed_copper_door",
|
||||
"minecraft:waxed_oxidized_copper_door",
|
||||
"minecraft:pale_oak_door"
|
||||
],
|
||||
"minecraft:golden_tier": [
|
||||
"minecraft:golden_sword",
|
||||
"minecraft:golden_shovel",
|
||||
"minecraft:golden_pickaxe",
|
||||
"minecraft:golden_axe",
|
||||
"minecraft:golden_hoe",
|
||||
"minecraft:golden_helmet",
|
||||
"minecraft:golden_chestplate",
|
||||
"minecraft:golden_leggings",
|
||||
"minecraft:golden_boots"
|
||||
],
|
||||
"minecraft:hanging_actor": [
|
||||
"minecraft:painting"
|
||||
],
|
||||
"minecraft:hanging_sign": [
|
||||
"minecraft:mangrove_hanging_sign",
|
||||
"minecraft:bamboo_hanging_sign",
|
||||
"minecraft:pale_oak_hanging_sign",
|
||||
"minecraft:spruce_hanging_sign",
|
||||
"minecraft:birch_hanging_sign",
|
||||
"minecraft:cherry_hanging_sign",
|
||||
"minecraft:oak_hanging_sign",
|
||||
"minecraft:jungle_hanging_sign",
|
||||
"minecraft:acacia_hanging_sign",
|
||||
"minecraft:dark_oak_hanging_sign",
|
||||
"minecraft:crimson_hanging_sign",
|
||||
"minecraft:warped_hanging_sign"
|
||||
],
|
||||
"minecraft:horse_armor": [
|
||||
"minecraft:iron_horse_armor",
|
||||
"minecraft:golden_horse_armor",
|
||||
"minecraft:leather_horse_armor",
|
||||
"minecraft:diamond_horse_armor"
|
||||
],
|
||||
"minecraft:iron_tier": [
|
||||
"minecraft:iron_chestplate",
|
||||
"minecraft:iron_shovel",
|
||||
"minecraft:iron_sword",
|
||||
"minecraft:iron_pickaxe",
|
||||
"minecraft:iron_axe",
|
||||
"minecraft:iron_hoe",
|
||||
"minecraft:iron_helmet",
|
||||
"minecraft:iron_leggings",
|
||||
"minecraft:iron_boots"
|
||||
],
|
||||
"minecraft:is_armor": [
|
||||
"minecraft:iron_chestplate",
|
||||
"minecraft:netherite_boots",
|
||||
"minecraft:chainmail_helmet",
|
||||
"minecraft:elytra",
|
||||
"minecraft:leather_helmet",
|
||||
"minecraft:leather_chestplate",
|
||||
"minecraft:leather_leggings",
|
||||
"minecraft:leather_boots",
|
||||
"minecraft:chainmail_chestplate",
|
||||
"minecraft:chainmail_leggings",
|
||||
"minecraft:chainmail_boots",
|
||||
"minecraft:iron_helmet",
|
||||
"minecraft:iron_leggings",
|
||||
"minecraft:iron_boots",
|
||||
"minecraft:diamond_helmet",
|
||||
"minecraft:diamond_chestplate",
|
||||
"minecraft:diamond_leggings",
|
||||
"minecraft:diamond_boots",
|
||||
"minecraft:golden_helmet",
|
||||
"minecraft:golden_chestplate",
|
||||
"minecraft:golden_leggings",
|
||||
"minecraft:golden_boots",
|
||||
"minecraft:turtle_helmet",
|
||||
"minecraft:netherite_chestplate",
|
||||
"minecraft:netherite_leggings",
|
||||
"minecraft:netherite_helmet"
|
||||
],
|
||||
"minecraft:is_axe": [
|
||||
"minecraft:iron_axe",
|
||||
"minecraft:wooden_axe",
|
||||
"minecraft:stone_axe",
|
||||
"minecraft:diamond_axe",
|
||||
"minecraft:golden_axe",
|
||||
"minecraft:netherite_axe"
|
||||
],
|
||||
"minecraft:is_cooked": [
|
||||
"minecraft:cooked_cod",
|
||||
"minecraft:cooked_porkchop",
|
||||
"minecraft:cooked_salmon",
|
||||
"minecraft:cooked_rabbit",
|
||||
"minecraft:cooked_beef",
|
||||
"minecraft:cooked_chicken",
|
||||
"minecraft:rabbit_stew",
|
||||
"minecraft:cooked_mutton"
|
||||
],
|
||||
"minecraft:is_fish": [
|
||||
"minecraft:cooked_cod",
|
||||
"minecraft:cooked_salmon",
|
||||
"minecraft:cod",
|
||||
"minecraft:salmon",
|
||||
"minecraft:tropical_fish",
|
||||
"minecraft:pufferfish"
|
||||
],
|
||||
"minecraft:is_food": [
|
||||
"minecraft:rabbit",
|
||||
"minecraft:cooked_porkchop",
|
||||
"minecraft:mushroom_stew",
|
||||
"minecraft:potato",
|
||||
"minecraft:enchanted_golden_apple",
|
||||
"minecraft:golden_carrot",
|
||||
"minecraft:carrot",
|
||||
"minecraft:chicken",
|
||||
"minecraft:beetroot",
|
||||
"minecraft:sweet_berries",
|
||||
"minecraft:apple",
|
||||
"minecraft:golden_apple",
|
||||
"minecraft:bread",
|
||||
"minecraft:porkchop",
|
||||
"minecraft:cookie",
|
||||
"minecraft:cooked_rabbit",
|
||||
"minecraft:beef",
|
||||
"minecraft:dried_kelp",
|
||||
"minecraft:beetroot_soup",
|
||||
"minecraft:melon_slice",
|
||||
"minecraft:cooked_beef",
|
||||
"minecraft:rotten_flesh",
|
||||
"minecraft:cooked_chicken",
|
||||
"minecraft:baked_potato",
|
||||
"minecraft:pumpkin_pie",
|
||||
"minecraft:rabbit_stew",
|
||||
"minecraft:cooked_mutton",
|
||||
"minecraft:mutton"
|
||||
],
|
||||
"minecraft:is_hoe": [
|
||||
"minecraft:wooden_hoe",
|
||||
"minecraft:stone_hoe",
|
||||
"minecraft:iron_hoe",
|
||||
"minecraft:diamond_hoe",
|
||||
"minecraft:golden_hoe",
|
||||
"minecraft:netherite_hoe"
|
||||
],
|
||||
"minecraft:is_meat": [
|
||||
"minecraft:rabbit",
|
||||
"minecraft:cooked_porkchop",
|
||||
"minecraft:chicken",
|
||||
"minecraft:porkchop",
|
||||
"minecraft:cooked_rabbit",
|
||||
"minecraft:beef",
|
||||
"minecraft:cooked_beef",
|
||||
"minecraft:rotten_flesh",
|
||||
"minecraft:cooked_chicken",
|
||||
"minecraft:rabbit_stew",
|
||||
"minecraft:cooked_mutton",
|
||||
"minecraft:mutton"
|
||||
],
|
||||
"minecraft:is_minecart": [
|
||||
"minecraft:command_block_minecart",
|
||||
"minecraft:minecart",
|
||||
"minecraft:chest_minecart",
|
||||
"minecraft:tnt_minecart",
|
||||
"minecraft:hopper_minecart"
|
||||
],
|
||||
"minecraft:is_pickaxe": [
|
||||
"minecraft:wooden_pickaxe",
|
||||
"minecraft:iron_pickaxe",
|
||||
"minecraft:stone_pickaxe",
|
||||
"minecraft:diamond_pickaxe",
|
||||
"minecraft:golden_pickaxe",
|
||||
"minecraft:netherite_pickaxe"
|
||||
],
|
||||
"minecraft:is_shears": [
|
||||
"minecraft:shears"
|
||||
],
|
||||
"minecraft:is_shovel": [
|
||||
"minecraft:iron_shovel",
|
||||
"minecraft:wooden_shovel",
|
||||
"minecraft:stone_shovel",
|
||||
"minecraft:diamond_shovel",
|
||||
"minecraft:golden_shovel",
|
||||
"minecraft:netherite_shovel"
|
||||
],
|
||||
"minecraft:is_sword": [
|
||||
"minecraft:netherite_sword",
|
||||
"minecraft:iron_sword",
|
||||
"minecraft:wooden_sword",
|
||||
"minecraft:stone_sword",
|
||||
"minecraft:diamond_sword",
|
||||
"minecraft:mace",
|
||||
"minecraft:golden_sword"
|
||||
],
|
||||
"minecraft:is_tool": [
|
||||
"minecraft:netherite_sword",
|
||||
"minecraft:iron_shovel",
|
||||
"minecraft:iron_sword",
|
||||
"minecraft:wooden_pickaxe",
|
||||
"minecraft:iron_pickaxe",
|
||||
"minecraft:iron_axe",
|
||||
"minecraft:wooden_sword",
|
||||
"minecraft:wooden_shovel",
|
||||
"minecraft:wooden_axe",
|
||||
"minecraft:stone_sword",
|
||||
"minecraft:stone_shovel",
|
||||
"minecraft:stone_pickaxe",
|
||||
"minecraft:stone_axe",
|
||||
"minecraft:diamond_sword",
|
||||
"minecraft:diamond_shovel",
|
||||
"minecraft:diamond_pickaxe",
|
||||
"minecraft:diamond_axe",
|
||||
"minecraft:mace",
|
||||
"minecraft:golden_sword",
|
||||
"minecraft:golden_shovel",
|
||||
"minecraft:golden_pickaxe",
|
||||
"minecraft:golden_axe",
|
||||
"minecraft:wooden_hoe",
|
||||
"minecraft:stone_hoe",
|
||||
"minecraft:iron_hoe",
|
||||
"minecraft:diamond_hoe",
|
||||
"minecraft:golden_hoe",
|
||||
"minecraft:netherite_pickaxe",
|
||||
"minecraft:netherite_shovel",
|
||||
"minecraft:netherite_axe",
|
||||
"minecraft:netherite_hoe"
|
||||
],
|
||||
"minecraft:is_trident": [
|
||||
"minecraft:trident"
|
||||
],
|
||||
"minecraft:leather_tier": [
|
||||
"minecraft:leather_helmet",
|
||||
"minecraft:leather_chestplate",
|
||||
"minecraft:leather_leggings",
|
||||
"minecraft:leather_boots"
|
||||
],
|
||||
"minecraft:lectern_books": [
|
||||
"minecraft:written_book",
|
||||
"minecraft:writable_book"
|
||||
],
|
||||
"minecraft:logs": [
|
||||
"minecraft:stripped_oak_log",
|
||||
"minecraft:mangrove_wood",
|
||||
"minecraft:spruce_wood",
|
||||
"minecraft:stripped_cherry_wood",
|
||||
"minecraft:stripped_crimson_stem",
|
||||
"minecraft:stripped_spruce_wood",
|
||||
"minecraft:spruce_log",
|
||||
"minecraft:acacia_wood",
|
||||
"minecraft:stripped_acacia_wood",
|
||||
"minecraft:pale_oak_wood",
|
||||
"minecraft:stripped_warped_hyphae",
|
||||
"minecraft:acacia_log",
|
||||
"minecraft:stripped_warped_stem",
|
||||
"minecraft:oak_log",
|
||||
"minecraft:birch_log",
|
||||
"minecraft:jungle_log",
|
||||
"minecraft:stripped_pale_oak_wood",
|
||||
"minecraft:dark_oak_log",
|
||||
"minecraft:jungle_wood",
|
||||
"minecraft:stripped_jungle_wood",
|
||||
"minecraft:oak_wood",
|
||||
"minecraft:birch_wood",
|
||||
"minecraft:dark_oak_wood",
|
||||
"minecraft:stripped_oak_wood",
|
||||
"minecraft:stripped_birch_wood",
|
||||
"minecraft:stripped_dark_oak_wood",
|
||||
"minecraft:stripped_dark_oak_log",
|
||||
"minecraft:mangrove_log",
|
||||
"minecraft:stripped_jungle_log",
|
||||
"minecraft:stripped_pale_oak_log",
|
||||
"minecraft:stripped_mangrove_wood",
|
||||
"minecraft:crimson_hyphae",
|
||||
"minecraft:stripped_cherry_log",
|
||||
"minecraft:stripped_birch_log",
|
||||
"minecraft:stripped_acacia_log",
|
||||
"minecraft:crimson_stem",
|
||||
"minecraft:warped_hyphae",
|
||||
"minecraft:pale_oak_log",
|
||||
"minecraft:stripped_spruce_log",
|
||||
"minecraft:warped_stem",
|
||||
"minecraft:stripped_crimson_hyphae",
|
||||
"minecraft:cherry_wood",
|
||||
"minecraft:cherry_log",
|
||||
"minecraft:stripped_mangrove_log"
|
||||
],
|
||||
"minecraft:logs_that_burn": [
|
||||
"minecraft:stripped_oak_log",
|
||||
"minecraft:mangrove_wood",
|
||||
"minecraft:spruce_wood",
|
||||
"minecraft:stripped_cherry_wood",
|
||||
"minecraft:stripped_spruce_wood",
|
||||
"minecraft:spruce_log",
|
||||
"minecraft:acacia_wood",
|
||||
"minecraft:stripped_acacia_wood",
|
||||
"minecraft:pale_oak_wood",
|
||||
"minecraft:acacia_log",
|
||||
"minecraft:oak_log",
|
||||
"minecraft:birch_log",
|
||||
"minecraft:jungle_log",
|
||||
"minecraft:stripped_pale_oak_wood",
|
||||
"minecraft:dark_oak_log",
|
||||
"minecraft:jungle_wood",
|
||||
"minecraft:stripped_jungle_wood",
|
||||
"minecraft:oak_wood",
|
||||
"minecraft:birch_wood",
|
||||
"minecraft:dark_oak_wood",
|
||||
"minecraft:stripped_oak_wood",
|
||||
"minecraft:stripped_birch_wood",
|
||||
"minecraft:stripped_dark_oak_wood",
|
||||
"minecraft:stripped_dark_oak_log",
|
||||
"minecraft:mangrove_log",
|
||||
"minecraft:stripped_jungle_log",
|
||||
"minecraft:stripped_pale_oak_log",
|
||||
"minecraft:stripped_mangrove_wood",
|
||||
"minecraft:stripped_cherry_log",
|
||||
"minecraft:stripped_birch_log",
|
||||
"minecraft:stripped_acacia_log",
|
||||
"minecraft:pale_oak_log",
|
||||
"minecraft:stripped_spruce_log",
|
||||
"minecraft:cherry_wood",
|
||||
"minecraft:cherry_log",
|
||||
"minecraft:stripped_mangrove_log"
|
||||
],
|
||||
"minecraft:mangrove_logs": [
|
||||
"minecraft:mangrove_wood",
|
||||
"minecraft:mangrove_log",
|
||||
"minecraft:stripped_mangrove_wood",
|
||||
"minecraft:stripped_mangrove_log"
|
||||
],
|
||||
"minecraft:music_disc": [
|
||||
"minecraft:music_disc_ward",
|
||||
"minecraft:music_disc_stal",
|
||||
"minecraft:music_disc_wait",
|
||||
"minecraft:music_disc_cat",
|
||||
"minecraft:music_disc_strad",
|
||||
"minecraft:music_disc_chirp",
|
||||
"minecraft:music_disc_mall",
|
||||
"minecraft:music_disc_creator_music_box",
|
||||
"minecraft:music_disc_pigstep",
|
||||
"minecraft:music_disc_11",
|
||||
"minecraft:music_disc_13",
|
||||
"minecraft:music_disc_blocks",
|
||||
"minecraft:music_disc_far",
|
||||
"minecraft:music_disc_mellohi",
|
||||
"minecraft:music_disc_otherside",
|
||||
"minecraft:music_disc_5",
|
||||
"minecraft:music_disc_relic",
|
||||
"minecraft:music_disc_creator",
|
||||
"minecraft:music_disc_precipice"
|
||||
],
|
||||
"minecraft:netherite_tier": [
|
||||
"minecraft:netherite_sword",
|
||||
"minecraft:netherite_boots",
|
||||
"minecraft:netherite_chestplate",
|
||||
"minecraft:netherite_pickaxe",
|
||||
"minecraft:netherite_leggings",
|
||||
"minecraft:netherite_shovel",
|
||||
"minecraft:netherite_axe",
|
||||
"minecraft:netherite_hoe",
|
||||
"minecraft:netherite_helmet"
|
||||
],
|
||||
"minecraft:planks": [
|
||||
"minecraft:spruce_planks",
|
||||
"minecraft:oak_planks",
|
||||
"minecraft:mangrove_planks",
|
||||
"minecraft:dark_oak_planks",
|
||||
"minecraft:birch_planks",
|
||||
"minecraft:jungle_planks",
|
||||
"minecraft:acacia_planks",
|
||||
"minecraft:bamboo_planks",
|
||||
"minecraft:warped_planks",
|
||||
"minecraft:pale_oak_planks",
|
||||
"minecraft:crimson_planks",
|
||||
"minecraft:cherry_planks"
|
||||
],
|
||||
"minecraft:sand": [
|
||||
"minecraft:sand",
|
||||
"minecraft:red_sand"
|
||||
],
|
||||
"minecraft:sign": [
|
||||
"minecraft:jungle_sign",
|
||||
"minecraft:bamboo_sign",
|
||||
"minecraft:mangrove_hanging_sign",
|
||||
"minecraft:cherry_sign",
|
||||
"minecraft:oak_sign",
|
||||
"minecraft:bamboo_hanging_sign",
|
||||
"minecraft:warped_sign",
|
||||
"minecraft:spruce_sign",
|
||||
"minecraft:pale_oak_hanging_sign",
|
||||
"minecraft:spruce_hanging_sign",
|
||||
"minecraft:acacia_sign",
|
||||
"minecraft:birch_hanging_sign",
|
||||
"minecraft:birch_sign",
|
||||
"minecraft:dark_oak_sign",
|
||||
"minecraft:mangrove_sign",
|
||||
"minecraft:crimson_sign",
|
||||
"minecraft:cherry_hanging_sign",
|
||||
"minecraft:oak_hanging_sign",
|
||||
"minecraft:jungle_hanging_sign",
|
||||
"minecraft:acacia_hanging_sign",
|
||||
"minecraft:dark_oak_hanging_sign",
|
||||
"minecraft:crimson_hanging_sign",
|
||||
"minecraft:warped_hanging_sign",
|
||||
"minecraft:pale_oak_sign"
|
||||
],
|
||||
"minecraft:soul_fire_base_blocks": [
|
||||
"minecraft:soul_soil",
|
||||
"minecraft:soul_sand"
|
||||
],
|
||||
"minecraft:spawn_egg": [
|
||||
"minecraft:enderman_spawn_egg",
|
||||
"minecraft:endermite_spawn_egg",
|
||||
"minecraft:tropical_fish_spawn_egg",
|
||||
"minecraft:ravager_spawn_egg",
|
||||
"minecraft:pufferfish_spawn_egg",
|
||||
"minecraft:zoglin_spawn_egg",
|
||||
"minecraft:strider_spawn_egg",
|
||||
"minecraft:slime_spawn_egg",
|
||||
"minecraft:glow_squid_spawn_egg",
|
||||
"minecraft:blaze_spawn_egg",
|
||||
"minecraft:witch_spawn_egg",
|
||||
"minecraft:horse_spawn_egg",
|
||||
"minecraft:polar_bear_spawn_egg",
|
||||
"minecraft:pillager_spawn_egg",
|
||||
"minecraft:stray_spawn_egg",
|
||||
"minecraft:zombie_pigman_spawn_egg",
|
||||
"minecraft:snow_golem_spawn_egg",
|
||||
"minecraft:panda_spawn_egg",
|
||||
"minecraft:axolotl_spawn_egg",
|
||||
"minecraft:agent_spawn_egg",
|
||||
"minecraft:shulker_spawn_egg",
|
||||
"minecraft:vindicator_spawn_egg",
|
||||
"minecraft:evoker_spawn_egg",
|
||||
"minecraft:parrot_spawn_egg",
|
||||
"minecraft:wolf_spawn_egg",
|
||||
"minecraft:sheep_spawn_egg",
|
||||
"minecraft:elder_guardian_spawn_egg",
|
||||
"minecraft:silverfish_spawn_egg",
|
||||
"minecraft:tadpole_spawn_egg",
|
||||
"minecraft:cow_spawn_egg",
|
||||
"minecraft:bogged_spawn_egg",
|
||||
"minecraft:ocelot_spawn_egg",
|
||||
"minecraft:bee_spawn_egg",
|
||||
"minecraft:piglin_brute_spawn_egg",
|
||||
"minecraft:rabbit_spawn_egg",
|
||||
"minecraft:camel_spawn_egg",
|
||||
"minecraft:creeper_spawn_egg",
|
||||
"minecraft:drowned_spawn_egg",
|
||||
"minecraft:chicken_spawn_egg",
|
||||
"minecraft:pig_spawn_egg",
|
||||
"minecraft:mooshroom_spawn_egg",
|
||||
"minecraft:skeleton_spawn_egg",
|
||||
"minecraft:spider_spawn_egg",
|
||||
"minecraft:zombie_spawn_egg",
|
||||
"minecraft:villager_spawn_egg",
|
||||
"minecraft:squid_spawn_egg",
|
||||
"minecraft:bat_spawn_egg",
|
||||
"minecraft:ghast_spawn_egg",
|
||||
"minecraft:magma_cube_spawn_egg",
|
||||
"minecraft:cave_spider_spawn_egg",
|
||||
"minecraft:guardian_spawn_egg",
|
||||
"minecraft:husk_spawn_egg",
|
||||
"minecraft:piglin_spawn_egg",
|
||||
"minecraft:wither_skeleton_spawn_egg",
|
||||
"minecraft:donkey_spawn_egg",
|
||||
"minecraft:creaking_spawn_egg",
|
||||
"minecraft:mule_spawn_egg",
|
||||
"minecraft:skeleton_horse_spawn_egg",
|
||||
"minecraft:zombie_horse_spawn_egg",
|
||||
"minecraft:npc_spawn_egg",
|
||||
"minecraft:breeze_spawn_egg",
|
||||
"minecraft:llama_spawn_egg",
|
||||
"minecraft:vex_spawn_egg",
|
||||
"minecraft:warden_spawn_egg",
|
||||
"minecraft:zombie_villager_spawn_egg",
|
||||
"minecraft:cod_spawn_egg",
|
||||
"minecraft:salmon_spawn_egg",
|
||||
"minecraft:dolphin_spawn_egg",
|
||||
"minecraft:turtle_spawn_egg",
|
||||
"minecraft:phantom_spawn_egg",
|
||||
"minecraft:cat_spawn_egg",
|
||||
"minecraft:fox_spawn_egg",
|
||||
"minecraft:wandering_trader_spawn_egg",
|
||||
"minecraft:hoglin_spawn_egg",
|
||||
"minecraft:sniffer_spawn_egg",
|
||||
"minecraft:goat_spawn_egg",
|
||||
"minecraft:iron_golem_spawn_egg",
|
||||
"minecraft:ender_dragon_spawn_egg",
|
||||
"minecraft:wither_spawn_egg",
|
||||
"minecraft:frog_spawn_egg",
|
||||
"minecraft:allay_spawn_egg",
|
||||
"minecraft:trader_llama_spawn_egg",
|
||||
"minecraft:armadillo_spawn_egg",
|
||||
"minecraft:spawn_egg"
|
||||
],
|
||||
"minecraft:stone_bricks": [
|
||||
"minecraft:mossy_stone_bricks",
|
||||
"minecraft:stone_bricks",
|
||||
"minecraft:cracked_stone_bricks",
|
||||
"minecraft:chiseled_stone_bricks"
|
||||
],
|
||||
"minecraft:stone_crafting_materials": [
|
||||
"minecraft:cobblestone",
|
||||
"minecraft:cobbled_deepslate",
|
||||
"minecraft:blackstone"
|
||||
],
|
||||
"minecraft:stone_tier": [
|
||||
"minecraft:stone_sword",
|
||||
"minecraft:stone_shovel",
|
||||
"minecraft:stone_pickaxe",
|
||||
"minecraft:stone_axe",
|
||||
"minecraft:stone_hoe"
|
||||
],
|
||||
"minecraft:stone_tool_materials": [
|
||||
"minecraft:cobblestone",
|
||||
"minecraft:cobbled_deepslate",
|
||||
"minecraft:blackstone"
|
||||
],
|
||||
"minecraft:transform_materials": [
|
||||
"minecraft:netherite_ingot"
|
||||
],
|
||||
"minecraft:transform_templates": [
|
||||
"minecraft:netherite_upgrade_smithing_template"
|
||||
],
|
||||
"minecraft:transformable_items": [
|
||||
"minecraft:diamond_sword",
|
||||
"minecraft:diamond_shovel",
|
||||
"minecraft:diamond_pickaxe",
|
||||
"minecraft:diamond_axe",
|
||||
"minecraft:diamond_hoe",
|
||||
"minecraft:diamond_helmet",
|
||||
"minecraft:diamond_chestplate",
|
||||
"minecraft:diamond_leggings",
|
||||
"minecraft:diamond_boots",
|
||||
"minecraft:golden_boots"
|
||||
],
|
||||
"minecraft:trim_materials": [
|
||||
"minecraft:resin_brick",
|
||||
"minecraft:diamond",
|
||||
"minecraft:iron_ingot",
|
||||
"minecraft:gold_ingot",
|
||||
"minecraft:redstone",
|
||||
"minecraft:netherite_ingot",
|
||||
"minecraft:lapis_lazuli",
|
||||
"minecraft:quartz",
|
||||
"minecraft:copper_ingot",
|
||||
"minecraft:emerald",
|
||||
"minecraft:amethyst_shard"
|
||||
],
|
||||
"minecraft:trim_templates": [
|
||||
"minecraft:coast_armor_trim_smithing_template",
|
||||
"minecraft:vex_armor_trim_smithing_template",
|
||||
"minecraft:wild_armor_trim_smithing_template",
|
||||
"minecraft:flow_armor_trim_smithing_template",
|
||||
"minecraft:silence_armor_trim_smithing_template",
|
||||
"minecraft:snout_armor_trim_smithing_template",
|
||||
"minecraft:dune_armor_trim_smithing_template",
|
||||
"minecraft:rib_armor_trim_smithing_template",
|
||||
"minecraft:host_armor_trim_smithing_template",
|
||||
"minecraft:eye_armor_trim_smithing_template",
|
||||
"minecraft:spire_armor_trim_smithing_template",
|
||||
"minecraft:sentry_armor_trim_smithing_template",
|
||||
"minecraft:ward_armor_trim_smithing_template",
|
||||
"minecraft:tide_armor_trim_smithing_template",
|
||||
"minecraft:wayfinder_armor_trim_smithing_template",
|
||||
"minecraft:raiser_armor_trim_smithing_template",
|
||||
"minecraft:shaper_armor_trim_smithing_template",
|
||||
"minecraft:bolt_armor_trim_smithing_template"
|
||||
],
|
||||
"minecraft:trimmable_armors": [
|
||||
"minecraft:iron_chestplate",
|
||||
"minecraft:netherite_boots",
|
||||
"minecraft:chainmail_helmet",
|
||||
"minecraft:leather_helmet",
|
||||
"minecraft:leather_chestplate",
|
||||
"minecraft:leather_leggings",
|
||||
"minecraft:leather_boots",
|
||||
"minecraft:chainmail_chestplate",
|
||||
"minecraft:chainmail_leggings",
|
||||
"minecraft:chainmail_boots",
|
||||
"minecraft:iron_helmet",
|
||||
"minecraft:iron_leggings",
|
||||
"minecraft:iron_boots",
|
||||
"minecraft:diamond_helmet",
|
||||
"minecraft:diamond_chestplate",
|
||||
"minecraft:diamond_leggings",
|
||||
"minecraft:diamond_boots",
|
||||
"minecraft:golden_helmet",
|
||||
"minecraft:golden_chestplate",
|
||||
"minecraft:golden_leggings",
|
||||
"minecraft:golden_boots",
|
||||
"minecraft:turtle_helmet",
|
||||
"minecraft:netherite_chestplate",
|
||||
"minecraft:netherite_leggings",
|
||||
"minecraft:netherite_helmet"
|
||||
],
|
||||
"minecraft:vibration_damper": [
|
||||
"minecraft:black_carpet",
|
||||
"minecraft:pink_carpet",
|
||||
"minecraft:lime_carpet",
|
||||
"minecraft:blue_carpet",
|
||||
"minecraft:green_wool",
|
||||
"minecraft:cyan_carpet",
|
||||
"minecraft:orange_wool",
|
||||
"minecraft:white_carpet",
|
||||
"minecraft:purple_carpet",
|
||||
"minecraft:yellow_carpet",
|
||||
"minecraft:light_gray_wool",
|
||||
"minecraft:magenta_carpet",
|
||||
"minecraft:purple_wool",
|
||||
"minecraft:gray_wool",
|
||||
"minecraft:red_carpet",
|
||||
"minecraft:brown_carpet",
|
||||
"minecraft:light_blue_wool",
|
||||
"minecraft:green_carpet",
|
||||
"minecraft:white_wool",
|
||||
"minecraft:magenta_wool",
|
||||
"minecraft:yellow_wool",
|
||||
"minecraft:lime_wool",
|
||||
"minecraft:pink_wool",
|
||||
"minecraft:cyan_wool",
|
||||
"minecraft:blue_wool",
|
||||
"minecraft:brown_wool",
|
||||
"minecraft:red_wool",
|
||||
"minecraft:black_wool",
|
||||
"minecraft:orange_carpet",
|
||||
"minecraft:light_blue_carpet",
|
||||
"minecraft:gray_carpet",
|
||||
"minecraft:light_gray_carpet"
|
||||
],
|
||||
"minecraft:warped_stems": [
|
||||
"minecraft:stripped_warped_hyphae",
|
||||
"minecraft:stripped_warped_stem",
|
||||
"minecraft:warped_hyphae",
|
||||
"minecraft:warped_stem"
|
||||
],
|
||||
"minecraft:wooden_slabs": [
|
||||
"minecraft:birch_slab",
|
||||
"minecraft:oak_slab",
|
||||
"minecraft:spruce_slab",
|
||||
"minecraft:bamboo_slab",
|
||||
"minecraft:warped_slab",
|
||||
"minecraft:pale_oak_slab",
|
||||
"minecraft:mangrove_slab",
|
||||
"minecraft:cherry_slab",
|
||||
"minecraft:jungle_slab",
|
||||
"minecraft:acacia_slab",
|
||||
"minecraft:dark_oak_slab",
|
||||
"minecraft:crimson_slab"
|
||||
],
|
||||
"minecraft:wooden_tier": [
|
||||
"minecraft:wooden_pickaxe",
|
||||
"minecraft:wooden_sword",
|
||||
"minecraft:wooden_shovel",
|
||||
"minecraft:wooden_axe",
|
||||
"minecraft:wooden_hoe"
|
||||
],
|
||||
"minecraft:wool": [
|
||||
"minecraft:green_wool",
|
||||
"minecraft:orange_wool",
|
||||
"minecraft:light_gray_wool",
|
||||
"minecraft:purple_wool",
|
||||
"minecraft:gray_wool",
|
||||
"minecraft:light_blue_wool",
|
||||
"minecraft:white_wool",
|
||||
"minecraft:magenta_wool",
|
||||
"minecraft:yellow_wool",
|
||||
"minecraft:lime_wool",
|
||||
"minecraft:pink_wool",
|
||||
"minecraft:cyan_wool",
|
||||
"minecraft:blue_wool",
|
||||
"minecraft:brown_wool",
|
||||
"minecraft:red_wool",
|
||||
"minecraft:black_wool"
|
||||
]
|
||||
}
|
||||
10730
core/src/main/resources/bedrock/runtime_item_states.1_21_60.json
Normal file
10730
core/src/main/resources/bedrock/runtime_item_states.1_21_60.json
Normal file
File diff suppressed because it is too large
Load Diff
Submodule core/src/main/resources/languages updated: 7499daf712...61642604b8
Submodule core/src/main/resources/mappings updated: 6808d0e16a...2281e339fc
@@ -8,5 +8,5 @@ org.gradle.vfs.watch=false
|
||||
|
||||
group=org.geysermc
|
||||
id=geyser
|
||||
version=2.6.0-SNAPSHOT
|
||||
version=2.6.1-SNAPSHOT
|
||||
description=Allows for players from Minecraft: Bedrock Edition to join Minecraft: Java Edition servers.
|
||||
|
||||
@@ -10,9 +10,9 @@ netty-io-uring = "0.0.25.Final-SNAPSHOT"
|
||||
guava = "29.0-jre"
|
||||
gson = "2.3.1" # Provided by Spigot 1.8.8
|
||||
websocket = "1.5.1"
|
||||
protocol-connection = "3.0.0.Beta5-20241213.160944-20"
|
||||
protocol-common = "3.0.0.Beta5-20241213.160944-20"
|
||||
protocol-codec = "3.0.0.Beta5-20241213.160944-20"
|
||||
protocol-connection = "3.0.0.Beta6-20250203.121006-1"
|
||||
protocol-common = "3.0.0.Beta6-20250203.121006-1"
|
||||
protocol-codec = "3.0.0.Beta6-20250203.121006-1"
|
||||
raknet = "1.0.0.CR3-20250128.101054-17"
|
||||
minecraftauth = "4.1.1"
|
||||
mcprotocollib = "1.21.4-20250121.131208-18"
|
||||
|
||||
Reference in New Issue
Block a user