From 5d294d6dc3040baa00638e44c67d787513cd82d0 Mon Sep 17 00:00:00 2001 From: kn-km <974787396@qq.com> Date: Mon, 27 Jul 2020 22:55:44 +0800 Subject: [PATCH 1/8] Fix #4234 --- .../java/com/gmail/nossr50/skills/salvage/SalvageManager.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/gmail/nossr50/skills/salvage/SalvageManager.java b/src/main/java/com/gmail/nossr50/skills/salvage/SalvageManager.java index 7eab2c9dc..cb4374b5a 100644 --- a/src/main/java/com/gmail/nossr50/skills/salvage/SalvageManager.java +++ b/src/main/java/com/gmail/nossr50/skills/salvage/SalvageManager.java @@ -100,7 +100,6 @@ public class SalvageManager extends SkillManager { potentialSalvageYield = Math.min(potentialSalvageYield, getSalvageLimit()); // Always get at least something back, if you're capable of salvaging it. - player.getInventory().setItemInMainHand(new ItemStack(Material.AIR)); location.add(0.5, 1, 0.5); Map enchants = item.getEnchantments(); @@ -140,6 +139,8 @@ public class SalvageManager extends SkillManager { return; } + player.getInventory().setItemInMainHand(new ItemStack(Material.AIR)); + Location anvilLoc = location.clone(); Location playerLoc = player.getLocation().clone(); double distance = anvilLoc.distance(playerLoc); From ed9521d4a048dfb7b7dc169802cfbc0b9d8247be Mon Sep 17 00:00:00 2001 From: kn-km <974787396@qq.com> Date: Mon, 27 Jul 2020 23:18:55 +0800 Subject: [PATCH 2/8] Fix #4234 --- .../java/com/gmail/nossr50/skills/repair/RepairManager.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/skills/repair/RepairManager.java b/src/main/java/com/gmail/nossr50/skills/repair/RepairManager.java index ab4a98fbe..910c3f5bf 100644 --- a/src/main/java/com/gmail/nossr50/skills/repair/RepairManager.java +++ b/src/main/java/com/gmail/nossr50/skills/repair/RepairManager.java @@ -128,6 +128,9 @@ public class RepairManager extends SkillManager { int baseRepairAmount = repairable.getBaseRepairDurability(item); // Did they send me daughters? short newDurability = repairCalculate(startDurability, baseRepairAmount); // When I asked for sons? + // toRemove should be refreshed before the event call. + toRemove = inventory.getItem(inventory.first(repairMaterial)).clone(); + // Call event if (EventUtils.callRepairCheckEvent(player, (short) (startDurability - newDurability), toRemove, item).isCancelled()) { return; @@ -139,7 +142,6 @@ public class RepairManager extends SkillManager { } // Remove the item - toRemove = inventory.getItem(inventory.first(repairMaterial)).clone(); toRemove.setAmount(1); inventory.removeItem(toRemove); @@ -393,4 +395,4 @@ public class RepairManager extends SkillManager { public void actualizeLastAnvilUse() { lastClick = (int) (System.currentTimeMillis() / Misc.TIME_CONVERSION_FACTOR); } -} \ No newline at end of file +} From c85ca2e2caa4c82d7769c1a06323d52a171888b1 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Fri, 31 Jul 2020 20:46:52 -0700 Subject: [PATCH 3/8] Dev mode --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 92c633a5f..cc7252461 100755 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 com.gmail.nossr50.mcMMO mcMMO - 2.1.138 + 2.1.139-SNAPSHOT mcMMO https://github.com/mcMMO-Dev/mcMMO From 01f111f78da1b4b86e894fa1436b50d99641b000 Mon Sep 17 00:00:00 2001 From: t00thpick1 Date: Sun, 2 Aug 2020 12:56:27 -0400 Subject: [PATCH 4/8] Switch to countdown latch so we don't need to bother with synchronization blocks. Fixes #4248 --- .../runnables/database/UUIDUpdateAsyncTask.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/runnables/database/UUIDUpdateAsyncTask.java b/src/main/java/com/gmail/nossr50/runnables/database/UUIDUpdateAsyncTask.java index 7a3901834..6c2c13822 100644 --- a/src/main/java/com/gmail/nossr50/runnables/database/UUIDUpdateAsyncTask.java +++ b/src/main/java/com/gmail/nossr50/runnables/database/UUIDUpdateAsyncTask.java @@ -17,6 +17,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.UUID; +import java.util.concurrent.CountDownLatch; import java.util.logging.Level; public class UUIDUpdateAsyncTask implements Runnable { @@ -29,7 +30,7 @@ public class UUIDUpdateAsyncTask implements Runnable { private static final int BATCH_SIZE = 100; // 100 at a time - private final Object awaiter = new Object(); + private final CountDownLatch awaiter = new CountDownLatch(1); private final mcMMO plugin; private final ImmutableList userNames; private int position = 0; @@ -98,12 +99,10 @@ public class UUIDUpdateAsyncTask implements Runnable { position += batch.size(); plugin.getLogger().info(String.format("Conversion progress: %d/%d users", position, userNames.size())); - if (position == userNames.size()) - { + if (position == userNames.size()) { mcMMO.getUpgradeManager().setUpgradeCompleted(UpgradeType.ADD_UUIDS); - awaiter.notify(); - } - else + awaiter.countDown(); + } else this.runTaskLaterAsynchronously(plugin, Misc.TICK_CONVERSION_FACTOR * DELAY_PERIOD); // Schedule next batch } @@ -122,7 +121,7 @@ public class UUIDUpdateAsyncTask implements Runnable { public void waitUntilFinished() { try { - awaiter.wait(); + awaiter.await(); } catch (InterruptedException e) { // I guess we don't care in this event } From 375292c0b36ec5a3f20baec29df72cd356ab0cab Mon Sep 17 00:00:00 2001 From: Flannery Lue Moore Date: Thu, 6 Aug 2020 22:22:48 +0000 Subject: [PATCH 5/8] PR for gilded blackstone and nether gold ore to the mining skill, and nether gold ore to the smelting skill. (#4253) * Added gilded blackstone and nether gold ore. * Added nether gold ore to smelting xp. --- src/main/java/com/gmail/nossr50/util/MaterialMapStore.java | 2 ++ src/main/resources/experience.yml | 1 + 2 files changed, 3 insertions(+) diff --git a/src/main/java/com/gmail/nossr50/util/MaterialMapStore.java b/src/main/java/com/gmail/nossr50/util/MaterialMapStore.java index 3ca4370f9..dcdd766f2 100644 --- a/src/main/java/com/gmail/nossr50/util/MaterialMapStore.java +++ b/src/main/java/com/gmail/nossr50/util/MaterialMapStore.java @@ -201,6 +201,8 @@ public class MaterialMapStore { ores.add("redstone_ore"); ores.add("emerald_ore"); ores.add("ancient_debris"); + ores.add("nether_gold_ore"); + ores.add("gilded_blackstone"); } private void fillArmors() { diff --git a/src/main/resources/experience.yml b/src/main/resources/experience.yml index e36f00ab4..f8ed15f62 100644 --- a/src/main/resources/experience.yml +++ b/src/main/resources/experience.yml @@ -464,6 +464,7 @@ Experience_Values: Lapis_Ore: 40 Nether_Quartz_Ore: 25 Redstone_Ore: 15 + Nether_Gold_Ore: 35 Taming: Animal_Taming: Llama: 1200 From 38017cabe7949eb25b6c32fbf7af70264fa7b007 Mon Sep 17 00:00:00 2001 From: emanondev <38587650+emanondev@users.noreply.github.com> Date: Fri, 7 Aug 2020 03:46:12 +0200 Subject: [PATCH 6/8] fixed /mmoinfo roll (#4088) * acrobatics roll mmoinfo fixes LocaleLoader#getString() accepts Object arrays no need to call getStats twice Max skill level is now configurable and so halfMaxSkillValue is now a variable which should be used on locale too instead of "50" * Updated locale_it Acrobatics.SubSkill.Roll.Mechanics supports half level variable instead of static level 50 * Updated locale_en_US Acrobatics.SubSkill.Roll.Mechanics supports half level variable instead of static level 50 * Updated Locale it fixed value --- .../datatypes/skills/subskills/acrobatics/Roll.java | 11 +++++++---- src/main/resources/locale/locale_en_US.properties | 2 +- src/main/resources/locale/locale_it.properties | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/datatypes/skills/subskills/acrobatics/Roll.java b/src/main/java/com/gmail/nossr50/datatypes/skills/subskills/acrobatics/Roll.java index 0718fec8c..9c233ae5e 100644 --- a/src/main/java/com/gmail/nossr50/datatypes/skills/subskills/acrobatics/Roll.java +++ b/src/main/java/com/gmail/nossr50/datatypes/skills/subskills/acrobatics/Roll.java @@ -337,7 +337,7 @@ public class Roll extends AcrobaticsSubSkill { //player.sendMessage(getDescription()); //Player stats player.sendMessage(LocaleLoader.getString("Commands.MmoInfo.Stats", - LocaleLoader.getString("Acrobatics.SubSkill.Roll.Stats", getStats(player)[0], getStats(player)[1]))); + LocaleLoader.getString("Acrobatics.SubSkill.Roll.Stats", getStats(player)))); //Mechanics player.sendMessage(LocaleLoader.getString("Commands.MmoInfo.Mechanics")); @@ -357,6 +357,9 @@ public class Roll extends AcrobaticsSubSkill { //1 = chance to roll with grace at half max level //2 = level where maximum bonus is reached //3 = additive chance to succeed per level + //4 = damage threshold when rolling + //5 = damage threshold when rolling with grace + //6 = half of level where maximum bonus is reached /* Roll: # ChanceMax: Maximum chance of rolling when on or higher @@ -370,7 +373,7 @@ public class Roll extends AcrobaticsSubSkill { //Chance to roll at half max skill RandomChanceSkill rollHalfMaxSkill = new RandomChanceSkill(null, subSkillType); - int halfMaxSkillValue = mcMMO.isRetroModeEnabled() ? 500 : 50; + int halfMaxSkillValue = AdvancedConfig.getInstance().getMaxBonusLevel(SubSkillType.ACROBATICS_ROLL)/2; rollHalfMaxSkill.setSkillLevel(halfMaxSkillValue); //Chance to graceful roll at full skill @@ -390,7 +393,7 @@ public class Roll extends AcrobaticsSubSkill { double maxLevel = AdvancedConfig.getInstance().getMaxBonusLevel(SubSkillType.ACROBATICS_ROLL); - return LocaleLoader.getString("Acrobatics.SubSkill.Roll.Mechanics", rollChanceHalfMax, graceChanceHalfMax, maxLevel, chancePerLevel, damageThreshold, damageThreshold * 2); + return LocaleLoader.getString("Acrobatics.SubSkill.Roll.Mechanics", rollChanceHalfMax, graceChanceHalfMax, maxLevel, chancePerLevel, damageThreshold, damageThreshold * 2,halfMaxSkillValue); } /** @@ -425,4 +428,4 @@ public class Roll extends AcrobaticsSubSkill { { return player.getLocation().getBlock().getLocation(); } -} \ No newline at end of file +} diff --git a/src/main/resources/locale/locale_en_US.properties b/src/main/resources/locale/locale_en_US.properties index 869b99c3e..dc65d0b2f 100644 --- a/src/main/resources/locale/locale_en_US.properties +++ b/src/main/resources/locale/locale_en_US.properties @@ -138,7 +138,7 @@ Acrobatics.SubSkill.Roll.Name=Roll Acrobatics.SubSkill.Roll.Description=Land strategically to avoid damage. Acrobatics.SubSkill.Roll.Chance=Roll Chance: [[YELLOW]]{0} Acrobatics.SubSkill.Roll.GraceChance=Graceful Roll Chance: [[YELLOW]]{0} -Acrobatics.SubSkill.Roll.Mechanics=[[GRAY]]Rolling is an active Sub-Skill with a passive component.\nWhenever you take fall damage you have a chance to completely negate the damage based on your skill level, at level 50 you have a [[YELLOW]]{0}%[[GRAY]] chance to prevent damage, and [[YELLOW]]{1}%[[GRAY]] if you activate Graceful Roll.\nThe chance for success is scaled against your skill level in a linear curve until level [[YELLOW]]{2}[[GRAY]] where it maxes out, every level in Acrobatics gives you a [[YELLOW]]{3}%[[GRAY]] chance to succeed.\nBy holding the sneak button you can double your odds to avoid fall damage and avoid up to twice the fall damage! Holding sneak will transform a normal roll into a Graceful Roll.\nRolling will only prevent up to [[RED]]{4}[[GRAY]] damage. Graceful Rolls will prevent up to [[GREEN]]{5}[[GRAY]] damage. +Acrobatics.SubSkill.Roll.Mechanics=[[GRAY]]Rolling is an active Sub-Skill with a passive component.\nWhenever you take fall damage you have a chance to completely negate the damage based on your skill level, at level [[YELLOW]]{6}%[[GRAY]] you have a [[YELLOW]]{0}%[[GRAY]] chance to prevent damage, and [[YELLOW]]{1}%[[GRAY]] if you activate Graceful Roll.\nThe chance for success is scaled against your skill level in a linear curve until level [[YELLOW]]{2}[[GRAY]] where it maxes out, every level in Acrobatics gives you a [[YELLOW]]{3}%[[GRAY]] chance to succeed.\nBy holding the sneak button you can double your odds to avoid fall damage and avoid up to twice the fall damage! Holding sneak will transform a normal roll into a Graceful Roll.\nRolling will only prevent up to [[RED]]{4}[[GRAY]] damage. Graceful Rolls will prevent up to [[GREEN]]{5}[[GRAY]] damage. Acrobatics.SubSkill.GracefulRoll.Name=Graceful Roll Acrobatics.SubSkill.GracefulRoll.Description=Twice as effective as a normal Roll Acrobatics.SubSkill.Dodge.Name=Dodge diff --git a/src/main/resources/locale/locale_it.properties b/src/main/resources/locale/locale_it.properties index 2f23681c3..7fcf079c9 100644 --- a/src/main/resources/locale/locale_it.properties +++ b/src/main/resources/locale/locale_it.properties @@ -142,7 +142,7 @@ Acrobatics.SubSkill.Roll.Name=Capriola Acrobatics.SubSkill.Roll.Description=Atterra strategicamente per evitare danni. Acrobatics.SubSkill.Roll.Chance=Possibilit\u00E0 di Capriola: [[YELLOW]]{0} Acrobatics.SubSkill.Roll.GraceChance=Possibilit\u00E0 di Capriola Aggraziata: [[YELLOW]]{0} -Acrobatics.SubSkill.Roll.Mechanics=[[GRAY]]La Capriola \u00E8 una Sotto-Abilit\u00E0 attiva con una componente passiva.\nOgni volta che subisci un danno da caduta hai la possibilit\u00E0 di annullare completamente il danno in base al tuo livello di abilit\u00E0, al livello 50 hai il [[YELLOW]]{0}%[[GRAY]] di possibilit\u00E0 di prevenire il danno, e il [[YELLOW]]{1}%[[GRAY]] se attivi Capriola Aggraziata.\nLe possibilit\u00E0 di successo sono scalate rispetto al tuo livello di abilit\u00E0 con una curva lineare fino al livello [[YELLOW]]{2}[[GRAY]] dove diventa massima, ogni livello in Acrobatica ti d\u00E0 il [[YELLOW]]{3}%[[GRAY]] di possibilit\u00E0 di successo.\nTenendo premuto il pulsante di accovacciamento puoi raddoppiare le tue probabilit\u00E0 di evitare i danni da caduta ed evitare fino al doppio del danno da caduta! Stando accovacciato trasformer\u00E0 una capriola normale in una Capriola Aggraziata.\nLe Capriole impediscono solo fino a [[RED]]{4}[[GRAY]] danni. Le Capriole Aggraziate impediscono fino a [[GREEN]]{5}[[GRAY]] danni. +Acrobatics.SubSkill.Roll.Mechanics=[[GRAY]]La Capriola \u00E8 una Sotto-Abilit\u00E0 attiva con una componente passiva.\nOgni volta che subisci un danno da caduta hai la possibilit\u00E0 di annullare completamente il danno in base al tuo livello di abilit\u00E0, al livello [[YELLOW]]{6}%[[GRAY]] hai il [[YELLOW]]{0}%[[GRAY]] di possibilit\u00E0 di prevenire il danno, e il [[YELLOW]]{1}%[[GRAY]] se attivi Capriola Aggraziata.\nLe possibilit\u00E0 di successo sono scalate rispetto al tuo livello di abilit\u00E0 con una curva lineare fino al livello [[YELLOW]]{2}[[GRAY]] dove diventa massima, ogni livello in Acrobatica ti d\u00E0 il [[YELLOW]]{3}%[[GRAY]] di possibilit\u00E0 di successo.\nTenendo premuto il pulsante di accovacciamento puoi raddoppiare le tue probabilit\u00E0 di evitare i danni da caduta ed evitare fino al doppio del danno da caduta! Stando accovacciato trasformer\u00E0 una capriola normale in una Capriola Aggraziata.\nLe Capriole impediscono solo fino a [[RED]]{4}[[GRAY]] danni. Le Capriole Aggraziate impediscono fino a [[GREEN]]{5}[[GRAY]] danni. Acrobatics.SubSkill.GracefulRoll.Name=Capriola Aggraziata Acrobatics.SubSkill.GracefulRoll.Description=Due volte pi\u00F9 efficace di una normale Capriola Acrobatics.SubSkill.Dodge.Name=Schivata From 4a4fd9fb75061f8af3473f186f99379154dda40e Mon Sep 17 00:00:00 2001 From: nossr50 Date: Thu, 6 Aug 2020 18:50:24 -0700 Subject: [PATCH 7/8] 2.1.139 --- Changelog.txt | 6 ++++++ pom.xml | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Changelog.txt b/Changelog.txt index e2a567466..224e570ae 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,3 +1,9 @@ +Version 2.1.139 + Code used to fetch UUIDs was reworked to avoid a scenario where it failed (thanks t00thpick1) + Added 'Netherite_Gold_Ore' to Smelting XP tables (thanks Quavelan) + Added 'Gilded_Blackstone' and 'Nether_Gold_Ore' to code used to determine what can activate Super Breaker in certain situations (thanks Quavelan) + MMOinfo for Roll was corrected (thanks emanondev) + Version 2.1.138 Fixed a bug where Netherite weapons/tools/armor weren't applying correct values in some skill calculations diff --git a/pom.xml b/pom.xml index cc7252461..877fb5f5d 100755 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 com.gmail.nossr50.mcMMO mcMMO - 2.1.139-SNAPSHOT + 2.1.139 mcMMO https://github.com/mcMMO-Dev/mcMMO From 8df15a4e55b27af7ac0fc72d587acc2bdf5b966a Mon Sep 17 00:00:00 2001 From: nossr50 Date: Thu, 6 Aug 2020 19:01:36 -0700 Subject: [PATCH 8/8] dev mode --- Changelog.txt | 4 ++-- pom.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index 224e570ae..9e5d912fa 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,7 +1,7 @@ Version 2.1.139 Code used to fetch UUIDs was reworked to avoid a scenario where it failed (thanks t00thpick1) - Added 'Netherite_Gold_Ore' to Smelting XP tables (thanks Quavelan) - Added 'Gilded_Blackstone' and 'Nether_Gold_Ore' to code used to determine what can activate Super Breaker in certain situations (thanks Quavelan) + Added 'Netherite_Gold_Ore' to Smelting XP tables (thanks Quavelen) + Added 'Gilded_Blackstone' and 'Nether_Gold_Ore' to code used to determine what can activate Super Breaker in certain situations (thanks Quavelen) MMOinfo for Roll was corrected (thanks emanondev) Version 2.1.138 diff --git a/pom.xml b/pom.xml index 877fb5f5d..980a1c971 100755 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 com.gmail.nossr50.mcMMO mcMMO - 2.1.139 + 2.1.140-SNAPSHOT mcMMO https://github.com/mcMMO-Dev/mcMMO