diff --git a/src/net/bdew/lib/Misc.scala b/src/net/bdew/lib/Misc.scala index 1fb765f..29886d5 100644 --- a/src/net/bdew/lib/Misc.scala +++ b/src/net/bdew/lib/Misc.scala @@ -82,7 +82,7 @@ object Misc { if (cls.isInstance(v)) Some(v.asInstanceOf[T]) else None def getNeighbourTile[T](origin: TileEntity, dir: ForgeDirection, cls: Class[T]) = - Option(origin.getWorldObj.getBlockTileEntity(origin.xCoord + dir.offsetX, + Option(origin.getWorldObj.getTileEntity(origin.xCoord + dir.offsetX, origin.yCoord + dir.offsetY, origin.zCoord + dir.offsetZ)) flatMap (asInstanceOpt(_, cls)) } diff --git a/src/net/bdew/lib/config/BlockManager.scala b/src/net/bdew/lib/config/BlockManager.scala index 8947b8f..4eaf558 100644 --- a/src/net/bdew/lib/config/BlockManager.scala +++ b/src/net/bdew/lib/config/BlockManager.scala @@ -29,8 +29,8 @@ class BlockManager() { GameRegistry.registerCustomItemStack(name, new ItemStack(block)) if (block.isInstanceOf[HasTE[_]]) - GameRegistry.registerTileEntity(block.asInstanceOf[HasTE[_]].TEClass, - "%s.%s".format(Misc.getActiveModId, name)) + GameRegistry.registerTileEntity(block.asInstanceOf[HasTE[_]].TEClass, + "%s.%s".format(Misc.getActiveModId, name)) return block } diff --git a/src/net/bdew/lib/covers/BlockCoverable.scala b/src/net/bdew/lib/covers/BlockCoverable.scala index ef1b8b2..347b6ba 100644 --- a/src/net/bdew/lib/covers/BlockCoverable.scala +++ b/src/net/bdew/lib/covers/BlockCoverable.scala @@ -14,6 +14,7 @@ import net.minecraft.world.{IBlockAccess, World} import net.minecraft.entity.player.EntityPlayer import net.bdew.lib.Misc import net.bdew.lib.items.ItemUtils +import net.minecraft.block.Block trait BlockCoverable[T <: TileCoverable] extends HasTE[T] { override def onBlockActivated(world: World, x: Int, y: Int, z: Int, player: EntityPlayer, face: Int, xoffs: Float, yoffs: Float, zoffs: Float): Boolean = { @@ -52,17 +53,17 @@ trait BlockCoverable[T <: TileCoverable] extends HasTE[T] { super.onBlockActivated(world, x, y, z, player, face, xoffs, yoffs, zoffs) } - override def getBlockTexture(w: IBlockAccess, x: Int, y: Int, z: Int, side: Int) = + override def getIcon(w: IBlockAccess, x: Int, y: Int, z: Int, side: Int) = (for { coverStack <- Option(getTE(w, x, y, z).covers(Misc.forgeDirection(side)).cval) coverItem <- Option(coverStack.getItem) flatMap (Misc.asInstanceOpt(_, classOf[ItemCover])) } yield coverItem.getCoverIcon(coverStack) - ) getOrElse super.getBlockTexture(w, x, y, z, side) + ) getOrElse super.getIcon(w, x, y, z, side) - override def breakBlock(world: World, x: Int, y: Int, z: Int, blockId: Int, meta: Int) { + override def breakBlock(world: World, x: Int, y: Int, z: Int, block: Block, meta: Int) { if (!world.isRemote) for ((dir, covOpt) <- getTE(world, x, y, z).covers; cover <- Option(covOpt.cval)) ItemUtils.throwItemAt(world, x, y, z, cover) - super.breakBlock(world, x, y, z, blockId, meta) + super.breakBlock(world, x, y, z, block, meta) } } diff --git a/src/net/bdew/lib/covers/ItemCover.scala b/src/net/bdew/lib/covers/ItemCover.scala index b104467..edbd036 100644 --- a/src/net/bdew/lib/covers/ItemCover.scala +++ b/src/net/bdew/lib/covers/ItemCover.scala @@ -10,14 +10,14 @@ package net.bdew.lib.covers import net.minecraft.item.{ItemStack, Item} -import net.minecraftforge.common.ForgeDirection -import net.minecraft.util.Icon +import net.minecraft.util.IIcon +import net.minecraftforge.common.util.ForgeDirection trait ItemCover extends Item { /** * @return Icon to render, MUST be on terrain spritesheet (0), not item! */ - def getCoverIcon(stack: ItemStack): Icon + def getCoverIcon(stack: ItemStack): IIcon /** * Perform tick, called on server only diff --git a/src/net/bdew/lib/covers/TileCoverable.scala b/src/net/bdew/lib/covers/TileCoverable.scala index 5f05d9f..a1f4d5f 100644 --- a/src/net/bdew/lib/covers/TileCoverable.scala +++ b/src/net/bdew/lib/covers/TileCoverable.scala @@ -10,10 +10,10 @@ package net.bdew.lib.covers import net.bdew.lib.data.base.{UpdateKind, TileDataSlots} -import net.minecraftforge.common.ForgeDirection import net.bdew.lib.data.DataSlotItemStack import net.bdew.lib.Misc import net.minecraft.item.ItemStack +import net.minecraftforge.common.util.ForgeDirection trait TileCoverable extends TileDataSlots { val covers = (ForgeDirection.VALID_DIRECTIONS map { x => diff --git a/src/net/bdew/lib/items/ItemUtils.scala b/src/net/bdew/lib/items/ItemUtils.scala index b9ce65b..9b084fa 100644 --- a/src/net/bdew/lib/items/ItemUtils.scala +++ b/src/net/bdew/lib/items/ItemUtils.scala @@ -16,7 +16,7 @@ import net.minecraft.entity.player.EntityPlayer import net.minecraft.inventory.{ISidedInventory, IInventory} import net.bdew.lib.Misc import java.util.Random -import net.minecraftforge.common.ForgeDirection +import net.minecraftforge.common.util.ForgeDirection object ItemUtils { def throwItemAt(world: World, x: Int, y: Int, z: Int, stack: ItemStack) { diff --git a/src/net/bdew/lib/network/NBTMessageToMessageCodec.scala b/src/net/bdew/lib/network/NBTMessageToMessageCodec.scala index 91a0174..4db2ed9 100644 --- a/src/net/bdew/lib/network/NBTMessageToMessageCodec.scala +++ b/src/net/bdew/lib/network/NBTMessageToMessageCodec.scala @@ -1,10 +1,10 @@ /* - * Copyright (c) bdew, 2014 - * https://github.com/bdew/teleporter + * Copyright (c) bdew, 2013 - 2014 + * https://github.com/bdew/bdlib * * This mod is distributed under the terms of the Minecraft Mod Public * License 1.0, or MMPL. Please check the contents of the license located in - * https://raw.github.com/bdew/teleporter/master/MMPL-1.0.txt + * https://raw.github.com/bdew/bdlib/master/MMPL-1.0.txt */ package net.bdew.lib.network diff --git a/src/net/bdew/lib/network/NetChannel.scala b/src/net/bdew/lib/network/NetChannel.scala index 60e47c6..797013d 100644 --- a/src/net/bdew/lib/network/NetChannel.scala +++ b/src/net/bdew/lib/network/NetChannel.scala @@ -1,10 +1,10 @@ /* - * Copyright (c) bdew, 2014 - * https://github.com/bdew/teleporter + * Copyright (c) bdew, 2013 - 2014 + * https://github.com/bdew/bdlib * * This mod is distributed under the terms of the Minecraft Mod Public * License 1.0, or MMPL. Please check the contents of the license located in - * https://raw.github.com/bdew/teleporter/master/MMPL-1.0.txt + * https://raw.github.com/bdew/bdlib/master/MMPL-1.0.txt */ package net.bdew.lib.network diff --git a/src/net/bdew/lib/network/NetChannelClientHandler.scala b/src/net/bdew/lib/network/NetChannelClientHandler.scala index da9bfb5..d52aca2 100644 --- a/src/net/bdew/lib/network/NetChannelClientHandler.scala +++ b/src/net/bdew/lib/network/NetChannelClientHandler.scala @@ -1,10 +1,10 @@ /* - * Copyright (c) bdew, 2014 - * https://github.com/bdew/teleporter + * Copyright (c) bdew, 2013 - 2014 + * https://github.com/bdew/bdlib * * This mod is distributed under the terms of the Minecraft Mod Public * License 1.0, or MMPL. Please check the contents of the license located in - * https://raw.github.com/bdew/teleporter/master/MMPL-1.0.txt + * https://raw.github.com/bdew/bdlib/master/MMPL-1.0.txt */ package net.bdew.lib.network diff --git a/src/net/bdew/lib/network/NetChannelServerHandler.scala b/src/net/bdew/lib/network/NetChannelServerHandler.scala index fa7d62a..b743e9c 100644 --- a/src/net/bdew/lib/network/NetChannelServerHandler.scala +++ b/src/net/bdew/lib/network/NetChannelServerHandler.scala @@ -1,10 +1,10 @@ /* - * Copyright (c) bdew, 2014 - * https://github.com/bdew/teleporter + * Copyright (c) bdew, 2013 - 2014 + * https://github.com/bdew/bdlib * * This mod is distributed under the terms of the Minecraft Mod Public * License 1.0, or MMPL. Please check the contents of the license located in - * https://raw.github.com/bdew/teleporter/master/MMPL-1.0.txt + * https://raw.github.com/bdew/bdlib/master/MMPL-1.0.txt */ package net.bdew.lib.network diff --git a/src/net/bdew/lib/recipes/lootlist/EntryLootList.scala b/src/net/bdew/lib/recipes/lootlist/EntryLootList.scala index 9aa6078..b02ee0b 100644 --- a/src/net/bdew/lib/recipes/lootlist/EntryLootList.scala +++ b/src/net/bdew/lib/recipes/lootlist/EntryLootList.scala @@ -1,10 +1,10 @@ /* * Copyright (c) bdew, 2013 - 2014 - * https://github.com/bdew/gendustry + * https://github.com/bdew/bdlib * * This mod is distributed under the terms of the Minecraft Mod Public * License 1.0, or MMPL. Please check the contents of the license located in - * https://raw.github.com/bdew/gendustry/master/MMPL-1.0.txt + * https://raw.github.com/bdew/bdlib/master/MMPL-1.0.txt */ package net.bdew.lib.recipes.lootlist