Skip to content

Commit d9b422e

Browse files
author
BuildTools
committed
Updated GitHub repository. Updated config.yml. Added check to prevent item usage during an active game. Fixed incompatible server version shutdown bug. Fixed typo in plugin description. Changed plugin version to 2.5.3.
1 parent 0147c14 commit d9b422e

File tree

5 files changed

+36
-11
lines changed

5 files changed

+36
-11
lines changed

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66

77
<groupId>me.loving11ish</groupId>
88
<artifactId>RedLightGreenLight</artifactId>
9-
<version>2.5.2</version>
9+
<version>2.5.3</version>
1010
<packaging>jar</packaging>
1111

1212
<name>RedLightGreenLight</name>
1313

14-
<description>A Red Light, Green Light mini game based off the Netflix series Squid Games.</description>
14+
<description>A Red Light, Green Light mini-game based off the Netflix series Squid Games.</description>
1515
<properties>
1616
<java.version>11</java.version>
1717
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

src/main/java/me/loving11ish/redlightgreenlight/RedLightGreenLight.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ public void onEnable() {
5050
logger.warning(ChatColor.RED + "RedLightGreenLight - Is now disabling!");
5151
logger.warning(ChatColor.RED + "-------------------------------------------");
5252
Bukkit.getPluginManager().disablePlugin(this);
53+
return;
5354
}else {
5455
logger.info(ChatColor.GREEN + "-------------------------------------------");
5556
logger.info(ChatColor.GREEN + "RedLightGreenLight - A supported Minecraft version has been detected");
@@ -78,7 +79,7 @@ public void onEnable() {
7879
logger.info("-------------------------------------------");
7980
logger.info(ChatColor.AQUA + "RedLightGreenLight - Plugin By Loving11ish");
8081
logger.info(ChatColor.AQUA + "RedLightGreenLight - has been loaded successfully");
81-
logger.info(ChatColor.AQUA + "RedLightGreenLight - Plugin Version: " + ChatColor.GREEN + pluginVersion);
82+
logger.info(ChatColor.AQUA + "RedLightGreenLight - Plugin Version: " + ChatColor.LIGHT_PURPLE + pluginVersion);
8283
logger.info("-------------------------------------------");
8384

8485
//Check for available updates
@@ -111,10 +112,13 @@ public void onDisable() {
111112
if (Bukkit.getScheduler().isCurrentlyRunning(CountDownTasksUtils.taskID4) || Bukkit.getScheduler().isQueued(CountDownTasksUtils.taskID4)){
112113
Bukkit.getScheduler().cancelTask(CountDownTasksUtils.taskID4);
113114
}
115+
logger.info("-------------------------------------------");
116+
logger.info(ChatColor.AQUA + "RedLightGreenLight - Plugin By Loving11ish");
117+
logger.info(ChatColor.AQUA + "RedLightGreenLight - Background tasks have disabled successfully");
114118
}catch (Exception e){
115119
logger.info("-------------------------------------------");
116120
logger.info(ChatColor.AQUA + "RedLightGreenLight - Plugin By Loving11ish");
117-
logger.info(ChatColor.AQUA + "RedLightGreenLight - background tasks have disabled successfully");
121+
logger.info(ChatColor.AQUA + "RedLightGreenLight - Background tasks have disabled successfully");
118122
}
119123

120124
for (int i = 0; i < onlinePlayers.size(); i++){

src/main/java/me/loving11ish/redlightgreenlight/events/PlayerInventoryAction.java

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@
44
import org.bukkit.entity.Player;
55
import org.bukkit.event.EventHandler;
66
import org.bukkit.event.Listener;
7+
import org.bukkit.event.block.Action;
78
import org.bukkit.event.block.BlockPlaceEvent;
89
import org.bukkit.event.inventory.InventoryClickEvent;
910
import org.bukkit.event.player.PlayerDropItemEvent;
11+
import org.bukkit.event.player.PlayerInteractEvent;
1012
import org.bukkit.event.player.PlayerSwapHandItemsEvent;
1113

1214
import java.util.UUID;
@@ -45,4 +47,29 @@ public void onOffHand(PlayerSwapHandItemsEvent event){
4547
event.setCancelled(true);
4648
}
4749
}
50+
@EventHandler
51+
public void onItemRightClick(PlayerInteractEvent event){
52+
Player player = event.getPlayer();
53+
UUID uuid = player.getUniqueId();
54+
if (event.getAction().equals(Action.RIGHT_CLICK_AIR)){
55+
if (GameManager.getGame1().contains(uuid)){
56+
event.setCancelled(true);
57+
}
58+
}
59+
if (event.getAction().equals(Action.LEFT_CLICK_AIR)){
60+
if (GameManager.getGame1().contains(uuid)){
61+
event.setCancelled(true);
62+
}
63+
}
64+
if (event.getAction().equals(Action.RIGHT_CLICK_BLOCK)){
65+
if (GameManager.getGame1().contains(uuid)){
66+
event.setCancelled(true);
67+
}
68+
}
69+
if (event.getAction().equals(Action.LEFT_CLICK_BLOCK)){
70+
if (GameManager.getGame1().contains(uuid)){
71+
event.setCancelled(true);
72+
}
73+
}
74+
}
4875
}

src/main/resources/config.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
33
# ----[RedLight-GreenLight]---- #
44
# ----[By Loving11ish]---- #
5-
# ----[mc.crapticraft.com]---- #
6-
# ----[Made in collaboration with BoboCraft]---- #
7-
# ----[play.bobocraft.com]---- #
85
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
96
# ----[Plugin Config File]---- #
107
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
@@ -134,9 +131,6 @@ Smite-losing-players: true
134131
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
135132
# ----[RedLight-GreenLight]---- #
136133
# ----[By Loving11ish]---- #
137-
# ----[mc.crapticraft.com]---- #
138-
# ----[Made in collaboration with BoboCraft]---- #
139-
# ----[play.bobocraft.com]---- #
140134
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
141135
# ----[Plugin Messages File]---- #
142136
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#

src/main/resources/plugin.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ version: '${project.version}'
33
main: me.loving11ish.redlightgreenlight.RedLightGreenLight
44
api-version: 1.13
55
authors: [ Loving11ish ]
6-
description: A Red Light, Green Light mini game based off the Netflix series Squid Games.
6+
description: A Red Light, Green Light mini-game based off the Netflix series Squid Games.
77
commands:
88
redlight:
99
description: The main command.

0 commit comments

Comments
 (0)