Skip to content

Commit

Permalink
Remove the original glowPowerup
Browse files Browse the repository at this point in the history
  • Loading branch information
iceBear67 committed Oct 14, 2024
1 parent c54151b commit 5521c40
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 34 deletions.
6 changes: 0 additions & 6 deletions src/main/java/dev/tylerm/khs/configuration/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ public class Config {
public static ItemStack
lobbyLeaveItem,
lobbyStartItem,
glowPowerupItem,
flightToggleItem,
teleportItem;

Expand Down Expand Up @@ -156,12 +155,7 @@ public static void loadConfig() {
//Glow
blindnessWhenHit = config.getInt("blindnessWhenHit");
alwaysGlow = config.getBoolean("alwaysGlow");
glowLength = Math.max(1, config.getInt("glow.time"));
glowStackable = config.getBoolean("glow.stackable");
glowEnabled = config.getBoolean("glow.enabled") && !alwaysGlow;
if (glowEnabled) {
glowPowerupItem = createItemStack("glow");
}

//Lobby
startingSeekerCount = Math.max(1, config.getInt("startingSeekerCount"));
Expand Down
3 changes: 0 additions & 3 deletions src/main/java/dev/tylerm/khs/game/PlayerLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,6 @@ public static void resetPlayer(Player player, Board board) {
}
for (PotionEffect effect : Items.HIDER_EFFECTS)
player.addPotionEffect(effect);
if (glowEnabled) {
player.getInventory().addItem(glowPowerupItem);
}
Bukkit.getScheduler().runTask(Main.getInstance(), ()->{
board.getHiderSelectedSkills().get(player.getUniqueId()).initialKits()
.forEach(player.getInventory()::addItem);
Expand Down
12 changes: 0 additions & 12 deletions src/main/java/dev/tylerm/khs/game/listener/InteractHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import dev.tylerm.khs.game.util.Status;
import dev.tylerm.khs.gui.BlockPickerGUI;
import dev.tylerm.khs.item.CustomItems;
import dev.tylerm.khs.util.item.ItemStacks;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.entity.Entity;
Expand All @@ -29,7 +28,6 @@
import java.util.UUID;

import static dev.tylerm.khs.configuration.Config.*;
import static dev.tylerm.khs.configuration.Config.glowPowerupItem;
import static dev.tylerm.khs.configuration.Localization.message;

@SuppressWarnings("deprecation")
Expand Down Expand Up @@ -78,16 +76,6 @@ private void onPlayerInteractLobby(ItemStack temp, PlayerInteractEvent event) {

private void onPlayerInteractGame(ItemStack temp, PlayerInteractEvent event) {
var player = event.getPlayer();
if (temp.isSimilar(glowPowerupItem)) {
if (!glowEnabled) return;
if (Main.getInstance().getBoard().isHider(player)) {
Main.getInstance().getGame().getGlow().onProjectile();
player.getInventory().remove(glowPowerupItem);
assert XMaterial.SNOWBALL.parseMaterial() != null;
player.getInventory().remove(XMaterial.SNOWBALL.parseMaterial());
event.setCancelled(true);
}
}
switch (CustomItems.getId(temp)) {
case CustomItems.BLOCK_CHANGER -> {
player.getInventory().remove(temp);
Expand Down
15 changes: 2 additions & 13 deletions src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -192,18 +192,7 @@ taunt:
# be longer than 1s. Since the glow effect wasn't added until Minecraft 1.9,
# any server running 1.8 will have this disabled regardless of the options below.
glow:
time: 10
stackable: true
enabled: false
name: "Glow Powerup"
lore: [
"Throw to make all seekers glow",
"Last 10s, all hiders can see it",
"Time stacks on multi use"
]
material: "SNOWBALL"
model-data: 0

# This has the same glow effect as the glow powerup in that all seekers positions get
# shown to hiders. But enabling this force disables the powerup, and instead always shows
# the seekers positions to the hiders. Good for small maps. Since the glow effect wasn't added
Expand All @@ -217,9 +206,9 @@ blindnessWhenHit: 20
# The message prefixes displayed before messages. The message contents themselves
# can be changed in localization.yml.
prefix:
default: '&9Hide and Seek > &f'
default: '&9躲猫猫 > &f'
error: '&cError > &f'
taunt: '&eTaunt > &f'
taunt: '&e嘲讽 > &f'
border: '&cWorld Border > &f'
abort: '&cAbort > &f'
gameover: '&aGame Over > &f'
Expand Down

0 comments on commit 5521c40

Please sign in to comment.