Merge branch 'master-MC1.10' into master-MC1.11

# Conflicts:
#	build.gradle
#	build.properties
#	src/main/scala/li/cil/oc/common/tileentity/Relay.scala
#	src/main/scala/li/cil/oc/common/tileentity/Switch.scala
#	src/main/scala/li/cil/oc/integration/Mods.scala
#	src/main/scala/li/cil/oc/integration/computercraft/PeripheralProvider.scala
#	src/main/scala/li/cil/oc/integration/jei/CallbackDocHandler.scala
#	src/main/scala/li/cil/oc/integration/jei/ManualUsageHandler.scala
#	src/main/scala/li/cil/oc/integration/wrcbe/WirelessRedstoneCBE.scala
#	src/main/scala/li/cil/oc/server/agent/Inventory.scala
#	src/main/scala/li/cil/oc/server/agent/Player.scala
#	src/main/scala/li/cil/oc/server/component/RedstoneWireless.scala
This commit is contained in:
Vexatos 2017-05-11 20:38:54 +02:00
commit a8bca1c1bb
4 changed files with 8 additions and 10 deletions

View File

@ -30,7 +30,7 @@ object CallbackDocHandler {
private val VexPattern = """(?s)^function(\(.*?\).*?); (.*)$""".r private val VexPattern = """(?s)^function(\(.*?\).*?); (.*)$""".r
def getRecipes(registry: IModRegistry): util.List[_] = registry.getIngredientRegistry.getIngredients(classOf[ItemStack]).collect { def getRecipes(registry: IModRegistry): util.List[CallbackDocRecipe] = registry.getIngredientRegistry.getIngredients(classOf[ItemStack]).collect {
case stack: ItemStack => case stack: ItemStack =>
val callbacks = api.Driver.environmentsFor(stack).flatMap(getCallbacks).toBuffer val callbacks = api.Driver.environmentsFor(stack).flatMap(getCallbacks).toBuffer
@ -52,9 +52,7 @@ object CallbackDocHandler {
Option(pages.map(page => new CallbackDocRecipe(stack, page))) Option(pages.map(page => new CallbackDocRecipe(stack, page)))
} }
else None else None
}.collect { }.flatten.flatten.toList
case Some(handler) => handler
}.flatten.toList
private def getCallbacks(env: Class[_]) = if (env != null) { private def getCallbacks(env: Class[_]) = if (env != null) {

View File

@ -24,12 +24,12 @@ import scala.collection.convert.WrapAsScala._
object ManualUsageHandler { object ManualUsageHandler {
def getRecipes(registry: IModRegistry): util.List[_] = registry.getIngredientRegistry.getIngredients(classOf[ItemStack]).collect { def getRecipes(registry: IModRegistry): util.List[ManualUsageRecipe] = registry.getIngredientRegistry.getIngredients(classOf[ItemStack]).collect {
case stack: ItemStack => api.Manual.pathFor(stack) match { case stack: ItemStack => api.Manual.pathFor(stack) match {
case s: String => new ManualUsageRecipe(stack, s) case s: String => Option(new ManualUsageRecipe(stack, s))
case _ => case _ => None
} }
} }.flatten.toList
object ManualUsageRecipeHandler extends IRecipeHandler[ManualUsageRecipe] { object ManualUsageRecipeHandler extends IRecipeHandler[ManualUsageRecipe] {
override def getRecipeWrapper(recipe: ManualUsageRecipe) = recipe override def getRecipeWrapper(recipe: ManualUsageRecipe) = recipe

View File

@ -15,7 +15,7 @@ import net.minecraft.block.state.IBlockState
import scala.collection.immutable import scala.collection.immutable
class Inventory(val agent: internal.Agent) extends InventoryPlayer(null) { class Inventory(playerEntity: EntityPlayer, val agent: internal.Agent) extends InventoryPlayer(playerEntity) {
def selectedItemStack: ItemStack = agent.mainInventory.getStackInSlot(agent.selectedSlot) def selectedItemStack: ItemStack = agent.mainInventory.getStackInSlot(agent.selectedSlot)

View File

@ -103,7 +103,7 @@ class Player(val agent: internal.Agent) extends FakePlayer(agent.world.asInstanc
setSize(1, 1) setSize(1, 1)
this.inventory = new Inventory(agent) this.inventory = new Inventory(this, agent)
var facing, side = EnumFacing.SOUTH var facing, side = EnumFacing.SOUTH