From b4179cb9a615d5996a7321b78869d1c731e159fa Mon Sep 17 00:00:00 2001 From: nossr50 Date: Fri, 18 Oct 2019 15:23:15 -0700 Subject: [PATCH 01/26] Fixed a dupe bug --- Changelog.txt | 4 ++ .../nossr50/listeners/BlockListener.java | 61 +++++++------------ 2 files changed, 27 insertions(+), 38 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index 9ad1752e9..ce9afdc66 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,3 +1,7 @@ +Version 2.1.110 + Fixed a dupe bug + Added Lithuanian locale (thanks Vyciokazz) + Version 2.1.109 Block Cracker will now correctly crack stone_bricks during Berserk again Added Lily_Of_The_Valley to the Bonus Drops list in config.yml (you'll probably want to add this manually) which enables it to double drop diff --git a/src/main/java/com/gmail/nossr50/listeners/BlockListener.java b/src/main/java/com/gmail/nossr50/listeners/BlockListener.java index e11b6271d..e3330e875 100644 --- a/src/main/java/com/gmail/nossr50/listeners/BlockListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/BlockListener.java @@ -41,7 +41,9 @@ import org.bukkit.event.block.*; import org.bukkit.inventory.ItemStack; import org.bukkit.metadata.MetadataValue; +import java.util.HashSet; import java.util.List; +import java.util.Set; public class BlockListener implements Listener { private final mcMMO plugin; @@ -53,6 +55,20 @@ public class BlockListener implements Listener { @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) public void onBlockDropItemEvent(BlockDropItemEvent event) { + //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 + + for(Item item : event.getItems()) { + uniqueMaterials.add(item.getItemStack().getType()); + } + + if(uniqueMaterials.size() > 1) { + //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; + } + for(Item item : event.getItems()) { ItemStack is = new ItemStack(item.getItemStack()); @@ -66,6 +82,13 @@ public class BlockListener implements Listener { && !Config.getInstance().getDoubleDropsEnabled(PrimarySkillType.WOODCUTTING, is.getType())) continue; + //If we suspect TEs might be duped only reward block + if(dontRewardTE) { + if(!is.getType().isBlock()) { + continue; + } + } + if (event.getBlock().getMetadata(mcMMO.BONUS_DROPS_METAKEY).size() > 0) { BonusDropMeta bonusDropMeta = (BonusDropMeta) event.getBlock().getMetadata(mcMMO.BONUS_DROPS_METAKEY).get(0); int bonusCount = bonusDropMeta.asInt(); @@ -80,44 +103,6 @@ public class BlockListener implements Listener { event.getBlock().removeMetadata(mcMMO.BONUS_DROPS_METAKEY, plugin); } - /*@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) - public void onBlockDropItemEvent(BlockDropItemEvent event) - { - for(Item item : event.getItems()) - { - ItemStack is = new ItemStack(item.getItemStack()); - - if(event.getBlock().getMetadata(mcMMO.doubleDrops).size() > 0) - { - List metadataValue = event.getBlock().getMetadata(mcMMO.doubleDrops); - - BonusDrops bonusDrops = (BonusDrops) metadataValue.get(0); - Collection potentialDrops = (Collection) bonusDrops.value(); - - if(potentialDrops.contains(is)) - { - event.getBlock().getState().getWorld().dropItemNaturally(event.getBlockState().getLocation(), is); - } - - event.getBlock().removeMetadata(mcMMO.doubleDrops, plugin); - } else { - if(event.getBlock().getMetadata(mcMMO.tripleDrops).size() > 0) { - List metadataValue = event.getBlock().getMetadata(mcMMO.tripleDrops); - - BonusDrops bonusDrops = (BonusDrops) metadataValue.get(0); - Collection potentialDrops = (Collection) bonusDrops.value(); - - if (potentialDrops.contains(is)) { - event.getBlock().getState().getWorld().dropItemNaturally(event.getBlockState().getLocation(), is); - event.getBlock().getState().getWorld().dropItemNaturally(event.getBlockState().getLocation(), is); - } - - event.getBlock().removeMetadata(mcMMO.tripleDrops, plugin); - } - } - } - }*/ - /** * Monitor BlockPistonExtend events. * From 335d708848516917fe4a83bca656f75210758724 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Fri, 18 Oct 2019 15:24:46 -0700 Subject: [PATCH 02/26] Bump version --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c63aa1914..4551bae9c 100755 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 com.gmail.nossr50.mcMMO mcMMO - 2.1.109 + 2.1.110-SNAPSHOT mcMMO https://github.com/mcMMO-Dev/mcMMO From 76ca7cc88fb810076ab547f3d6571a85e0fcba7d Mon Sep 17 00:00:00 2001 From: nossr50 Date: Fri, 18 Oct 2019 15:37:36 -0700 Subject: [PATCH 03/26] Additional dupe failsafes --- .../nossr50/listeners/BlockListener.java | 51 +++++++++++-------- 1 file changed, 30 insertions(+), 21 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/listeners/BlockListener.java b/src/main/java/com/gmail/nossr50/listeners/BlockListener.java index e3330e875..7374f56bf 100644 --- a/src/main/java/com/gmail/nossr50/listeners/BlockListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/BlockListener.java @@ -58,9 +58,15 @@ public class BlockListener implements Listener { //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 + int blockCount = 0; for(Item item : event.getItems()) { + //Track unique materials uniqueMaterials.add(item.getItemStack().getType()); + + //Count blocks as a second failsafe + if(item.getItemStack().getType().isBlock()) + blockCount++; } if(uniqueMaterials.size() > 1) { @@ -69,32 +75,35 @@ public class BlockListener implements Listener { dontRewardTE = true; } - for(Item item : event.getItems()) - { - ItemStack is = new ItemStack(item.getItemStack()); + //If there are more than one block in the item list we can't really trust it and will back out of rewarding bonus drops + if(blockCount <= 1) { + for(Item item : event.getItems()) + { + ItemStack is = new ItemStack(item.getItemStack()); - if(is.getAmount() <= 0) - continue; - - //TODO: Ignore this abomination its rewritten in 2.2 - if(!Config.getInstance().getDoubleDropsEnabled(PrimarySkillType.MINING, is.getType()) - && !Config.getInstance().getDoubleDropsEnabled(PrimarySkillType.HERBALISM, is.getType()) - && !Config.getInstance().getDoubleDropsEnabled(PrimarySkillType.WOODCUTTING, is.getType())) - continue; - - //If we suspect TEs might be duped only reward block - if(dontRewardTE) { - if(!is.getType().isBlock()) { + if(is.getAmount() <= 0) continue; + + //TODO: Ignore this abomination its rewritten in 2.2 + if(!Config.getInstance().getDoubleDropsEnabled(PrimarySkillType.MINING, is.getType()) + && !Config.getInstance().getDoubleDropsEnabled(PrimarySkillType.HERBALISM, is.getType()) + && !Config.getInstance().getDoubleDropsEnabled(PrimarySkillType.WOODCUTTING, is.getType())) + continue; + + //If we suspect TEs might be duped only reward block + if(dontRewardTE) { + if(!is.getType().isBlock()) { + continue; + } } - } - if (event.getBlock().getMetadata(mcMMO.BONUS_DROPS_METAKEY).size() > 0) { - BonusDropMeta bonusDropMeta = (BonusDropMeta) event.getBlock().getMetadata(mcMMO.BONUS_DROPS_METAKEY).get(0); - int bonusCount = bonusDropMeta.asInt(); + if (event.getBlock().getMetadata(mcMMO.BONUS_DROPS_METAKEY).size() > 0) { + BonusDropMeta bonusDropMeta = (BonusDropMeta) event.getBlock().getMetadata(mcMMO.BONUS_DROPS_METAKEY).get(0); + int bonusCount = bonusDropMeta.asInt(); - for (int i = 0; i < bonusCount; i++) { - event.getBlock().getWorld().dropItemNaturally(event.getBlockState().getLocation(), is); + for (int i = 0; i < bonusCount; i++) { + event.getBlock().getWorld().dropItemNaturally(event.getBlockState().getLocation(), is); + } } } } From e6c9cc6fddbbf05f4bd764663ffaa7ecd4734302 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Fri, 18 Oct 2019 15:48:12 -0700 Subject: [PATCH 04/26] Actually fixed BlockCracker + One more type of block can be cracked --- Changelog.txt | 2 ++ .../java/com/gmail/nossr50/listeners/BlockListener.java | 3 ++- .../com/gmail/nossr50/skills/unarmed/UnarmedManager.java | 9 ++++++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index ce9afdc66..afb6d1384 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,5 +1,7 @@ Version 2.1.110 Fixed a dupe bug + Actually fixed Block Cracker + You can now crack Infested Stone Bricks with Block Cracker Added Lithuanian locale (thanks Vyciokazz) Version 2.1.109 diff --git a/src/main/java/com/gmail/nossr50/listeners/BlockListener.java b/src/main/java/com/gmail/nossr50/listeners/BlockListener.java index 7374f56bf..a57735b08 100644 --- a/src/main/java/com/gmail/nossr50/listeners/BlockListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/BlockListener.java @@ -1,5 +1,6 @@ package com.gmail.nossr50.listeners; +import com.gmail.nossr50.config.AdvancedConfig; import com.gmail.nossr50.config.Config; import com.gmail.nossr50.config.HiddenConfig; import com.gmail.nossr50.config.WorldBlacklist; @@ -588,7 +589,7 @@ public class BlockListener implements Listener { blockState.update(true); } } - else if (mcMMOPlayer.getAbilityMode(SuperAbilityType.BERSERK) && heldItem.getType() == Material.AIR) { + else if (mcMMOPlayer.getAbilityMode(SuperAbilityType.BERSERK) && (heldItem.getType() == Material.AIR || Config.getInstance().getUnarmedItemsAsUnarmed())) { if (mcMMOPlayer.getUnarmedManager().canUseBlockCracker() && BlockUtils.affectedByBlockCracker(blockState)) { if (EventUtils.simulateBlockBreak(block, player, true) && mcMMOPlayer.getUnarmedManager().blockCrackerCheck(blockState)) { blockState.update(); diff --git a/src/main/java/com/gmail/nossr50/skills/unarmed/UnarmedManager.java b/src/main/java/com/gmail/nossr50/skills/unarmed/UnarmedManager.java index 78bef306a..a22fea6f7 100644 --- a/src/main/java/com/gmail/nossr50/skills/unarmed/UnarmedManager.java +++ b/src/main/java/com/gmail/nossr50/skills/unarmed/UnarmedManager.java @@ -92,7 +92,14 @@ public class UnarmedManager extends SkillManager { return false; } - blockState.setType(Material.CRACKED_STONE_BRICKS); + blockState.getBlock().setType(Material.CRACKED_STONE_BRICKS); + return true; + case INFESTED_STONE_BRICKS: + if (!Unarmed.blockCrackerSmoothBrick) { + return false; + } + + blockState.getBlock().setType(Material.INFESTED_CRACKED_STONE_BRICKS); return true; default: From 188b0f9813e5f0c6c82d2893a80a4f0b62914955 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Fri, 18 Oct 2019 15:48:53 -0700 Subject: [PATCH 05/26] 2.1.110 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4551bae9c..3ba5abb26 100755 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 com.gmail.nossr50.mcMMO mcMMO - 2.1.110-SNAPSHOT + 2.1.110 mcMMO https://github.com/mcMMO-Dev/mcMMO From 7eab20ef563383c9ea9e4cab1bb1145c6213d1ca Mon Sep 17 00:00:00 2001 From: Ineusia Date: Fri, 8 Nov 2019 01:11:29 -0600 Subject: [PATCH 06/26] Added error message for missing Repairables section (rather than throw NPE) --- .../gmail/nossr50/config/skills/repair/RepairConfig.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/com/gmail/nossr50/config/skills/repair/RepairConfig.java b/src/main/java/com/gmail/nossr50/config/skills/repair/RepairConfig.java index c04a98676..ae908d243 100644 --- a/src/main/java/com/gmail/nossr50/config/skills/repair/RepairConfig.java +++ b/src/main/java/com/gmail/nossr50/config/skills/repair/RepairConfig.java @@ -3,6 +3,7 @@ package com.gmail.nossr50.config.skills.repair; import com.gmail.nossr50.config.ConfigLoader; import com.gmail.nossr50.datatypes.skills.ItemType; import com.gmail.nossr50.datatypes.skills.MaterialType; +import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.skills.repair.repairables.Repairable; import com.gmail.nossr50.skills.repair.repairables.RepairableFactory; import com.gmail.nossr50.util.ItemUtils; @@ -26,7 +27,13 @@ public class RepairConfig extends ConfigLoader { protected void loadKeys() { repairables = new ArrayList(); + if (!config.isConfigurationSection("Repairables")) { + mcMMO.p.getLogger().severe("Could not find Repairables section in " + fileName); + return; + } + ConfigurationSection section = config.getConfigurationSection("Repairables"); + Set keys = section.getKeys(false); for (String key : keys) { From ca1906fbc58105b82b9bf1822d39226e549717bd Mon Sep 17 00:00:00 2001 From: Ineusia Date: Fri, 8 Nov 2019 01:15:32 -0600 Subject: [PATCH 07/26] Added error message for missing Salvageables section (rather than throw NPE) --- .../gmail/nossr50/config/skills/salvage/SalvageConfig.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/com/gmail/nossr50/config/skills/salvage/SalvageConfig.java b/src/main/java/com/gmail/nossr50/config/skills/salvage/SalvageConfig.java index 5400ca826..2975e6316 100644 --- a/src/main/java/com/gmail/nossr50/config/skills/salvage/SalvageConfig.java +++ b/src/main/java/com/gmail/nossr50/config/skills/salvage/SalvageConfig.java @@ -3,6 +3,7 @@ package com.gmail.nossr50.config.skills.salvage; import com.gmail.nossr50.config.ConfigLoader; import com.gmail.nossr50.datatypes.skills.ItemType; import com.gmail.nossr50.datatypes.skills.MaterialType; +import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.skills.salvage.salvageables.Salvageable; import com.gmail.nossr50.skills.salvage.salvageables.SalvageableFactory; import com.gmail.nossr50.util.ItemUtils; @@ -27,6 +28,11 @@ public class SalvageConfig extends ConfigLoader { protected void loadKeys() { salvageables = new ArrayList(); + if (!config.isConfigurationSection("Salvageables")) { + mcMMO.p.getLogger().severe("Could not find Salvageables section in " + fileName); + return; + } + ConfigurationSection section = config.getConfigurationSection("Salvageables"); Set keys = section.getKeys(false); From c5cbab39b6ae789382e35b6216edcb877bc0d0ed Mon Sep 17 00:00:00 2001 From: Ineusia Date: Sun, 10 Nov 2019 11:56:32 -0600 Subject: [PATCH 08/26] Update RepairConfig.java Removed accidental whitespace --- .../com/gmail/nossr50/config/skills/repair/RepairConfig.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/com/gmail/nossr50/config/skills/repair/RepairConfig.java b/src/main/java/com/gmail/nossr50/config/skills/repair/RepairConfig.java index ae908d243..848ba8468 100644 --- a/src/main/java/com/gmail/nossr50/config/skills/repair/RepairConfig.java +++ b/src/main/java/com/gmail/nossr50/config/skills/repair/RepairConfig.java @@ -33,7 +33,6 @@ public class RepairConfig extends ConfigLoader { } ConfigurationSection section = config.getConfigurationSection("Repairables"); - Set keys = section.getKeys(false); for (String key : keys) { From 3ce0d7b97224ddcbfa084b180edeb215acdd4c3c Mon Sep 17 00:00:00 2001 From: nossr50 Date: Sun, 10 Nov 2019 19:51:47 -0800 Subject: [PATCH 09/26] dev mode --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3ba5abb26..558316a82 100755 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 com.gmail.nossr50.mcMMO mcMMO - 2.1.110 + 2.1.111-SNAPSHOT mcMMO https://github.com/mcMMO-Dev/mcMMO From b7dd491c012be38177f4ad68ec1f702e6c812457 Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Wed, 13 Nov 2019 19:53:02 +0000 Subject: [PATCH 10/26] Prevent nesting of bleed damage This commit prevents the nesting of damage event processing in general in regards to bleed, health related stuff will need a further glance over down the line, however; This will fix a major problematic area --- .../com/gmail/nossr50/listeners/EntityListener.java | 4 ++++ .../com/gmail/nossr50/util/skills/CombatUtils.java | 13 +++++++++++++ 2 files changed, 17 insertions(+) diff --git a/src/main/java/com/gmail/nossr50/listeners/EntityListener.java b/src/main/java/com/gmail/nossr50/listeners/EntityListener.java index d837e2de2..4b6d92ce4 100644 --- a/src/main/java/com/gmail/nossr50/listeners/EntityListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/EntityListener.java @@ -319,6 +319,10 @@ public class EntityListener implements Listener { return; } + if (CombatUtils.isProcessingNoInvulnDamage()) { + return; + } + if (event.getEntity() instanceof ArmorStand) { return; } 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 a59c238e7..f52499450 100644 --- a/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java +++ b/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java @@ -39,6 +39,8 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import javax.annotation.Nullable; + public final class CombatUtils { private CombatUtils() {} @@ -554,6 +556,11 @@ public final class CombatUtils { target.damage(damage); } + private static boolean processingNoInvulnDamage; + public static boolean isProcessingNoInvulnDamage() { + return processingNoInvulnDamage; + } + public static void dealNoInvulnerabilityTickDamage(LivingEntity target, double damage, Entity attacker) { if (target.isDead()) { return; @@ -564,7 +571,11 @@ public final class CombatUtils { // potentially mis-attributing the death cause; calling a fake event would partially fix this, but this and setting the last damage // cause do have issues around plugin observability. This is not a perfect solution, but it appears to be the best one here // We also set no damage ticks to 0, to ensure that damage is applied for this case, and reset it back to the original value + // Snapshot current state so we can pop up properly boolean wasMetaSet = target.getMetadata(mcMMO.CUSTOM_DAMAGE_METAKEY).size() != 0; + boolean wasProcessing = processingNoInvulnDamage; + // set markers + processingNoInvulnDamage = true; target.setMetadata(mcMMO.CUSTOM_DAMAGE_METAKEY, mcMMO.metadataValue); int noDamageTicks = target.getNoDamageTicks(); target.setNoDamageTicks(0); @@ -572,6 +583,8 @@ public final class CombatUtils { target.setNoDamageTicks(noDamageTicks); if (!wasMetaSet) target.removeMetadata(mcMMO.CUSTOM_DAMAGE_METAKEY, mcMMO.p); + if (!wasProcessing) + processingNoInvulnDamage = false; } public static void dealNoInvulnerabilityTickDamageRupture(LivingEntity target, double damage, Entity attacker, int toolTier) { From 1c71f1daf5a49dcafabaab1fd07c13fd8eecfc2c Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Wed, 13 Nov 2019 19:56:07 +0000 Subject: [PATCH 11/26] Update changelog --- Changelog.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Changelog.txt b/Changelog.txt index afb6d1384..61573aaa8 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,3 +1,7 @@ +Version 2.1.111 + Further prevent nesting of bleed damage calls + Warn about reparable/salvage configs with missing sections + Version 2.1.110 Fixed a dupe bug Actually fixed Block Cracker From af50699de173d5e0080766db62334e27fbd6cc53 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Tue, 10 Dec 2019 21:35:44 -0800 Subject: [PATCH 12/26] 1.15 changes --- Changelog.txt | 3 +++ pom.xml | 2 +- src/main/resources/experience.yml | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Changelog.txt b/Changelog.txt index 61573aaa8..24111e46d 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,6 +1,9 @@ Version 2.1.111 Further prevent nesting of bleed damage calls Warn about reparable/salvage configs with missing sections + Added Bee combat experience modifier to experience.yml (Update your experience.yml file, see notes) + Breaking a Bee Nest will result in Herbalism XP (Update your experience.yml file, see notes) + Breeding bees will now result in Taming XP (Update your experience.yml file, see notes) Version 2.1.110 Fixed a dupe bug diff --git a/pom.xml b/pom.xml index 558316a82..655cc1cff 100755 --- a/pom.xml +++ b/pom.xml @@ -167,7 +167,7 @@ org.spigotmc spigot-api - 1.14.4-R0.1-SNAPSHOT + 1.15-R0.1-SNAPSHOT provided diff --git a/src/main/resources/experience.yml b/src/main/resources/experience.yml index b4eab61d9..3a43721ea 100644 --- a/src/main/resources/experience.yml +++ b/src/main/resources/experience.yml @@ -275,6 +275,7 @@ Experience_Values: Brown_Mushroom_Block: 70 Mushroom_Stem: 80 Herbalism: + Bee_Nest: 200 Sweet_Berry_Bush: 300 Seagrass: 10 Tall_Seagrass: 10 @@ -441,6 +442,7 @@ Experience_Values: Cat: 500 Fox: 1000 Panda: 1000 + Bee: 100 Combat: Multiplier: Animals: 1.0 @@ -502,4 +504,5 @@ Experience_Values: Ravager: 4.0 Trader_Llama: 1.0 Wandering_trader: 1.0 + Bee: 1.5 From 1104f48ad582fab7c5597ccac0fa87c5aaf11bb3 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Tue, 10 Dec 2019 21:46:09 -0800 Subject: [PATCH 13/26] 2.1.111 --- Changelog.txt | 1 + pom.xml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Changelog.txt b/Changelog.txt index 24111e46d..40d9966b9 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,4 +1,5 @@ Version 2.1.111 + mcMMO is compatible with the following versions of MC: 1.15 / 1.14.4 / 1.14.3 / 1.14.2 / 1.14.1 / 1.14 / 1.13.2 Further prevent nesting of bleed damage calls Warn about reparable/salvage configs with missing sections Added Bee combat experience modifier to experience.yml (Update your experience.yml file, see notes) diff --git a/pom.xml b/pom.xml index 655cc1cff..215dcf653 100755 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 com.gmail.nossr50.mcMMO mcMMO - 2.1.111-SNAPSHOT + 2.1.111 mcMMO https://github.com/mcMMO-Dev/mcMMO From da98be88ad57967d56f97f9a7c4f24ca1e9bc5cb Mon Sep 17 00:00:00 2001 From: nossr50 Date: Tue, 10 Dec 2019 21:51:41 -0800 Subject: [PATCH 14/26] Update changelog --- Changelog.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Changelog.txt b/Changelog.txt index 40d9966b9..c768e4ce3 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -6,6 +6,11 @@ Version 2.1.111 Breaking a Bee Nest will result in Herbalism XP (Update your experience.yml file, see notes) Breeding bees will now result in Taming XP (Update your experience.yml file, see notes) + NOTES: + You will need to update your experience.yml by hand or delete it to get XP from new things in 1.15 + The default version of mcMMO's experience.yml looks like this: https://paste.gg/p/anonymous/15c34df6e60d45d9a3508b379a5e6514 + You'll want to add Bee to combat XP section, and Bee_Nest to Herbalism XP, and Bee to Taming XP section. + Version 2.1.110 Fixed a dupe bug Actually fixed Block Cracker From 601297799f55fc3b0ff21e4dcf9f6313d053daee Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Mon, 16 Dec 2019 01:03:40 +0000 Subject: [PATCH 15/26] Enforce locale usage for enums to ensure correct casing (Fixes #4086) --- Changelog.txt | 3 +++ .../commands/experience/ConvertExperienceCommand.java | 4 +++- .../gmail/nossr50/commands/party/PartyItemShareCommand.java | 6 ++++-- src/main/java/com/gmail/nossr50/config/Config.java | 3 ++- .../com/gmail/nossr50/config/party/ItemWeightConfig.java | 3 ++- .../gmail/nossr50/config/skills/salvage/SalvageConfig.java | 5 +++-- .../java/com/gmail/nossr50/skills/child/ChildConfig.java | 5 +++-- src/main/java/com/gmail/nossr50/util/StringUtils.java | 2 ++ 8 files changed, 22 insertions(+), 9 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index c768e4ce3..5d7139249 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,3 +1,6 @@ +Version 2.1.112 + Correct locale usage for enum access, now enforces using the english locale to prevent issues with oddball locales for configs/commands + Version 2.1.111 mcMMO is compatible with the following versions of MC: 1.15 / 1.14.4 / 1.14.3 / 1.14.2 / 1.14.1 / 1.14 / 1.13.2 Further prevent nesting of bleed damage calls diff --git a/src/main/java/com/gmail/nossr50/commands/experience/ConvertExperienceCommand.java b/src/main/java/com/gmail/nossr50/commands/experience/ConvertExperienceCommand.java index 973214a78..147212bd0 100644 --- a/src/main/java/com/gmail/nossr50/commands/experience/ConvertExperienceCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/experience/ConvertExperienceCommand.java @@ -11,13 +11,15 @@ import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; +import java.util.Locale; + public class ConvertExperienceCommand implements CommandExecutor { @Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { switch (args.length) { case 2: FormulaType previousType = mcMMO.getFormulaManager().getPreviousFormulaType(); - FormulaType newType = FormulaType.getFormulaType(args[1].toUpperCase()); + FormulaType newType = FormulaType.getFormulaType(args[1].toUpperCase(Locale.ENGLISH)); if (newType == FormulaType.UNKNOWN) { sender.sendMessage(LocaleLoader.getString("Commands.mcconvert.Experience.Invalid")); diff --git a/src/main/java/com/gmail/nossr50/commands/party/PartyItemShareCommand.java b/src/main/java/com/gmail/nossr50/commands/party/PartyItemShareCommand.java index e8d8db40d..15f18bf73 100644 --- a/src/main/java/com/gmail/nossr50/commands/party/PartyItemShareCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/party/PartyItemShareCommand.java @@ -14,6 +14,8 @@ import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; +import java.util.Locale; + public class PartyItemShareCommand implements CommandExecutor { @Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { @@ -32,7 +34,7 @@ public class PartyItemShareCommand implements CommandExecutor { switch (args.length) { case 2: - ShareMode mode = ShareMode.getShareMode(args[1].toUpperCase()); + ShareMode mode = ShareMode.getShareMode(args[1].toUpperCase(Locale.ENGLISH)); if (mode == null) { sender.sendMessage(LocaleLoader.getString("Commands.Usage.2", "party", "itemshare", "")); @@ -57,7 +59,7 @@ public class PartyItemShareCommand implements CommandExecutor { } try { - handleToggleItemShareCategory(party, ItemShareType.valueOf(args[1].toUpperCase()), toggle); + handleToggleItemShareCategory(party, ItemShareType.valueOf(args[1].toUpperCase(Locale.ENGLISH)), toggle); } catch (IllegalArgumentException ex) { sender.sendMessage(LocaleLoader.getString("Commands.Usage.2", "party", "itemshare", " ")); diff --git a/src/main/java/com/gmail/nossr50/config/Config.java b/src/main/java/com/gmail/nossr50/config/Config.java index fcbd75545..69e0dc30a 100644 --- a/src/main/java/com/gmail/nossr50/config/Config.java +++ b/src/main/java/com/gmail/nossr50/config/Config.java @@ -12,6 +12,7 @@ import org.bukkit.configuration.ConfigurationSection; import java.util.ArrayList; import java.util.List; +import java.util.Locale; import java.util.Set; public class Config extends AutoUpdateConfigLoader { @@ -277,7 +278,7 @@ public class Config extends AutoUpdateConfigLoader { /* Mob Healthbar */ public MobHealthbarType getMobHealthbarDefault() { try { - return MobHealthbarType.valueOf(config.getString("Mob_Healthbar.Display_Type", "HEARTS").toUpperCase().trim()); + return MobHealthbarType.valueOf(config.getString("Mob_Healthbar.Display_Type", "HEARTS").toUpperCase(Locale.ENGLISH).trim()); } catch (IllegalArgumentException ex) { return MobHealthbarType.HEARTS; diff --git a/src/main/java/com/gmail/nossr50/config/party/ItemWeightConfig.java b/src/main/java/com/gmail/nossr50/config/party/ItemWeightConfig.java index 6e84bd8f6..50af1065b 100644 --- a/src/main/java/com/gmail/nossr50/config/party/ItemWeightConfig.java +++ b/src/main/java/com/gmail/nossr50/config/party/ItemWeightConfig.java @@ -5,6 +5,7 @@ import com.gmail.nossr50.util.StringUtils; import org.bukkit.Material; import java.util.HashSet; +import java.util.Locale; public class ItemWeightConfig extends ConfigLoader { private static ItemWeightConfig instance; @@ -29,7 +30,7 @@ public class ItemWeightConfig extends ConfigLoader { HashSet miscItems = new HashSet(); for (String item : config.getStringList("Party_Shareables.Misc_Items")) { - Material material = Material.getMaterial(item.toUpperCase()); + Material material = Material.getMaterial(item.toUpperCase(Locale.ENGLISH)); if (material != null) { miscItems.add(material); diff --git a/src/main/java/com/gmail/nossr50/config/skills/salvage/SalvageConfig.java b/src/main/java/com/gmail/nossr50/config/skills/salvage/SalvageConfig.java index 2975e6316..dc802c468 100644 --- a/src/main/java/com/gmail/nossr50/config/skills/salvage/SalvageConfig.java +++ b/src/main/java/com/gmail/nossr50/config/skills/salvage/SalvageConfig.java @@ -14,6 +14,7 @@ import org.bukkit.inventory.ItemStack; import java.util.ArrayList; import java.util.List; +import java.util.Locale; import java.util.Set; public class SalvageConfig extends ConfigLoader { @@ -78,7 +79,7 @@ public class SalvageConfig extends ConfigLoader { } else { try { - salvageMaterialType = MaterialType.valueOf(salvageMaterialTypeString.replace(" ", "_").toUpperCase()); + salvageMaterialType = MaterialType.valueOf(salvageMaterialTypeString.replace(" ", "_").toUpperCase(Locale.ENGLISH)); } catch (IllegalArgumentException ex) { reason.add(key + " has an invalid MaterialType of " + salvageMaterialTypeString); @@ -112,7 +113,7 @@ public class SalvageConfig extends ConfigLoader { } else { try { - salvageItemType = ItemType.valueOf(salvageItemTypeString.replace(" ", "_").toUpperCase()); + salvageItemType = ItemType.valueOf(salvageItemTypeString.replace(" ", "_").toUpperCase(Locale.ENGLISH)); } catch (IllegalArgumentException ex) { reason.add(key + " has an invalid ItemType of " + salvageItemTypeString); diff --git a/src/main/java/com/gmail/nossr50/skills/child/ChildConfig.java b/src/main/java/com/gmail/nossr50/skills/child/ChildConfig.java index 91a0c419f..a2cf127a8 100644 --- a/src/main/java/com/gmail/nossr50/skills/child/ChildConfig.java +++ b/src/main/java/com/gmail/nossr50/skills/child/ChildConfig.java @@ -6,6 +6,7 @@ import com.gmail.nossr50.util.StringUtils; import org.bukkit.configuration.file.YamlConfiguration; import java.util.EnumSet; +import java.util.Locale; public class ChildConfig extends AutoUpdateConfigLoader { public ChildConfig() { @@ -27,7 +28,7 @@ public class ChildConfig extends AutoUpdateConfigLoader { for (String name : config.getStringList(StringUtils.getCapitalized(skill.name()))) { try { - PrimarySkillType parentSkill = PrimarySkillType.valueOf(name.toUpperCase()); + PrimarySkillType parentSkill = PrimarySkillType.valueOf(name.toUpperCase(Locale.ENGLISH)); FamilyTree.enforceNotChildSkill(parentSkill); parentSkills.add(parentSkill); } @@ -45,7 +46,7 @@ public class ChildConfig extends AutoUpdateConfigLoader { * If they're dedicated enough to have modified it, they can have the errors it may produce. * Alternatively, this can be used to allow child skills to be parent skills, provided there are no circular dependencies this is an advanced sort of configuration. */ - parentSkills.add(PrimarySkillType.valueOf(name.toUpperCase())); + parentSkills.add(PrimarySkillType.valueOf(name.toUpperCase(Locale.ENGLISH))); } } diff --git a/src/main/java/com/gmail/nossr50/util/StringUtils.java b/src/main/java/com/gmail/nossr50/util/StringUtils.java index 31d1e77d4..24527bc2b 100644 --- a/src/main/java/com/gmail/nossr50/util/StringUtils.java +++ b/src/main/java/com/gmail/nossr50/util/StringUtils.java @@ -7,6 +7,8 @@ import org.bukkit.block.data.Ageable; import org.bukkit.block.data.BlockData; import org.bukkit.entity.EntityType; +import java.util.Locale; + public class StringUtils { /** From 8fd1af4cbfc42dcfd375689e7c78de46bc5d0e3a Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Tue, 31 Dec 2019 12:16:12 +0000 Subject: [PATCH 16/26] Don't cache mob infomation in the updater task --- Changelog.txt | 1 + .../runnables/MobHealthDisplayUpdaterTask.java | 17 +++++++---------- .../gmail/nossr50/util/MobHealthbarUtils.java | 5 +++++ 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index 5d7139249..3269027c9 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,5 +1,6 @@ Version 2.1.112 Correct locale usage for enum access, now enforces using the english locale to prevent issues with oddball locales for configs/commands + Don't cache names in mob health updater task, also; Don't schedule if the entity is already dead Version 2.1.111 mcMMO is compatible with the following versions of MC: 1.15 / 1.14.4 / 1.14.3 / 1.14.2 / 1.14.1 / 1.14 / 1.13.2 diff --git a/src/main/java/com/gmail/nossr50/runnables/MobHealthDisplayUpdaterTask.java b/src/main/java/com/gmail/nossr50/runnables/MobHealthDisplayUpdaterTask.java index a81cc21ed..111ed9482 100644 --- a/src/main/java/com/gmail/nossr50/runnables/MobHealthDisplayUpdaterTask.java +++ b/src/main/java/com/gmail/nossr50/runnables/MobHealthDisplayUpdaterTask.java @@ -6,23 +6,20 @@ import org.bukkit.scheduler.BukkitRunnable; public class MobHealthDisplayUpdaterTask extends BukkitRunnable { private LivingEntity target; - private String oldName; - private boolean oldNameVisible; public MobHealthDisplayUpdaterTask(LivingEntity target) { - if (target.isValid()) { - this.target = target; - this.oldName = target.getMetadata(mcMMO.customNameKey).get(0).asString(); - this.oldNameVisible = target.getMetadata(mcMMO.customVisibleKey).get(0).asBoolean(); - } + this.target = target; } @Override public void run() { - if (target != null && target.isValid()) { - target.setCustomNameVisible(oldNameVisible); - target.setCustomName(oldName); + if (target.hasMetadata(mcMMO.customNameKey)) { + target.setCustomName(target.getMetadata(mcMMO.customNameKey).get(0).asString()); target.removeMetadata(mcMMO.customNameKey, mcMMO.p); + } + + if (target.hasMetadata(mcMMO.customVisibleKey)) { + target.setCustomNameVisible(target.getMetadata(mcMMO.customVisibleKey).get(0).asBoolean()); target.removeMetadata(mcMMO.customVisibleKey, mcMMO.p); } } diff --git a/src/main/java/com/gmail/nossr50/util/MobHealthbarUtils.java b/src/main/java/com/gmail/nossr50/util/MobHealthbarUtils.java index 9c40f8aa6..815ab39e3 100644 --- a/src/main/java/com/gmail/nossr50/util/MobHealthbarUtils.java +++ b/src/main/java/com/gmail/nossr50/util/MobHealthbarUtils.java @@ -60,6 +60,11 @@ public final class MobHealthbarUtils { return; } + // Don't mangle invalid entities, they're not going to be rendered anyways + if (!target.isValid()) { + return; + } + boolean oldNameVisible = target.isCustomNameVisible(); String newName = createHealthDisplay(Config.getInstance().getMobHealthbarDefault(), target, damage); From 3cbbf1bee02aa6cfd3127730255f56a976597340 Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Tue, 31 Dec 2019 12:17:03 +0000 Subject: [PATCH 17/26] Move valid check higher up, no need to set additional metadata --- .../java/com/gmail/nossr50/util/MobHealthbarUtils.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/util/MobHealthbarUtils.java b/src/main/java/com/gmail/nossr50/util/MobHealthbarUtils.java index 815ab39e3..4f17d0955 100644 --- a/src/main/java/com/gmail/nossr50/util/MobHealthbarUtils.java +++ b/src/main/java/com/gmail/nossr50/util/MobHealthbarUtils.java @@ -44,6 +44,11 @@ public final class MobHealthbarUtils { return; } + // Don't mangle invalid entities, they're not going to be rendered anyways + if (!target.isValid()) { + return; + } + String originalName = target.getName(); String oldName = target.getCustomName(); @@ -60,10 +65,6 @@ public final class MobHealthbarUtils { return; } - // Don't mangle invalid entities, they're not going to be rendered anyways - if (!target.isValid()) { - return; - } boolean oldNameVisible = target.isCustomNameVisible(); String newName = createHealthDisplay(Config.getInstance().getMobHealthbarDefault(), target, damage); From 41bdca948a66dac4b7e93983af3987ebfb3b5a8b Mon Sep 17 00:00:00 2001 From: nossr50 Date: Mon, 13 Jan 2020 19:28:28 -0800 Subject: [PATCH 18/26] Update POM for 1.15.1 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 215dcf653..669566eb1 100755 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 com.gmail.nossr50.mcMMO mcMMO - 2.1.111 + 2.1.112-SNAPSHOT mcMMO https://github.com/mcMMO-Dev/mcMMO @@ -167,7 +167,7 @@ org.spigotmc spigot-api - 1.15-R0.1-SNAPSHOT + 1.15.1-R0.1-SNAPSHOT provided From 24b3bf110027a122878b5fe47a0ed91c50e25b77 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Tue, 14 Jan 2020 19:44:17 -0800 Subject: [PATCH 19/26] NPE fix for combat on unloaded profiles --- Changelog.txt | 4 ++- .../nossr50/listeners/BlockListener.java | 2 -- .../com/gmail/nossr50/util/StringUtils.java | 2 -- .../nossr50/util/skills/CombatUtils.java | 26 +++++++++++++++++-- .../nossr50/worldguard/WorldGuardManager.java | 1 - 5 files changed, 27 insertions(+), 8 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index 3269027c9..4ed552cee 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,6 +1,8 @@ Version 2.1.112 Correct locale usage for enum access, now enforces using the english locale to prevent issues with oddball locales for configs/commands - Don't cache names in mob health updater task, also; Don't schedule if the entity is already dead + Fixed a NPE that can occur if a player engages in combat with specific skills before their profile is loaded + mcMMO is now more compatible with certain mob stacking plugins + Improved behaviour for mob health bars Version 2.1.111 mcMMO is compatible with the following versions of MC: 1.15 / 1.14.4 / 1.14.3 / 1.14.2 / 1.14.1 / 1.14 / 1.13.2 diff --git a/src/main/java/com/gmail/nossr50/listeners/BlockListener.java b/src/main/java/com/gmail/nossr50/listeners/BlockListener.java index a57735b08..308ca9ade 100644 --- a/src/main/java/com/gmail/nossr50/listeners/BlockListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/BlockListener.java @@ -1,6 +1,5 @@ package com.gmail.nossr50.listeners; -import com.gmail.nossr50.config.AdvancedConfig; import com.gmail.nossr50.config.Config; import com.gmail.nossr50.config.HiddenConfig; import com.gmail.nossr50.config.WorldBlacklist; @@ -44,7 +43,6 @@ import org.bukkit.metadata.MetadataValue; import java.util.HashSet; import java.util.List; -import java.util.Set; public class BlockListener implements Listener { private final mcMMO plugin; diff --git a/src/main/java/com/gmail/nossr50/util/StringUtils.java b/src/main/java/com/gmail/nossr50/util/StringUtils.java index 24527bc2b..31d1e77d4 100644 --- a/src/main/java/com/gmail/nossr50/util/StringUtils.java +++ b/src/main/java/com/gmail/nossr50/util/StringUtils.java @@ -7,8 +7,6 @@ import org.bukkit.block.data.Ageable; import org.bukkit.block.data.BlockData; import org.bukkit.entity.EntityType; -import java.util.Locale; - public class StringUtils { /** 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 f52499450..00610ade5 100644 --- a/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java +++ b/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java @@ -39,8 +39,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import javax.annotation.Nullable; - public final class CombatUtils { private CombatUtils() {} @@ -50,6 +48,12 @@ public final class CombatUtils { } McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player); + + //Make sure the profiles been loaded + if(mcMMOPlayer == null) { + return; + } + SwordsManager swordsManager = mcMMOPlayer.getSwordsManager(); double initialDamage = event.getDamage(); double finalDamage = initialDamage; @@ -96,6 +100,12 @@ public final class CombatUtils { Map modifiers = getModifiers(event); McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player); + + //Make sure the profiles been loaded + if(mcMMOPlayer == null) { + return; + } + AxesManager axesManager = mcMMOPlayer.getAxesManager(); if (axesManager.canActivateAbility()) { @@ -139,6 +149,12 @@ public final class CombatUtils { double finalDamage = initialDamage; McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player); + + //Make sure the profiles been loaded + if(mcMMOPlayer == null) { + return; + } + UnarmedManager unarmedManager = mcMMOPlayer.getUnarmedManager(); if (unarmedManager.canActivateAbility()) { @@ -209,6 +225,12 @@ public final class CombatUtils { double initialDamage = event.getDamage(); McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player); + + //Make sure the profiles been loaded + if(mcMMOPlayer == null) { + return; + } + ArcheryManager archeryManager = mcMMOPlayer.getArcheryManager(); double finalDamage = event.getDamage(); diff --git a/src/main/java/com/gmail/nossr50/worldguard/WorldGuardManager.java b/src/main/java/com/gmail/nossr50/worldguard/WorldGuardManager.java index fecd8f6a2..cf4d83d15 100644 --- a/src/main/java/com/gmail/nossr50/worldguard/WorldGuardManager.java +++ b/src/main/java/com/gmail/nossr50/worldguard/WorldGuardManager.java @@ -1,6 +1,5 @@ package com.gmail.nossr50.worldguard; -import com.gmail.nossr50.mcMMO; import com.sk89q.worldedit.bukkit.BukkitAdapter; import com.sk89q.worldedit.bukkit.BukkitPlayer; import com.sk89q.worldguard.WorldGuard; From 7c156319be68b83c4be3b889a4d0037b1bc227ae Mon Sep 17 00:00:00 2001 From: nossr50 Date: Tue, 14 Jan 2020 19:53:37 -0800 Subject: [PATCH 20/26] Skill Shot is now multiplicative instead of additive --- Changelog.txt | 1 + src/main/java/com/gmail/nossr50/skills/archery/Archery.java | 2 +- src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index 4ed552cee..d16ba5df5 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -3,6 +3,7 @@ Version 2.1.112 Fixed a NPE that can occur if a player engages in combat with specific skills before their profile is loaded mcMMO is now more compatible with certain mob stacking plugins Improved behaviour for mob health bars + Archery's Skill Shot bonus damage is now multiplicative instead of additive (nerfing early game skill shot ranks) Version 2.1.111 mcMMO is compatible with the following versions of MC: 1.15 / 1.14.4 / 1.14.3 / 1.14.2 / 1.14.1 / 1.14 / 1.13.2 diff --git a/src/main/java/com/gmail/nossr50/skills/archery/Archery.java b/src/main/java/com/gmail/nossr50/skills/archery/Archery.java index 25e5d2ec5..d94bc1d6e 100644 --- a/src/main/java/com/gmail/nossr50/skills/archery/Archery.java +++ b/src/main/java/com/gmail/nossr50/skills/archery/Archery.java @@ -70,6 +70,6 @@ public class Archery { } public static double getDamageBonusPercent(Player player) { - return ((RankUtils.getRank(player, SubSkillType.ARCHERY_SKILL_SHOT)) * AdvancedConfig.getInstance().getSkillShotRankDamageMultiplier()) / 100.0D; + return ((RankUtils.getRank(player, SubSkillType.ARCHERY_SKILL_SHOT)) * (AdvancedConfig.getInstance().getSkillShotRankDamageMultiplier()) / 100.0D); } } 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 00610ade5..d29a66c03 100644 --- a/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java +++ b/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java @@ -248,7 +248,8 @@ public final class CombatUtils { } if (archeryManager.canSkillShot()) { - finalDamage+=archeryManager.skillShot(initialDamage); + //not additive + finalDamage = archeryManager.skillShot(initialDamage); } if (archeryManager.canDaze(target)) { From a118d8465e7dbd591d4e9313e02364cf2fa05171 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Tue, 14 Jan 2020 19:57:38 -0800 Subject: [PATCH 21/26] Sweet Berry Bush nerf --- Changelog.txt | 1 + src/main/resources/experience.yml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Changelog.txt b/Changelog.txt index d16ba5df5..4f1e6c865 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -4,6 +4,7 @@ Version 2.1.112 mcMMO is now more compatible with certain mob stacking plugins Improved behaviour for mob health bars Archery's Skill Shot bonus damage is now multiplicative instead of additive (nerfing early game skill shot ranks) + Sweet Berry Bush's default Herbalism XP is now 50 instead of 300 (Update your experience.yml or delete it to generate a new one) Version 2.1.111 mcMMO is compatible with the following versions of MC: 1.15 / 1.14.4 / 1.14.3 / 1.14.2 / 1.14.1 / 1.14 / 1.13.2 diff --git a/src/main/resources/experience.yml b/src/main/resources/experience.yml index 3a43721ea..24496392a 100644 --- a/src/main/resources/experience.yml +++ b/src/main/resources/experience.yml @@ -276,7 +276,7 @@ Experience_Values: Mushroom_Stem: 80 Herbalism: Bee_Nest: 200 - Sweet_Berry_Bush: 300 + Sweet_Berry_Bush: 50 Seagrass: 10 Tall_Seagrass: 10 Kelp: 3 From ceaff0c8621f9e780fbe95688a5e91e69353e65f Mon Sep 17 00:00:00 2001 From: nossr50 Date: Tue, 14 Jan 2020 20:09:41 -0800 Subject: [PATCH 22/26] SkillShot tweaks --- src/main/java/com/gmail/nossr50/skills/archery/Archery.java | 2 +- src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/skills/archery/Archery.java b/src/main/java/com/gmail/nossr50/skills/archery/Archery.java index d94bc1d6e..9d3634e46 100644 --- a/src/main/java/com/gmail/nossr50/skills/archery/Archery.java +++ b/src/main/java/com/gmail/nossr50/skills/archery/Archery.java @@ -66,7 +66,7 @@ public class Archery { { double damageBonusPercent = getDamageBonusPercent(player); double newDamage = oldDamage + (oldDamage * damageBonusPercent); - return Math.min(newDamage, Archery.skillShotMaxBonusDamage); + return Math.min(newDamage, (oldDamage + Archery.skillShotMaxBonusDamage)); } public static double getDamageBonusPercent(Player player) { 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 d29a66c03..bf5539c0b 100644 --- a/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java +++ b/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java @@ -248,7 +248,7 @@ public final class CombatUtils { } if (archeryManager.canSkillShot()) { - //not additive + //Not Additive finalDamage = archeryManager.skillShot(initialDamage); } From d892bfe83a0af53e7c1333f85d0bba4d98342547 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Tue, 14 Jan 2020 20:10:33 -0800 Subject: [PATCH 23/26] 2.1.112 --- 1 | 11 +++++++++++ pom.xml | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 1 diff --git a/1 b/1 new file mode 100644 index 000000000..c0087c86d --- /dev/null +++ b/1 @@ -0,0 +1,11 @@ +SkillShot tweaks +# Please enter the commit message for your changes. Lines starting +# with '#' will be ignored, and an empty message aborts the commit. +# +# On branch master +# Your branch is up to date with 'origin/master'. +# +# Changes to be committed: +# modified: src/main/java/com/gmail/nossr50/skills/archery/Archery.java +# modified: src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java +# diff --git a/pom.xml b/pom.xml index 669566eb1..1d96392ab 100755 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 com.gmail.nossr50.mcMMO mcMMO - 2.1.112-SNAPSHOT + 2.1.112 mcMMO https://github.com/mcMMO-Dev/mcMMO From de5a8babc59e3e9fb8e70f21e1a1eaf68346ae3b Mon Sep 17 00:00:00 2001 From: nossr50 Date: Wed, 15 Jan 2020 13:21:33 -0800 Subject: [PATCH 24/26] dev mode --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 1d96392ab..fb6f36e08 100755 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 com.gmail.nossr50.mcMMO mcMMO - 2.1.112 + 2.1.113-SNAPSHOT mcMMO https://github.com/mcMMO-Dev/mcMMO From d4adb490e2b4c31b68be4770161c3985b3296f4b Mon Sep 17 00:00:00 2001 From: t00thpick1 Date: Wed, 15 Jan 2020 13:32:10 -0800 Subject: [PATCH 25/26] Fixing PTP exploit --- .../commands/party/teleport/PtpCommand.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpCommand.java b/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpCommand.java index 5ba7b5654..8d046c8fb 100644 --- a/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpCommand.java @@ -19,6 +19,7 @@ import com.gmail.nossr50.util.skills.SkillUtils; import com.gmail.nossr50.worldguard.WorldGuardManager; import com.gmail.nossr50.worldguard.WorldGuardUtils; import com.google.common.collect.ImmutableList; +import org.bukkit.World; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; @@ -168,6 +169,23 @@ public class PtpCommand implements TabExecutor { McMMOPlayer mcMMOTarget = UserManager.getPlayer(targetName); Player target = mcMMOTarget.getPlayer(); + + if (Config.getInstance().getPTPCommandWorldPermissions()) { + World targetWorld = target.getWorld(); + World playerWorld = player.getWorld(); + + if (!Permissions.partyTeleportAllWorlds(player)) { + if (!Permissions.partyTeleportWorld(target, targetWorld)) { + player.sendMessage(LocaleLoader.getString("Commands.ptp.NoWorldPermissions", targetWorld.getName())); + return; + } + else if (targetWorld != playerWorld && !Permissions.partyTeleportWorld(player, targetWorld)) { + player.sendMessage(LocaleLoader.getString("Commands.ptp.NoWorldPermissions", targetWorld.getName())); + return; + } + } + } + PartyTeleportRecord ptpRecord = mcMMOTarget.getPartyTeleportRecord(); if (!ptpRecord.isConfirmRequired()) { From 421a394f68fc714899f167dc3faf53114b8469ce Mon Sep 17 00:00:00 2001 From: t00thpick1 Date: Wed, 15 Jan 2020 13:49:11 -0800 Subject: [PATCH 26/26] Another check for PTP exploit --- .../runnables/items/TeleportationWarmup.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/main/java/com/gmail/nossr50/runnables/items/TeleportationWarmup.java b/src/main/java/com/gmail/nossr50/runnables/items/TeleportationWarmup.java index 3a72c3790..d9a62429b 100644 --- a/src/main/java/com/gmail/nossr50/runnables/items/TeleportationWarmup.java +++ b/src/main/java/com/gmail/nossr50/runnables/items/TeleportationWarmup.java @@ -6,8 +6,10 @@ import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.party.PartyManager; import com.gmail.nossr50.util.EventUtils; import com.gmail.nossr50.util.Misc; +import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.skills.SkillUtils; import org.bukkit.Location; +import org.bukkit.World; import org.bukkit.entity.Player; import org.bukkit.scheduler.BukkitRunnable; @@ -51,6 +53,23 @@ public class TeleportationWarmup extends BukkitRunnable { } } + if (Config.getInstance().getPTPCommandWorldPermissions()) { + World targetWorld = targetPlayer.getWorld(); + World playerWorld = teleportingPlayer.getWorld(); + + if (!Permissions.partyTeleportAllWorlds(teleportingPlayer)) { + if (!Permissions.partyTeleportWorld(targetPlayer, targetWorld)) { + teleportingPlayer.sendMessage(LocaleLoader.getString("Commands.ptp.NoWorldPermissions", targetWorld.getName())); + return; + } + else if (targetWorld != playerWorld && !Permissions.partyTeleportWorld(teleportingPlayer, targetWorld)) { + teleportingPlayer.sendMessage(LocaleLoader.getString("Commands.ptp.NoWorldPermissions", targetWorld.getName())); + return; + } + } + } + + EventUtils.handlePartyTeleportEvent(teleportingPlayer, targetPlayer); } }