Advertisement
Guest User

Untitled

a guest
Jan 18th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 1.29 KB | None | 0 0
  1. package me.amuxix.runes
  2.  
  3. import me.amuxix.Runecraft
  4. import me.amuxix.material.Material.{Air, Glass}
  5. import me.amuxix.pattern._
  6. import me.amuxix.runes.traits.Tiered
  7. import me.amuxix.util._
  8. import org.bukkit.event.player.PlayerInteractEvent
  9.  
  10. /**
  11.   * Created by Amuxix on 02/01/2017.
  12.   */
  13. object Compass extends RunePattern {
  14.   val pattern: Pattern = Pattern(Compass.apply, width = 3)(
  15.     ActivationLayer(
  16.       Tier, Air, Tier,
  17.       Air, Tier, Air,
  18.       Tier, Air, Tier
  19.     )
  20.   )
  21. }
  22.  
  23. case class Compass(event: PlayerInteractEvent, blocks: Array[Array[Array[Block]]], rotation: Matrix4, rotationCenter:
  24. Vector3[Int], pattern: Pattern)
  25.   extends Rune with Tiered {
  26.  
  27.  
  28.   //These lines below change the compass to make a sort of an arrow pointing north
  29.   (center - SouthEast).block.move(South) //This moves the block at the NorthEast corner 1 block to the south
  30.   (center - SouthWest).block.move(South) //This moves the block at the NorthWest corner 1 block to the south
  31.   center.block.move(North) //This moves the center block 1 block to the north
  32.  
  33.   override def notifyActivator(): Unit = {
  34.     super.notifyActivator()
  35.     if (tierType == Glass) {
  36.       //If player used glass show the current version.
  37.       activator.sendMessage(Runecraft.self.getDescription.getFullName)
  38.     }
  39.   }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement