mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-16 10:51:55 -04:00
Merge branch 'OC1.3-MC1.6.4' of github.com:MightyPirates/OpenComputers
This commit is contained in:
commit
d71efdfbb8
@ -17,8 +17,14 @@ import net.minecraftforge.event.entity.player.PlayerInteractEvent.Action
|
||||
import net.minecraftforge.event.entity.player.{PlayerDestroyItemEvent, PlayerInteractEvent}
|
||||
|
||||
object EventHandler {
|
||||
private var currentlyPlacing = false
|
||||
|
||||
@ForgeSubscribe
|
||||
def playerInteract(event: PlayerInteractEvent) {
|
||||
this.synchronized {
|
||||
if (currentlyPlacing) return
|
||||
try {
|
||||
currentlyPlacing = true
|
||||
val player = event.entityPlayer
|
||||
if (event.action == Action.RIGHT_CLICK_BLOCK && player.getEntityWorld.isRemote) {
|
||||
if (place(player)) {
|
||||
@ -26,6 +32,11 @@ object EventHandler {
|
||||
}
|
||||
}
|
||||
}
|
||||
finally {
|
||||
currentlyPlacing = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
def place(player: EntityPlayer) = {
|
||||
val world = player.getEntityWorld
|
||||
|
Loading…
x
Reference in New Issue
Block a user