fixed wrong sub-api in bc tool check potentially leading to crashes if some other mod provided partial bc api

This commit is contained in:
Florian Nücke 2014-02-27 14:04:52 +01:00
parent 7938a04fd8
commit 87b5b3a412

View File

@ -6,7 +6,7 @@ import net.minecraft.entity.player.EntityPlayer
object BuildCraft { object BuildCraft {
def holdsApplicableWrench(player: EntityPlayer, x: Int, y: Int, z: Int) = def holdsApplicableWrench(player: EntityPlayer, x: Int, y: Int, z: Int) =
ModAPIManager.INSTANCE.hasAPI("BuildCraftAPI|core") && ModAPIManager.INSTANCE.hasAPI("BuildCraftAPI|tools") &&
player.getCurrentEquippedItem != null && player.getCurrentEquippedItem != null &&
(player.getCurrentEquippedItem.getItem match { (player.getCurrentEquippedItem.getItem match {
case wrench: IToolWrench => wrench.canWrench(player, x, y, z) case wrench: IToolWrench => wrench.canWrench(player, x, y, z)
@ -14,7 +14,7 @@ object BuildCraft {
}) })
def wrenchUsed(player: EntityPlayer, x: Int, y: Int, z: Int) = def wrenchUsed(player: EntityPlayer, x: Int, y: Int, z: Int) =
ModAPIManager.INSTANCE.hasAPI("BuildCraftAPI|core") && ModAPIManager.INSTANCE.hasAPI("BuildCraftAPI|tools") &&
player.getCurrentEquippedItem != null && player.getCurrentEquippedItem != null &&
(player.getCurrentEquippedItem.getItem match { (player.getCurrentEquippedItem.getItem match {
case wrench: IToolWrench if wrench.canWrench(player, x, y, z) => case wrench: IToolWrench if wrench.canWrench(player, x, y, z) =>