Skip to content

Commit 0e5300b

Browse files
authored
Temporarily revert "All dev changes from GreenSurvivors (#383)" (#384)
This reverts commit 12c5168.
1 parent 12c5168 commit 0e5300b

File tree

104 files changed

+754
-1131
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+754
-1131
lines changed

Minigames/pom.xml

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
<dependency>
7272
<groupId>io.papermc</groupId>
7373
<artifactId>paperlib</artifactId>
74-
<version>1.0.7</version>
74+
<version>1.0.5</version>
7575
<scope>compile</scope>
7676
</dependency>
7777
<dependency>
@@ -132,16 +132,6 @@
132132
<include>config.yml</include>
133133
<include>*.properties</include>
134134
<include>presets/*.yml</include>
135-
</includes>
136-
</resource>
137-
<!-- With maven-resources-plugin(shipped with maven 3.9.0+
138-
filtering binary / compressed data breaks since it assumes UTF-8.
139-
We don't need filtering of it anyway.-->
140-
<resource>
141-
<targetPath>.</targetPath>
142-
<filtering>false</filtering>
143-
<directory>src/main/resources</directory>
144-
<includes>
145135
<include>resourcepack/*.zip</include>
146136
</includes>
147137
</resource>
@@ -162,7 +152,7 @@
162152
<plugin>
163153
<groupId>org.apache.maven.plugins</groupId>
164154
<artifactId>maven-shade-plugin</artifactId>
165-
<version>3.5.1</version>
155+
<version>3.4.0</version>
166156
<configuration>
167157
<filters>
168158
<filter>
@@ -210,7 +200,7 @@
210200
<plugin>
211201
<groupId>org.apache.maven.plugins</groupId>
212202
<artifactId>maven-source-plugin</artifactId>
213-
<version>3.3.0</version>
203+
<version>3.2.1</version>
214204
<executions>
215205
<execution>
216206
<id>attach-sources</id>
@@ -224,7 +214,7 @@
224214
<plugin>
225215
<groupId>org.apache.maven.plugins</groupId>
226216
<artifactId>maven-surefire-plugin</artifactId>
227-
<version>3.2.1</version>
217+
<version>3.0.0-M6</version>
228218
<configuration>
229219
<skipTests>true</skipTests>
230220
<forkCount>1</forkCount>
@@ -234,12 +224,12 @@
234224
<plugin>
235225
<groupId>org.apache.maven.plugins</groupId>
236226
<artifactId>maven-dependency-plugin</artifactId>
237-
<version>3.6.1</version>
227+
<version>3.5.0</version>
238228
</plugin>
239229
<plugin>
240230
<groupId>org.codehaus.mojo</groupId>
241231
<artifactId>versions-maven-plugin</artifactId>
242-
<version>2.16.1</version>
232+
<version>2.8.1</version>
243233
</plugin>
244234
<plugin>
245235
<groupId>org.apache.maven.plugins</groupId>

Minigames/src/main/java/au/com/mineauz/minigames/Events.java

Lines changed: 17 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
import org.bukkit.event.inventory.InventoryDragEvent;
3535
import org.bukkit.event.player.*;
3636
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
37-
import org.bukkit.inventory.Inventory;
3837
import org.bukkit.inventory.ItemStack;
3938
import org.bukkit.potion.PotionEffect;
4039
import org.bukkit.potion.PotionEffectType;
@@ -49,7 +48,7 @@ public class Events implements Listener {
4948
private final MinigameManager mdata = plugin.getMinigameManager();
5049

5150
@EventHandler(priority = EventPriority.NORMAL)
52-
public void onPlayerResourcePack(PlayerResourcePackStatusEvent event) { //todo 1.20.3 + add ressource pack not set
51+
public void onPlayerResourcePack(PlayerResourcePackStatusEvent event) {
5352
final MinigamePlayer ply = pdata.getMinigamePlayer(event.getPlayer());
5453
List<MinigamePlayer> required = plugin.getPlayerManager().getApplyingPack();
5554
if (ply.isInMinigame()) {
@@ -178,7 +177,7 @@ public void onPlayerDisconnect(PlayerQuitEvent event) {
178177
MinigamePlayer ply = pdata.getMinigamePlayer(event.getPlayer());
179178
if (ply.isInMinigame()) {
180179
if (ply.getPlayer().isDead()) {
181-
ply.getOfflineMinigamePlayer().setLoginLocation(ply.getMinigame().getQuitLocation());
180+
ply.getOfflineMinigamePlayer().setLoginLocation(ply.getMinigame().getQuitPosition());
182181
ply.getOfflineMinigamePlayer().savePlayerData();
183182
}
184183
pdata.quitMinigame(pdata.getMinigamePlayer(event.getPlayer()), false);
@@ -244,7 +243,7 @@ public void onPlayerConnect(PlayerJoinEvent event) {
244243
}
245244

246245
@EventHandler
247-
public void playerInteract(PlayerInteractEvent event) {
246+
public void playerInterract(PlayerInteractEvent event) {
248247
MinigamePlayer ply = pdata.getMinigamePlayer(event.getPlayer());
249248

250249
if (ply.isInMinigame() && !ply.canInteract()) {
@@ -253,11 +252,11 @@ public void playerInteract(PlayerInteractEvent event) {
253252
}
254253
if (ply.isInMenu() && ply.getNoClose() && ply.getManualEntry() != null) {
255254
event.setCancelled(true);
255+
ply.setNoClose(false);
256256
if (event.getClickedBlock() != null) {
257-
ply.setNoClose(false);
258257
ply.getManualEntry().checkValidEntry(event.getClickedBlock().getBlockData().getAsString());
259-
ply.setManualEntry(null);
260258
}
259+
ply.setManualEntry(null);
261260
return;
262261
}
263262
if (event.getClickedBlock() != null && event.getClickedBlock().getType() == Material.DRAGON_EGG) {
@@ -272,7 +271,6 @@ public void playerInteract(PlayerInteractEvent event) {
272271
if (cblock.getState() instanceof Sign sign && sign.getSide(Side.FRONT).getLine(0).equalsIgnoreCase(ChatColor.DARK_BLUE + "[Minigame]")) {
273272
// wax signs automatically
274273
sign.setWaxed(true);
275-
sign.update();
276274
if (event.getPlayer().hasPermission("minigame.sign.use.details")) {
277275
if ((sign.getLine(1).equalsIgnoreCase(ChatColor.GREEN + "Join") || sign.getLine(1).equalsIgnoreCase(ChatColor.GREEN + "Bet")) && !ply.isInMinigame()) {
278276
Minigame mgm = mdata.getMinigame(sign.getLine(2));
@@ -382,6 +380,7 @@ public void playerInteract(PlayerInteractEvent event) {
382380
}
383381
}
384382

383+
385384
//Spectator disables:
386385
if (ply.isInMinigame() && pdata.getMinigamePlayer(event.getPlayer()).getMinigame().isSpectator(pdata.getMinigamePlayer(event.getPlayer()))) {
387386
event.setCancelled(true);
@@ -459,11 +458,7 @@ private void entityDamageEntity(EntityDamageByEntityEvent event) {
459458
if (sb.getShooter() instanceof Player player) {
460459
MinigamePlayer shooter = pdata.getMinigamePlayer(player);
461460
Minigame mgm = ply.getMinigame();
462-
463-
if (shooter == null) {
464-
return;
465-
}
466-
461+
if (shooter == null) return;
467462
if (shooter.isInMinigame() && shooter.getMinigame().equals(ply.getMinigame())) {
468463
if (!shooter.canPvP()) {
469464
event.setCancelled(true);
@@ -632,14 +627,13 @@ private void spectatorAttack(EntityDamageByEntityEvent event) {
632627

633628
@EventHandler(ignoreCancelled = true)
634629
private void clickMenu(InventoryClickEvent event) {
635-
MinigamePlayer mgPlayer = pdata.getMinigamePlayer(((Player) event.getWhoClicked()));
636-
if (mgPlayer.isInMenu()) {
637-
if (event.getRawSlot() < mgPlayer.getMenu().getSize()) {
638-
if (!mgPlayer.getMenu().getAllowModify() || mgPlayer.getMenu().hasMenuItem(event.getRawSlot())) {
630+
MinigamePlayer ply = pdata.getMinigamePlayer((Player) event.getWhoClicked());
631+
if (ply.isInMenu()) {
632+
if (event.getRawSlot() < ply.getMenu().getSize()) {
633+
if (!ply.getMenu().getAllowModify() || ply.getMenu().hasMenuItem(event.getRawSlot()))
639634
event.setCancelled(true);
640-
}
641635

642-
MenuItem item = mgPlayer.getMenu().getClicked(event.getRawSlot());
636+
MenuItem item = ply.getMenu().getClicked(event.getRawSlot());
643637
if (item != null) {
644638
ItemStack disItem = null;
645639
switch (event.getClick()) {
@@ -657,38 +651,12 @@ private void clickMenu(InventoryClickEvent event) {
657651

658652
event.setCurrentItem(disItem);
659653
}
660-
/*
661-
* Cancel special cases, where event.getRawSlot() is not in the Menu inventory,
662-
* but the event modifies it anyway
663-
*/
664-
} else if (!mgPlayer.getMenu().getAllowModify()) {
665-
Inventory topInv = event.getView().getTopInventory();
666-
switch (event.getAction()) {
667-
case PICKUP_ALL, PICKUP_SOME, PICKUP_HALF, PICKUP_ONE, DROP_ALL_SLOT, DROP_ONE_SLOT, HOTBAR_MOVE_AND_READD, // may take
668-
PLACE_ALL, PLACE_SOME, PLACE_ONE, /*may place*/
669-
SWAP_WITH_CURSOR, HOTBAR_SWAP /*may give and take*/ -> {
670-
if (event.getClickedInventory() == topInv) {
671-
event.setCancelled(true);
672-
}
673-
}
674-
case COLLECT_TO_CURSOR -> { // may take complex
675-
if (topInv.contains(event.getCursor().getType())) {
676-
event.setCancelled(true);
677-
}
678-
}
679-
case MOVE_TO_OTHER_INVENTORY -> {
680-
event.setCancelled(true);
681-
} // definitely one or the other
682-
default -> {
683-
} // do nothing for any other action
684-
}
685654
}
686-
687-
} else if (mgPlayer.isInMinigame()) {
688-
if (!mgPlayer.getLoadout().allowOffHand() && event.getSlot() == 40) {
655+
} else if (ply.isInMinigame()) {
656+
if (!ply.getLoadout().allowOffHand() && event.getSlot() == 40) {
689657
event.setCancelled(true);
690-
} else if ((mgPlayer.getLoadout().isArmourLocked() && event.getSlot() >= 36 && event.getSlot() <= 39) ||
691-
(mgPlayer.getLoadout().isInventoryLocked() && event.getSlot() >= 0 && event.getSlot() <= 35)) {
658+
} else if ((ply.getLoadout().isArmourLocked() && event.getSlot() >= 36 && event.getSlot() <= 39) ||
659+
(ply.getLoadout().isInventoryLocked() && event.getSlot() >= 0 && event.getSlot() <= 35)) {
692660
event.setCancelled(true);
693661
}
694662
}
@@ -747,6 +715,7 @@ private void manualItemEntry(AsyncPlayerChatEvent event) {
747715
ply.getManualEntry().checkValidEntry(event.getMessage());
748716
ply.setManualEntry(null);
749717
}
718+
750719
}
751720

752721
@EventHandler(ignoreCancelled = true)

Minigames/src/main/java/au/com/mineauz/minigames/MinigameMessageType.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
public enum MinigameMessageType {
44
INFO,
5-
WARN,
65
ERROR,
76
WIN,
87
LOSS,

Minigames/src/main/java/au/com/mineauz/minigames/MinigameUtils.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -278,9 +278,10 @@ public static MinigameTool giveMinigameTool(MinigamePlayer player) {
278278
*/
279279
public static boolean hasMinigameTool(MinigamePlayer player) {
280280
for (ItemStack i : player.getPlayer().getInventory().getContents()) {
281-
if (i != null && i.getItemMeta() != null &&
282-
i.getItemMeta().getDisplayName().equals(ChatColor.GREEN + "Minigame Tool")) {
283-
return true;
281+
if (i != null && i.getItemMeta() != null) {
282+
if (i.getItemMeta().getDisplayName().equals(ChatColor.GREEN + "Minigame Tool")) {
283+
return true;
284+
}
284285
}
285286
}
286287
return false;

Minigames/src/main/java/au/com/mineauz/minigames/Minigames.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package au.com.mineauz.minigames;
22

33
import au.com.mineauz.minigames.backend.BackendManager;
4+
import au.com.mineauz.minigames.blockRecorder.BasicRecorder;
45
import au.com.mineauz.minigames.commands.CommandDispatcher;
56
import au.com.mineauz.minigames.config.MinigameSave;
67
import au.com.mineauz.minigames.display.DisplayManager;
@@ -13,7 +14,6 @@
1314
import au.com.mineauz.minigames.minigame.reward.RewardsModule;
1415
import au.com.mineauz.minigames.objects.MinigamePlayer;
1516
import au.com.mineauz.minigames.objects.ResourcePack;
16-
import au.com.mineauz.minigames.recorder.BasicRecorder;
1717
import au.com.mineauz.minigames.signs.SignBase;
1818
import au.com.mineauz.minigames.stats.MinigameStats;
1919
import au.com.mineauz.minigames.stats.StatValueField;

0 commit comments

Comments
 (0)