Disallow Blocks.AIR as a texture for models

Set to null so I do not need to check for two values every time
This commit is contained in:
KnightMiner committed 2020-08-05 21:34:16 -05:00
1 parent 65fa5cd869
commit 623a28f673
2 files changed
+3 -3

No files matched your search

@@ -189,7 +189,7 @@ public class RetexturedModel implements IModelGeometry<RetexturedModel> {
// if particle is retextured, fetch particle from the cached model
if (retextured.contains("particle")) {
Block block = data.getData(RetexturedHelper.BLOCK_PROPERTY);
if (block != null && block != Blocks.AIR) {
if (block != null) {
return getCachedModel(block).getParticleTexture(data);
}
}
@@ -199,7 +199,7 @@ public class RetexturedModel implements IModelGeometry<RetexturedModel> {
@Override
public List<BakedQuad> getQuads(@Nullable BlockState state, @Nullable Direction direction, Random random, IModelData data) {
Block block = data.getData(RetexturedHelper.BLOCK_PROPERTY);
if (block == null || block == Blocks.AIR) {
if (block == null) {
return originalModel.getQuads(state, direction, random, data);
}
return getCachedModel(block).getQuads(state, direction, random, data);
@@ -19,7 +19,7 @@ public final class RetexturedHelper {
/** Tag name for texture blocks. Should not be used directly, use the utils to interact */
private static final String TAG_TEXTURE = "texture";
/** Property for tile entities containing a texture block */
public static final ModelProperty<Block> BLOCK_PROPERTY = new ModelProperty<>();
public static final ModelProperty<Block> BLOCK_PROPERTY = new ModelProperty<>(block -> block != Blocks.AIR);
/* Getting */