mirror of
https://github.com/GeyserMC/Geyser.git
synced 2026-01-06 15:41:50 +00:00
Merge remote-tracking branch 'upstream/master' into feature/1.21.6
# Conflicts: # core/src/main/java/org/geysermc/geyser/registry/populator/ItemRegistryPopulator.java
This commit is contained in:
@@ -44,6 +44,7 @@ import org.cloudburstmc.nbt.NbtType;
|
||||
import org.cloudburstmc.nbt.NbtUtils;
|
||||
import org.cloudburstmc.protocol.bedrock.codec.v786.Bedrock_v786;
|
||||
import org.cloudburstmc.protocol.bedrock.codec.v800.Bedrock_v800;
|
||||
import org.cloudburstmc.protocol.bedrock.codec.v818.Bedrock_v818;
|
||||
import org.cloudburstmc.protocol.bedrock.data.BlockPropertyData;
|
||||
import org.cloudburstmc.protocol.bedrock.data.definitions.BlockDefinition;
|
||||
import org.geysermc.geyser.GeyserImpl;
|
||||
@@ -118,6 +119,7 @@ public final class BlockRegistryPopulator {
|
||||
var blockMappers = ImmutableMap.<ObjectIntPair<String>, Remapper>builder()
|
||||
.put(ObjectIntPair.of("1_21_70", Bedrock_v786.CODEC.getProtocolVersion()), Conversion800_786::remapBlock)
|
||||
.put(ObjectIntPair.of("1_21_80", Bedrock_v800.CODEC.getProtocolVersion()), tag -> tag)
|
||||
.put(ObjectIntPair.of("1_21_90", Bedrock_v818.CODEC.getProtocolVersion()), tag -> tag)
|
||||
.build();
|
||||
|
||||
// We can keep this strong as nothing should be garbage collected
|
||||
|
||||
@@ -142,9 +142,12 @@ public class CreativeItemRegistryPopulator {
|
||||
}
|
||||
}
|
||||
|
||||
if (!found) {
|
||||
return null;
|
||||
}
|
||||
// TODO this is nice, but has the nasty side-effect of breaking creative categories.
|
||||
// We would need to re-write those to fully remove new items / categories
|
||||
// if (!found) {
|
||||
// GeyserImpl.getInstance().getLogger().debug("Removing item that we don't yet translate: " + identifier);
|
||||
// return null;
|
||||
// }
|
||||
}
|
||||
|
||||
JsonNode damageNode = itemNode.get("damage");
|
||||
|
||||
@@ -47,6 +47,7 @@ import org.cloudburstmc.nbt.NbtType;
|
||||
import org.cloudburstmc.nbt.NbtUtils;
|
||||
import org.cloudburstmc.protocol.bedrock.codec.v786.Bedrock_v786;
|
||||
import org.cloudburstmc.protocol.bedrock.codec.v800.Bedrock_v800;
|
||||
import org.cloudburstmc.protocol.bedrock.codec.v818.Bedrock_v818;
|
||||
import org.cloudburstmc.protocol.bedrock.data.definitions.BlockDefinition;
|
||||
import org.cloudburstmc.protocol.bedrock.data.definitions.ItemDefinition;
|
||||
import org.cloudburstmc.protocol.bedrock.data.definitions.SimpleItemDefinition;
|
||||
@@ -111,20 +112,6 @@ public class ItemRegistryPopulator {
|
||||
|
||||
public static void populate() {
|
||||
// 1.21.5
|
||||
//Map<Item, Item> itemFallbacks = new HashMap<>();
|
||||
//itemFallbacks.put(Items.BUSH, Items.SHORT_GRASS);
|
||||
//itemFallbacks.put(Items.CACTUS_FLOWER, Items.BUBBLE_CORAL_FAN);
|
||||
//itemFallbacks.put(Items.FIREFLY_BUSH, Items.SHORT_GRASS);
|
||||
//itemFallbacks.put(Items.LEAF_LITTER, Items.PINK_PETALS);
|
||||
//itemFallbacks.put(Items.SHORT_DRY_GRASS, Items.DEAD_BUSH);
|
||||
//itemFallbacks.put(Items.TALL_DRY_GRASS, Items.TALL_GRASS);
|
||||
//itemFallbacks.put(Items.WILDFLOWERS, Items.PINK_PETALS);
|
||||
//itemFallbacks.put(Items.TEST_BLOCK, Items.STRUCTURE_BLOCK);
|
||||
//itemFallbacks.put(Items.TEST_INSTANCE_BLOCK, Items.JIGSAW);
|
||||
//itemFallbacks.put(Items.BLUE_EGG, Items.EGG);
|
||||
//itemFallbacks.put(Items.BROWN_EGG, Items.EGG);
|
||||
|
||||
// 1.21.6
|
||||
Map<Item, Item> itemFallbacks = new HashMap<>();
|
||||
itemFallbacks.put(Items.BLACK_HARNESS, Items.SADDLE);
|
||||
itemFallbacks.put(Items.BLUE_HARNESS, Items.SADDLE);
|
||||
@@ -149,6 +136,7 @@ public class ItemRegistryPopulator {
|
||||
List<PaletteVersion> paletteVersions = new ArrayList<>(2);
|
||||
paletteVersions.add(new PaletteVersion("1_21_70", Bedrock_v786.CODEC.getProtocolVersion(), itemFallbacks, (item, mapping) -> mapping));
|
||||
paletteVersions.add(new PaletteVersion("1_21_80", Bedrock_v800.CODEC.getProtocolVersion(), Map.of(Items.MUSIC_DISC_TEARS, Items.MUSIC_DISC_5), (item, mapping) -> mapping));
|
||||
paletteVersions.add(new PaletteVersion("1_21_90", Bedrock_v818.CODEC.getProtocolVersion()));
|
||||
|
||||
GeyserBootstrap bootstrap = GeyserImpl.getInstance().getBootstrap();
|
||||
|
||||
|
||||
@@ -43,6 +43,7 @@ import org.geysermc.geyser.entity.type.player.SkullPlayerEntity;
|
||||
import org.geysermc.geyser.session.GeyserSession;
|
||||
import org.geysermc.geyser.session.auth.BedrockClientData;
|
||||
import org.geysermc.geyser.text.GeyserLocale;
|
||||
import org.geysermc.geyser.util.FileUtils;
|
||||
|
||||
import java.awt.*;
|
||||
import java.io.IOException;
|
||||
@@ -54,6 +55,8 @@ import java.util.function.Consumer;
|
||||
|
||||
public class SkinManager {
|
||||
|
||||
static final String GEOMETRY = new String(FileUtils.readAllBytes("bedrock/geometries/geo.json"), StandardCharsets.UTF_8);
|
||||
|
||||
/**
|
||||
* Builds a Bedrock player list entry from our existing, cached Bedrock skin information
|
||||
*/
|
||||
@@ -176,7 +179,7 @@ public class SkinManager {
|
||||
.skinResourcePatch(geometry.geometryName())
|
||||
.skinData(ImageData.of(skin.skinData()))
|
||||
.capeData(ImageData.of(cape.capeData()))
|
||||
.geometryData(geometry.geometryData())
|
||||
.geometryData(geometry.geometryData().isBlank() ? GEOMETRY : geometry.geometryData())
|
||||
.premium(true)
|
||||
.capeId(cape.capeId())
|
||||
.fullSkinId(skinId)
|
||||
|
||||
414
core/src/main/resources/bedrock/geometries/geo.json
Normal file
414
core/src/main/resources/bedrock/geometries/geo.json
Normal file
@@ -0,0 +1,414 @@
|
||||
{
|
||||
"format_version" : "1.12.0",
|
||||
"minecraft:geometry" : [
|
||||
{
|
||||
"bones" : [
|
||||
{
|
||||
"name" : "body",
|
||||
"parent" : "waist",
|
||||
"pivot" : [ 0.0, 24.0, 0.0 ]
|
||||
},
|
||||
{
|
||||
"name" : "waist",
|
||||
"pivot" : [ 0.0, 12.0, 0.0 ]
|
||||
},
|
||||
{
|
||||
"cubes" : [
|
||||
{
|
||||
"origin" : [ -5.0, 8.0, 3.0 ],
|
||||
"size" : [ 10, 16, 1 ],
|
||||
"uv" : [ 0, 0 ]
|
||||
}
|
||||
],
|
||||
"name" : "cape",
|
||||
"parent" : "body",
|
||||
"pivot" : [ 0.0, 24.0, 3.0 ],
|
||||
"rotation" : [ 0.0, 180.0, 0.0 ]
|
||||
}
|
||||
],
|
||||
"description" : {
|
||||
"identifier" : "geometry.cape",
|
||||
"texture_height" : 32,
|
||||
"texture_width" : 64
|
||||
}
|
||||
},
|
||||
{
|
||||
"bones" : [
|
||||
{
|
||||
"name" : "root",
|
||||
"pivot" : [ 0.0, 0.0, 0.0 ]
|
||||
},
|
||||
{
|
||||
"cubes" : [
|
||||
{
|
||||
"origin" : [ -4.0, 12.0, -2.0 ],
|
||||
"size" : [ 8, 12, 4 ],
|
||||
"uv" : [ 16, 16 ]
|
||||
}
|
||||
],
|
||||
"name" : "body",
|
||||
"parent" : "waist",
|
||||
"pivot" : [ 0.0, 24.0, 0.0 ]
|
||||
},
|
||||
{
|
||||
"name" : "waist",
|
||||
"parent" : "root",
|
||||
"pivot" : [ 0.0, 12.0, 0.0 ]
|
||||
},
|
||||
{
|
||||
"cubes" : [
|
||||
{
|
||||
"origin" : [ -4.0, 24.0, -4.0 ],
|
||||
"size" : [ 8, 8, 8 ],
|
||||
"uv" : [ 0, 0 ]
|
||||
}
|
||||
],
|
||||
"name" : "head",
|
||||
"parent" : "body",
|
||||
"pivot" : [ 0.0, 24.0, 0.0 ]
|
||||
},
|
||||
{
|
||||
"name" : "cape",
|
||||
"parent" : "body",
|
||||
"pivot" : [ 0.0, 24, 3.0 ]
|
||||
},
|
||||
{
|
||||
"cubes" : [
|
||||
{
|
||||
"inflate" : 0.50,
|
||||
"origin" : [ -4.0, 24.0, -4.0 ],
|
||||
"size" : [ 8, 8, 8 ],
|
||||
"uv" : [ 32, 0 ]
|
||||
}
|
||||
],
|
||||
"name" : "hat",
|
||||
"parent" : "head",
|
||||
"pivot" : [ 0.0, 24.0, 0.0 ]
|
||||
},
|
||||
{
|
||||
"cubes" : [
|
||||
{
|
||||
"origin" : [ 4.0, 12.0, -2.0 ],
|
||||
"size" : [ 4, 12, 4 ],
|
||||
"uv" : [ 32, 48 ]
|
||||
}
|
||||
],
|
||||
"name" : "leftArm",
|
||||
"parent" : "body",
|
||||
"pivot" : [ 5.0, 22.0, 0.0 ]
|
||||
},
|
||||
{
|
||||
"cubes" : [
|
||||
{
|
||||
"inflate" : 0.250,
|
||||
"origin" : [ 4.0, 12.0, -2.0 ],
|
||||
"size" : [ 4, 12, 4 ],
|
||||
"uv" : [ 48, 48 ]
|
||||
}
|
||||
],
|
||||
"name" : "leftSleeve",
|
||||
"parent" : "leftArm",
|
||||
"pivot" : [ 5.0, 22.0, 0.0 ]
|
||||
},
|
||||
{
|
||||
"name" : "leftItem",
|
||||
"parent" : "leftArm",
|
||||
"pivot" : [ 6.0, 15.0, 1.0 ]
|
||||
},
|
||||
{
|
||||
"cubes" : [
|
||||
{
|
||||
"origin" : [ -8.0, 12.0, -2.0 ],
|
||||
"size" : [ 4, 12, 4 ],
|
||||
"uv" : [ 40, 16 ]
|
||||
}
|
||||
],
|
||||
"name" : "rightArm",
|
||||
"parent" : "body",
|
||||
"pivot" : [ -5.0, 22.0, 0.0 ]
|
||||
},
|
||||
{
|
||||
"cubes" : [
|
||||
{
|
||||
"inflate" : 0.250,
|
||||
"origin" : [ -8.0, 12.0, -2.0 ],
|
||||
"size" : [ 4, 12, 4 ],
|
||||
"uv" : [ 40, 32 ]
|
||||
}
|
||||
],
|
||||
"name" : "rightSleeve",
|
||||
"parent" : "rightArm",
|
||||
"pivot" : [ -5.0, 22.0, 0.0 ]
|
||||
},
|
||||
{
|
||||
"locators" : {
|
||||
"lead_hold" : [ -6, 15, 1 ]
|
||||
},
|
||||
"name" : "rightItem",
|
||||
"parent" : "rightArm",
|
||||
"pivot" : [ -6, 15, 1 ]
|
||||
},
|
||||
{
|
||||
"cubes" : [
|
||||
{
|
||||
"origin" : [ -0.10, 0.0, -2.0 ],
|
||||
"size" : [ 4, 12, 4 ],
|
||||
"uv" : [ 16, 48 ]
|
||||
}
|
||||
],
|
||||
"name" : "leftLeg",
|
||||
"parent" : "root",
|
||||
"pivot" : [ 1.90, 12.0, 0.0 ]
|
||||
},
|
||||
{
|
||||
"cubes" : [
|
||||
{
|
||||
"inflate" : 0.250,
|
||||
"origin" : [ -0.10, 0.0, -2.0 ],
|
||||
"size" : [ 4, 12, 4 ],
|
||||
"uv" : [ 0, 48 ]
|
||||
}
|
||||
],
|
||||
"name" : "leftPants",
|
||||
"parent" : "leftLeg",
|
||||
"pivot" : [ 1.90, 12.0, 0.0 ]
|
||||
},
|
||||
{
|
||||
"cubes" : [
|
||||
{
|
||||
"origin" : [ -3.90, 0.0, -2.0 ],
|
||||
"size" : [ 4, 12, 4 ],
|
||||
"uv" : [ 0, 16 ]
|
||||
}
|
||||
],
|
||||
"name" : "rightLeg",
|
||||
"parent" : "root",
|
||||
"pivot" : [ -1.90, 12.0, 0.0 ]
|
||||
},
|
||||
{
|
||||
"cubes" : [
|
||||
{
|
||||
"inflate" : 0.250,
|
||||
"origin" : [ -3.90, 0.0, -2.0 ],
|
||||
"size" : [ 4, 12, 4 ],
|
||||
"uv" : [ 0, 32 ]
|
||||
}
|
||||
],
|
||||
"name" : "rightPants",
|
||||
"parent" : "rightLeg",
|
||||
"pivot" : [ -1.90, 12.0, 0.0 ]
|
||||
},
|
||||
{
|
||||
"cubes" : [
|
||||
{
|
||||
"inflate" : 0.250,
|
||||
"origin" : [ -4.0, 12.0, -2.0 ],
|
||||
"size" : [ 8, 12, 4 ],
|
||||
"uv" : [ 16, 32 ]
|
||||
}
|
||||
],
|
||||
"name" : "jacket",
|
||||
"parent" : "body",
|
||||
"pivot" : [ 0.0, 24.0, 0.0 ]
|
||||
}
|
||||
],
|
||||
"description" : {
|
||||
"identifier" : "geometry.humanoid.custom",
|
||||
"texture_height" : 64,
|
||||
"texture_width" : 64,
|
||||
"visible_bounds_height" : 2,
|
||||
"visible_bounds_offset" : [ 0, 1, 0 ],
|
||||
"visible_bounds_width" : 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"bones" : [
|
||||
{
|
||||
"name" : "root",
|
||||
"pivot" : [ 0.0, 0.0, 0.0 ]
|
||||
},
|
||||
{
|
||||
"name" : "waist",
|
||||
"parent" : "root",
|
||||
"pivot" : [ 0.0, 12.0, 0.0 ]
|
||||
},
|
||||
{
|
||||
"cubes" : [
|
||||
{
|
||||
"origin" : [ -4.0, 12.0, -2.0 ],
|
||||
"size" : [ 8, 12, 4 ],
|
||||
"uv" : [ 16, 16 ]
|
||||
}
|
||||
],
|
||||
"name" : "body",
|
||||
"parent" : "waist",
|
||||
"pivot" : [ 0.0, 24.0, 0.0 ]
|
||||
},
|
||||
{
|
||||
"cubes" : [
|
||||
{
|
||||
"origin" : [ -4.0, 24.0, -4.0 ],
|
||||
"size" : [ 8, 8, 8 ],
|
||||
"uv" : [ 0, 0 ]
|
||||
}
|
||||
],
|
||||
"name" : "head",
|
||||
"parent" : "body",
|
||||
"pivot" : [ 0.0, 24.0, 0.0 ]
|
||||
},
|
||||
{
|
||||
"cubes" : [
|
||||
{
|
||||
"inflate" : 0.50,
|
||||
"origin" : [ -4.0, 24.0, -4.0 ],
|
||||
"size" : [ 8, 8, 8 ],
|
||||
"uv" : [ 32, 0 ]
|
||||
}
|
||||
],
|
||||
"name" : "hat",
|
||||
"parent" : "head",
|
||||
"pivot" : [ 0.0, 24.0, 0.0 ]
|
||||
},
|
||||
{
|
||||
"cubes" : [
|
||||
{
|
||||
"origin" : [ -3.90, 0.0, -2.0 ],
|
||||
"size" : [ 4, 12, 4 ],
|
||||
"uv" : [ 0, 16 ]
|
||||
}
|
||||
],
|
||||
"name" : "rightLeg",
|
||||
"parent" : "root",
|
||||
"pivot" : [ -1.90, 12.0, 0.0 ]
|
||||
},
|
||||
{
|
||||
"cubes" : [
|
||||
{
|
||||
"inflate" : 0.250,
|
||||
"origin" : [ -3.90, 0.0, -2.0 ],
|
||||
"size" : [ 4, 12, 4 ],
|
||||
"uv" : [ 0, 32 ]
|
||||
}
|
||||
],
|
||||
"name" : "rightPants",
|
||||
"parent" : "rightLeg",
|
||||
"pivot" : [ -1.90, 12.0, 0.0 ]
|
||||
},
|
||||
{
|
||||
"cubes" : [
|
||||
{
|
||||
"origin" : [ -0.10, 0.0, -2.0 ],
|
||||
"size" : [ 4, 12, 4 ],
|
||||
"uv" : [ 16, 48 ]
|
||||
}
|
||||
],
|
||||
"name" : "leftLeg",
|
||||
"parent" : "root",
|
||||
"pivot" : [ 1.90, 12.0, 0.0 ]
|
||||
},
|
||||
{
|
||||
"cubes" : [
|
||||
{
|
||||
"inflate" : 0.250,
|
||||
"origin" : [ -0.10, 0.0, -2.0 ],
|
||||
"size" : [ 4, 12, 4 ],
|
||||
"uv" : [ 0, 48 ]
|
||||
}
|
||||
],
|
||||
"name" : "leftPants",
|
||||
"parent" : "leftLeg",
|
||||
"pivot" : [ 1.90, 12.0, 0.0 ]
|
||||
},
|
||||
{
|
||||
"cubes" : [
|
||||
{
|
||||
"origin" : [ 4.0, 11.50, -2.0 ],
|
||||
"size" : [ 3, 12, 4 ],
|
||||
"uv" : [ 32, 48 ]
|
||||
}
|
||||
],
|
||||
"name" : "leftArm",
|
||||
"parent" : "body",
|
||||
"pivot" : [ 5.0, 21.50, 0.0 ]
|
||||
},
|
||||
{
|
||||
"cubes" : [
|
||||
{
|
||||
"inflate" : 0.250,
|
||||
"origin" : [ 4.0, 11.50, -2.0 ],
|
||||
"size" : [ 3, 12, 4 ],
|
||||
"uv" : [ 48, 48 ]
|
||||
}
|
||||
],
|
||||
"name" : "leftSleeve",
|
||||
"parent" : "leftArm",
|
||||
"pivot" : [ 5.0, 21.50, 0.0 ]
|
||||
},
|
||||
{
|
||||
"name" : "leftItem",
|
||||
"parent" : "leftArm",
|
||||
"pivot" : [ 6, 14.50, 1 ]
|
||||
},
|
||||
{
|
||||
"cubes" : [
|
||||
{
|
||||
"origin" : [ -7.0, 11.50, -2.0 ],
|
||||
"size" : [ 3, 12, 4 ],
|
||||
"uv" : [ 40, 16 ]
|
||||
}
|
||||
],
|
||||
"name" : "rightArm",
|
||||
"parent" : "body",
|
||||
"pivot" : [ -5.0, 21.50, 0.0 ]
|
||||
},
|
||||
{
|
||||
"cubes" : [
|
||||
{
|
||||
"inflate" : 0.250,
|
||||
"origin" : [ -7.0, 11.50, -2.0 ],
|
||||
"size" : [ 3, 12, 4 ],
|
||||
"uv" : [ 40, 32 ]
|
||||
}
|
||||
],
|
||||
"name" : "rightSleeve",
|
||||
"parent" : "rightArm",
|
||||
"pivot" : [ -5.0, 21.50, 0.0 ]
|
||||
},
|
||||
{
|
||||
"locators" : {
|
||||
"lead_hold" : [ -6, 14.50, 1 ]
|
||||
},
|
||||
"name" : "rightItem",
|
||||
"parent" : "rightArm",
|
||||
"pivot" : [ -6, 14.50, 1 ]
|
||||
},
|
||||
{
|
||||
"cubes" : [
|
||||
{
|
||||
"inflate" : 0.250,
|
||||
"origin" : [ -4.0, 12.0, -2.0 ],
|
||||
"size" : [ 8, 12, 4 ],
|
||||
"uv" : [ 16, 32 ]
|
||||
}
|
||||
],
|
||||
"name" : "jacket",
|
||||
"parent" : "body",
|
||||
"pivot" : [ 0.0, 24.0, 0.0 ]
|
||||
},
|
||||
{
|
||||
"name" : "cape",
|
||||
"parent" : "body",
|
||||
"pivot" : [ 0.0, 24, -3.0 ]
|
||||
}
|
||||
],
|
||||
"description" : {
|
||||
"identifier" : "geometry.humanoid.customSlim",
|
||||
"texture_height" : 64,
|
||||
"texture_width" : 64,
|
||||
"visible_bounds_height" : 2,
|
||||
"visible_bounds_offset" : [ 0, 1, 0 ],
|
||||
"visible_bounds_width" : 1
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user