This commit is contained in:
LunarAkai 2024-03-27 02:26:39 +01:00
commit b20cdbbc46
3 changed files with 39 additions and 31 deletions

View file

@ -316,7 +316,7 @@ public class MinecleanerArena {
public void removePlayer() {
int sizeWidth = BoardSize.boardSizesWidth[widthIndex];
int sizeHeight = BoardSize.boardSizesWidth[widthIndex];
int sizeHeight = BoardSize.boardSizesHeight[widthIndex];
this.arenaStatus = ArenaStatus.INACTIVE;
this.currentPlayer = null;
@ -333,27 +333,35 @@ public class MinecleanerArena {
public void showStartHeads() {
int correction = 1;
int xcorrection = 0;
int width = BoardSize.boardSizesWidth[widthIndex];
int height = BoardSize.boardSizesHeight[widthIndex];
if(widthIndex == 0) {
correction = 0;
}
if(widthIndex == 2) {
xcorrection = 1;
}
// x breite/2-2 + 0
// y höhe * 2/3 -1
// MINE -
setDiplayBlock(5+widthIndex+xcorrection, 2+widthIndex+correction, MinecleanerHeads.MINESWEEPER_LETTER_M, true);
setDiplayBlock(5+widthIndex+xcorrection, 3+widthIndex+correction, MinecleanerHeads.MINESWEEPER_LETTER_I, true);
setDiplayBlock(5+widthIndex+xcorrection, 4+widthIndex+correction, MinecleanerHeads.MINESWEEPER_LETTER_N, true);
setDiplayBlock(5+widthIndex+xcorrection, 5+widthIndex+correction, MinecleanerHeads.MINESWEEPER_LETTER_E, true);
setDiplayBlock(5+widthIndex+xcorrection, 6+widthIndex+correction, MinecleanerHeads.MINESWEEPER_LETTER_MINUS, true);
setDiplayBlock(width/2-2 + 0, height/2 + 1, MinecleanerHeads.MINESWEEPER_LETTER_M, true);
setDiplayBlock(width/2-2 + 1, height/2 + 1, MinecleanerHeads.MINESWEEPER_LETTER_I, true);
setDiplayBlock(width/2-2 + 2, height/2 + 1, MinecleanerHeads.MINESWEEPER_LETTER_N, true);
setDiplayBlock(width/2-2 + 3, height/2 + 1, MinecleanerHeads.MINESWEEPER_LETTER_E, true);
setDiplayBlock(width/2-2 + 4, height/2 + 1, MinecleanerHeads.MINESWEEPER_LETTER_MINUS, true);
// SWEEPER
setDiplayBlock(3+widthIndex+xcorrection, 1+widthIndex+correction, MinecleanerHeads.MINESWEEPER_LETTER_S, true);
setDiplayBlock(3+widthIndex+xcorrection, 2+widthIndex+correction, MinecleanerHeads.MINESWEEPER_LETTER_W, true);
setDiplayBlock(3+widthIndex+xcorrection, 3+widthIndex+correction, MinecleanerHeads.MINESWEEPER_LETTER_E, true);
setDiplayBlock(3+widthIndex+xcorrection, 4+widthIndex+correction, MinecleanerHeads.MINESWEEPER_LETTER_E, true);
setDiplayBlock(3+widthIndex+xcorrection, 5+widthIndex+correction, MinecleanerHeads.MINESWEEPER_LETTER_P, true);
setDiplayBlock(3+widthIndex+xcorrection, 6+widthIndex+correction, MinecleanerHeads.MINESWEEPER_LETTER_E, true);
setDiplayBlock(3+widthIndex+xcorrection, 7+widthIndex+correction, MinecleanerHeads.MINESWEEPER_LETTER_R, true);
setDiplayBlock(width/2-3 + 0, height/2 - 1, MinecleanerHeads.MINESWEEPER_LETTER_S, true);
setDiplayBlock(width/2-3 + 1, height/2 - 1, MinecleanerHeads.MINESWEEPER_LETTER_W, true);
setDiplayBlock(width/2-3 + 2, height/2 - 1, MinecleanerHeads.MINESWEEPER_LETTER_E, true);
setDiplayBlock(width/2-3 + 3, height/2 - 1, MinecleanerHeads.MINESWEEPER_LETTER_E, true);
setDiplayBlock(width/2-3 + 4, height/2 - 1, MinecleanerHeads.MINESWEEPER_LETTER_P, true);
setDiplayBlock(width/2-3 + 5, height/2 - 1, MinecleanerHeads.MINESWEEPER_LETTER_E, true);
setDiplayBlock(width/2-3 + 6, height/2 - 1, MinecleanerHeads.MINESWEEPER_LETTER_R, true);
}
@ -366,19 +374,19 @@ public class MinecleanerArena {
if(widthIndex == 2) {
xcorrection = 1;
}
setDiplayBlock(5+widthIndex+xcorrection, 2+widthIndex+correction, MinecleanerHeads.MINESWEEPER_TILE_UNKNOWN, true);
setDiplayBlock(5+widthIndex+xcorrection, 3+widthIndex+correction, MinecleanerHeads.MINESWEEPER_TILE_UNKNOWN, true);
setDiplayBlock(5+widthIndex+xcorrection, 4+widthIndex+correction, MinecleanerHeads.MINESWEEPER_TILE_UNKNOWN, true);
setDiplayBlock(5+widthIndex+xcorrection, 5+widthIndex+correction, MinecleanerHeads.MINESWEEPER_TILE_UNKNOWN, true);
setDiplayBlock(5+widthIndex+xcorrection, 6+widthIndex+correction, MinecleanerHeads.MINESWEEPER_TILE_UNKNOWN, true);
setDiplayBlock(2+widthIndex+correction, 5+widthIndex+xcorrection, MinecleanerHeads.MINESWEEPER_TILE_UNKNOWN, true);
setDiplayBlock(3+widthIndex+correction, 5+widthIndex+xcorrection, MinecleanerHeads.MINESWEEPER_TILE_UNKNOWN, true);
setDiplayBlock(4+widthIndex+correction, 5+widthIndex+xcorrection, MinecleanerHeads.MINESWEEPER_TILE_UNKNOWN, true);
setDiplayBlock(5+widthIndex+correction, 5+widthIndex+xcorrection, MinecleanerHeads.MINESWEEPER_TILE_UNKNOWN, true);
setDiplayBlock(6+widthIndex+correction, 5+widthIndex+xcorrection, MinecleanerHeads.MINESWEEPER_TILE_UNKNOWN, true);
setDiplayBlock(3+widthIndex+xcorrection, 1+widthIndex+correction, MinecleanerHeads.MINESWEEPER_TILE_UNKNOWN, true);
setDiplayBlock(3+widthIndex+xcorrection, 2+widthIndex+correction, MinecleanerHeads.MINESWEEPER_TILE_UNKNOWN, true);
setDiplayBlock(3+widthIndex+xcorrection, 3+widthIndex+correction, MinecleanerHeads.MINESWEEPER_TILE_UNKNOWN, true);
setDiplayBlock(3+widthIndex+xcorrection, 4+widthIndex+correction, MinecleanerHeads.MINESWEEPER_TILE_UNKNOWN, true);
setDiplayBlock(3+widthIndex+xcorrection, 5+widthIndex+correction, MinecleanerHeads.MINESWEEPER_TILE_UNKNOWN, true);
setDiplayBlock(3+widthIndex+xcorrection, 6+widthIndex+correction, MinecleanerHeads.MINESWEEPER_TILE_UNKNOWN, true);
setDiplayBlock(3+widthIndex+xcorrection, 7+widthIndex+correction, MinecleanerHeads.MINESWEEPER_TILE_UNKNOWN, true);
setDiplayBlock(1+widthIndex+correction, 3+widthIndex+xcorrection, MinecleanerHeads.MINESWEEPER_TILE_UNKNOWN, true);
setDiplayBlock(2+widthIndex+correction, 3+widthIndex+xcorrection, MinecleanerHeads.MINESWEEPER_TILE_UNKNOWN, true);
setDiplayBlock(3+widthIndex+correction, 3+widthIndex+xcorrection, MinecleanerHeads.MINESWEEPER_TILE_UNKNOWN, true);
setDiplayBlock(4+widthIndex+correction, 3+widthIndex+xcorrection, MinecleanerHeads.MINESWEEPER_TILE_UNKNOWN, true);
setDiplayBlock(5+widthIndex+correction, 3+widthIndex+xcorrection, MinecleanerHeads.MINESWEEPER_TILE_UNKNOWN, true);
setDiplayBlock(6+widthIndex+correction, 3+widthIndex+xcorrection, MinecleanerHeads.MINESWEEPER_TILE_UNKNOWN, true);
setDiplayBlock(7+widthIndex+correction, 3+widthIndex+xcorrection, MinecleanerHeads.MINESWEEPER_TILE_UNKNOWN, true);
}
public void removeBlockDisplays() {
@ -547,9 +555,9 @@ public class MinecleanerArena {
int d1z = d0x;
Location loc = location.clone();
for(int fx = -1 - widthIndex; fx < 2; fx++) {
for(int fy = -1; fy < 2 + widthIndex; fy++) {
for(int fx = -1 - (BoardSize.boardSizesWidth[widthIndex]/3 - 3); fx < 2; fx++) { // boardWith/3
for(int fy = -1; fy < BoardSize.boardSizesHeight[widthIndex]/3 - 1; fy++) { // fy < boardHeight/3 - 1
loc.set(location.getX() + d1x * fx, location.getY() + fy, location.getZ() + d1z * fx);
blocks.add(loc.clone());
}

View file

@ -72,8 +72,8 @@ public class MinecleanerListener implements Listener {
if(e.getAction() == Action.RIGHT_CLICK_BLOCK) {
hasRightClicked = true;
}
player.sendMessage("Arena click! " + blockxInt + " " + blockzInt + " Right Clicked: " + hasRightClicked);
plugin.getManager().handleFieldClick(e.getPlayer(), blockxInt, blockzInt, hasRightClicked);
//player.sendMessage("Arena click! " + blockxInt + " " + blockzInt + " Right Clicked: " + hasRightClicked);
plugin.getManager().handleFieldClick(e.getPlayer(), blockzInt, blockxInt, hasRightClicked);
}
}
}

View file

@ -16,6 +16,6 @@ public class BoardSize {
public static int[] mineCounter = {
12,
25,
50,
45,
};
}