private static String debugOutput(IRegistry<ModelResourceLocation, IBakedModel> modelRegistry, ResourceLocation defaultMrl, IBakedModel missingModel) { String prefix = defaultMrl.getResourceDomain() + ":" + defaultMrl.getResourcePath(); if (modelRegistry instanceof RegistrySimple) { RegistrySimple<?, ?> rg = (RegistrySimple<?, ?>) modelRegistry; StringBuilder sb = new StringBuilder(); for (Object key : rg.getKeys()) { if (key != null && modelRegistry.getObject((ModelResourceLocation) key) != missingModel && key.toString().startsWith(prefix)) { sb.append(key + "; "); } } if (sb.length() > 0) { sb.setLength(sb.length() - 2); } else { sb.append("(none)"); } return "Loaded states for " + prefix + " are: " + sb.toString(); } else { return "Loaded states could not be determined because modelRegistry is not a RegistrySimple."; } }
public void register(int id, K key, V value) { if(id < 0 || id >= maxId) { throw new IndexOutOfBoundsException("Id is out of range: " + id); } if(key instanceof ResourceLocation) { //check ResourceLocation key and log warning if it differs from the active ModID key = (K) GameData.checkPrefix(key.toString()); } super.putObject(key, value); V objectWithId = getObjectById(id); if(objectWithId != null) { throw new IllegalArgumentException(String.format("Tried to reassign id %d to %s (%s), but it is already assigned to %s (%s)!", id, value, key, objectWithId, getNameForObject(objectWithId))); } underlyingIntegerMap.put(value, id); }
ArrayList<ModelResourceLocation> modelLocations = Lists.newArrayList(); for (ModelResourceLocation modelLoc : registry.getKeys()) { if (modelLoc.getResourceDomain().equals(REFERENCE.MODID) && modelLoc.getResourcePath().equals(BlockBloodContainer.regName) ArrayList<ModelResourceLocation> modelLocations = Lists.newArrayList(); for (ModelResourceLocation modelLoc : registry.getKeys()) { if (modelLoc.getResourceDomain().equals(REFERENCE.MODID) && modelLoc.getResourcePath().equals(BlockAltarInspiration.regName) ArrayList<ModelResourceLocation> modelLocations = Lists.newArrayList(); for (ModelResourceLocation modelLoc : registry.getKeys()) { if (modelLoc.getResourceDomain().equals(REFERENCE.MODID) && modelLoc.getResourcePath().equals(BlockWeaponTable.regName)