From c6578405fc5e3e9f262da92a404c15c441046eb8 Mon Sep 17 00:00:00 2001 From: Lord Cambion Date: Tue, 24 Mar 2026 14:14:11 +0100 Subject: [PATCH] Fixes Now Oceans have Gravel in the bottom. Now DarkOakLeaves have correct color --- .../Common/res/TitleUpdate/res/colours.col | Bin 5738 -> 5738 bytes .../Common/res/TitleUpdate/res/colours.xml | 2 +- .../Common/res/TitleUpdate/res/xml2col.py | 41 ++++++++++++++++++ Minecraft.World/OceanBiome.h | 2 + 4 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 Minecraft.Client/Common/res/TitleUpdate/res/xml2col.py diff --git a/Minecraft.Client/Common/res/TitleUpdate/res/colours.col b/Minecraft.Client/Common/res/TitleUpdate/res/colours.col index 8c58f862f477aaf9c3fe045cc85dd1a0e2dcc188..4f16a4e953707b6e82752b9896ee560e321c9dba 100644 GIT binary patch delta 16 YcmaE*^GavK3?}Btbq1SfGo2R(06&ig;{X5v delta 16 YcmaE*^GavK3?^m`6Ryp(na&FX06EPD5&!@I diff --git a/Minecraft.Client/Common/res/TitleUpdate/res/colours.xml b/Minecraft.Client/Common/res/TitleUpdate/res/colours.xml index 57c4a334..2e4e35f7 100644 --- a/Minecraft.Client/Common/res/TitleUpdate/res/colours.xml +++ b/Minecraft.Client/Common/res/TitleUpdate/res/colours.xml @@ -29,7 +29,7 @@ - + diff --git a/Minecraft.Client/Common/res/TitleUpdate/res/xml2col.py b/Minecraft.Client/Common/res/TitleUpdate/res/xml2col.py new file mode 100644 index 00000000..364c44a9 --- /dev/null +++ b/Minecraft.Client/Common/res/TitleUpdate/res/xml2col.py @@ -0,0 +1,41 @@ +import struct +import xml.etree.ElementTree as ET + +def write_utf_string(f, s): + # Format DataOutputStream: 2 byte lenght + string + binary_str = s.encode('utf-8') + f.write(struct.pack('>H', len(binary_str))) + f.write(binary_str) + +def convert_xml_to_col(xml_file, output_col): + try: + tree = ET.parse(xml_file) + root = tree.getroot() + + colours = [] + for colour in root.findall('colour'): + name = colour.get('name') + value_str = colour.get('value') + + # Convert hex to int + value_int = int(value_str, 16) + colours.append((name, value_int)) + + with open(output_col, 'wb') as f: + # Header: Version1 + colour counter + f.write(struct.pack('>I', 1)) + f.write(struct.pack('>I', len(colours))) + + for name, value in colours: + write_utf_string(f, name) + # 'I' (unsigned int) to avoid error 2 miliardi + f.write(struct.pack('>I', value)) + + print(f"Success! Created: {output_col} with {len(colours)} colors.") + + except Exception as e: + print(f"Error during conversion: {e}") + +if __name__ == "__main__": + # Make sure file name is "colours.xml" + convert_xml_to_col('colours.xml', 'colours.col') \ No newline at end of file diff --git a/Minecraft.World/OceanBiome.h b/Minecraft.World/OceanBiome.h index a7faaf39..b4a13c59 100644 --- a/Minecraft.World/OceanBiome.h +++ b/Minecraft.World/OceanBiome.h @@ -10,5 +10,7 @@ public: friendlies.clear(); friendlies_chicken.clear(); // 4J added since chicken now separated from main friendlies friendlies_wolf.clear(); // 4J added since wolf now separated from main friendlies + topMaterial = Tile::gravel_Id; // blocco superficiale + material = Tile::gravel_Id; } };