mirror of
https://github.com/DieReicheErethons/Brewery.git
synced 2025-01-22 21:11:20 +01:00
Remove Drunkeness on Death
This commit is contained in:
parent
c691fea1ee
commit
dcf92cf074
@ -42,7 +42,8 @@ public class BRecipe {
|
||||
if (mat != null) {
|
||||
this.ingredients.put(Material.matchMaterial(ingredParts[0]), P.p.parseInt(ingredParts[1]));
|
||||
} else {
|
||||
P.p.errorLog("Unknown Material: " + ingredParts[0]);
|
||||
P.p.errorLog("Unbekanntes Material: " + ingredParts[0]);
|
||||
this.ingredients = null;
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
|
@ -165,7 +165,7 @@ public class P extends JavaPlugin {
|
||||
if (recipe.isValid()) {
|
||||
BIngredients.recipes.add(recipe);
|
||||
} else {
|
||||
errorLog("Recipe with id: '" + recipeId + "' failed to load!");
|
||||
errorLog("Laden des Rezeptes mit id: '" + recipeId + "' fehlgeschlagen!");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -175,8 +175,12 @@ public class P extends JavaPlugin {
|
||||
if (configSection != null) {
|
||||
for (String ingredient : configSection.getKeys(false)) {
|
||||
Material mat = Material.matchMaterial(ingredient);
|
||||
BIngredients.cookedNames.put(mat, (configSection.getString(ingredient, null)));
|
||||
BIngredients.possibleIngredients.add(mat);
|
||||
if (mat != null) {
|
||||
BIngredients.cookedNames.put(mat, (configSection.getString(ingredient, null)));
|
||||
BIngredients.possibleIngredients.add(mat);
|
||||
} else {
|
||||
errorLog("Unbekanntes Material: " + ingredient);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3,6 +3,7 @@ package com.dre.brewery.listeners;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
import org.bukkit.event.player.PlayerItemConsumeEvent;
|
||||
import org.bukkit.event.player.PlayerRespawnEvent;
|
||||
import org.bukkit.event.player.PlayerMoveEvent;
|
||||
import org.bukkit.event.player.AsyncPlayerChatEvent;
|
||||
import org.bukkit.event.player.PlayerLoginEvent;
|
||||
@ -134,6 +135,12 @@ public class PlayerListener implements Listener {
|
||||
}
|
||||
}
|
||||
|
||||
// Player has died! He should no longer be drunk
|
||||
@EventHandler
|
||||
public void onPlayerRespawn(PlayerRespawnEvent event) {
|
||||
BPlayer.players.remove(event.getPlayer().getName());
|
||||
}
|
||||
|
||||
// player walks while drunk, push him around!
|
||||
@EventHandler(priority = EventPriority.LOW)
|
||||
public void onPlayerMove(PlayerMoveEvent event) {
|
||||
|
Loading…
Reference in New Issue
Block a user