Skip to content

Commit

Permalink
Allow other mods to register fruit blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
Nedelosk committed Apr 9, 2017
1 parent 0aa4a0f commit 4fae8c2
Showing 1 changed file with 8 additions and 7 deletions.
Expand Up @@ -21,13 +21,14 @@ public Map<IBlockState, ModelResourceLocation> putStateModelLocations(Block bloc
BlockFruitPod blockFruitPod = (BlockFruitPod) block;
IAlleleFruit fruit = blockFruitPod.getFruit();
String modID = fruit.getModID();
if (Constants.MOD_ID.equals(modID)) {
String modelName = fruit.getModelName();
String resourcePath = Constants.MOD_ID + ":pods/" + modelName;
for (IBlockState state : block.getBlockState().getValidStates()) {
String propertyString = getPropertyString(state.getProperties());
mapStateModelLocations.put(state, new ModelResourceLocation(resourcePath, propertyString));
}
if(modID == null){
modID = Constants.MOD_ID;
}
String modelName = fruit.getModelName();
String resourcePath = modID + ":pods/" + modelName;
for (IBlockState state : block.getBlockState().getValidStates()) {
String propertyString = getPropertyString(state.getProperties());
mapStateModelLocations.put(state, new ModelResourceLocation(resourcePath, propertyString));
}
}
return mapStateModelLocations;
Expand Down

0 comments on commit 4fae8c2

Please sign in to comment.