From 27443f5f73a017b63325dbe0b662843e5339c67c Mon Sep 17 00:00:00 2001 From: Lasm Gratel Date: Wed, 3 Feb 2021 18:20:52 +0800 Subject: [PATCH] v1.3.2 --- README.md | 8 +++++ build.gradle | 16 +++++----- build.properties | 6 ++-- src/net/bdew/pressure/Pressure.scala | 4 +-- .../pressure/blocks/BasePoweredBlock.scala | 2 +- .../blocks/BlockFilterableRotatable.scala | 29 ++++++++++++++++++- .../pressure/blocks/output/BlockOutput.scala | 12 +++++++- .../pressure/blocks/output/TileOutput.scala | 7 +++-- .../pressure/blocks/router/TileRouter.scala | 2 +- .../blocks/router/gui/ContainerRouter.scala | 2 +- .../pressure/blocks/router/gui/SlotMode.scala | 2 +- .../blocks/source/BlockCreativeSource.scala | 2 +- .../blocks/source/BlockWaterSource.scala | 2 +- .../blocks/source/InteractiveTank.scala | 25 ++++++++++++++++ .../pressure/blocks/tank/BaseController.scala | 3 +- .../blocks/tank/TileFluidOutputBase.scala | 10 +++---- .../blocks/valves/check/BlockCheckValve.scala | 2 +- .../valves/sensor/BlockPipeSensor.scala | 2 +- .../bdew/pressure/items/ItemDebugger.scala | 3 +- .../bdew/pressure/misc/FluidNameHelper.scala | 4 +-- src/net/bdew/pressure/misc/SlotFilter.scala | 2 +- .../pressure/model/ExtendedModelLoader.scala | 4 +-- 22 files changed, 110 insertions(+), 39 deletions(-) create mode 100644 src/net/bdew/pressure/blocks/source/InteractiveTank.scala diff --git a/README.md b/README.md index a60ee96..1ef5f88 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,11 @@ ### [Downloads and Docs](http://bdew.net/pressure) ### [Forum thread](http://www.minecraftforum.net/topic/2727722-) ### [Jenkins](http://jenkins.bdew.net/) + +### Modifications + +Now requires [CoFH Core](https://www.curseforge.com/minecraft/mc-mods/cofh-core/files/2920433) to be installed! + +Fixed https://github.com/bdew/pressure/issues/115 https://github.com/bdew/pressure/issues/111 https://github.com/bdew/pressure/issues/117 + +Added wrench support, tested on Crescent Hammer \ No newline at end of file diff --git a/build.gradle b/build.gradle index 2f18555..d5a8c07 100644 --- a/build.gradle +++ b/build.gradle @@ -37,11 +37,7 @@ if (project.hasProperty('forgeOverride')) { config.forge.version = forgeOverride } -if (project.hasProperty('buildnum')) { - ext.simpleVersion = "${config.pressure.version}.${project.buildnum}" -} else { - ext.simpleVersion = "${config.pressure.version}-DEV" -} +ext.simpleVersion = config.pressure.version version = simpleVersion + '-mc' + config.minecraft.version @@ -71,7 +67,7 @@ repositories { } maven { name "HWYLA" - url "http://tehnut.info/maven" + url "https://maven.tehnut.info/" } maven { name "OpenComputers" @@ -81,19 +77,25 @@ repositories { name "MCMultipart" url "http://maven.amadornes.com/" } + maven { + name = "CoFH Maven" + url "http://maven.covers1624.net" + } } dependencies { compile "net.bdew:bdlib:${config.bdlib.version}-mc${config.minecraft.version}:dev" deobfCompile "mezz.jei:jei_${config.minecraft.version}:${config.jei.version}" - deobfCompile "mcp.mobius.waila:Hwyla:${config.hwyla.version}" + compile "mcp.mobius.waila:Hwyla:${config.hwyla.version}:api" // deobfCompile "MCMultiPart:MCMultiPart:${config.mcmultipart.version}:universal" compile "net.bdew.thirdparty:mekanism:${config.mekanism.version}:api" // compile "net.bdew.thirdparty:computercraft:${config.computercraft.version}-mc${config.minecraft.version}:api" compile "li.cil.oc:OpenComputers:${config.opencomputers.version}:api" + deobfCompile "cofh:CoFHCore:1.12.2-4.6.3.27:universal" + } import org.apache.tools.ant.filters.ReplaceTokens diff --git a/build.properties b/build.properties index 4d771e2..2f0f4d6 100644 --- a/build.properties +++ b/build.properties @@ -1,9 +1,9 @@ -pressure.version=1.3.1 +pressure.version=1.3.2 curseforge.id=221214 bdlib.version=1.14.3.9 minecraft.version=1.12.2 -minecraft.mappings=snapshot_20171003 -forge.version=14.23.0.2512 +minecraft.mappings=stable_39 +forge.version=14.23.5.2838 #mcmultipart.version=1.3.0 jei.version=4.8.0.105 hwyla.version=1.8.20-B35_1.12 diff --git a/src/net/bdew/pressure/Pressure.scala b/src/net/bdew/pressure/Pressure.scala index a0ab84f..03cd8ea 100644 --- a/src/net/bdew/pressure/Pressure.scala +++ b/src/net/bdew/pressure/Pressure.scala @@ -26,7 +26,7 @@ import net.minecraftforge.fml.common.network.NetworkRegistry import net.minecraftforge.fml.relauncher.Side import org.apache.logging.log4j.Logger -@Mod(modid = Pressure.modId, version = "PRESSURE_VER", name = "Pressure Pipes", dependencies = "required-after:bdlib", modLanguage = "scala", acceptedMinecraftVersions = "[1.12,1.12.2]") +@Mod(modid = Pressure.modId, version = "PRESSURE_VER", name = "Pressure Pipes", dependencies = "required-after:bdlib; required-after:cofhcore", modLanguage = "scala", acceptedMinecraftVersions = "[1.12,1.12.2]") object Pressure { var log: Logger = null var instance = this @@ -71,4 +71,4 @@ object Pressure { if (Misc.haveModVersion("EnderIO")) EnderIOProxy.init() } -} \ No newline at end of file +} diff --git a/src/net/bdew/pressure/blocks/BasePoweredBlock.scala b/src/net/bdew/pressure/blocks/BasePoweredBlock.scala index 650506b..e4d66f6 100644 --- a/src/net/bdew/pressure/blocks/BasePoweredBlock.scala +++ b/src/net/bdew/pressure/blocks/BasePoweredBlock.scala @@ -31,7 +31,7 @@ class BasePoweredBlock[T <: TileFilterable](name: String, teClass: Class[T]) ext } override def neighborChanged(state: IBlockState, world: World, pos: BlockPos, block: Block, fromPos: BlockPos): Unit = { - val powered = world.isBlockIndirectlyGettingPowered(pos) > 0 + val powered = world.getRedstonePowerFromNeighbors(pos) > 0 if (powered != getSignal(state)) setSignal(world, pos, powered) } diff --git a/src/net/bdew/pressure/blocks/BlockFilterableRotatable.scala b/src/net/bdew/pressure/blocks/BlockFilterableRotatable.scala index d11b9ab..d695279 100644 --- a/src/net/bdew/pressure/blocks/BlockFilterableRotatable.scala +++ b/src/net/bdew/pressure/blocks/BlockFilterableRotatable.scala @@ -9,9 +9,36 @@ package net.bdew.pressure.blocks +import cofh.core.util.RayTracer +import cofh.core.util.helpers.{ServerHelper, WrenchHelper} import net.bdew.lib.block.HasTE -import net.bdew.lib.rotate.BaseRotatableBlock +import net.bdew.lib.rotate.{BaseRotatableBlock, Properties} +import net.minecraft.block.state.IBlockState +import net.minecraft.entity.player.EntityPlayer +import net.minecraft.util.math.BlockPos +import net.minecraft.util.{EnumFacing, EnumHand} +import net.minecraft.world.World trait BlockFilterableRotatable extends BlockFilterable with BaseRotatableBlock { this: HasTE[_ <: TileFilterable] => + override def onBlockActivated(world: World, pos: BlockPos, state: IBlockState, player: EntityPlayer, hand: EnumHand, side: EnumFacing, hitX: Float, hitY: Float, hitZ: Float): Boolean ={ + val traceResult = RayTracer.retrace(player) + if (traceResult == null) return false + + val tile = world.getTileEntity(pos) + if (tile == null || tile.isInvalid) return false + + if (WrenchHelper.isHoldingUsableWrench(player, traceResult)) { + if (ServerHelper.isServerWorld(world)) rotateBlock(world, pos, state, side) + WrenchHelper.usedWrench(player, traceResult) + return true + } + + super.onBlockActivated(world, pos, state, player, hand, side, hitX, hitY, hitZ) + } + + def rotateBlock(world: World, pos: BlockPos, state: IBlockState, side: EnumFacing): Unit = { + val facing = state.getValue(Properties.FACING) + setFacing(world, pos, facing.rotateAround(side.getAxis)) + } } diff --git a/src/net/bdew/pressure/blocks/output/BlockOutput.scala b/src/net/bdew/pressure/blocks/output/BlockOutput.scala index 26703cf..5ecf405 100644 --- a/src/net/bdew/pressure/blocks/output/BlockOutput.scala +++ b/src/net/bdew/pressure/blocks/output/BlockOutput.scala @@ -9,14 +9,24 @@ package net.bdew.pressure.blocks.output +import net.bdew.lib.rotate.RotatedHelper import net.bdew.pressure.api.IPressureConnectableBlock import net.bdew.pressure.blocks.{BaseIOBlock, BlockNotifyUpdates} +import net.minecraft.block.state.IBlockState +import net.minecraft.entity.EntityLivingBase +import net.minecraft.item.ItemStack import net.minecraft.util.EnumFacing import net.minecraft.util.math.BlockPos -import net.minecraft.world.IBlockAccess +import net.minecraft.world.{IBlockAccess, World} object BlockOutput extends BaseIOBlock("output", classOf[TileOutput]) with BlockNotifyUpdates with IPressureConnectableBlock { override def canConnectTo(world: IBlockAccess, pos: BlockPos, side: EnumFacing) = getFacing(world, pos) == side.getOpposite override def isTraversable(world: IBlockAccess, pos: BlockPos) = false + + override def onBlockPlacedBy(world: World, pos: BlockPos, state: IBlockState, placer: EntityLivingBase, stack: ItemStack) = { + val dir = RotatedHelper.getFacingFromEntity(placer, getValidFacings, getDefaultFacing) + setFacing(world, pos, dir.getOpposite) + super.onBlockPlacedBy(world, pos, state, placer, stack) + } } diff --git a/src/net/bdew/pressure/blocks/output/TileOutput.scala b/src/net/bdew/pressure/blocks/output/TileOutput.scala index 2db8ba5..e04b62c 100644 --- a/src/net/bdew/pressure/blocks/output/TileOutput.scala +++ b/src/net/bdew/pressure/blocks/output/TileOutput.scala @@ -9,13 +9,14 @@ package net.bdew.pressure.blocks.output -import net.bdew.lib.PimpVanilla._ import net.bdew.lib.capabilities.helpers.{FluidHandlerNull, FluidHelper} import net.bdew.lib.capabilities.{Capabilities, CapabilityProvider} import net.bdew.lib.data.base.TileDataSlots import net.bdew.pressure.api.IPressureEject import net.bdew.pressure.blocks.TileFilterable import net.minecraft.util.EnumFacing +import net.minecraft.util.math.BlockPos +import net.minecraft.world.World import net.minecraftforge.fluids.FluidStack class TileOutput extends TileDataSlots with CapabilityProvider with IPressureEject with TileFilterable { @@ -32,7 +33,7 @@ class TileOutput extends TileDataSlots with CapabilityProvider with IPressureEje addCapabilityOption(Capabilities.CAP_FLUID_HANDLER) { side => if (side == getFacing) Some(FluidHandlerNull) else None } - override def pressureNodePos = getPos - override def pressureNodeWorld = getWorld + override def pressureNodePos: BlockPos = getPos + override def pressureNodeWorld: World = getWorld } diff --git a/src/net/bdew/pressure/blocks/router/TileRouter.scala b/src/net/bdew/pressure/blocks/router/TileRouter.scala index 181f283..e694da5 100644 --- a/src/net/bdew/pressure/blocks/router/TileRouter.scala +++ b/src/net/bdew/pressure/blocks/router/TileRouter.scala @@ -40,7 +40,7 @@ class TileRouter extends TileDataSlotsTicking with IPressureInject with IPressur def canWorkWithRsMode(rsMode: RSMode.Value) = rsMode match { case RSMode.ALWAYS => true case RSMode.NEVER => false - case _ => (getWorld.isBlockIndirectlyGettingPowered(pos) > 0) ^ (rsMode == RSMode.RS_OFF) + case _ => (getWorld.getRedstonePowerFromNeighbors(pos) > 0) ^ (rsMode == RSMode.RS_OFF) } def isSideValidIO(side: EnumFacing, fluid: Fluid, modes: Set[RouterSideMode.Value]): Boolean = diff --git a/src/net/bdew/pressure/blocks/router/gui/ContainerRouter.scala b/src/net/bdew/pressure/blocks/router/gui/ContainerRouter.scala index 3e4f362..087ba75 100644 --- a/src/net/bdew/pressure/blocks/router/gui/ContainerRouter.scala +++ b/src/net/bdew/pressure/blocks/router/gui/ContainerRouter.scala @@ -27,7 +27,7 @@ class ContainerRouter(val te: TileRouter, player: EntityPlayer) extends NoInvCon addSlotToContainer(new SlotMode(this, i, 27 + 21 * i, 19)) for (i <- 0 until 6) - addSlotToContainer(new SlotFilter(inventory, te.getCapability(PressureAPI.FILTERABLE, EnumFacing.getFront(i)), i, 27 + 21 * i, 39)) + addSlotToContainer(new SlotFilter(inventory, te.getCapability(PressureAPI.FILTERABLE, EnumFacing.byIndex(i)), i, 27 + 21 * i, 39)) bindPlayerInventory(player.inventory, 8, 84, 142) diff --git a/src/net/bdew/pressure/blocks/router/gui/SlotMode.scala b/src/net/bdew/pressure/blocks/router/gui/SlotMode.scala index 725c54d..66c15f4 100644 --- a/src/net/bdew/pressure/blocks/router/gui/SlotMode.scala +++ b/src/net/bdew/pressure/blocks/router/gui/SlotMode.scala @@ -17,7 +17,7 @@ import net.minecraft.item.ItemStack import net.minecraft.util.EnumFacing class SlotMode(container: ContainerRouter, index: Int, x: Int, y: Int) extends Slot(container.inventory, index, x, y) with SlotClickable { - val dir = EnumFacing.getFront(index) + val dir = EnumFacing.byIndex(index) override def onClick(clickType: ClickType, button: Int, player: EntityPlayer): ItemStack = { val stack = player.inventory.getItemStack diff --git a/src/net/bdew/pressure/blocks/source/BlockCreativeSource.scala b/src/net/bdew/pressure/blocks/source/BlockCreativeSource.scala index e2838b1..1abc3a4 100644 --- a/src/net/bdew/pressure/blocks/source/BlockCreativeSource.scala +++ b/src/net/bdew/pressure/blocks/source/BlockCreativeSource.scala @@ -13,7 +13,7 @@ import net.bdew.lib.block.{BaseBlock, HasTE} import net.bdew.pressure.blocks.BlockFilterable import net.minecraft.block.material.Material -object BlockCreativeSource extends BaseBlock("creative_source", Material.IRON) with HasTE[TileCreativeSource] with BlockFilterable { +object BlockCreativeSource extends BaseBlock("creative_source", Material.IRON) with HasTE[TileCreativeSource] with BlockFilterable with InteractiveTank { override val TEClass = classOf[TileCreativeSource] setHardness(1) } diff --git a/src/net/bdew/pressure/blocks/source/BlockWaterSource.scala b/src/net/bdew/pressure/blocks/source/BlockWaterSource.scala index c050886..6ca09c6 100644 --- a/src/net/bdew/pressure/blocks/source/BlockWaterSource.scala +++ b/src/net/bdew/pressure/blocks/source/BlockWaterSource.scala @@ -12,7 +12,7 @@ package net.bdew.pressure.blocks.source import net.bdew.lib.block.{BaseBlock, HasTE} import net.minecraft.block.material.Material -object BlockWaterSource extends BaseBlock("water_source", Material.IRON) with HasTE[TileWaterSource] { +object BlockWaterSource extends BaseBlock("water_source", Material.IRON) with HasTE[TileWaterSource] with InteractiveTank { override val TEClass = classOf[TileWaterSource] setHardness(1) } diff --git a/src/net/bdew/pressure/blocks/source/InteractiveTank.scala b/src/net/bdew/pressure/blocks/source/InteractiveTank.scala new file mode 100644 index 0000000..9794be7 --- /dev/null +++ b/src/net/bdew/pressure/blocks/source/InteractiveTank.scala @@ -0,0 +1,25 @@ +package net.bdew.pressure.blocks.source + +import cofh.core.util.helpers.FluidHelper +import net.bdew.lib.block.BaseBlock +import net.minecraft.block.state.IBlockState +import net.minecraft.entity.player.EntityPlayer +import net.minecraft.util.math.BlockPos +import net.minecraft.util.{EnumFacing, EnumHand} +import net.minecraft.world.World +import net.minecraftforge.fluids.capability.CapabilityFluidHandler + +trait InteractiveTank extends BaseBlock { + override def onBlockActivated(world: World, pos: BlockPos, state: IBlockState, player: EntityPlayer, hand: EnumHand, facing: EnumFacing, hitX: Float, hitY: Float, hitZ: Float): Boolean = { + super.onBlockActivated(world, pos, state, player, hand, facing, hitX, hitY, hitZ) + val tile = world.getTileEntity(pos) + if (tile == null) return false + val heldItem = player.getHeldItem(hand) + val handler = tile.getCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, null) + if (FluidHelper.isFluidHandler(heldItem)) { + FluidHelper.interactWithHandler(heldItem, handler, player, hand) + return true + } + false + } +} diff --git a/src/net/bdew/pressure/blocks/tank/BaseController.scala b/src/net/bdew/pressure/blocks/tank/BaseController.scala index 46be40e..6973c50 100644 --- a/src/net/bdew/pressure/blocks/tank/BaseController.scala +++ b/src/net/bdew/pressure/blocks/tank/BaseController.scala @@ -9,6 +9,7 @@ package net.bdew.pressure.blocks.tank +import net.bdew.lib.multiblock.ResourceProvider import net.bdew.lib.multiblock.block.BlockController import net.bdew.lib.multiblock.tile.TileController import net.bdew.pressure.PressureResourceProvider @@ -16,7 +17,7 @@ import net.minecraft.block.material.Material class BaseController[T <: TileController](name: String, TEClass: Class[T]) extends BlockController(name, Material.IRON, TEClass) { - override def resources = PressureResourceProvider + override def resources: ResourceProvider = PressureResourceProvider setHardness(1) } diff --git a/src/net/bdew/pressure/blocks/tank/TileFluidOutputBase.scala b/src/net/bdew/pressure/blocks/tank/TileFluidOutputBase.scala index a70548c..cf7f877 100644 --- a/src/net/bdew/pressure/blocks/tank/TileFluidOutputBase.scala +++ b/src/net/bdew/pressure/blocks/tank/TileFluidOutputBase.scala @@ -9,8 +9,7 @@ package net.bdew.pressure.blocks.tank -import net.bdew.lib.PimpVanilla._ -import net.bdew.lib.capabilities.helpers.{FluidDrainMonitor, FluidHelper, FluidMultiHandler} +import net.bdew.lib.capabilities.helpers.{FluidHelper, FluidMultiHandler} import net.bdew.lib.capabilities.{Capabilities, CapabilityProvider} import net.bdew.lib.multiblock.data.OutputConfigFluid import net.bdew.lib.multiblock.interact.CIFluidOutput @@ -24,10 +23,9 @@ abstract class TileFluidOutputBase extends TileOutput[OutputConfigFluid] with RS override def getCore = getCoreAs[CIFluidOutput] override val outputConfigType = classOf[OutputConfigFluid] - addCapabilityOption(Capabilities.CAP_FLUID_HANDLER) { side => - if (getCfg(side).exists(checkCanOutput)) - getCore map (core => new FluidDrainMonitor(FluidMultiHandler.wrap(core.getOutputTanks), stack => addOutput(side, stack))) - else None + // bdew/pressure#111 + addCapabilityOption(Capabilities.CAP_FLUID_HANDLER) { _ => + getCore.map(core => FluidMultiHandler.wrap(core.getOutputTanks)) } def addOutput(side: EnumFacing, res: FluidStack) = { diff --git a/src/net/bdew/pressure/blocks/valves/check/BlockCheckValve.scala b/src/net/bdew/pressure/blocks/valves/check/BlockCheckValve.scala index 5685fb0..a16d999 100644 --- a/src/net/bdew/pressure/blocks/valves/check/BlockCheckValve.scala +++ b/src/net/bdew/pressure/blocks/valves/check/BlockCheckValve.scala @@ -26,7 +26,7 @@ object BlockCheckValve extends BlockValve("check_valve") with HasTE[TileCheckVal setHardness(2) override def neighborChanged(state: IBlockState, world: World, pos: BlockPos, block: Block, fromPos: BlockPos): Unit = { - val powered = world.isBlockIndirectlyGettingPowered(pos) > 0 + val powered = world.getRedstonePowerFromNeighbors(pos) > 0 if (powered != getSignal(world, pos)) setSignal(world, pos, powered) } diff --git a/src/net/bdew/pressure/blocks/valves/sensor/BlockPipeSensor.scala b/src/net/bdew/pressure/blocks/valves/sensor/BlockPipeSensor.scala index 74627bf..2ae2c81 100644 --- a/src/net/bdew/pressure/blocks/valves/sensor/BlockPipeSensor.scala +++ b/src/net/bdew/pressure/blocks/valves/sensor/BlockPipeSensor.scala @@ -45,7 +45,7 @@ object BlockPipeSensor extends BlockValve("pipe_sensor") with HasTE[TilePipeSens for ((fluid, amount) <- flow) { player.sendMessage( L(" * %s - %s mB/t", - L(FluidNameHelper.sanitizeUnlocalizedName(fluid)).setColor(Color.YELLOW), + L(FluidNameHelper.sanitizeTranslationKey(fluid)).setColor(Color.YELLOW), DecFormat.short(amount).setColor(Color.YELLOW) ) ) diff --git a/src/net/bdew/pressure/items/ItemDebugger.scala b/src/net/bdew/pressure/items/ItemDebugger.scala index b9cb0ff..5aa8ae3 100644 --- a/src/net/bdew/pressure/items/ItemDebugger.scala +++ b/src/net/bdew/pressure/items/ItemDebugger.scala @@ -9,7 +9,6 @@ package net.bdew.pressure.items -import net.bdew.lib.PimpVanilla._ import net.bdew.lib.items.BaseItem import net.bdew.pressure.pressurenet.{Helper, ScanResult} import net.minecraft.entity.player.EntityPlayer @@ -32,7 +31,7 @@ object ItemDebugger extends BaseItem("debugger") { player.sendMessage("Outs: " + (outs map (_.blockRefFace) mkString ", ")) player.sendMessage("Seen:") for (x <- seen) - player.sendMessage(" * %s: %s".format(x, world.getBlockState(x).getBlock.getUnlocalizedName)) + player.sendMessage(" * %s: %s".format(x, world.getBlockState(x).getBlock.getTranslationKey)) player.sendMessage("PConn: " + Helper.getPipeConnections(world, br).mkString(",")) player.sendMessage("Scanned %d blocks, took %d μs".format(seen.size, scanTime / 1000)) } diff --git a/src/net/bdew/pressure/misc/FluidNameHelper.scala b/src/net/bdew/pressure/misc/FluidNameHelper.scala index 19272b4..3d1df14 100644 --- a/src/net/bdew/pressure/misc/FluidNameHelper.scala +++ b/src/net/bdew/pressure/misc/FluidNameHelper.scala @@ -12,8 +12,8 @@ package net.bdew.pressure.misc import net.minecraftforge.fluids.{Fluid, FluidRegistry} object FluidNameHelper { - // because their getUnlocalizedName returns bullshit - def sanitizeUnlocalizedName(f: Fluid) = f match { + // because their getTranslationKey returns bullshit + def sanitizeTranslationKey(f: Fluid) = f match { case FluidRegistry.WATER => "tile.water.name" case FluidRegistry.LAVA => "tile.lava.name" case _ => f.getUnlocalizedName diff --git a/src/net/bdew/pressure/misc/SlotFilter.scala b/src/net/bdew/pressure/misc/SlotFilter.scala index 76ea91a..fff3c65 100644 --- a/src/net/bdew/pressure/misc/SlotFilter.scala +++ b/src/net/bdew/pressure/misc/SlotFilter.scala @@ -18,7 +18,7 @@ import net.minecraft.item.ItemStack import net.minecraft.util.EnumFacing class SlotFilter(container: IInventory, filterable: IFilterable, index: Int, x: Int, y: Int) extends Slot(container, index, x, y) with SlotClickable { - val dir = EnumFacing.getFront(index) + val dir = EnumFacing.byIndex(index) override def onClick(clickType: ClickType, button: Int, player: EntityPlayer): ItemStack = { val stack = player.inventory.getItemStack diff --git a/src/net/bdew/pressure/model/ExtendedModelLoader.scala b/src/net/bdew/pressure/model/ExtendedModelLoader.scala index 9ebf542..787258f 100644 --- a/src/net/bdew/pressure/model/ExtendedModelLoader.scala +++ b/src/net/bdew/pressure/model/ExtendedModelLoader.scala @@ -16,13 +16,13 @@ import net.minecraftforge.client.model.{ICustomModelLoader, ModelLoaderRegistry} object ExtendedModelLoader extends ICustomModelLoader { override def accepts(modelLocation: ResourceLocation) = - modelLocation.getResourceDomain.equals("pressure") && modelLocation.getResourcePath.endsWith(".extended") + modelLocation.getNamespace.equals("pressure") && modelLocation.getPath.endsWith(".extended") def wrap(model: String, enhancer: ModelEnhancer) = enhancer.wrap(ModelLoaderRegistry.getModel(new ResourceLocation(model))) override def loadModel(modelLocation: ResourceLocation) = - modelLocation.getResourcePath match { + modelLocation.getPath match { case "models/block/filtered_rotated.extended" => wrap("pressure:block/rotated", FluidFilterRotatedModelEnhancer) case "models/block/filtered_cube_all.extended" => wrap("minecraft:block/cube_all", FluidFilterModelEnhancer) case "models/block/router.extended" => wrap("minecraft:block/cube_all", RouterOverlayModelEnhancer)