Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
k-chop committed Dec 26, 2014
2 parents 83e1cc2 + 73705fd commit c17f8a1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ object ModTFCWailaPlugin {

@EventHandler
def init(event: FMLInitializationEvent): Unit = {
FMLInterModComms.sendMessage("Waila", "register", "tfcwailaplugin.Providers.init")
FMLInterModComms.sendMessage("Waila", "register", "com.github.whelmaze.tfcwailaplugin.Providers.init")
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,18 @@ import com.bioxx.tfc.TileEntities.TEPottery
import mcp.mobius.waila.api.{IWailaConfigHandler, IWailaDataAccessor}
import net.minecraft.item.ItemStack
import net.minecraftforge.common.util.ForgeDirection
import scala.language.postfixOps

import implicits.ItemFoodTFCAdapter
import implicits.ItemStackAdapter

object PotteryProvider extends ProviderBase[TEPottery] {

override def getWailaStack(accessor: IWailaDataAccessor, config: IWailaConfigHandler): ItemStack = accessor.getTileEntity match {
case e: TEPottery =>
val pos = accessor.getPosition
override def getWailaStack(accessor: IWailaDataAccessor, config: IWailaConfigHandler): ItemStack = {
Option(accessor.getTileEntity) collect {
case e: TEPottery if e.straw < 8 && ForgeDirection.getOrientation(accessor.getPosition.sideHit) == ForgeDirection.UP =>
val pos = accessor.getPosition

if (e.straw < 8 && ForgeDirection.getOrientation(pos.sideHit) == ForgeDirection.UP) {
val v = pos.hitVec
val hitX = v.xCoord - v.xCoord.floor
val hitZ = v.zCoord - v.zCoord.floor
Expand All @@ -34,8 +35,7 @@ object PotteryProvider extends ProviderBase[TEPottery] {
else if (hitX > 0.5 && hitZ > 0.5)
e.getStackInSlot(3)
else null
} else null
case _ => null // null null null...
} orNull
}

override def getWailaBody(stack: ItemStack,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package com.github.whelmaze.tfcwailaplugin
import com.bioxx.tfc.Food.ItemFoodTFC
import com.bioxx.tfc.api.Util.Helper
import net.minecraft.inventory.IInventory
import net.minecraft.item.ItemStack
import net.minecraft.item.{Item, ItemStack}

object implicits {

Expand Down Expand Up @@ -39,8 +39,8 @@ object implicits {

@inline def toInfoString: String = is.getItem match {
case i: ItemFoodTFC => i.toSimpleInfoString(is)
case i if i == null => s"$WHITE*** ${GOLD}ItemStack is null! $WHITE***"
case i => s"${is.getDisplayName} x${is.stackSize}"
case i: Item => s"${is.getDisplayName} x${is.stackSize}"
case _ => s"$WHITE*** ${GOLD}Invalid ItemStack $WHITE***"
}
}

Expand Down

0 comments on commit c17f8a1

Please sign in to comment.