@@ -164,7 +164,8 @@ public static void populate() {
164
164
}
165
165
166
166
NbtMap vanillaComponents ;
167
- try (InputStream stream = bootstrap .getResourceOrThrow ("mappings/item_components.nbt" )) {
167
+ // TODO e.g. breeze rod icon does not load with our modified item components
168
+ try (InputStream stream = bootstrap .getResourceOrThrow ("bedrock/item_components.nbt" )) {
168
169
vanillaComponents = (NbtMap ) NbtUtils .createGZIPReader (stream , true , true ).readTag ();
169
170
} catch (Exception e ) {
170
171
throw new AssertionError ("Unable to load Bedrock item components" , e );
@@ -198,7 +199,7 @@ public static void populate() {
198
199
199
200
// Used for custom items
200
201
int nextFreeBedrockId = 0 ;
201
- // TODO rename or yeet
202
+ // TODO yeet
202
203
List <ItemDefinition > componentItemData = new ObjectArrayList <>();
203
204
204
205
Int2ObjectMap <ItemDefinition > registry = new Int2ObjectOpenHashMap <>();
@@ -212,8 +213,10 @@ public static void populate() {
212
213
213
214
NbtMap components = null ;
214
215
if (entry .isComponentBased ()) {
215
- // TODO test
216
216
components = vanillaComponents .getCompound (entry .getName ());
217
+ if (components == null ) {
218
+ throw new RuntimeException ("Could not find vanilla components for vanilla component based item! " + entry .getName ());
219
+ }
217
220
}
218
221
219
222
ItemDefinition definition = new SimpleItemDefinition (entry .getName ().intern (), id , entry .getVersion (), entry .isComponentBased (), components );
@@ -449,8 +452,7 @@ public static void populate() {
449
452
int customProtocolId = nextFreeBedrockId ++;
450
453
mappingItem = mappingItem .withBedrockData (customProtocolId );
451
454
bedrockIdentifier = customBlockData .identifier ();
452
- // TODO add component nbt here
453
- definition = new SimpleItemDefinition (bedrockIdentifier , customProtocolId , true );
455
+ definition = new SimpleItemDefinition (bedrockIdentifier , customProtocolId , 2 , false , null );
454
456
registry .put (customProtocolId , definition );
455
457
customBlockItemDefinitions .put (customBlockData , definition );
456
458
customIdMappings .put (customProtocolId , bedrockIdentifier );
@@ -528,7 +530,7 @@ public static void populate() {
528
530
}
529
531
530
532
// ComponentItemData - used to register some custom properties
531
- componentItemData .add (customMapping .itemDefinition ()); // TODO
533
+ componentItemData .add (customMapping .itemDefinition ());
532
534
customItemOptions .add (Pair .of (customItem .customItemOptions (), customMapping .itemDefinition ()));
533
535
registry .put (customMapping .integerId (), customMapping .itemDefinition ());
534
536
@@ -623,7 +625,6 @@ public static void populate() {
623
625
int customItemId = nextFreeBedrockId ++;
624
626
NonVanillaItemRegistration registration = CustomItemRegistryPopulator .registerCustomItem (customItem , customItemId , palette .protocolVersion );
625
627
626
- // TODO yeet?
627
628
componentItemData .add (registration .mapping ().getBedrockDefinition ());
628
629
ItemMapping mapping = registration .mapping ();
629
630
Item javaItem = registration .javaItem ();
@@ -663,7 +664,6 @@ public static void populate() {
663
664
int customProtocolId = nextFreeBedrockId ++;
664
665
String identifier = customBlock .identifier ();
665
666
666
- // TODO
667
667
final ItemDefinition definition = new SimpleItemDefinition (identifier , customProtocolId , 2 , false , null );
668
668
registry .put (customProtocolId , definition );
669
669
customBlockItemDefinitions .put (customBlock , definition );
0 commit comments