From f9f4d52fdb813bdc10e8f852e44ab9b103b126b4 Mon Sep 17 00:00:00 2001 From: Ewout Van Schil Date: Sat, 20 Oct 2018 12:34:28 +0200 Subject: [PATCH 1/2] update 1.4 --- .gradle/4.4.1/fileContent/fileContent.lock | Bin 17 -> 17 bytes .gradle/4.4.1/fileHashes/fileHashes.bin | Bin 22847 -> 23047 bytes .gradle/4.4.1/fileHashes/fileHashes.lock | Bin 17 -> 17 bytes .gradle/4.4.1/taskHistory/taskHistory.bin | Bin 62074 -> 80026 bytes .gradle/4.4.1/taskHistory/taskHistory.lock | Bin 17 -> 17 bytes .../buildOutputCleanup.lock | Bin 17 -> 17 bytes .gradle/buildOutputCleanup/outputFiles.bin | Bin 18767 -> 18803 bytes .idea/modules/GameSpleef_main.iml | 2 +- .idea/modules/GameSpleef_test.iml | 2 +- .idea/workspace.xml | 167 +++++++++++++----- GameSpleef.iml | 2 +- .../zeroprox/gamespleef/GameSpleef$1.class | Bin 787 -> 787 bytes .../zeroprox/gamespleef/GameSpleef$2.class | Bin 703 -> 703 bytes .../zeroprox/gamespleef/GameSpleef$3.class | Bin 754 -> 754 bytes .../zeroprox/gamespleef/GameSpleef$4.class | Bin 748 -> 748 bytes .../GameSpleef$AdminBuildTypes.class | Bin 1693 -> 1693 bytes .../gamespleef/GameSpleef$GameType.class | Bin 1122 -> 1122 bytes .../zeroprox/gamespleef/GameSpleef$Mode.class | Bin 1245 -> 1245 bytes .../zeroprox/gamespleef/GameSpleef.class | Bin 14093 -> 14749 bytes .../gamespleef/commands/HelpCmd.class | Bin 3622 -> 4028 bytes .../gamespleef/commands/JoinCmd.class | Bin 2660 -> 3174 bytes .../gamespleef/commands/LeaveCmd.class | Bin 2296 -> 2503 bytes .../gamespleef/commands/ListCmd.class | Bin 4089 -> 4463 bytes .../gamespleef/commands/admin/BuildCmd.class | Bin 9544 -> 9869 bytes .../gamespleef/game/GameClassic.class | Bin 20041 -> 22321 bytes .../gamespleef/game/GameManager.class | Bin 3653 -> 4573 bytes .../zeroprox/gamespleef/game/IGame.class | Bin 1857 -> 1877 bytes .../gamespleef/utils/GameSerialize.class | Bin 1933 -> 2493 bytes build/resources/main/mcmod.info | 2 +- build/tmp/generateMetadata/mcmod.info | 2 +- gradle.properties | 2 +- .../cloud/zeroprox/gamespleef/GameSpleef.java | 56 ++++-- .../zeroprox/gamespleef/commands/HelpCmd.java | 3 +- .../zeroprox/gamespleef/commands/JoinCmd.java | 12 +- .../gamespleef/commands/LeaveCmd.java | 4 +- .../zeroprox/gamespleef/commands/ListCmd.java | 2 +- .../gamespleef/commands/admin/BuildCmd.java | 8 +- .../zeroprox/gamespleef/game/GameClassic.java | 117 ++++++------ .../zeroprox/gamespleef/game/GameManager.java | 14 +- .../cloud/zeroprox/gamespleef/game/IGame.java | 2 + .../gamespleef/utils/GameSerialize.java | 9 + .../gamespleef/utils/MessageManager.java | 123 +++++++++++++ 42 files changed, 386 insertions(+), 143 deletions(-) create mode 100644 src/main/java/cloud/zeroprox/gamespleef/utils/MessageManager.java diff --git a/.gradle/4.4.1/fileContent/fileContent.lock b/.gradle/4.4.1/fileContent/fileContent.lock index 14cd5dd65e18c40aa78305473d0d2126a6664d5e..c1f88721e778d2d00661c99dec02847698989ca5 100644 GIT binary patch literal 17 TcmZQ}j_KfiuQx3x)1Q#Xra+4ylDA3*Bs85le(F||0pO=Jw^5>|P3x#Qda*qs$%Eh(!SKw20W zbb^5dnkDxXXZD1IFY-)j^o%=xUZ4o1gJu1^8(<9#EN?J%w8Sj_STFshJLJmahq}`$ z#UDeoq&Psdumwym_jgffn>XK-kLLjYm7|RYTdUgnA&%d*0isBSZSrmZ6+zsyijSS! zuwwbVUgk0*N0$p=lh*!u05u7Va}9njd-Z+V`<=69ZB=a%a{#IYI(O~G7Z4q+YbRd~ zaH;or#d3E>pu6yrG~<99!KZR`eW3Txk6ExCKOGxp_*NIORRk5~S{k;jlr!fSWz_d(0 z9;j=MQoM#&X^eM74lD6jR5Hk8(SG?e-ZzUnBOx_iR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!O5(OjLyBL^75x|Ct2uN}?NEnHz73XAh~w1X({?KM;ZNV5t|d*8KqrCh zdj0@t2N3Z8oU9%K4zcGCCI^P-+9SzvTn8#Z3!ama4&pi7*B7tdee~MTudjeEMK(>< zWAa|OY0pD+>yb=jnS^QDp2)BtgzZ7#K_~?N= z^&d*}P<8OBq3Tcpm1a&|Dyrs7-o5EQDb}f_{G|w03&)SiilM@jPlXDBk_|8r9)^OQ z4a-n$3sH>(nHUz-wMmxw!z+u3hVywD9>6pK3ItdpWW?f8>^feb0GbU1=sG6%hKaML zgh_6*n7lH~M`ERoQE;)1R#{ED8Tan|UBO`M9(DCk<_*_{I@&&5D#)Di)Mk|jYn-0W zJXXcnkdlDvPhMd8gC3a-H=TR0*7<0K?_729%y}_CR2}@wHm?r1W0ctTETQB@N9-Ys U!XH<6&G(oAQT6!8WX4E403f>tod5s; diff --git a/.gradle/4.4.1/fileHashes/fileHashes.lock b/.gradle/4.4.1/fileHashes/fileHashes.lock index e169adc0aa56acfabcd0a00fe8dd4b416de0ed4c..9ed1da5cd64cdb7df376fb87abc156fbd930a057 100644 GIT binary patch literal 17 VcmZSndhp7Y({H0^GJpZgHULcj2B-i4 literal 17 VcmZSndhp7Y({H0^GJpY#GXPAC1~mWx diff --git a/.gradle/4.4.1/taskHistory/taskHistory.bin b/.gradle/4.4.1/taskHistory/taskHistory.bin index 5aa793f03da4758f74529a02b49d9a44d764e56d..755c352409cf74f714beb9415a0442296e671905 100644 GIT binary patch delta 1864 zcma*nc~BEq7y$6REJL9vELja{Fi6E{%2ecZsulqctd6MxxnjANONfxf1dv04D1wSe z@Kp>E0;oe;6b4+iLtB{&3bdB11hoQkYOO8h7{wN}b_2yfmg;n8-p-qS^L_8zZ{Pl= zh7t9+fpQUtPMf))Ese&uoSj#0q0zRukn>eF4z?`%L<$ka3Uqelc++T{ZQ!g+R9r%G zk|bIt3k#2sCdAde7OUl@%rGtI~$>r&mp$+;{f`}6N6rr z*H-L8l#}4zuG^2H+vyxE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git a/.gradle/4.4.1/taskHistory/taskHistory.lock b/.gradle/4.4.1/taskHistory/taskHistory.lock index 1cb30a6563e1adb547ce077711e236a008bc0ed7..de6f959f2448f7143b64938efa4f95ad1f8fe18a 100644 GIT binary patch literal 17 UcmZR6{M)bK*Przt7$6`I08L#6qW}N^ literal 17 UcmZR6{M)bK*Przt7$6`H08LE>lK=n! diff --git a/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/.gradle/buildOutputCleanup/buildOutputCleanup.lock index 59ee9f55cc83786fbfe6e5a0bfbf59126850a6a2..ac8f82c190ed15993509d2f1b6bfee285b519a7f 100644 GIT binary patch literal 17 UcmZSXxcB~8w?oBa1_+oB07G;IU|Ky0(42Os0){T{rN{XB$N8G)+!093snk^lez delta 35 rcmex7iShg-#tkMCjQo>*B|J8-mC$BntlX&hLwuvb0 - + diff --git a/.idea/modules/GameSpleef_test.iml b/.idea/modules/GameSpleef_test.iml index c306e53..4cd8a83 100644 --- a/.idea/modules/GameSpleef_test.iml +++ b/.idea/modules/GameSpleef_test.iml @@ -1,5 +1,5 @@ - + diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 73a3126..e655cf1 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,19 +2,47 @@ + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -57,24 +85,33 @@ - + - + - + - + + + + + + + + + + @@ -317,10 +354,10 @@ @@ -479,11 +516,11 @@ - + @@ -507,7 +544,6 @@ - @@ -574,6 +610,7 @@ + + @@ -726,45 +736,47 @@ + - - + + - - - - - - - - - + - + + + + + + + + + + + - - @@ -781,13 +793,6 @@ - - - - - - - @@ -868,9 +873,6 @@ - - - @@ -878,13 +880,6 @@ - - - - - - - @@ -954,9 +949,6 @@ - - - @@ -964,13 +956,6 @@ - - - - - - - @@ -999,9 +984,6 @@ - - - @@ -1009,9 +991,6 @@ - - - @@ -1019,21 +998,6 @@ - - - - - - - - - - - - - - - @@ -1094,13 +1058,6 @@ - - - - - - - @@ -1108,27 +1065,10 @@ - - - - - - - - - - - - - - - - - @@ -1167,9 +1107,6 @@ - - - @@ -1184,10 +1121,41 @@ + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + diff --git a/src/main/java/cloud/zeroprox/gamespleef/commands/admin/BuildCmd.java b/src/main/java/cloud/zeroprox/gamespleef/commands/admin/BuildCmd.java index 14883eb..9b8c951 100644 --- a/src/main/java/cloud/zeroprox/gamespleef/commands/admin/BuildCmd.java +++ b/src/main/java/cloud/zeroprox/gamespleef/commands/admin/BuildCmd.java @@ -13,6 +13,7 @@ import org.spongepowered.api.text.Text; import org.spongepowered.api.text.action.TextActions; import org.spongepowered.api.text.format.TextColors; +import org.spongepowered.api.util.AABB; import java.util.*; @@ -79,29 +80,13 @@ public CommandResult execute(CommandSource src, CommandContext args) throws Comm case CORNER_FLOOR_1: gameSerialize.corner_floor_1 = player.getLocation(); if (gameSerialize.corner_floor_2 != null) { - gameSerialize.floors.add(new AABBSerialize( - gameSerialize.corner_floor_1.getBlockX(), - gameSerialize.corner_floor_1.getBlockY(), - gameSerialize.corner_floor_1.getBlockZ(), - gameSerialize.corner_floor_2.getBlockX(), - gameSerialize.corner_floor_2.getBlockY(), - gameSerialize.corner_floor_2.getBlockZ())); - gameSerialize.corner_floor_1 = null; - gameSerialize.corner_floor_2 = null; + trySavingFloor(src); } break; case CORNER_FLOOR_2: gameSerialize.corner_floor_2 = player.getLocation(); if (gameSerialize.corner_floor_1 != null) { - gameSerialize.floors.add(new AABBSerialize( - gameSerialize.corner_floor_1.getBlockX(), - gameSerialize.corner_floor_1.getBlockY(), - gameSerialize.corner_floor_1.getBlockZ(), - gameSerialize.corner_floor_2.getBlockX(), - gameSerialize.corner_floor_2.getBlockY(), - gameSerialize.corner_floor_2.getBlockZ())); - gameSerialize.corner_floor_1 = null; - gameSerialize.corner_floor_2 = null; + trySavingFloor(src); } break; case CORNER_AREA_1: @@ -119,6 +104,48 @@ public CommandResult execute(CommandSource src, CommandContext args) throws Comm return CommandResult.empty(); } + private void trySavingFloor(CommandSource src) { + try { + // try making the AABB to see if it was setup correctly + AABB aabb = new AABB(gameSerialize.corner_floor_1.getBlockX(), + gameSerialize.corner_floor_1.getBlockY(), + gameSerialize.corner_floor_1.getBlockZ(), + gameSerialize.corner_floor_2.getBlockX(), + gameSerialize.corner_floor_2.getBlockY(), + gameSerialize.corner_floor_2.getBlockZ()); + + gameSerialize.floors.add(new AABBSerialize( + gameSerialize.corner_floor_1.getBlockX(), + gameSerialize.corner_floor_1.getBlockY(), + gameSerialize.corner_floor_1.getBlockZ(), + gameSerialize.corner_floor_2.getBlockX(), + gameSerialize.corner_floor_2.getBlockY(), + gameSerialize.corner_floor_2.getBlockZ())); + gameSerialize.corner_floor_1 = null; + gameSerialize.corner_floor_2 = null; + + } catch (Exception e) { + if (e instanceof IllegalArgumentException) { + switch (e.getMessage()) { + case "The box is degenerate on x": + src.sendMessage(Text.of("The floor is not correctly setup, you have selected the same 'X' location for both corners.")); + break; + case "The box is degenerate on y": + src.sendMessage(Text.of("The floor is not correctly setup, you have selected the same 'Y' location for both corners. Try going 1 block lower.")); + break; + case "The box is degenerate on z": + src.sendMessage(Text.of("The floor is not correctly setup, you have selected the same 'Z' location for both corners.")); + break; + default: + src.sendMessage(Text.of("Unknown problem with making the floor region has occurred.")); + break; + } + } + gameSerialize.corner_floor_1 = null; + gameSerialize.corner_floor_2 = null; + } + } + private void showProgress(CommandSource src) { List textArray = new ArrayList<>(); if (gameSerialize == null) {