Made the touch inversion check in screens use the origin block as it should. First part of #1291.

This commit is contained in:
Florian Nücke 2015-07-12 12:20:33 +02:00
parent 1b502f5a41
commit e0f9f04e35
2 changed files with 2 additions and 2 deletions

View File

@ -337,7 +337,7 @@ class Screen(val tier: Int) extends RedstoneAware {
if (Wrench.holdsApplicableWrench(player, BlockPosition(x, y, z)) && getValidRotations(world, x, y, z).contains(side) && !force) false if (Wrench.holdsApplicableWrench(player, BlockPosition(x, y, z)) && getValidRotations(world, x, y, z).contains(side) && !force) false
else if (api.Items.get(player.getHeldItem) == api.Items.get(Constants.ItemName.Analyzer)) false else if (api.Items.get(player.getHeldItem) == api.Items.get(Constants.ItemName.Analyzer)) false
else world.getTileEntity(x, y, z) match { else world.getTileEntity(x, y, z) match {
case screen: tileentity.Screen if screen.hasKeyboard && (force || player.isSneaking == screen.invertTouchMode) => case screen: tileentity.Screen if screen.hasKeyboard && (force || player.isSneaking == screen.origin.invertTouchMode) =>
// Yep, this GUI is actually purely client side. We could skip this // Yep, this GUI is actually purely client side. We could skip this
// if, but it is clearer this way (to trigger it from the server we // if, but it is clearer this way (to trigger it from the server we
// would have to give screens a "container", which we do not want). // would have to give screens a "container", which we do not want).

View File

@ -243,7 +243,7 @@ class Screen(var tier: Int) extends traits.TextBuffer with SidedEnvironment with
} }
}) })
} }
if (arrows.size > 0) { if (arrows.nonEmpty) {
for (arrow <- arrows) { for (arrow <- arrows) {
val hitX = arrow.posX - x val hitX = arrow.posX - x
val hitY = arrow.posY - y val hitY = arrow.posY - y