Skip to content

Commit

Permalink
Fetched minigamesbox general hunger lose
Browse files Browse the repository at this point in the history
  • Loading branch information
Tigerpanzer02 committed Jan 15, 2024
1 parent 5b0560e commit 53d45ee
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 21 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ repositories {
}

dependencies {
implementation("plugily.projects:MiniGamesBox-Classic:1.3.6") { isTransitive = false }
implementation("plugily.projects:MiniGamesBox-Classic:1.3.6-SNAPSHOT2") { isTransitive = false }
compileOnly("org.spigotmc:spigot-api:1.20.4-R0.1-SNAPSHOT")
compileOnly("io.papermc.paper:paper-api:1.19.3-R0.1-SNAPSHOT")
compileOnly("org.jetbrains:annotations:24.0.1")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ public AdditionalValueInitializer(Main plugin) {
}

private void registerConfigOptions() {
getConfigPreferences().registerOption("HUNGER_LOSE", new ConfigOption("Hunger-Lose", false));
getConfigPreferences().registerOption("NATURAL_REGENERATION", new ConfigOption("Natural-Regeneration", false));
getConfigPreferences().registerOption("CAGE_ONLY_FLOOR", new ConfigOption("Cage.Only-Floor", false));
getConfigPreferences().registerOption("BLOCK_BREAK_DROP", new ConfigOption("Block-Break-Drop", true));
Expand Down
16 changes: 0 additions & 16 deletions src/main/java/plugily/projects/thebridge/events/PluginEvents.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,22 +57,6 @@ public void onDrop(PlayerDropItemEvent event) {
}
}

@EventHandler(priority = EventPriority.HIGH)
public void onFoodLevelChange(FoodLevelChangeEvent event) {
if (event.getEntity().getType() != EntityType.PLAYER) {
return;
}
Player player = (Player) event.getEntity();
Arena arena = plugin.getArenaRegistry().getArena(player);
if (arena == null) {
return;
}
if (plugin.getConfigPreferences().getOption("HUNGER_LOSE")) {
event.setCancelled(true);
event.setFoodLevel(20);
}
}

@EventHandler(priority = EventPriority.HIGH)
public void onAppleConsume(PlayerItemConsumeEvent event) {
Player player = event.getPlayer();
Expand Down
8 changes: 5 additions & 3 deletions src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ Damage:
Drowning: false
# Should players get fire damage?
Fire: false
# Should players lose food ingame & get damage?
Hunger: false


Cycle:
Expand All @@ -186,14 +188,14 @@ Time-Manager:
# Change the Bow Cooldown
Bow-Cooldown: 3


# Allow spectators on arena instances
Spectators: true


# Should players naturally regenerate health during a game
Natural-Regeneration: false

# Should players lose hunger during a game
Hunger-Lose: false

# Should blocks when broken drop items during a game
Block-Break-Drop: true
Expand All @@ -219,4 +221,4 @@ Update-Notifier:
# You edited it, huh? Next time hurt yourself!
Do-Not-Edit:
File-Version: 2
Core-Version: 3
Core-Version: 4

0 comments on commit 53d45ee

Please sign in to comment.