diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 77c087bb6..ddd132071 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -49,4 +49,4 @@ jobs: # 4. Build via Maven - name: Build via Maven - run: mvn verify -B --file pom.xml + run: mvn verify -B --file pom.xml -DdisableXmlReport=true diff --git a/Changelog.txt b/Changelog.txt index 49e7d1422..ec943bc5a 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -49,6 +49,30 @@ Version 2.2.000 New Power Level Command This power level command gives you a view of all your current masteries, it also provides a summary of your power level. +Version 2.1.219 + Added support for various new things from Minecraft 1.20 + Fixed double drop issue with Beetroots + Added 'Camel' to taming experience in experience.yml + Added 'Sniffer' to taming experience in experience.yml + Added 'Snifflet' to taming experience in experience.yml + Added 'Pitcher_Plant' to bonus drops in config.yml + Added 'Torchflower' to bonus drops in config.yml + Added 'Pink_Petals' to bonus drops in config.yml + Added 'Cherry_Log' to bonus drops in config.yml + Added 'Cherry_Wood' to bonus drops in config.yml + Added 'Camel' to combat experience in experience.yml + Added 'Sniffer' to combat experience in experience.yml + Added 'Snifflet' to combat experience in experience.yml + Added 'Torchflower' to herbalism experience in experience.yml + Added 'Pitcher_Plant' to herbalism experience in experience.yml + Added 'Pink_Petals' to herbalism experience in experience.yml + Added 'Cherry_Log' to woodcutting experience in experience.yml + Added 'Cherry_Wood' to woodcutting experience in experience.yml + Added 'Stripped_Cherry_Log' to woodcutting experience in experience.yml + Added 'Stripped_Cherry_Wood' to woodcutting experience in experience.yml + Added 'Skills.Mining.BlastMining.Bonus_Drops.Enabled' to advanced.yml to enable/disable bonus drops from Blast Mining + NOTE: There are plans to add experience and potentially subskills for discovering items via the new brushing mechanic, but this will have to wait for new Spigot API to become available + Version 2.1.218 Fixed locale pt_BR type (thanks MrPowerGamerBR) Updated Russian Locale (thanks imDaniX) diff --git a/pom.xml b/pom.xml index 7a832016e..ca4dcd638 100755 --- a/pom.xml +++ b/pom.xml @@ -254,37 +254,37 @@ net.kyori adventure-text-serializer-gson - 4.11.0 + 4.13.0 net.kyori adventure-api - 4.11.0 + 4.13.0 net.kyori adventure-nbt - 4.11.0 + 4.13.0 net.kyori adventure-key - 4.11.0 + 4.13.0 net.kyori adventure-text-serializer-gson-legacy-impl - 4.11.0 + 4.13.0 net.kyori adventure-platform-bukkit - 4.1.2 + 4.3.0 net.kyori adventure-platform-api - 4.1.2 + 4.3.0 org.apache.maven.scm diff --git a/src/main/java/com/gmail/nossr50/commands/McnotifyCommand.java b/src/main/java/com/gmail/nossr50/commands/McnotifyCommand.java index 2ffb16910..d693a99c7 100644 --- a/src/main/java/com/gmail/nossr50/commands/McnotifyCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/McnotifyCommand.java @@ -24,8 +24,10 @@ public class McnotifyCommand implements TabExecutor { McMMOPlayer mcMMOPlayer = UserManager.getPlayer((Player) sender); //Not Loaded yet - if (mcMMOPlayer == null) + if (mcMMOPlayer == null) { sender.sendMessage(LocaleLoader.getString("Profile.PendingLoad")); + return true; + } sender.sendMessage(LocaleLoader.getString("Commands.Notifications." + (mcMMOPlayer.useChatNotifications() ? "Off" : "On"))); mcMMOPlayer.toggleChatNotifications(); diff --git a/src/main/java/com/gmail/nossr50/commands/player/InspectCommand.java b/src/main/java/com/gmail/nossr50/commands/player/InspectCommand.java index f1b93b1af..816656b1f 100644 --- a/src/main/java/com/gmail/nossr50/commands/player/InspectCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/player/InspectCommand.java @@ -47,21 +47,28 @@ public class InspectCommand implements TabExecutor { sender.sendMessage(LocaleLoader.getString("Inspect.OfflineStats", playerName)); + // Sum power level + int powerLevel = 0; + sender.sendMessage(LocaleLoader.getString("Stats.Header.Gathering")); for (PrimarySkillType skill : mcMMO.p.getSkillTools().GATHERING_SKILLS) { sender.sendMessage(CommandUtils.displaySkill(profile, skill)); + powerLevel += profile.getSkillLevel(skill); } sender.sendMessage(LocaleLoader.getString("Stats.Header.Combat")); for (PrimarySkillType skill : mcMMO.p.getSkillTools().COMBAT_SKILLS) { sender.sendMessage(CommandUtils.displaySkill(profile, skill)); + powerLevel += profile.getSkillLevel(skill); } sender.sendMessage(LocaleLoader.getString("Stats.Header.Misc")); for (PrimarySkillType skill : mcMMO.p.getSkillTools().MISC_SKILLS) { sender.sendMessage(CommandUtils.displaySkill(profile, skill)); + powerLevel += profile.getSkillLevel(skill); } + sender.sendMessage(LocaleLoader.getString("Commands.PowerLevel", powerLevel)); } else { Player target = mcMMOPlayer.getPlayer(); boolean isVanished = false; @@ -95,9 +102,7 @@ public class InspectCommand implements TabExecutor { CommandUtils.printCombatSkills(target, sender); CommandUtils.printMiscSkills(target, sender); - if (!isVanished) { - sender.sendMessage(LocaleLoader.getString("Commands.PowerLevel", mcMMOPlayer.getPowerLevel())); - } + sender.sendMessage(LocaleLoader.getString("Commands.PowerLevel", mcMMOPlayer.getPowerLevel())); } return true; diff --git a/src/main/java/com/gmail/nossr50/config/AdvancedConfig.java b/src/main/java/com/gmail/nossr50/config/AdvancedConfig.java index 84da46281..25425a0a3 100644 --- a/src/main/java/com/gmail/nossr50/config/AdvancedConfig.java +++ b/src/main/java/com/gmail/nossr50/config/AdvancedConfig.java @@ -777,6 +777,10 @@ public class AdvancedConfig extends BukkitConfig { return config.getDouble("Skills.Mining.BlastMining.OreBonus.Rank_" + rank); } + public boolean isBlastMiningBonusDropsEnabled() { + return config.getBoolean("Skills.Mining.BlastMining.Bonus_Drops.Enabled", true); + } + public double getDebrisReduction(int rank) { return config.getDouble("Skills.Mining.BlastMining.DebrisReduction.Rank_" + rank); } diff --git a/src/main/java/com/gmail/nossr50/datatypes/skills/PrimarySkillType.java b/src/main/java/com/gmail/nossr50/datatypes/skills/PrimarySkillType.java index 22ab7f4a6..5b513c280 100644 --- a/src/main/java/com/gmail/nossr50/datatypes/skills/PrimarySkillType.java +++ b/src/main/java/com/gmail/nossr50/datatypes/skills/PrimarySkillType.java @@ -27,40 +27,6 @@ public enum PrimarySkillType { TAMING, UNARMED, WOODCUTTING; -// boolean issueWarning = true; - - /* - * Everything below here will be removed in 2.2 (Tridents & Crossbows) - * Everything below here will be removed in 2.2 (Tridents & Crossbows) - * Everything below here will be removed in 2.2 (Tridents & Crossbows) - * Everything below here will be removed in 2.2 (Tridents & Crossbows) - * Everything below here will be removed in 2.2 (Tridents & Crossbows) - * Everything below here will be removed in 2.2 (Tridents & Crossbows) - * Everything below here will be removed in 2.2 (Tridents & Crossbows) - * Everything below here will be removed in 2.2 (Tridents & Crossbows) - * Everything below here will be removed in 2.2 (Tridents & Crossbows) - * Everything below here will be removed in 2.2 (Tridents & Crossbows) - * Everything below here will be removed in 2.2 (Tridents & Crossbows) - * Everything below here will be removed in 2.2 (Tridents & Crossbows) - * Everything below here will be removed in 2.2 (Tridents & Crossbows) - * Everything below here will be removed in 2.2 (Tridents & Crossbows) - * Everything below here will be removed in 2.2 (Tridents & Crossbows) - * Everything below here will be removed in 2.2 (Tridents & Crossbows) - */ - - -// private void processWarning() { -// if(issueWarning) { -// StackTraceElement[] stackTraceElements = Thread.currentThread().getStackTrace(); -// Bukkit.getScheduler().scheduleSyncDelayedTask(mcMMO.p, () -> { -// mcMMO.p.getLogger().severe("A plugin that hooks into mcMMO via the mcMMO API is using soon to be deprecated API calls. Contact the plugin author and inform them to update their code before it breaks."); -// mcMMO.p.getLogger().severe("Deprecation Call from: " + stackTraceElements[2].toString()); -// mcMMO.p.getLogger().severe("This warning will not repeat itself. Nothing is broken for now, but in the future it will be."); -// }); -// -// issueWarning = !issueWarning; -// } -// } /** * WARNING: Being removed in an upcoming update, you should be using mcMMO.getSkillTools() instead diff --git a/src/main/java/com/gmail/nossr50/listeners/BlockListener.java b/src/main/java/com/gmail/nossr50/listeners/BlockListener.java index 184403d65..59f2525a8 100644 --- a/src/main/java/com/gmail/nossr50/listeners/BlockListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/BlockListener.java @@ -38,6 +38,7 @@ import org.bukkit.event.block.*; import org.bukkit.inventory.ItemStack; import java.util.HashSet; +import java.util.Locale; public class BlockListener implements Listener { private final mcMMO plugin; @@ -56,6 +57,12 @@ public class BlockListener implements Listener { return; } + int tileEntityTolerance = 1; + + // beetroot hotfix, potentially other plants may need this fix + if(event.getBlockState().getType() == Material.BEETROOTS) + tileEntityTolerance = 2; + //Track how many "things" are being dropped HashSet uniqueMaterials = new HashSet<>(); boolean dontRewardTE = false; //If we suspect TEs are mixed in with other things don't reward bonus drops for anything that isn't a block @@ -70,7 +77,7 @@ public class BlockListener implements Listener { blockCount++; } - if(uniqueMaterials.size() > 1) { + if(uniqueMaterials.size() > tileEntityTolerance) { //Too many things are dropping, assume tile entities might be duped //Technically this would also prevent something like coal from being bonus dropped if you placed a TE above a coal ore when mining it but that's pretty edge case and this is a good solution for now dontRewardTE = true; diff --git a/src/main/java/com/gmail/nossr50/listeners/EntityListener.java b/src/main/java/com/gmail/nossr50/listeners/EntityListener.java index 4e9418555..fc9f686be 100644 --- a/src/main/java/com/gmail/nossr50/listeners/EntityListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/EntityListener.java @@ -361,40 +361,30 @@ public class EntityListener implements Listener { //Friendly fire checks if (defender instanceof Player defendingPlayer) { - Player attackingPlayer; - //If the attacker is a Player or a projectile belonging to a player - if(attacker instanceof Projectile || attacker instanceof Player) { - if(attacker instanceof Projectile projectile) { - if(((Projectile) attacker).getShooter() instanceof Player) { - attackingPlayer = (Player) projectile.getShooter(); + if(attacker instanceof Projectile projectile) { + if(projectile.getShooter() instanceof Player attackingPlayer && !attackingPlayer.equals(defendingPlayer)) { + //Check for party friendly fire and cancel the event + if (checkParties(event, defendingPlayer, attackingPlayer)) { + return; + } + } - //Check for party friendly fire and cancel the event - if (checkParties(event, defendingPlayer, attackingPlayer)) - { + //Deflect checks + final McMMOPlayer mcMMOPlayer = UserManager.getPlayer(defendingPlayer); + if (mcMMOPlayer != null) { + UnarmedManager unarmedManager = mcMMOPlayer.getUnarmedManager(); + + if (unarmedManager.canDeflect()) { + if (projectile instanceof Arrow && unarmedManager.deflectCheck()) { + event.setCancelled(true); return; } - } - - //Deflect checks - final McMMOPlayer mcMMOPlayer = UserManager.getPlayer(defendingPlayer); - if (mcMMOPlayer != null) { - UnarmedManager unarmedManager = mcMMOPlayer.getUnarmedManager(); - - if (unarmedManager.canDeflect()) { - if (projectile instanceof Arrow && unarmedManager.deflectCheck()) { - event.setCancelled(true); - return; - } - } - } - } else { - attackingPlayer = (Player) attacker; - //Check for party friendly fire and cancel the event - if (checkParties(event, defendingPlayer, attackingPlayer)) - return; } + } else if (attacker instanceof Player attackingPlayer){ + if (checkParties(event, defendingPlayer, attackingPlayer)) + return; } } diff --git a/src/main/java/com/gmail/nossr50/skills/herbalism/HerbalismManager.java b/src/main/java/com/gmail/nossr50/skills/herbalism/HerbalismManager.java index 509c6e36c..69f15d024 100644 --- a/src/main/java/com/gmail/nossr50/skills/herbalism/HerbalismManager.java +++ b/src/main/java/com/gmail/nossr50/skills/herbalism/HerbalismManager.java @@ -40,10 +40,7 @@ import org.bukkit.inventory.PlayerInventory; import org.bukkit.scheduler.BukkitRunnable; import org.jetbrains.annotations.NotNull; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashSet; -import java.util.List; +import java.util.*; public class HerbalismManager extends SkillManager { public HerbalismManager(McMMOPlayer mcMMOPlayer) { @@ -771,35 +768,39 @@ public class HerbalismManager extends SkillManager { PlayerInventory playerInventory = player.getInventory(); Material seed; - switch (blockState.getType()) { - case CARROTS: - seed = Material.CARROT; + switch (blockState.getType().getKey().getKey().toLowerCase(Locale.ROOT)) { + case "carrots": + seed = Material.matchMaterial("CARROT"); break; - case WHEAT: - seed = Material.WHEAT_SEEDS; + case "wheat": + seed = Material.matchMaterial("WHEAT_SEEDS"); break; - case NETHER_WART: - seed = Material.NETHER_WART; + case "nether_wart": + seed = Material.getMaterial("NETHER_WART"); break; - case POTATOES: - seed = Material.POTATO; + case "potatoes": + seed = Material.matchMaterial("POTATO"); break; - case BEETROOTS: - seed = Material.BEETROOT_SEEDS; + case "beetroots": + seed = Material.matchMaterial("BEETROOT_SEEDS"); break; - case COCOA: - seed = Material.COCOA_BEANS; + case "cocoa": + seed = Material.matchMaterial("COCOA_BEANS"); break; + case "torchflower": + seed = Material.matchMaterial("TORCHFLOWER_SEEDS"); + break; default: return false; } + ItemStack seedStack = new ItemStack(seed); if (ItemUtils.isAxe(blockBreakEvent.getPlayer().getInventory().getItemInMainHand()) @@ -850,17 +851,17 @@ public class HerbalismManager extends SkillManager { return true; } - switch (blockState.getType()) { + switch (blockState.getType().getKey().getKey()) { - case POTATOES: - case CARROTS: - case WHEAT: + case "potatoes": + case "carrots": + case "wheat": finalAge = getGreenThumbStage(greenTerra); break; - case BEETROOTS: - case NETHER_WART: + case "beetroots": + case "nether_wart": if (greenTerra || greenThumbStage > 2) { finalAge = 2; @@ -871,9 +872,9 @@ public class HerbalismManager extends SkillManager { else { finalAge = 0; } - break; + break; - case COCOA: + case "cocoa": if (getGreenThumbStage(greenTerra) >= 2) { finalAge = 1; @@ -887,6 +888,7 @@ public class HerbalismManager extends SkillManager { return false; } + //Start the delayed replant startReplantTask(finalAge, blockBreakEvent, blockState, false); return true; diff --git a/src/main/java/com/gmail/nossr50/skills/mining/MiningManager.java b/src/main/java/com/gmail/nossr50/skills/mining/MiningManager.java index a9e6e3b82..365bd3603 100644 --- a/src/main/java/com/gmail/nossr50/skills/mining/MiningManager.java +++ b/src/main/java/com/gmail/nossr50/skills/mining/MiningManager.java @@ -1,6 +1,7 @@ package com.gmail.nossr50.skills.mining; import com.gmail.nossr50.api.ItemSpawnReason; +import com.gmail.nossr50.config.AdvancedConfig; import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.datatypes.experience.XPGainReason; import com.gmail.nossr50.datatypes.interactions.NotificationType; @@ -216,7 +217,7 @@ public class MiningManager extends SkillManager { Misc.spawnItem(getPlayer(), Misc.getBlockCenter(blockState), new ItemStack(blockState.getType()), ItemSpawnReason.BLAST_MINING_ORES); // Initial block that would have been dropped - if (!mcMMO.getPlaceStore().isTrue(blockState)) { + if (mcMMO.p.getAdvancedConfig().isBlastMiningBonusDropsEnabled() && !mcMMO.getPlaceStore().isTrue(blockState)) { for (int i = 1; i < dropMultiplier; i++) { // Bukkit.broadcastMessage("Bonus Drop on Ore: "+blockState.getType().toString()); Misc.spawnItem(getPlayer(), Misc.getBlockCenter(blockState), new ItemStack(blockState.getType()), ItemSpawnReason.BLAST_MINING_ORES_BONUS_DROP); // Initial block that would have been dropped @@ -303,21 +304,16 @@ public class MiningManager extends SkillManager { * @return the Blast Mining tier */ public int getDropMultiplier() { - switch(getBlastMiningTier()) { - case 8: - case 7: - return 3; - case 6: - case 5: - case 4: - case 3: - return 2; - case 2: - case 1: - return 1; - default: - return 0; + if (mcMMO.p.getAdvancedConfig().isBlastMiningBonusDropsEnabled()) { + return 0; } + + return switch (getBlastMiningTier()) { + case 8, 7 -> 3; + case 6, 5, 4, 3 -> 2; + case 2, 1 -> 1; + default -> 0; + }; } /** diff --git a/src/main/java/com/gmail/nossr50/util/ItemUtils.java b/src/main/java/com/gmail/nossr50/util/ItemUtils.java index 9f3d58e23..ed763fdf3 100644 --- a/src/main/java/com/gmail/nossr50/util/ItemUtils.java +++ b/src/main/java/com/gmail/nossr50/util/ItemUtils.java @@ -22,6 +22,7 @@ import org.jetbrains.annotations.Nullable; import java.util.Collections; import java.util.List; +import java.util.Locale; public final class ItemUtils { /** @@ -413,31 +414,31 @@ public final class ItemUtils { */ public static boolean isHerbalismDrop(ItemStack item) { //TODO: 1.14 This needs to be updated - switch (item.getType()) { - case WHEAT: - case WHEAT_SEEDS: - case CARROT: - case CHORUS_FRUIT: - case CHORUS_FLOWER: - case POTATO: - case BEETROOT: - case BEETROOTS: - case BEETROOT_SEEDS: - case NETHER_WART: - case BROWN_MUSHROOM: - case RED_MUSHROOM: - case ROSE_BUSH: - case DANDELION: - case CACTUS: - case SUGAR_CANE: - case MELON: - case MELON_SEEDS: - case PUMPKIN: - case PUMPKIN_SEEDS: - case LILY_PAD: - case VINE: - case TALL_GRASS: - case COCOA_BEANS: + switch (item.getType().getKey().getKey().toLowerCase()) { + case "wheat": + case "wheat_seeds": + case "carrot": + case "chorus_fruit": + case "chorus_flower": + case "potato": + case "beetroot": + case "beetroots": + case "beetroot_seeds": + case "nether_wart": + case "brown_mushroom": + case "red_mushroom": + case "rose_bush": + case "dandelion": + case "cactus": + case "sugar_cane": + case "melon": + case "melon_seeds": + case "pumpkin": + case "pumpkin_seeds": + case "lily_pad": + case "vine": + case "tall_grass": + case "cocoa_beans": return true; default: @@ -445,6 +446,7 @@ public final class ItemUtils { } } + /** * Checks to see if an item is a mob drop. * diff --git a/src/main/java/com/gmail/nossr50/util/MaterialMapStore.java b/src/main/java/com/gmail/nossr50/util/MaterialMapStore.java index 446372101..7ed67d191 100644 --- a/src/main/java/com/gmail/nossr50/util/MaterialMapStore.java +++ b/src/main/java/com/gmail/nossr50/util/MaterialMapStore.java @@ -1017,6 +1017,7 @@ public class MaterialMapStore { private void fillTreeFellerDestructibleWhiteList() { treeFellerDestructibleWhiteList.add("oak_leaves"); + treeFellerDestructibleWhiteList.add("cherry_leaves"); treeFellerDestructibleWhiteList.add("acacia_leaves"); treeFellerDestructibleWhiteList.add("birch_leaves"); treeFellerDestructibleWhiteList.add("dark_oak_leaves"); @@ -1171,6 +1172,7 @@ public class MaterialMapStore { private void fillToolBlackList() { + toolBlackList.add("chiseled_bookshelf"); toolBlackList.add("black_bed"); toolBlackList.add("blue_bed"); toolBlackList.add("brown_bed"); @@ -1256,17 +1258,28 @@ public class MaterialMapStore { toolBlackList.add("yellow_shulker_box"); toolBlackList.add("shulker_box"); toolBlackList.add("acacia_sign"); + toolBlackList.add("acacia_hanging_sign"); toolBlackList.add("acacia_wall_sign"); toolBlackList.add("birch_sign"); + toolBlackList.add("birch_hanging_sign"); toolBlackList.add("birch_wall_sign"); toolBlackList.add("dark_oak_sign"); + toolBlackList.add("dark_oak_hanging_sign"); toolBlackList.add("dark_oak_wall_sign"); toolBlackList.add("jungle_sign"); + toolBlackList.add("jungle_hanging_sign"); toolBlackList.add("jungle_wall_sign"); toolBlackList.add("spruce_sign"); + toolBlackList.add("spruce_hanging_sign"); toolBlackList.add("spruce_wall_sign"); toolBlackList.add("oak_sign"); + toolBlackList.add("oak_hanging_sign"); toolBlackList.add("oak_wall_sign"); + toolBlackList.add("cherry_sign"); + toolBlackList.add("cherry_hanging_sign"); + toolBlackList.add("cherry_wall_sign"); + toolBlackList.add("stripped_cherry_log"); + toolBlackList.add("stripped_cherry_wood"); toolBlackList.add("stripped_acacia_log"); toolBlackList.add("stripped_acacia_wood"); toolBlackList.add("stripped_birch_log"); @@ -1308,6 +1321,7 @@ public class MaterialMapStore { toolBlackList.add("lodestone"); toolBlackList.add("respawn_anchor"); toolBlackList.add("sweet_berry_bush"); + toolBlackList.add("smithing_table"); } public boolean isIntendedToolPickaxe(@NotNull Material material) { diff --git a/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java b/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java index bf4a3a4ee..ac9cc6388 100644 --- a/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java +++ b/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java @@ -8,6 +8,7 @@ import com.gmail.nossr50.datatypes.player.McMMOPlayer; import com.gmail.nossr50.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.datatypes.skills.SubSkillType; import com.gmail.nossr50.events.fake.FakeEntityDamageByEntityEvent; +import com.gmail.nossr50.events.fake.FakeEntityDamageEvent; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.metadata.MobMetaFlagType; import com.gmail.nossr50.metadata.MobMetadataService; @@ -885,8 +886,14 @@ public final class CombatUtils { return false; } - public static boolean canDamage(@NotNull Entity attacker, @NotNull Entity target, @NotNull DamageCause damageCause, double damage) { - EntityDamageEvent damageEvent = new FakeEntityDamageByEntityEvent(attacker, target, damageCause, damage); + public static boolean canDamage(@Nullable Entity attacker, @NotNull Entity target, @NotNull DamageCause damageCause, double damage) { + EntityDamageEvent damageEvent; + if (attacker != null) { + damageEvent = new FakeEntityDamageByEntityEvent(attacker, target, damageCause, damage); + } else { + damageEvent = new FakeEntityDamageEvent(target, damageCause, damage); + } + mcMMO.p.getServer().getPluginManager().callEvent(damageEvent); return !damageEvent.isCancelled(); diff --git a/src/main/resources/advanced.yml b/src/main/resources/advanced.yml index 087445f52..ce788d396 100644 --- a/src/main/resources/advanced.yml +++ b/src/main/resources/advanced.yml @@ -299,6 +299,8 @@ Skills: RetroMode: 1000 BlastMining: + Bonus_Drops: + Enabled: true # BlastDamageDecrease Ranks: % of damage reduced from TNT explosions BlastDamageDecrease: Rank_1: 0.0 diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 4193b6d0d..0827b53b7 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -468,6 +468,9 @@ Green_Thumb_Replanting_Crops: ### Bonus_Drops: Herbalism: + Pitcher_Plant: true + Torchflower: true + Pink_Petals: true Glow_Berries: true Cave_Vines: true Cave_Vines_Plant: true @@ -605,6 +608,8 @@ Bonus_Drops: Acacia_Log: true Birch_Wood: true Birch_Log: true + Cherry_Wood: true + Cherry_Log: true Dark_Oak_Wood: true Dark_Oak_Log: true Oak_Wood: true diff --git a/src/main/resources/experience.yml b/src/main/resources/experience.yml index f1bde0450..88a3150dd 100644 --- a/src/main/resources/experience.yml +++ b/src/main/resources/experience.yml @@ -277,18 +277,21 @@ Experience_Values: Crimson_Stem: 35 Warped_Stem: 35 Oak_Log: 70 + Cherry_Log: 105 Spruce_Log: 80 Birch_Log: 90 Jungle_Log: 100 Acacia_Log: 90 Dark_Oak_Log: 90 Stripped_Oak_Log: 70 + Stripped_Cherry_Log: 105 Stripped_Spruce_Log: 80 Stripped_Birch_Log: 90 Stripped_Jungle_Log: 100 Stripped_Acacia_Log: 90 Stripped_Dark_Oak_Log: 90 Stripped_Oak_Wood: 70 + Stripped_Cherry_Wood: 70 Stripped_Spruce_Wood: 80 Stripped_Birch_Wood: 90 Stripped_Jungle_Wood: 100 @@ -298,6 +301,7 @@ Experience_Values: Stripped_Crimson_Stem: 50 Stripped_Warped_Stem: 50 Oak_Wood: 70 + Cherry_Wood: 105 Spruce_Wood: 70 Birch_Wood: 70 Jungle_Wood: 70 @@ -310,6 +314,8 @@ Experience_Values: Brown_Mushroom_Block: 70 Mushroom_Stem: 80 Herbalism: + Pitcher_Plant: 160 + Pink_Petals: 10 Small_Dripleaf: 140 Big_Dripleaf: 140 Cave_Vines: 90 @@ -401,6 +407,7 @@ Experience_Values: Cornflower: 150 Lily_Of_The_Valley: 150 Wither_Rose: 500 + Torchflower: 90 Mining: Sculk: 4 Sculk_Vein: 3 @@ -541,6 +548,9 @@ Experience_Values: Cobbled_Deepslate: 5 Taming: Animal_Taming: + Camel: 1300 + Sniffer: 1500 + Snifflet: 900 Llama: 1200 Wolf: 250 Ocelot: 500 @@ -633,3 +643,6 @@ Experience_Values: Frog: 1.7 Warden: 6.0 Tadpole: 0.2 + Sniffer: 1.1 + Snifflet: 1.1 + Camel: 1.2 diff --git a/src/main/resources/locale/locale_zh_CN.properties b/src/main/resources/locale/locale_zh_CN.properties index fcb88284c..0b139369c 100644 --- a/src/main/resources/locale/locale_zh_CN.properties +++ b/src/main/resources/locale/locale_zh_CN.properties @@ -999,12 +999,12 @@ Skills.Parents=主技能 Skills.Stats={0}&a{1}&3 XP(&7{2}&3/&7{3}&3) Skills.ChildStats={0}&a{1} Skills.MaxXP=最大 -Skills.TooTired=你太累了暂时无法使用该技能.&e({0}s) +Skills.TooTired=你太累了,暂时无法使用该技能.&e({0}s) Skills.TooTired.Named=&7(&6{0}&e {1}s&7) Skills.TooTired.Extra=&6{0} &e技能冷却时间 - {1} Skills.Cancelled=&6{0} &c已取消! Skills.ConfirmOrCancel=&a再次右键以确定 &6{0}&a. 左键取消. -Skills.AbilityGateRequirementFail=&7你需要 &e{0}&7 级以上的 &3{1}&7 来使用这个能力. +Skills.AbilityGateRequirementFail=&7你还需要提升 &e{0}&7 级 &3{1}&7 才能使用这个能力. #数据 Stats.Header.Combat=&6-=格斗技能=- Stats.Header.Gathering=&6-=采集技能=- @@ -1066,7 +1066,7 @@ Commands.Description.addlevels=给玩家增加 mcMMO 等级 Commands.Description.adminchat=切换 mcMMO 管理员聊天或发送管理员聊天信息 Commands.Description.addxp=给玩家增加 mcMMO 经验 Commands.Description.hardcore=修改 mcMMO hardcore 百分比或切换 hardcore 模式开/关 -Commands.Description.inspect=查看玩家详细的 mcMMO 信息 +Commands.Description.inspect=查看玩家的 mcMMO 详细信息 Commands.Description.mcability=切换 mcMMO 技能右键激活 开/关 Commands.Description.mccooldown=查看所有mcMMO技能冷却时间 Commands.Description.mcchatspy=切换对完聊天监视开/关 @@ -1095,8 +1095,8 @@ Commands.Description.vampirism=更改 mcMMO 榨取百分比 或切换 vampirism Commands.Description.xplock=锁定指定 mcMMO 技能的经验条 Commands.Description.xprate=更改 mcMMO 经验倍率或开启一个 mcMMO 经验翻倍事件 #更新检查器 -UpdateChecker.Outdated=你正在使用这一个旧版本的 mcMMO! -UpdateChecker.NewAvailable=Spigot 上有一个新版本. +UpdateChecker.Outdated=你正在使用旧版本的 mcMMO! +UpdateChecker.NewAvailable=在 Spigot 上有一个新版本. #记分板抬头 Scoreboard.Header.PlayerStats=&emcMMO 统计 Scoreboard.Header.PlayerCooldowns=&emcMMO 冷却 @@ -1111,7 +1111,7 @@ Scoreboard.Misc.Cooldown=&d冷却 Scoreboard.Misc.Overall=&6总体 Scoreboard.Misc.Ability=能力 #数据库恢复 -Profile.PendingLoad=&c你的mcMMO玩家数据未加载. +Profile.PendingLoad=&c你的mcMMO玩家数据未正常加载. Profile.Loading.Success=&a你的mcMMO数据已加载 Profile.Loading.Failure=&cmcMMO 无法加载你的数据. 请联系 &b服务器管理员反馈你的问题.\n&e你可以继续在服务器游玩, 但是你 &l没有mcMMO等级&e 并且你获得的任何经验都 &l不会被保存&e. Profile.Loading.AdminFailureNotice=&4[A]&c mcMMO 无法加载玩家 &e{0}&c 的数据. &d请检查你的数据库. @@ -1141,4 +1141,4 @@ Chat.Channel.Off=&6(&amcMMO-聊天&6) &7你的聊天消息将不再自动发送 Chat.Spy.Party=&6[&eSPY&6-&a{2}&6] &r{0} &b→ &r{1} Broadcasts.LevelUpMilestone=&6(&amcMMO&6) {0}&7 的 &3{2}&7 技能等级提升到了 &a{1}&7! Broadcasts.PowerLevelUpMilestone=&6(&amcMMO&6) {0}&7 总等级已达到 &a{1}&7! -Scoreboard.Recovery=正在尝试恢复 mcMMO 记分牌... \ No newline at end of file +Scoreboard.Recovery=正在尝试恢复 mcMMO 记分牌...