mirror of
https://github.com/GTNewHorizons/IguanaTweaksTConstruct.git
synced 2026-11-25 22:34:38 +00:00
Just some crash-prevention in cases that shouldn't happen with compatible tcon versions anyway.
This commit is contained in:
1 parent
00fdc5a67d
commit
dfe752f232
1 file changed
+8
-1
@@ -8,6 +8,7 @@ import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraftforge.event.entity.player.ItemTooltipEvent;
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
import tconstruct.library.tools.ToolMaterial;
|
||||
import tconstruct.library.util.IToolPart;
|
||||
|
||||
public class PartToolTipHandler {
|
||||
@@ -29,7 +30,13 @@ public class PartToolTipHandler {
|
||||
ItemStack stack = event.itemStack;
|
||||
IToolPart part = (IToolPart)stack.getItem();
|
||||
|
||||
String ability = TConstructRegistry.getMaterial(part.getMaterialID(stack)).ability();
|
||||
ToolMaterial mat = TConstructRegistry.getMaterial(part.getMaterialID(stack));
|
||||
if(mat == null)
|
||||
return;
|
||||
|
||||
String ability = mat.ability();
|
||||
if(ability == null)
|
||||
return;
|
||||
// paper or thaumium?
|
||||
if(ability.equals(StatCollector.translateToLocal("materialtraits.writable")) ||
|
||||
ability.equals(StatCollector.translateToLocal("materialtraits.thaumic"))) {
|
||||
|
||||
Reference in new issue
Block a user