Skip to content

Commit

Permalink
some debug
Browse files Browse the repository at this point in the history
  • Loading branch information
zelytra committed Sep 12, 2021
1 parent 241f373 commit 88d7872
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import fr.zelytra.daedalus.Daedalus;
import fr.zelytra.daedalus.managers.game.GameStatesEnum;
import fr.zelytra.daedalus.managers.maze.Maze;
import fr.zelytra.daedalus.managers.maze.Vector2;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.Action;
Expand All @@ -25,10 +26,15 @@ public void onInteract(PlayerInteractEvent e) {
if (maze == null) {
return;
}
System.out.println("trigger");
int groundY = (int) maze.getOrigin().getY();
if (e.getAction() == Action.LEFT_CLICK_BLOCK || e.getAction() == Action.RIGHT_CLICK_BLOCK) {
if (e.getClickedBlock().getY() >= groundY + (wallHigh - limit))
Vector2 matrixCoordinate = new Vector2((int) (e.getClickedBlock().getX() - maze.getOrigin().getX() + 1), (int) (e.getClickedBlock().getZ() - maze.getOrigin().getZ() + 1));
System.out.println(maze.getMaze()[matrixCoordinate.x][matrixCoordinate.z]);
if (maze.getMaze()[matrixCoordinate.x][matrixCoordinate.z] >= 1 && e.getClickedBlock().getY() >= groundY + (wallHigh - limit)) {
System.out.println("cancel");
e.setCancelled(true);
}
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import org.bukkit.event.player.PlayerPortalEvent;

public class PortalListener implements Listener {

@EventHandler
public void onPortal(PlayerPortalEvent e){
e.setCanCreatePortal(false);
Expand Down

0 comments on commit 88d7872

Please sign in to comment.