mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-13 17:04:24 +00:00
Prevent fiery NPEs with minimal texture bows when natura/tc is not present #1055
This commit is contained in:
1 parent
bd498aacb5
commit
5933333f99
1 file changed
+6
-2
@@ -11,6 +11,7 @@ import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
import tconstruct.library.tools.BowstringMaterial;
|
||||
import tconstruct.library.tools.CustomMaterial;
|
||||
import tconstruct.tools.TinkerTools;
|
||||
|
||||
public class Shortbow extends BowBase
|
||||
@@ -43,8 +44,11 @@ public class Shortbow extends BowBase
|
||||
@Override
|
||||
protected int getDefaultColor(int renderPass, int materialID) {
|
||||
// bowstring uses custom material
|
||||
if(renderPass == 0)
|
||||
return TConstructRegistry.getCustomMaterial(materialID, BowstringMaterial.class).color;
|
||||
if(renderPass == 0) {
|
||||
CustomMaterial mat = TConstructRegistry.getCustomMaterial(materialID, BowstringMaterial.class);
|
||||
if(mat != null)
|
||||
return mat.color;
|
||||
}
|
||||
|
||||
return super.getDefaultColor(renderPass, materialID);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user