Skip to content

Commit bafa43e

Browse files
committed
Add current 1.21.11 update files
1 parent 544daf6 commit bafa43e

2 files changed

Lines changed: 129 additions & 2 deletions

File tree

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
/*
2+
* Copyright (c) 2025 GeyserMC. http://geysermc.org
3+
*
4+
* Permission is hereby granted, free of charge, to any person obtaining a copy
5+
* of this software and associated documentation files (the "Software"), to deal
6+
* in the Software without restriction, including without limitation the rights
7+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
* copies of the Software, and to permit persons to whom the Software is
9+
* furnished to do so, subject to the following conditions:
10+
*
11+
* The above copyright notice and this permission notice shall be included in
12+
* all copies or substantial portions of the Software.
13+
*
14+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20+
* THE SOFTWARE.
21+
*
22+
* @author GeyserMC
23+
* @link https://github.com/GeyserMC/PackConverter
24+
*
25+
*/
26+
27+
package org.geysermc.pack.converter.type.texture.transformer.type.entity;
28+
29+
import com.google.auto.service.AutoService;
30+
import net.kyori.adventure.key.Key;
31+
import org.geysermc.pack.converter.type.texture.transformer.TextureTransformer;
32+
import org.geysermc.pack.converter.type.texture.transformer.TransformContext;
33+
import org.geysermc.pack.converter.util.ImageUtil;
34+
import org.geysermc.pack.converter.util.KeyUtil;
35+
import org.jetbrains.annotations.NotNull;
36+
import org.w3c.dom.Text;
37+
import team.unnamed.creative.texture.Texture;
38+
39+
import java.awt.*;
40+
import java.awt.image.BufferedImage;
41+
import java.io.IOException;
42+
43+
@AutoService(TextureTransformer.class)
44+
public class CamelTransformer implements TextureTransformer {
45+
private static final Key CAMEL = KeyUtil.key(Key.MINECRAFT_NAMESPACE, "entity/camel/camel.png");
46+
private static final Key CAMEL_SADDLE = KeyUtil.key(Key.MINECRAFT_NAMESPACE, "entity/equipment/camel_saddle/saddle.png");
47+
private static final Key CAMEL_HUSK = KeyUtil.key(Key.MINECRAFT_NAMESPACE, "entity/camel/camel_husk.png");
48+
private static final Key CAMEL_HUSK_BEDROCK = KeyUtil.key(Key.MINECRAFT_NAMESPACE, "entity/camel_husk/camel_husk.png");
49+
private static final Key CAMEL_HUSK_SADDLE = KeyUtil.key(Key.MINECRAFT_NAMESPACE, "entity/equipment/camel_husk_saddle/saddle.png");
50+
51+
@Override
52+
public void transform(@NotNull TransformContext context) throws IOException {
53+
if (context.isTexturePresent(CAMEL) || context.isTexturePresent(CAMEL_SADDLE)) {
54+
Texture camelTexture = context.pollOrPeekVanilla(CAMEL);
55+
Texture saddleTexture = context.pollOrPeekVanilla(CAMEL_SADDLE);
56+
handleCamel(context, camelTexture, saddleTexture, CAMEL);
57+
}
58+
59+
if (context.isTexturePresent(CAMEL_HUSK) || context.isTexturePresent(CAMEL_HUSK_SADDLE)) {
60+
Texture camelTexture = context.pollOrPeekVanilla(CAMEL_HUSK);
61+
Texture saddleTexture = context.pollOrPeekVanilla(CAMEL_HUSK_SADDLE);
62+
handleCamel(context, camelTexture, saddleTexture, CAMEL_HUSK_BEDROCK);
63+
}
64+
}
65+
66+
private void handleCamel(@NotNull TransformContext context, Texture camelTexture, Texture saddleTexture, Key bedrockKey) throws IOException {
67+
BufferedImage camelImage = this.readImage(camelTexture);
68+
if (camelImage == null) {
69+
context.error("Unable to read camel image! Skipping...");
70+
return;
71+
}
72+
73+
BufferedImage saddleImage = this.readImage(saddleTexture);
74+
if (saddleImage == null) {
75+
context.error("Unable to read camel saddle image! Skipping...");
76+
return;
77+
}
78+
79+
float scale = camelImage.getWidth() / 128f;
80+
81+
float saddlePreScale = scale / (saddleImage.getWidth() / 128f);
82+
83+
BufferedImage scaledSaddleImage = ImageUtil.scale(saddleImage, saddlePreScale);
84+
85+
Graphics graphics = camelImage.getGraphics();
86+
87+
graphics.drawImage(
88+
ImageUtil.crop(
89+
scaledSaddleImage,
90+
0, (int) (64 * scale),
91+
(int) (128 * scale), (int) (64 * scale)
92+
),
93+
0, (int) (64 * scale), null
94+
);
95+
96+
graphics.drawImage(
97+
ImageUtil.crop(
98+
scaledSaddleImage,
99+
(int) (84 * scale), (int) (51 * scale),
100+
(int) (44 * scale), (int) (13 * scale)
101+
),
102+
(int) (84 * scale), (int) (51 * scale), null
103+
);
104+
105+
context.offer(bedrockKey, camelImage, "png");
106+
}
107+
}

converter/src/main/resources/mappings/textures.json

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -967,6 +967,7 @@
967967
"boat/mangrove": "boat/mangrove_boat",
968968
"boat/cherry": "boat/cherry_boat",
969969
"boat/pale_oak": "boat/pale_oak_boat",
970+
"camel/camel_husk": "camel_husk/camel_husk",
970971
"cat/all_black": "cat/allblackcat",
971972
"cat/black": ["cat/blackcat", "cat/tuxedo"],
972973
"cat/british_shorthair": "cat/britishshorthair",
@@ -1086,6 +1087,7 @@
10861087
"signs/hanging/spruce": "spruce_hanging_sign",
10871088
"signs/hanging/warped": "warped_hanging_sign",
10881089
"skeleton/bogged_overlay": "skeleton/bogged_clothes",
1090+
"skeleton/parched": "parched/parched",
10891091
"skeleton/skeleton": ["skeleton/skeleton", "skulls/skeleton"],
10901092
"skeleton/wither_skeleton": ["skeleton/wither_skeleton", "skulls/wither_skeleton"],
10911093
"strider/strider_cold": "strider/strider_suffocated",
@@ -1181,7 +1183,13 @@
11811183
"equipment/horse_body/copper": "horse2/armor/horse_armor_copper",
11821184
"equipment/horse_body/iron": "horse2/armor/horse_armor_iron",
11831185
"equipment/horse_body/gold": "horse2/armor/horse_armor_gold",
1184-
"equipment/horse_body/diamond": "horse2/armor/horse_armor_diamond"
1186+
"equipment/horse_body/diamond": "horse2/armor/horse_armor_diamond",
1187+
1188+
"equipment/nautilus_body/copper": "nautilus/armor/nautilus_armor_copper",
1189+
"equipment/nautilus_body/iron": "nautilus/armor/nautilus_armor_iron",
1190+
"equipment/nautilus_body/gold": "nautilus/armor/nautilus_armor_gold",
1191+
"equipment/nautilus_body/diamond": "nautilus/armor/nautilus_armor_diamond",
1192+
"equipment/nautilus_body/netherite": "nautilus/armor/nautilus_armor_netherite"
11851193
},
11861194
"environment": {
11871195
"clouds": "clouds",
@@ -1720,6 +1728,7 @@
17201728
"bogged_spawn_egg": "spawn_eggs/spawn_egg_bogged",
17211729
"breeze_spawn_egg": "spawn_eggs/spawn_egg_breeze",
17221730
"camel_spawn_egg": "spawn_eggs/spawn_egg_camel",
1731+
"camel_husk_spawn_egg": "spawn_eggs/spawn_egg_camel_husk",
17231732
"cat_spawn_egg": "spawn_eggs/spawn_egg_cat",
17241733
"cave_spider_spawn_egg": "spawn_eggs/spawn_egg_cave_spider",
17251734
"chicken_spawn_egg": "spawn_eggs/spawn_egg_chicken",
@@ -1751,8 +1760,10 @@
17511760
"magma_cube_spawn_egg": "spawn_eggs/spawn_egg_magma_cube",
17521761
"mooshroom_spawn_egg": "spawn_eggs/spawn_egg_mooshroom",
17531762
"mule_spawn_egg": "spawn_eggs/spawn_egg_mule",
1763+
"nautilus_spawn_egg": "spawn_eggs/spawn_egg_nautilus",
17541764
"ocelot_spawn_egg": "spawn_eggs/spawn_egg_ocelot",
17551765
"panda_spawn_egg": "spawn_eggs/spawn_egg_panda",
1766+
"parched_spawn_egg": "spawn_eggs/spawn_egg_parched",
17561767
"parrot_spawn_egg": "spawn_eggs/spawn_egg_parrot",
17571768
"phantom_spawn_egg": "spawn_eggs/spawn_egg_phantom",
17581769
"pig_spawn_egg": "spawn_eggs/spawn_egg_pig",
@@ -1792,6 +1803,7 @@
17921803
"zoglin_spawn_egg": "spawn_eggs/spawn_egg_zoglin",
17931804
"zombie_spawn_egg": "spawn_eggs/spawn_egg_zombie",
17941805
"zombie_horse_spawn_egg": "spawn_eggs/spawn_egg_zombie_horse",
1806+
"zombie_nautilus_spawn_egg": "spawn_eggs/spawn_egg_zombie_nautilus",
17951807
"zombie_villager_spawn_egg": "spawn_eggs/spawn_egg_zombie_villager",
17961808
"zombified_piglin_spawn_egg": "spawn_eggs/spawn_egg_zombified_piglin"
17971809
},
@@ -1993,5 +2005,13 @@
19932005
"entity/decorated_pot/sheaf_pottery_pattern": "blocks/sheaf_pottery_pattern",
19942006
"entity/decorated_pot/shelter_pottery_pattern": "blocks/shelter_pottery_pattern",
19952007
"entity/decorated_pot/skull_pottery_pattern": "blocks/skull_pottery_pattern",
1996-
"entity/decorated_pot/snort_pottery_pattern": "blocks/snort_pottery_pattern"
2008+
"entity/decorated_pot/snort_pottery_pattern": "blocks/snort_pottery_pattern",
2009+
2010+
"item/wooden_spear_in_hand": "entity/spear/wood_spear",
2011+
"item/stone_spear_in_hand": "entity/spear/stone_spear",
2012+
"item/copper_spear_in_hand": "entity/spear/copper_spear",
2013+
"item/iron_spear_in_hand": "entity/spear/iron_spear",
2014+
"item/golden_spear_in_hand": "entity/spear/gold_spear",
2015+
"item/diamond_spear_in_hand": "entity/spear/diamond_spear",
2016+
"item/netherite_spear_in_hand": "entity/spear/netherite_spear"
19972017
}

0 commit comments

Comments
 (0)