Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/add player head mappings #5113

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
ea991e8
potentially fix render bug regarding view distance
Tjorven-Liebe Sep 3, 2024
e3062a9
potentially fix render bug regarding view distance
Tjorven-Liebe Sep 3, 2024
a8c4858
potentially fix render bug regarding view distance
Tjorven-Liebe Sep 3, 2024
eaa4c03
add configuration option per environmental ("GEYSER_EMPTY_CHUNK_COUNT")
Tjorven-Liebe Sep 3, 2024
2751554
Merge branch 'master' into development
ByteExceptionM Sep 10, 2024
8bf434e
Merge remote-tracking branch 'geyser/master' into development
ByteExceptionM Sep 17, 2024
420b1bb
Merge remote-tracking branch 'refs/remotes/geyser/master' into develo…
Tjorven-Liebe Sep 18, 2024
16ba335
Merge remote-tracking branch 'origin/development' into development
Tjorven-Liebe Sep 18, 2024
5c70754
Merge remote-tracking branch 'geyser/master' into development
Tjorven-Liebe Sep 19, 2024
a4a383d
fix: purpur_pillars now also work in the inventory
Tjorven-Liebe Sep 19, 2024
f0d37b3
Merge remote-tracking branch 'geyser/master' into development
Tjorven-Liebe Sep 20, 2024
5fb77c7
Merge remote-tracking branch 'geyser/master' into development
Tjorven-Liebe Sep 23, 2024
851cd3c
Merge remote-tracking branch 'refs/remotes/geyser/master' into featur…
Tjorven-Liebe Oct 1, 2024
de1a6fb
Merge remote-tracking branch 'geyser/master' into feature/1.21.31
Tjorven-Liebe Oct 1, 2024
d734458
chore: Update geyser to latest version
Tjorven-Liebe Oct 1, 2024
ebe8929
Merge pull request #1 from iwmedia/development
ByteExceptionM Oct 1, 2024
92e3728
Merge pull request #5 from iwmedia/feature/1.21.31
ByteExceptionM Oct 1, 2024
1e3af1d
Merge branch 'main' into development
ByteExceptionM Oct 1, 2024
7b42f31
Merge pull request #6 from iwmedia/development
ByteExceptionM Oct 1, 2024
6c40001
fix: Path for mapppings
Tjorven-Liebe Oct 1, 2024
ef5c7ff
Merge pull request #7 from iwmedia/feature/1.21.31
ByteExceptionM Oct 1, 2024
0bc5b67
Merge branch 'main' into development
ByteExceptionM Oct 1, 2024
386cc04
Merge pull request #8 from iwmedia/development
ByteExceptionM Oct 1, 2024
8dd589a
Merge remote-tracking branch 'geyser/master' into development
Tjorven-Liebe Oct 7, 2024
550c0d4
Merge remote-tracking branch 'geyser/master' into development
Tjorven-Liebe Oct 14, 2024
fd35231
Merge remote-tracking branch 'geyser/master' into development
Tjorven-Liebe Oct 21, 2024
9b569ea
Merge remote-tracking branch 'geyser/master' into development
Tjorven-Liebe Oct 22, 2024
74e32d4
Merge remote-tracking branch 'geyser/master' into development
Tjorven-Liebe Oct 22, 2024
200faee
fix: mappings for player_head
Tjorven-Liebe Oct 22, 2024
6d423b7
Merge remote-tracking branch 'geyser/master' into feature/add-player-…
Tjorven-Liebe Oct 23, 2024
a520526
fix: Mappings for skulls and heads
Tjorven-Liebe Oct 23, 2024
6d41fc5
fix: typos in identifier
Tjorven-Liebe Oct 23, 2024
cc4e871
fix: mappings
Tjorven-Liebe Oct 23, 2024
0a777a4
fix: link in .gitmodules
Tjorven-Liebe Oct 23, 2024
c9df9b1
Update .gitmodules
Tjorven-Liebe Oct 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[submodule "core/src/main/resources/mappings"]
path = core/src/main/resources/mappings
url = https://github.com/GeyserMC/mappings.git
[submodule "core/src/main/resources/languages"]
path = core/src/main/resources/languages
url = https://github.com/GeyserMC/languages.git
[submodule "core/src/main/resources/mappings"]
path = core/src/main/resources/mappings
url = https://github.com/GeyserMC/mappings.git
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ public class Conversion685_671 {

static GeyserMappingItem remapItem(Item item, GeyserMappingItem mapping) {
mapping = Conversion712_685.remapItem(item, mapping);

String identifer = mapping.getBedrockIdentifier();
String identifier = mapping.getBedrockIdentifier();

if (NEW_MUSIC_DISCS.contains(item)) {
return mapping.withBedrockIdentifier("minecraft:music_disc_otherside");
Expand All @@ -59,12 +58,12 @@ static GeyserMappingItem remapItem(Item item, GeyserMappingItem mapping) {
return mapping.withBedrockIdentifier("minecraft:glass_bottle");
}

if (!NEW_BLOCKS.contains(identifer)) {
if (!NEW_BLOCKS.contains(identifier)) {
return mapping;
}

if (NEW_CORAL_BLOCKS.contains(identifer)) {
switch (identifer) {
if (NEW_CORAL_BLOCKS.contains(identifier)) {
switch (identifier) {
case "minecraft:tube_coral_block" -> { return mapping.withBedrockIdentifier("minecraft:coral_block").withBedrockData(0); }
case "minecraft:brain_coral_block" -> { return mapping.withBedrockIdentifier("minecraft:coral_block").withBedrockData(1); }
case "minecraft:bubble_coral_block" -> { return mapping.withBedrockIdentifier("minecraft:coral_block").withBedrockData(2); }
Expand All @@ -78,8 +77,8 @@ static GeyserMappingItem remapItem(Item item, GeyserMappingItem mapping) {
}
}

if (NEW_DOUBLE_PLANTS.contains(identifer)) {
switch (identifer) {
if (NEW_DOUBLE_PLANTS.contains(identifier)) {
switch (identifier) {
case "minecraft:sunflower" -> { return mapping.withBedrockIdentifier("minecraft:double_plant").withBedrockData(0); }
case "minecraft:lilac" -> { return mapping.withBedrockIdentifier("minecraft:double_plant").withBedrockData(1); }
case "minecraft:tall_grass" -> { return mapping.withBedrockIdentifier("minecraft:double_plant").withBedrockData(2); }
Expand All @@ -89,8 +88,8 @@ static GeyserMappingItem remapItem(Item item, GeyserMappingItem mapping) {
}
}

if (NEW_STONE_BLOCK_SLABS.contains(identifer)) {
switch (identifer) {
if (NEW_STONE_BLOCK_SLABS.contains(identifier)) {
switch (identifier) {
case "minecraft:smooth_stone_slab" -> { return mapping.withBedrockIdentifier("minecraft:stone_block_slab").withBedrockData(0); }
case "minecraft:sandstone_slab" -> { return mapping.withBedrockIdentifier("minecraft:stone_block_slab").withBedrockData(1); }
case "minecraft:petrified_oak_slab" -> { return mapping.withBedrockIdentifier("minecraft:stone_block_slab").withBedrockData(2); }
Expand All @@ -102,8 +101,8 @@ static GeyserMappingItem remapItem(Item item, GeyserMappingItem mapping) {
}
}

if (NEW_TALLGRASSES.contains(identifer)) {
switch (identifer) {
if (NEW_TALLGRASSES.contains(identifier)) {
switch (identifier) {
case "minecraft:short_grass" -> { return mapping.withBedrockIdentifier("minecraft:tallgrass").withBedrockData(1); }
case "minecraft:fern" -> { return mapping.withBedrockIdentifier("minecraft:tallgrass").withBedrockData(2); }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,62 +33,61 @@ public class Conversion712_685 {

static GeyserMappingItem remapItem(Item item, GeyserMappingItem mapping) {
mapping = Conversion729_712.remapItem(item, mapping);
String identifier = mapping.getBedrockIdentifier();

String identifer = mapping.getBedrockIdentifier();

if (!NEW_BLOCKS.contains(identifer)) {
if (!NEW_BLOCKS.contains(identifier)) {
return mapping;
}

if (identifer.equals("minecraft:coarse_dirt")) {
if (identifier.equals("minecraft:coarse_dirt")) {
return mapping.withBedrockIdentifier("minecraft:dirt").withBedrockData(1);
}

if (identifer.equals("minecraft:dandelion")) {
if (identifier.equals("minecraft:dandelion")) {
return mapping.withBedrockIdentifier("minecraft:yellow_flower").withBedrockData(0);
}

if (identifer.equals("minecraft:red_sand")) {
if (identifier.equals("minecraft:red_sand")) {
return mapping.withBedrockIdentifier("minecraft:sand").withBedrockData(1);
}

if (NEW_PRISMARINE_BLOCKS.contains(identifer)) {
switch (identifer) {
if (NEW_PRISMARINE_BLOCKS.contains(identifier)) {
switch (identifier) {
case "minecraft:prismarine" -> { return mapping.withBedrockIdentifier("minecraft:prismarine").withBedrockData(0); }
case "minecraft:dark_prismarine" -> { return mapping.withBedrockIdentifier("minecraft:prismarine").withBedrockData(1); }
case "minecraft:prismarine_bricks" -> { return mapping.withBedrockIdentifier("minecraft:prismarine").withBedrockData(2); }
}
}

if (NEW_SANDSTONE_BLOCKS.contains(identifer)) {
switch (identifer) {
if (NEW_SANDSTONE_BLOCKS.contains(identifier)) {
switch (identifier) {
case "minecraft:sandstone" -> { return mapping.withBedrockIdentifier("minecraft:sandstone").withBedrockData(0); }
case "minecraft:chiseled_sandstone" -> { return mapping.withBedrockIdentifier("minecraft:sandstone").withBedrockData(1); }
case "minecraft:cut_sandstone" -> { return mapping.withBedrockIdentifier("minecraft:sandstone").withBedrockData(2); }
case "minecraft:smooth_sandstone" -> { return mapping.withBedrockIdentifier("minecraft:sandstone").withBedrockData(3); }
}
}

if (NEW_RED_SANDSTONE_BLOCKS.contains(identifer)) {
switch (identifer) {
if (NEW_RED_SANDSTONE_BLOCKS.contains(identifier)) {
switch (identifier) {
case "minecraft:red_sandstone" -> { return mapping.withBedrockIdentifier("minecraft:red_sandstone").withBedrockData(0); }
case "minecraft:chiseled_red_sandstone" -> { return mapping.withBedrockIdentifier("minecraft:red_sandstone").withBedrockData(1); }
case "minecraft:cut_red_sandstone" -> { return mapping.withBedrockIdentifier("minecraft:red_sandstone").withBedrockData(2); }
case "minecraft:smooth_red_sandstone" -> { return mapping.withBedrockIdentifier("minecraft:red_sandstone").withBedrockData(3); }
}
}

if (NEW_QUARTZ_BLOCKS.contains(identifer)) {
switch (identifer) {
if (NEW_QUARTZ_BLOCKS.contains(identifier)) {
switch (identifier) {
case "minecraft:quartz_block" -> { return mapping.withBedrockIdentifier("minecraft:quartz_block").withBedrockData(0); }
case "minecraft:chiseled_quartz_block" -> { return mapping.withBedrockIdentifier("minecraft:quartz_block").withBedrockData(1); }
case "minecraft:quartz_pillar" -> { return mapping.withBedrockIdentifier("minecraft:quartz_block").withBedrockData(2); }
case "minecraft:smooth_quartz" -> { return mapping.withBedrockIdentifier("minecraft:quartz_block").withBedrockData(3); }
}
}

if (NEW_STONE_BLOCK_SLABS_2.contains(identifer)) {
switch (identifer) {
if (NEW_STONE_BLOCK_SLABS_2.contains(identifier)) {
switch (identifier) {
case "minecraft:red_sandstone_slab" -> { return mapping.withBedrockIdentifier("minecraft:stone_block_slab2").withBedrockData(0); }
case "minecraft:purpur_slab" -> { return mapping.withBedrockIdentifier("minecraft:stone_block_slab2").withBedrockData(1); }
case "minecraft:prismarine_slab" -> { return mapping.withBedrockIdentifier("minecraft:stone_block_slab2").withBedrockData(2); }
Expand All @@ -100,8 +99,8 @@ static GeyserMappingItem remapItem(Item item, GeyserMappingItem mapping) {
}
}

if (NEW_STONE_BLOCK_SLABS_3.contains(identifer)) {
switch (identifer) {
if (NEW_STONE_BLOCK_SLABS_3.contains(identifier)) {
switch (identifier) {
case "minecraft:end_stone_brick_slab" -> { return mapping.withBedrockIdentifier("minecraft:stone_block_slab3").withBedrockData(0); }
case "minecraft:smooth_red_sandstone_slab" -> { return mapping.withBedrockIdentifier("minecraft:stone_block_slab3").withBedrockData(1); }
case "minecraft:polished_andesite_slab" -> { return mapping.withBedrockIdentifier("minecraft:stone_block_slab3").withBedrockData(2); }
Expand All @@ -113,8 +112,8 @@ static GeyserMappingItem remapItem(Item item, GeyserMappingItem mapping) {
}
}

if (NEW_STONE_BLOCK_SLABS_4.contains(identifer)) {
switch (identifer) {
if (NEW_STONE_BLOCK_SLABS_4.contains(identifier)) {
switch (identifier) {
case "minecraft:mossy_stone_brick_slab" -> { return mapping.withBedrockIdentifier("minecraft:stone_block_slab4").withBedrockData(0); }
case "minecraft:smooth_quartz_slab" -> { return mapping.withBedrockIdentifier("minecraft:stone_block_slab4").withBedrockData(1); }
case "minecraft:normal_stone_slab" -> { return mapping.withBedrockIdentifier("minecraft:stone_block_slab4").withBedrockData(2); }
Expand All @@ -123,8 +122,8 @@ static GeyserMappingItem remapItem(Item item, GeyserMappingItem mapping) {
}
}

if (NEW_MONSTER_EGGS.contains(identifer)) {
switch (identifer) {
if (NEW_MONSTER_EGGS.contains(identifier)) {
switch (identifier) {
case "minecraft:infested_stone" -> { return mapping.withBedrockIdentifier("minecraft:monster_egg").withBedrockData(0); }
case "minecraft:infested_cobblestone" -> { return mapping.withBedrockIdentifier("minecraft:monster_egg").withBedrockData(1); }
case "minecraft:infested_stone_bricks" -> { return mapping.withBedrockIdentifier("minecraft:monster_egg").withBedrockData(2); }
Expand All @@ -134,17 +133,17 @@ static GeyserMappingItem remapItem(Item item, GeyserMappingItem mapping) {
}
}

if (NEW_STONEBRICK_BLOCKS.contains(identifer)) {
switch (identifer) {
if (NEW_STONEBRICK_BLOCKS.contains(identifier)) {
switch (identifier) {
case "minecraft:stone_bricks" -> { return mapping.withBedrockIdentifier("minecraft:stonebrick").withBedrockData(0); }
case "minecraft:mossy_stone_bricks" -> { return mapping.withBedrockIdentifier("minecraft:stonebrick").withBedrockData(1); }
case "minecraft:cracked_stone_bricks" -> { return mapping.withBedrockIdentifier("minecraft:stonebrick").withBedrockData(2); }
case "minecraft:chiseled_stone_bricks" -> { return mapping.withBedrockIdentifier("minecraft:stonebrick").withBedrockData(3); }
}
}

if (NEW_ANVILS.contains(identifer)) {
switch (identifer) {
if (NEW_ANVILS.contains(identifier)) {
switch (identifier) {
case "minecraft:anvil" -> { return mapping.withBedrockIdentifier("minecraft:anvil").withBedrockData(0); }
case "minecraft:chipped_anvil" -> { return mapping.withBedrockIdentifier("minecraft:anvil").withBedrockData(4); }
case "minecraft:damaged_anvil" -> { return mapping.withBedrockIdentifier("minecraft:anvil").withBedrockData(8); }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public class Conversion729_712 {
private static final List<String> NEW_BLOCKS = Stream.of(NEW_PURPUR_BLOCKS, NEW_WALL_BLOCKS, NEW_SPONGE_BLOCKS, NEW_TNT_BLOCKS, STRUCTURE_VOID).flatMap(List::stream).toList();

static GeyserMappingItem remapItem(Item item, GeyserMappingItem mapping) {
mapping = Conversion748_729.remapItem(item, mapping);
String identifier = mapping.getBedrockIdentifier();

if (!NEW_BLOCKS.contains(identifier)) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
/*
* Copyright (c) 2024 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.populator;

import org.geysermc.geyser.item.type.Item;
import org.geysermc.geyser.registry.type.GeyserMappingItem;

import java.util.List;

public class Conversion748_729 {

private static final List<String> NEW_PLAYER_HEADS = List.of("minecraft:skeleton_skull", "minecraft:wither_skeleton_skull", "minecraft:zombie_head", "minecraft:player_head", "minecraft:creeper_head", "minecraft:dragon_head", "minecraft:piglin_head");

static GeyserMappingItem remapItem(Item item, GeyserMappingItem mapping) {
String identifier = mapping.getBedrockIdentifier();

if (!NEW_PLAYER_HEADS.contains(identifier)) {
return mapping;
}
switch (identifier) {
case "minecraft:skeleton_skull" -> {
return mapping.withBedrockIdentifier("minecraft:skull")
.withBedrockData(0);
}
case "minecraft:wither_skeleton_skull" -> {
return mapping.withBedrockIdentifier("minecraft:skull")
.withBedrockData(1);
}
case "minecraft:zombie_head" -> {
return mapping.withBedrockIdentifier("minecraft:skull")
.withBedrockData(2);
}
case "minecraft:player_head" -> {
return mapping.withBedrockIdentifier("minecraft:skull")
.withBedrockData(3);
}
case "minecraft:creeper_head" -> {
return mapping.withBedrockIdentifier("minecraft:skull")
.withBedrockData(4);
}
case "minecraft:dragon_head" -> {
return mapping.withBedrockIdentifier("minecraft:skull")
.withBedrockData(5);
}
case "minecraft:piglin_head" -> {
return mapping.withBedrockIdentifier("minecraft:skull")
.withBedrockData(6);
}
}
return mapping;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
import java.io.InputStream;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.logging.Logger;

/**
* Populates the item registries.
Expand All @@ -95,7 +96,7 @@ public static void populate() {
paletteVersions.add(new PaletteVersion("1_20_80", Bedrock_v671.CODEC.getProtocolVersion(), Collections.emptyMap(), Conversion685_671::remapItem));
paletteVersions.add(new PaletteVersion("1_21_0", Bedrock_v685.CODEC.getProtocolVersion(), Collections.emptyMap(), Conversion712_685::remapItem));
paletteVersions.add(new PaletteVersion("1_21_20", Bedrock_v712.CODEC.getProtocolVersion(), Collections.emptyMap(), Conversion729_712::remapItem));
paletteVersions.add(new PaletteVersion("1_21_30", Bedrock_v729.CODEC.getProtocolVersion()));
paletteVersions.add(new PaletteVersion("1_21_30", Bedrock_v729.CODEC.getProtocolVersion(), Collections.emptyMap(), Conversion748_729::remapItem));
paletteVersions.add(new PaletteVersion("1_21_40", Bedrock_v748.CODEC.getProtocolVersion()));

GeyserBootstrap bootstrap = GeyserImpl.getInstance().getBootstrap();
Expand Down
14 changes: 9 additions & 5 deletions core/src/main/resources/bedrock/runtime_item_states.1_21_40.json
Original file line number Diff line number Diff line change
Expand Up @@ -3547,6 +3547,10 @@
"name": "minecraft:item.reeds",
"id": 83
},
{
"name": "minecraft:item.skull",
"id": 144
},
{
"name": "minecraft:item.soul_campfire",
"id": -290
Expand Down Expand Up @@ -5664,12 +5668,12 @@
"id": 144
},
{
"name": "minecraft:skeleton_spawn_egg",
"id": 471
"name": "minecraft:skull",
"id": 533
},
{
"name": "minecraft:skull",
"id": 736
"name": "minecraft:skeleton_spawn_egg",
"id": 471
},
{
"name": "minecraft:skull_banner_pattern",
Expand Down Expand Up @@ -6991,4 +6995,4 @@
"name": "minecraft:zombie_villager_spawn_egg",
"id": 505
}
]
]
2 changes: 1 addition & 1 deletion core/src/main/resources/mappings
Loading