use of icbm.classic.api.reg.IExplosiveData in project ICBM-Classic by BuiltBrokenModding.
the class ClientReg method registerMissileRenders.
protected static void registerMissileRenders() {
for (// TODO run loop once for all 4 content types
IExplosiveData data : // TODO run loop once for all 4 content types
ICBMClassicAPI.EX_MISSILE_REGISTRY.getExplosives()) {
final String resourcePath = data.getRegistryName().getNamespace() + ":missiles/" + data.getRegistryName().getPath();
missileModelMap.put(data, new ModelResourceLocation(resourcePath, "inventory"));
}
ModelLoader.registerItemVariants(ItemReg.itemMissile, missileModelMap.values().stream().map(model -> new ResourceLocation(model.getNamespace() + ":" + model.getPath())).toArray(ResourceLocation[]::new));
ModelLoader.setCustomMeshDefinition(ItemReg.itemMissile, new ItemModelMapperExplosive(missileModelMap, missileModelMap.get(ICBMExplosives.CONDENSED)));
}
use of icbm.classic.api.reg.IExplosiveData in project ICBM-Classic by BuiltBrokenModding.
the class ICBMCreativeTab method compareExplosives.
private int compareExplosives(IExplosive explosiveA, IExplosive explosiveB) {
final IExplosiveData dataA = Optional.ofNullable(explosiveA.getExplosiveData()).orElse(ICBMExplosives.CONDENSED);
final IExplosiveData dataB = Optional.ofNullable(explosiveB.getExplosiveData()).orElse(ICBMExplosives.CONDENSED);
final int tierA = dataA.getTier().ordinal();
final int tierB = dataB.getTier().ordinal();
// If tiers are the same move to sorting by explosive registry index
if (tierA == tierB) {
return dataA.getRegistryID() - dataB.getRegistryID();
}
return tierA - tierB;
}
Aggregations