Skip to content

Commit

Permalink
More polish and bugfixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Wertik committed Jul 9, 2020
1 parent 75b1939 commit c9d65c2
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/main/java/nl/aurorion/blockregen/BlockRegen.java
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ public void onEnable() {
}

public void reload(CommandSender sender) {

consoleOutput.addListener(sender);
checkDependencies();

files.getSettings().load();
Expand All @@ -163,6 +165,7 @@ public void reload(CommandSender sender) {
if (getConfig().getBoolean("Auto-Save.Enabled", false))
regenerationManager.reloadAutoSave();

consoleOutput.removeListener(sender);
sender.sendMessage(Message.RELOAD.get());
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/nl/aurorion/blockregen/Message.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public enum Message {
* Messages on block break errs.
*/
TOOL_REQUIRED_ERROR("Tool-Required-Error", "&cYou can only break this block with the following tool(s): &b%tool%&c."),
ENCHANT_REQUIRED_ERROR("Enchant-Required-Error", "&cYour tool has to have one of the following enchantment(s): &b%enchant%&c."),
ENCHANT_REQUIRED_ERROR("Enchant-Required-Error", "&cYour tool has to have at least one of the following enchantment(s): &b%enchant%&c."),
JOBS_REQUIRED_ERROR("Jobs-Error", "&cYou need to reach following job levels in order to break this block: &b%job%"),
PERMISSION_BLOCK_ERROR("Permission-Error", "&cYou don't have the permission to break this block.");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.block.Block;
import org.bukkit.block.BlockState;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.entity.ExperienceOrb;
Expand Down Expand Up @@ -281,6 +280,8 @@ private void process(RegenerationProcess process, BlockBreakEvent event) {

if (doubleExp) expAmount *= 2;

plugin.getConsoleOutput().debug("Exp: " + expAmount);

if (experienceDrop.isDropNaturally())
world.spawn(location, ExperienceOrb.class).setExperience(expAmount);
else player.giveExp(expAmount);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,12 @@ public void load(String name) {

ExperienceDrop experienceDrop = new ExperienceDrop();

experienceDrop.setAmount(Amount.loadAmount(plugin.getFiles().getBlockList().getFileConfiguration(), "Blocks." + name + ".drop-item.exp-drop.amount", 0));
experienceDrop.setAmount(Amount.loadAmount(plugin.getFiles().getBlockList().getFileConfiguration(), "Blocks." + name + ".drop-item.exp.amount", 0));

experienceDrop.setDropNaturally(plugin.getFiles().getBlockList().getFileConfiguration().getBoolean("Blocks." + name + ".drop-item.exp.drop-naturally", false));

drop.setExperienceDrop(experienceDrop);
plugin.getConsoleOutput().debug("Exp drop: " + experienceDrop.toString());

drops.add(drop);
}
Expand Down

0 comments on commit c9d65c2

Please sign in to comment.