From c532c31530899c0f84b168ce83fa474722c9734a Mon Sep 17 00:00:00 2001 From: iceiix <43691553+iceiix@users.noreply.github.com> Date: Wed, 15 May 2019 12:22:24 -0700 Subject: [PATCH] Add support for a modded block: rockwool from Thermal Expansion (#153) The first in support for modded content, a simple custom block: "rockwool" from the Thermal Expansion and Thermal Foundation mods for Forge: https://ftb.gamepedia.com/Rockwool_(Thermal_Expansion_3) This makes use of the Forge handshake (#88 #134 #144), matching the mod block names from the negotiation to numeric identifiers in the world to steven_blocks. Rockwool was chosen due to ease of implementation, it looks like wool from vanilla (except is fire-proof), and by supporting it the groundwork necessary is laid for more sophisticated mod support. Tested with Thermal Expansion on 1.7.10, 1.10.2 (FTB Beyond), and 1.12.2 Forge servers. * Add `modid` macro token, skipped from vanilla mappings * Add ThermalExpansionRockwool block (1.7.10) * Register modded blocks by modid->[data], and lookup block metadata * Save block IDs from ModIdData/RegistryData to World modded_block_ids * Add namespaced mod ids for ModIdData, \u{1}=block \u{2}=item * Add ThermalFoundation's Rockwool (1.12.2) --- protocol/src/protocol/forge.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/protocol/src/protocol/forge.rs b/protocol/src/protocol/forge.rs index 841df92..005a887 100644 --- a/protocol/src/protocol/forge.rs +++ b/protocol/src/protocol/forge.rs @@ -85,6 +85,9 @@ impl Serializable for ModIdMapping { } } +pub static BLOCK_NAMESPACE: &'static str = "\u{1}"; +pub static ITEM_NAMESPACE: &'static str = "\u{2}"; + #[derive(Debug)] pub enum FmlHs { ServerHello {