Redefine removal value in IRetextureableModel from null to empty string {""} due to ImmutibleMap not allowing null Values. Closes #1927

This commit is contained in:
Lex Manos 2015-06-09 12:36:36 -07:00
parent f62ee5c4f5
commit fef959d1e9
3 changed files with 11 additions and 10 deletions

View file

@ -416,7 +416,7 @@ public class ForgeBlockStateV1 extends Marker
for (Entry<String, JsonElement> e : json.get("textures").getAsJsonObject().entrySet())
{
if (e.getValue().isJsonNull())
ret.textures.put(e.getKey(), null);
ret.textures.put(e.getKey(), ""); // We have to use "" because ImmutibleMaps don't allow nulls -.-
else
ret.textures.put(e.getKey(), e.getValue().getAsString());
}

View file

@ -10,9 +10,10 @@ public interface IRetexturableModel extends IModel
* as a model should be able to be retextured multiple times producing
* a separate model each time.
*
* The input map MAY map to NULL which should be used to indicate the
* texture was removed. Handling of that is up to the model itself.
* Such as using default, missing texture, or removing vertices.
* The input map MAY map to an empty string "" which should be used
* to indicate the texture was removed. Handling of that is up to
* the model itself. Such as using default, missing texture, or
* removing vertices.
*
* The input should be considered a DIFF of the old textures, not a
* replacement as it may not contain everything.

View file

@ -310,7 +310,7 @@ public class ModelLoader extends ModelBakery
for (Entry<String, String> e : textures.entrySet())
{
if (e.getValue() == null)
if ("".equals(e.getValue()))
{
removed.add(e.getKey());
neweModel.textures.remove(e.getKey());