From 441125dbd1abe9598510563b6d7aade9435fc125 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Thu, 27 Feb 2020 07:36:41 -0800 Subject: [PATCH 01/29] 2.1.117 --- Changelog.txt | 5 +++++ pom.xml | 2 +- .../java/com/gmail/nossr50/skills/mining/MiningManager.java | 2 +- .../com/gmail/nossr50/util/skills/ParticleEffectUtils.java | 6 ++++++ 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index 7c6d6aade..d0f26a381 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,3 +1,8 @@ +Version 2.1.117 + Fixed a rare http error when polling Mojang for UUIDs + Fixed a bug that allowed duping + + Version 2.1.116 Fixed directional plants not maintaining their direction when replanted diff --git a/pom.xml b/pom.xml index 0c2f79be8..d41267bcb 100755 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 com.gmail.nossr50.mcMMO mcMMO - 2.1.117-SNAPSHOT + 2.1.117 mcMMO https://github.com/mcMMO-Dev/mcMMO 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 00853db63..4d4f9eb8e 100644 --- a/src/main/java/com/gmail/nossr50/skills/mining/MiningManager.java +++ b/src/main/java/com/gmail/nossr50/skills/mining/MiningManager.java @@ -147,7 +147,7 @@ public class MiningManager extends SkillManager { ores.add(blockState); } //Server bug that allows beacons to be duped when yield is set to 0 - else if(blockState.getType() != Material.BEACON) { + else if(blockState.getType() != Material.BEACON && blockState.getType() != Material.SHULKER_BOX) { debris.add(blockState); } } diff --git a/src/main/java/com/gmail/nossr50/util/skills/ParticleEffectUtils.java b/src/main/java/com/gmail/nossr50/util/skills/ParticleEffectUtils.java index 4ddf909af..9c9f19cf6 100644 --- a/src/main/java/com/gmail/nossr50/util/skills/ParticleEffectUtils.java +++ b/src/main/java/com/gmail/nossr50/util/skills/ParticleEffectUtils.java @@ -43,12 +43,18 @@ public final class ParticleEffectUtils { return; } + if(location.getWorld() == null) + return; + location.getWorld().playEffect(location, Effect.MOBSPAWNER_FLAMES, 1); } public static void playSmokeEffect(Location location) { World world = location.getWorld(); + if(world == null) + return; + // Have to do it this way, because not all block directions are valid for smoke world.playEffect(location, Effect.SMOKE, BlockFace.SOUTH_EAST); world.playEffect(location, Effect.SMOKE, BlockFace.SOUTH); From 0a59b79ef914075df0fe20e0c08e7f5896034c7a Mon Sep 17 00:00:00 2001 From: nossr50 Date: Thu, 27 Feb 2020 10:50:56 -0800 Subject: [PATCH 02/29] Dev mode --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d41267bcb..fce0727f7 100755 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 com.gmail.nossr50.mcMMO mcMMO - 2.1.117 + 2.1.118-SNAPSHOT mcMMO https://github.com/mcMMO-Dev/mcMMO From 9f0fe267787a6576f3cce60c76ea495719ef8e8b Mon Sep 17 00:00:00 2001 From: nossr50 Date: Thu, 27 Feb 2020 12:45:35 -0800 Subject: [PATCH 03/29] Blast Mining Tweaks --- Changelog.txt | 4 ++ .../config/experience/ExperienceConfig.java | 38 ++++++++++++ .../nossr50/listeners/EntityListener.java | 4 +- .../nossr50/skills/mining/MiningManager.java | 61 +++++++++---------- 4 files changed, 73 insertions(+), 34 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index d0f26a381..119a70065 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,3 +1,7 @@ +Version 2.1.118 + Fixed another dupe bug + Blast Mining no longer reduces debris from explosions due to some issues with the Bukkit API + Version 2.1.117 Fixed a rare http error when polling Mojang for UUIDs Fixed a bug that allowed duping diff --git a/src/main/java/com/gmail/nossr50/config/experience/ExperienceConfig.java b/src/main/java/com/gmail/nossr50/config/experience/ExperienceConfig.java index 185c5c207..06c4ea9ce 100644 --- a/src/main/java/com/gmail/nossr50/config/experience/ExperienceConfig.java +++ b/src/main/java/com/gmail/nossr50/config/experience/ExperienceConfig.java @@ -7,6 +7,8 @@ import com.gmail.nossr50.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.datatypes.skills.alchemy.PotionStage; import com.gmail.nossr50.util.StringUtils; import org.bukkit.Material; +import org.bukkit.block.Block; +import org.bukkit.block.BlockState; import org.bukkit.block.data.BlockData; import org.bukkit.boss.BarColor; import org.bukkit.boss.BarStyle; @@ -219,6 +221,42 @@ public class ExperienceConfig extends AutoUpdateConfigLoader { return 0; } + /* Materials */ + public int getXp(PrimarySkillType skill, BlockState blockState) + { + Material data = blockState.getType(); + + String baseString = "Experience_Values." + StringUtils.getCapitalized(skill.toString()) + "."; + String explicitString = baseString + StringUtils.getExplicitConfigMaterialString(data); + if (config.contains(explicitString)) + return config.getInt(explicitString); + String friendlyString = baseString + StringUtils.getFriendlyConfigMaterialString(data); + if (config.contains(friendlyString)) + return config.getInt(friendlyString); + String wildcardString = baseString + StringUtils.getWildcardConfigMaterialString(data); + if (config.contains(wildcardString)) + return config.getInt(wildcardString); + return 0; + } + + /* Materials */ + public int getXp(PrimarySkillType skill, Block block) + { + Material data = block.getType(); + + String baseString = "Experience_Values." + StringUtils.getCapitalized(skill.toString()) + "."; + String explicitString = baseString + StringUtils.getExplicitConfigMaterialString(data); + if (config.contains(explicitString)) + return config.getInt(explicitString); + String friendlyString = baseString + StringUtils.getFriendlyConfigMaterialString(data); + if (config.contains(friendlyString)) + return config.getInt(friendlyString); + String wildcardString = baseString + StringUtils.getWildcardConfigMaterialString(data); + if (config.contains(wildcardString)) + return config.getInt(wildcardString); + return 0; + } + /* Materials */ public int getXp(PrimarySkillType skill, BlockData data) { diff --git a/src/main/java/com/gmail/nossr50/listeners/EntityListener.java b/src/main/java/com/gmail/nossr50/listeners/EntityListener.java index 2f191cc6e..ab6b1cbae 100644 --- a/src/main/java/com/gmail/nossr50/listeners/EntityListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/EntityListener.java @@ -839,8 +839,8 @@ public class EntityListener implements Listener { MiningManager miningManager = UserManager.getPlayer(player).getMiningManager(); if (miningManager.canUseBlastMining()) { - miningManager.blastMiningDropProcessing(event.getYield(), event.blockList()); - event.setYield(0); + miningManager.blastMiningDropProcessing(event.getYield(), event); +// event.setYield(0); } } 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 4d4f9eb8e..84c5d4145 100644 --- a/src/main/java/com/gmail/nossr50/skills/mining/MiningManager.java +++ b/src/main/java/com/gmail/nossr50/skills/mining/MiningManager.java @@ -2,6 +2,7 @@ package com.gmail.nossr50.skills.mining; import com.gmail.nossr50.config.AdvancedConfig; import com.gmail.nossr50.config.Config; +import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.datatypes.experience.XPGainReason; import com.gmail.nossr50.datatypes.interactions.NotificationType; import com.gmail.nossr50.datatypes.player.McMMOPlayer; @@ -12,6 +13,8 @@ import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.runnables.skills.AbilityCooldownTask; import com.gmail.nossr50.skills.SkillManager; import com.gmail.nossr50.util.*; +import com.gmail.nossr50.util.blockmeta.HashChunkletManager; +import com.gmail.nossr50.util.blockmeta.chunkmeta.ChunkManager; import com.gmail.nossr50.util.player.NotificationManager; import com.gmail.nossr50.util.random.RandomChanceUtil; import com.gmail.nossr50.util.skills.RankUtils; @@ -19,9 +22,11 @@ import com.gmail.nossr50.util.skills.SkillUtils; import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.block.BlockState; +import org.bukkit.block.Container; import org.bukkit.enchantments.Enchantment; import org.bukkit.entity.Player; import org.bukkit.entity.TNTPrimed; +import org.bukkit.event.entity.EntityExplodeEvent; import org.bukkit.inventory.ItemStack; import java.util.ArrayList; @@ -126,55 +131,47 @@ public class MiningManager extends SkillManager { * Handler for explosion drops and XP gain. * * @param yield The % of blocks to drop - * @param blockList The list of blocks to drop + * @param event The {@link EntityExplodeEvent} */ - public void blastMiningDropProcessing(float yield, List blockList) { + public void blastMiningDropProcessing(float yield, EntityExplodeEvent event) { + //Strip out only stuff that gives mining XP + List ores = new ArrayList(); - List debris = new ArrayList(); + + List newYieldList = new ArrayList<>(); + for (Block targetBlock : event.blockList()) { + //Containers usually have 0 XP unless someone edited their config in a very strange way + if (ExperienceConfig.getInstance().getXp(PrimarySkillType.MINING, targetBlock) == 0 || targetBlock instanceof Container || mcMMO.getPlaceStore().isTrue(targetBlock)) { + newYieldList.add(targetBlock); + } else { + ores.add(targetBlock.getState()); + } + } + int xp = 0; float oreBonus = (float) (getOreBonus() / 100); //TODO: Pretty sure something is fucked with debrisReduction stuff - float debrisReduction = (float) (getDebrisReduction() / 100); +// float debrisReduction = (float) (getDebrisReduction() / 100); int dropMultiplier = getDropMultiplier(); - float debrisYield = yield - debrisReduction; - - for (Block block : blockList) { - BlockState blockState = block.getState(); - - if (BlockUtils.isOre(blockState)) { - ores.add(blockState); - } - //Server bug that allows beacons to be duped when yield is set to 0 - else if(blockState.getType() != Material.BEACON && blockState.getType() != Material.SHULKER_BOX) { - debris.add(blockState); - } - } +// float debrisYield = yield - debrisReduction; for (BlockState blockState : ores) { - if (Misc.getRandom().nextFloat() < (yield + oreBonus)) { - if (!mcMMO.getPlaceStore().isTrue(blockState)) { - xp += Mining.getBlockXp(blockState); - } + if (Misc.getRandom().nextFloat() < (newYieldList.size() + oreBonus)) { + xp += Mining.getBlockXp(blockState); Misc.dropItem(Misc.getBlockCenter(blockState), new ItemStack(blockState.getType())); // Initial block that would have been dropped - if (!mcMMO.getPlaceStore().isTrue(blockState)) { - for (int i = 1; i < dropMultiplier; i++) { - Mining.handleSilkTouchDrops(blockState); // Bonus drops - should drop the block & not the items - } + for (int i = 1; i < dropMultiplier; i++) { + Mining.handleSilkTouchDrops(blockState); // Bonus drops - should drop the block & not the items } } } - if (debrisYield > 0) { - for (BlockState blockState : debris) { - if (Misc.getRandom().nextFloat() < debrisYield) { - Misc.dropItems(Misc.getBlockCenter(blockState), blockState.getBlock().getDrops()); - } - } - } + //Replace the event blocklist with the newYield list + event.blockList().clear(); + event.blockList().addAll(newYieldList); applyXpGain(xp, XPGainReason.PVE); } From 326ff1cd7042bd1cd83cca78e1fd8e56b6b7acc6 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Fri, 28 Feb 2020 15:27:57 -0800 Subject: [PATCH 04/29] Update blast mining info in /mining --- Changelog.txt | 1 + .../com/gmail/nossr50/commands/skills/MiningCommand.java | 6 +++--- .../java/com/gmail/nossr50/skills/mining/MiningManager.java | 2 -- src/main/resources/locale/locale_cs_CZ.properties | 2 +- src/main/resources/locale/locale_de.properties | 2 +- src/main/resources/locale/locale_en_US.properties | 2 +- src/main/resources/locale/locale_es.properties | 2 +- src/main/resources/locale/locale_fr.properties | 2 +- src/main/resources/locale/locale_hu_HU.properties | 2 +- src/main/resources/locale/locale_it.properties | 2 +- src/main/resources/locale/locale_ja_JP.properties | 2 +- src/main/resources/locale/locale_ko.properties | 2 +- src/main/resources/locale/locale_lt_LT.properties | 2 +- src/main/resources/locale/locale_pt_BR.properties | 2 +- src/main/resources/locale/locale_ru.properties | 2 +- src/main/resources/locale/locale_th_TH.properties | 2 +- src/main/resources/locale/locale_zh_CN.properties | 2 +- src/main/resources/locale/locale_zh_TW.properties | 2 +- 18 files changed, 19 insertions(+), 20 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index 119a70065..c4268e7d8 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,6 +1,7 @@ Version 2.1.118 Fixed another dupe bug Blast Mining no longer reduces debris from explosions due to some issues with the Bukkit API + Modified locale string 'Mining.Blast.Effect' to remove debris reduction mention Version 2.1.117 Fixed a rare http error when polling Mojang for UUIDs diff --git a/src/main/java/com/gmail/nossr50/commands/skills/MiningCommand.java b/src/main/java/com/gmail/nossr50/commands/skills/MiningCommand.java index ee7710aa6..7e7c5d5c6 100644 --- a/src/main/java/com/gmail/nossr50/commands/skills/MiningCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/skills/MiningCommand.java @@ -25,7 +25,7 @@ public class MiningCommand extends SkillCommand { private int bonusTNTDrops; private double blastRadiusIncrease; private String oreBonus; - private String debrisReduction; +// private String debrisReduction; private String blastDamageDecrease; private boolean canSuperBreaker; @@ -47,7 +47,7 @@ public class MiningCommand extends SkillCommand { blastMiningRank = miningManager.getBlastMiningTier(); bonusTNTDrops = miningManager.getDropMultiplier(); oreBonus = percent.format(miningManager.getOreBonus() / 30.0D); // Base received in TNT is 30% - debrisReduction = percent.format(miningManager.getDebrisReduction() / 30.0D); // Base received in TNT is 30% +// debrisReduction = percent.format(miningManager.getDebrisReduction() / 30.0D); // Base received in TNT is 30% blastDamageDecrease = percent.format(miningManager.getBlastDamageModifier() / 100.0D); blastRadiusIncrease = miningManager.getBlastRadiusModifier(); } @@ -86,7 +86,7 @@ public class MiningCommand extends SkillCommand { } if (canBlast) { - messages.add(getStatMessage(false, true, SubSkillType.MINING_BLAST_MINING, String.valueOf(blastMiningRank), String.valueOf(RankUtils.getHighestRank(SubSkillType.MINING_BLAST_MINING)), LocaleLoader.getString("Mining.Blast.Effect", oreBonus, debrisReduction, bonusTNTDrops))); + messages.add(getStatMessage(false, true, SubSkillType.MINING_BLAST_MINING, String.valueOf(blastMiningRank), String.valueOf(RankUtils.getHighestRank(SubSkillType.MINING_BLAST_MINING)), LocaleLoader.getString("Mining.Blast.Effect", oreBonus, bonusTNTDrops))); //messages.add(LocaleLoader.getString("Mining.Blast.Rank", blastMiningRank, RankUtils.getHighestRank(SubSkillType.MINING_BLAST_MINING), LocaleLoader.getString("Mining.Blast.Effect", oreBonus, debrisReduction, bonusTNTDrops))); } 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 84c5d4145..fba28df36 100644 --- a/src/main/java/com/gmail/nossr50/skills/mining/MiningManager.java +++ b/src/main/java/com/gmail/nossr50/skills/mining/MiningManager.java @@ -13,8 +13,6 @@ import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.runnables.skills.AbilityCooldownTask; import com.gmail.nossr50.skills.SkillManager; import com.gmail.nossr50.util.*; -import com.gmail.nossr50.util.blockmeta.HashChunkletManager; -import com.gmail.nossr50.util.blockmeta.chunkmeta.ChunkManager; import com.gmail.nossr50.util.player.NotificationManager; import com.gmail.nossr50.util.random.RandomChanceUtil; import com.gmail.nossr50.util.skills.RankUtils; diff --git a/src/main/resources/locale/locale_cs_CZ.properties b/src/main/resources/locale/locale_cs_CZ.properties index 5136fdad2..bba15218e 100644 --- a/src/main/resources/locale/locale_cs_CZ.properties +++ b/src/main/resources/locale/locale_cs_CZ.properties @@ -159,7 +159,7 @@ Mining.Skills.SuperBreaker.Other.On=[[GREEN]]{0}[[DARK_GREEN]] has used [[RED]]M Mining.Skills.SuperBreaker.Refresh=[[GREEN]]Schopnost [[YELLOW]]Super Breaker [[GREEN]]obnovena! Mining.Skillup=Dovednost v dolovani byla navysena o {0}. Celkem ({1}) Mining.Blast.Boom=[[GRAY]]**VYBUCH** -Mining.Blast.Effect=+{0} v\u00fdnos rudy, -{1} v\u00fdnos trosek, {2}x ko\u0159ist +Mining.Blast.Effect=+{0} v\u00fdnos rudy, {1}x ko\u0159ist Mining.Blast.Radius.Increase=Navyseni radiusu vybuchu: [[YELLOW]]+{0} Mining.Blast.Rank=V\u00fdbu\u0161n\u00e9 t\u011b\u017een\u00ed [[YELLOW]] Rank {0}/8 [[GRAY]]({1}) Mining.Blast.Other.On=[[GREEN]]{0}[[DARK_GREEN]] pou\u017eil [[RED]]V\u00fdbu\u0161n\u00e9 T\u011b\u017een\u00ed! diff --git a/src/main/resources/locale/locale_de.properties b/src/main/resources/locale/locale_de.properties index 0c11d2e20..4a1fb3f96 100644 --- a/src/main/resources/locale/locale_de.properties +++ b/src/main/resources/locale/locale_de.properties @@ -601,7 +601,7 @@ Mining.Ability.Locked.2 = GESPERRT bis Skill {0}+ (Exp Mining.Ability.Lower = &7**Du senkst deine SPITZHACKE** Mining.Ability.Ready = &a**Deine SPITZHACKE ist bereit** Mining.Blast.Boom = &7**BOOM** -Mining.Blast.Effect = +{0} Erze -{1} Schutt, {2}x Drops +Mining.Blast.Effect = +{0} Erze {1}x Drops Mining.Blast.Other.On = &a{0}&2 benutzte &cZ\u00FCndstoff! Mining.Blast.Refresh = &aDein &eZ\u00FCndstoff &aist wieder bereit! Mining.Listener = Bergbau: diff --git a/src/main/resources/locale/locale_en_US.properties b/src/main/resources/locale/locale_en_US.properties index e7457ee53..9d2b3ca7a 100644 --- a/src/main/resources/locale/locale_en_US.properties +++ b/src/main/resources/locale/locale_en_US.properties @@ -330,7 +330,7 @@ Mining.Skills.SuperBreaker.Refresh=[[GREEN]]Your [[YELLOW]]Super Breaker [[GREEN #Blast Mining Mining.Blast.Boom=[[GRAY]]**BOOM** Mining.Blast.Cooldown= -Mining.Blast.Effect=+{0} ore yield, -{1} debris yield, {2}x drops +Mining.Blast.Effect=+{0} ore yield, {1}x drops Mining.Blast.Other.On=[[GREEN]]{0}[[DARK_GREEN]] has used [[RED]]Blast Mining! Mining.Blast.Refresh=[[GREEN]]Your [[YELLOW]]Blast Mining [[GREEN]]ability is refreshed! #REPAIR diff --git a/src/main/resources/locale/locale_es.properties b/src/main/resources/locale/locale_es.properties index 38a2aae5f..ef38d8b78 100644 --- a/src/main/resources/locale/locale_es.properties +++ b/src/main/resources/locale/locale_es.properties @@ -161,7 +161,7 @@ Mining.Skills.SuperBreaker.Other.On=[[GREEN]]\u00a1{0}[[DARK_GREEN]] us\u00f3 [[ Mining.Skills.SuperBreaker.Refresh=[[GREEN]]\u00a1Tu habilidad de [[YELLOW]]S\u00faper Destructor [[GREEN]]est\u00e1 refrescada! Mining.Skillup=Habilidad de Miner\u00eda incrementada en {0}. Total ({1}) Mining.Blast.Boom=[[GRAY]]**BOOM** -Mining.Blast.Effect=+ {0} mineral de rendimiento, - {1} rendimiento de los desechos, {2} x drops +Mining.Blast.Effect=+ {0} mineral de rendimiento, {1} x drops Mining.Blast.Radius.Increase=Incrementado Radio de Explosi\u00f3n: [[YELLOW]]+{0} Mining.Blast.Rank=Miner\u00eda Explosiva: [[YELLOW]] Rango {0}/8 [[GRAY]]({1}) Mining.Blast.Other.On=[[GREEN]]\u00a1{0}[[DARK_GREEN]] us\u00f3 [[RED]]Miner\u00eda Explosiva! diff --git a/src/main/resources/locale/locale_fr.properties b/src/main/resources/locale/locale_fr.properties index 886a7d0ed..8c6eb9a26 100644 --- a/src/main/resources/locale/locale_fr.properties +++ b/src/main/resources/locale/locale_fr.properties @@ -181,7 +181,7 @@ Mining.Skills.SuperBreaker.Other.On=[[GREEN]]{0}[[DARK_GREEN]] a utilis\u00e9 [[ Mining.Skills.SuperBreaker.Refresh=[[GREEN]]Votre comp\u00e9tence [[YELLOW]]Broyeur [[GREEN]]est pr\u00eate ! Mining.Skillup=Le talent Minage augmente de {0}. Total ({1}) Mining.Blast.Boom=[[GRAY]]**BOUM** -Mining.Blast.Effect=+{0} de r\u00e9colte des minerais, -{1} de r\u00e9colte des d\u00e9bris, {2}x les r\u00e9compenses +Mining.Blast.Effect=+{0} de r\u00e9colte des minerais, {1}x les r\u00e9compenses Mining.Blast.Radius.Increase=Rayon d\'explosion : [[YELLOW]]+{0} Mining.Blast.Rank=Minage explosif : [[YELLOW]]Rang {0}/8 [[GRAY]]({1}) Mining.Blast.Other.On=[[GREEN]]{0}[[DARK_GREEN]] a utilis\u00e9 [[RED]]Minage explosif ! diff --git a/src/main/resources/locale/locale_hu_HU.properties b/src/main/resources/locale/locale_hu_HU.properties index d922950b8..fc239ba87 100644 --- a/src/main/resources/locale/locale_hu_HU.properties +++ b/src/main/resources/locale/locale_hu_HU.properties @@ -330,7 +330,7 @@ Mining.Skills.SuperBreaker.Refresh=[[GREEN]]A [[YELLOW]]Szuper T\u00F6r\u00E9s [ #Blast Mining Mining.Blast.Boom=[[GRAY]]**BUMM** Mining.Blast.Cooldown= -Mining.Blast.Effect=+{0} \u00E9rc hozam, -{1} t\u00F6rmel\u00E9k hozam, {2}x t\u00E1rgy es\u00E9s +Mining.Blast.Effect=+{0} \u00E9rc hozam, {1}x t\u00E1rgy es\u00E9s Mining.Blast.Other.On=[[GREEN]]{0}[[DARK_GREEN]] haszn\u00E1lta a [[RED]]Robbant\u00E1sb\u00E1ny\u00E1szat [[DARK_GREEN]]k\u00E9pess\u00E9get! Mining.Blast.Refresh=[[GREEN]]A [[YELLOW]]Robbant\u00E1sb\u00E1ny\u00E1szat [[GREEN]]k\u00E9pess\u00E9ged ism\u00E9t el\u00E9rhet\u0151! #REPAIR diff --git a/src/main/resources/locale/locale_it.properties b/src/main/resources/locale/locale_it.properties index ceb73350c..7fc89d026 100644 --- a/src/main/resources/locale/locale_it.properties +++ b/src/main/resources/locale/locale_it.properties @@ -338,7 +338,7 @@ Mining.Skills.SuperBreaker.Refresh=[[GREEN]]La tua capacit\u00E0 [[YELLOW]]Super #Blast Mining Mining.Blast.Boom=[[GRAY]]**BOOM** Mining.Blast.Cooldown= -Mining.Blast.Effect=+{0} minerale raccolto, -{1} macerie prodotte, drop {2}x +Mining.Blast.Effect=+{0} minerale raccolto, drop {1}x Mining.Blast.Other.On=[[GREEN]]{0}[[DARK_GREEN]] ha usato [[RED]]Estrazione Esplosiva! Mining.Blast.Refresh=[[GREEN]]La tua capacit\u00E0 [[YELLOW]]Estrazione Esplosiva [[GREEN]]si \u00E8 rigenerata! diff --git a/src/main/resources/locale/locale_ja_JP.properties b/src/main/resources/locale/locale_ja_JP.properties index 043d0788d..87771d5d3 100644 --- a/src/main/resources/locale/locale_ja_JP.properties +++ b/src/main/resources/locale/locale_ja_JP.properties @@ -322,7 +322,7 @@ Mining.Skills.SuperBreaker.Other.On=[[GREEN]]{0}[[DARK_GREEN]]\u304c [[RED]]\u30 # Blast Mining Mining.Blast.Boom=[[GRAY]]**BOOM** Mining.Blast.Cooldown= -Mining.Blast.Effect=+{0} ore yield, -{1} debris yield, {2}x \u30c9\u30ed\u30c3\u30d7 +Mining.Blast.Effect=+{0} ore yield, {1}x \u30c9\u30ed\u30c3\u30d7 Mining.Blast.Other.On=[[GREEN]]{0}[[DARK_GREEN]] \u304c [[RED]]\u30d6\u30e9\u30b9\u30c8\u30de\u30a4\u30cb\u30f3\u30b0 [[DARK_GREEN]]\u3092\u4f7f\u3063\u305f\uff01 Mining.Blast.Refresh=[[YELLOW]]\u30d6\u30e9\u30b9\u30c8\u30de\u30a4\u30cb\u30f3\u30b0[GREEN]]\u30a2\u30d3\u30ea\u30c6\u30a3\u304c\u56de\u5fa9\u3057\u307e\u3057\u305f\uff01 diff --git a/src/main/resources/locale/locale_ko.properties b/src/main/resources/locale/locale_ko.properties index fc24f4701..a06114f3b 100644 --- a/src/main/resources/locale/locale_ko.properties +++ b/src/main/resources/locale/locale_ko.properties @@ -211,7 +211,7 @@ Mining.Skillup=\uCC44\uAD11 \uAE30\uC220\uC774 {0} \uC62C\uB77C \uCD1D {1} \uB80 #Blast Mining Mining.Blast.Boom=[[GRAY]]**\uD3ED\uBC1C** -Mining.Blast.Effect=+{0} \uAD11\uBB3C \uC774\uC775, -{1} \uD30C\uD3B8 \uC0B0\uCD9C, {2}x \uB4DC\uB86D +Mining.Blast.Effect=+{0} \uAD11\uBB3C \uC774\uC775, {1}x \uB4DC\uB86D Mining.Blast.Radius.Increase=\uD3ED\uBC1C \uBC18\uACBD \uC99D\uAC00: [[YELLOW]]+{0} Mining.Blast.Rank=\uD3ED\uBC1C \uCC44\uAD74: [[YELLOW]]{0}/8\uB7AD\uD06C [[GRAY]]({1}) Mining.Blast.Other.On=[[GREEN]]{0}[[DARK_GREEN]]\uB2D8\uC740 [[RED]]\uD3ED\uBC1C \uCC44\uAD74\uC744 \uC0AC\uC6A9\uD558\uC168\uC2B5\uB2C8\uB2E4! diff --git a/src/main/resources/locale/locale_lt_LT.properties b/src/main/resources/locale/locale_lt_LT.properties index b8593a1a5..03296ff8a 100644 --- a/src/main/resources/locale/locale_lt_LT.properties +++ b/src/main/resources/locale/locale_lt_LT.properties @@ -330,7 +330,7 @@ Mining.Skills.SuperBreaker.Refresh=[[GREEN]]Your [[YELLOW]]Super Breaker [[GREEN #Blast Mining Mining.Blast.Boom=[[GRAY]]**BOOM** Mining.Blast.Cooldown= -Mining.Blast.Effect=+{0} ore yield, -{1} debris yield, {2}x drops +Mining.Blast.Effect=+{0} ore yield, {1}x drops Mining.Blast.Other.On=[[GREEN]]{0}[[DARK_GREEN]] has used [[RED]]Blast Mining! Mining.Blast.Refresh=[[GREEN]]Your [[YELLOW]]Blast Mining [[GREEN]]ability is refreshed! #REPAIR diff --git a/src/main/resources/locale/locale_pt_BR.properties b/src/main/resources/locale/locale_pt_BR.properties index 1d9484e1e..95c800825 100644 --- a/src/main/resources/locale/locale_pt_BR.properties +++ b/src/main/resources/locale/locale_pt_BR.properties @@ -194,7 +194,7 @@ Mining.Skillup=[[YELLOW]]Habilidade de Mineracao foi aumentada para {0}. Total ( #Mineracao Explosiva Mining.Blast.Boom=[[GRAY]]**BOOM** -Mining.Blast.Effect=+{0} Rendimento de Minerios, -{1} Prejuizo de Detritos, {2}x drops +Mining.Blast.Effect=+{0} Rendimento de Minerios, {1}x drops Mining.Blast.Radius.Increase=[[RED]]Aumento no Raio de explosao: [[YELLOW]]+{0} Mining.Blast.Rank=[[RED]]Mineracao Explosiva: [[YELLOW]] Rank {0}/{1} [[GRAY]]({2}) Mining.Blast.Other.On=[[GREEN]]{0}[[DARK_GREEN]] usou [[RED]]Mineracao Explosiva! diff --git a/src/main/resources/locale/locale_ru.properties b/src/main/resources/locale/locale_ru.properties index c80d5e8b4..2710d8151 100644 --- a/src/main/resources/locale/locale_ru.properties +++ b/src/main/resources/locale/locale_ru.properties @@ -290,7 +290,7 @@ Mining.Skillup=\u0423\u0440\u043e\u0432\u0435\u043d\u044c \u043d\u0430\u0432\u04 #Blast Mining Mining.Blast.Boom=[[GRAY]]**\u0411\u0423\u041c** Mining.Blast.Cooldown= -Mining.Blast.Effect=+{0} \u0440\u0443\u0434\u044b, -{1} \u043c\u0443\u0441\u043e\u0440\u0430, {2}x \u0434\u0440\u043e\u043f +Mining.Blast.Effect=+{0} \u0440\u0443\u0434\u044b, {1}x \u0434\u0440\u043e\u043f Mining.Blast.Radius.Increase=\u0420\u0430\u0434\u0438\u0443\u0441 \u0412\u0437\u0440\u044b\u0432\u0430 \u0423\u0432\u0435\u043b\u0438\u0447\u0435\u043d: [[YELLOW]]+{0} Mining.Blast.Rank=\u041f\u043e\u0434\u0440\u044b\u0432\u043d\u0430\u044f \u0414\u043e\u0431\u044b\u0447\u0430: [[YELLOW]] \u0420\u0430\u043d\u0433 {0}/8 [[GRAY]]({1}) Mining.Blast.Other.On=[[GREEN]]{0}[[DARK_GREEN]] \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0443\u043c\u0435\u043d\u0438\u0435 [[RED]]\"\u041f\u043e\u0434\u0440\u044b\u0432\u043d\u0430\u044f \u0414\u043e\u0431\u044b\u0447\u0430\"! diff --git a/src/main/resources/locale/locale_th_TH.properties b/src/main/resources/locale/locale_th_TH.properties index 402daeb04..003fd5246 100644 --- a/src/main/resources/locale/locale_th_TH.properties +++ b/src/main/resources/locale/locale_th_TH.properties @@ -159,7 +159,7 @@ Mining.Skills.SuperBreaker.Other.On=[[GREEN]]{0}[[DARK_GREEN]] \u0e44\u0e14\u0e4 Mining.Skills.SuperBreaker.Refresh=[[GREEN]]\u0e04\u0e27\u0e32\u0e21\u0e2a\u0e32\u0e21\u0e23\u0e16\u0e17\u0e31\u0e01\u0e29\u0e30 [[YELLOW]]Super Breaker [[GREEN]]\u0e04\u0e39\u0e25\u0e14\u0e32\u0e27\u0e19\u0e4c\u0e40\u0e2a\u0e23\u0e47\u0e08\u0e41\u0e25\u0e49\u0e27! Mining.Skillup=\u0e17\u0e31\u0e01\u0e29\u0e30 Mining \u0e40\u0e1e\u0e34\u0e48\u0e21\u0e02\u0e36\u0e49\u0e19 {0}. \u0e21\u0e35\u0e17\u0e31\u0e49\u0e07\u0e2b\u0e21\u0e14 ({1}) Mining.Blast.Boom=[[GRAY]]**BOOM** -Mining.Blast.Effect=+{0} \u0e1c\u0e25\u0e1c\u0e25\u0e34\u0e15\u0e41\u0e23\u0e48, -{1} \u0e1c\u0e25\u0e1c\u0e25\u0e34\u0e15\u0e40\u0e28\u0e29, {2}x \u0e14\u0e23\u0e2d\u0e1b +Mining.Blast.Effect=+{0} \u0e1c\u0e25\u0e1c\u0e25\u0e34\u0e15\u0e41\u0e23\u0e48, {1}x \u0e14\u0e23\u0e2d\u0e1b Mining.Blast.Radius.Increase=\u0e23\u0e31\u0e28\u0e21\u0e35\u0e02\u0e2d\u0e07\u0e23\u0e30\u0e40\u0e1a\u0e34\u0e14\u0e40\u0e1e\u0e34\u0e48\u0e21\u0e02\u0e36\u0e49\u0e19: [[YELLOW]]+{0} Mining.Blast.Rank=\u0e17\u0e31\u0e01\u0e29\u0e30 Blast Mining: [[YELLOW]] \u0e23\u0e30\u0e14\u0e31\u0e1a {0}/8 [[GRAY]]({1}) Mining.Blast.Other.On=[[GREEN]]{0}[[DARK_GREEN]] \u0e44\u0e14\u0e49\u0e43\u0e0a\u0e49\u0e17\u0e31\u0e01\u0e29\u0e30 [[RED]]Blast Mining! diff --git a/src/main/resources/locale/locale_zh_CN.properties b/src/main/resources/locale/locale_zh_CN.properties index f3414e3b1..f1473c859 100644 --- a/src/main/resources/locale/locale_zh_CN.properties +++ b/src/main/resources/locale/locale_zh_CN.properties @@ -330,7 +330,7 @@ Mining.Skills.SuperBreaker.Refresh=[[GREEN]]\u4f60\u7684 [[YELLOW]]\u8d85\u7ea7\ #Blast Mining Mining.Blast.Boom=[[GRAY]]**\u5623** Mining.Blast.Cooldown= -Mining.Blast.Effect=+{0} \u77ff\u7269\u91cf, -{1} \u788e\u7247\u91cf, {2}x \u6389\u843d +Mining.Blast.Effect=+{0} \u77ff\u7269\u91cf, {1}x \u6389\u843d Mining.Blast.Other.On=[[GREEN]]{0}[[DARK_GREEN]] \u4f7f\u7528\u4e86 [[RED]]\u7206\u7834\u5f00\u91c7! Mining.Blast.Refresh=[[GREEN]]\u4f60\u7684 [[YELLOW]]\u7206\u7834\u5f00\u91c7 [[GREEN]]\u6280\u80fd\u53ef\u4ee5\u4f7f\u7528\u4e86! #REPAIR diff --git a/src/main/resources/locale/locale_zh_TW.properties b/src/main/resources/locale/locale_zh_TW.properties index e6f7a9b8d..85b97acea 100644 --- a/src/main/resources/locale/locale_zh_TW.properties +++ b/src/main/resources/locale/locale_zh_TW.properties @@ -165,7 +165,7 @@ Mining.Skills.SuperBreaker.Other.On=[[GREEN]]{0}[[DARK_GREEN]] \u4f7f\u7528\u4e8 Mining.Skills.SuperBreaker.Refresh=[[GREEN]]\u4f60\u7684[[YELLOW]] \u8d85\u7d1a\u788e\u77f3\u6a5f [[GREEN]]\u80fd\u529b\u5df2\u53ef\u518d\u6b21\u4f7f\u7528\uff01 Mining.Skillup=\u6316\u7926\u6280\u80fd\u4e0a\u5347\u4e86 {0}! \u7e3d\u7b49\u7d1a ({1})! Mining.Blast.Boom=[[GRAY]]**\u78b0!** -Mining.Blast.Effect=+{0} \u7926\u7269\u7522\u91cf, -{1}\u5783\u573e\u7522\u91cf, {2}x \u6389\u843d\u91cf +Mining.Blast.Effect=+{0} \u7926\u7269\u7522\u91cf, {1}x \u6389\u843d\u91cf Mining.Blast.Radius.Increase=\u7206\u70b8\u534a\u5f91\u63d0\u5347: [[YELLOW]]+{0} Mining.Blast.Rank=\u6316\u7926\u7206\u767c: [[YELLOW]] \u6392\u540d {0}/8 [[GRAY]]({1}) Mining.Blast.Other.On=[[GREEN]]{0}[[DARK_GREEN]] \u4f7f\u7528\u4e86 [[RED]]\u6316\u7926\u7206\u767c! From 12abd68adde9b0529fa695806c12806544aff702 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Fri, 28 Feb 2020 15:43:32 -0800 Subject: [PATCH 05/29] Rupture fires a FakeEntityDamageByEntityEvent fixes #4122 --- Changelog.txt | 2 +- .../com/gmail/nossr50/runnables/skills/BleedTimerTask.java | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Changelog.txt b/Changelog.txt index c4268e7d8..276222851 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -2,12 +2,12 @@ Version 2.1.118 Fixed another dupe bug Blast Mining no longer reduces debris from explosions due to some issues with the Bukkit API Modified locale string 'Mining.Blast.Effect' to remove debris reduction mention + Rupture now fires a FakeEntityDamageByEntityEvent before damaging its victims (cancelling it will be ignored) Version 2.1.117 Fixed a rare http error when polling Mojang for UUIDs Fixed a bug that allowed duping - Version 2.1.116 Fixed directional plants not maintaining their direction when replanted diff --git a/src/main/java/com/gmail/nossr50/runnables/skills/BleedTimerTask.java b/src/main/java/com/gmail/nossr50/runnables/skills/BleedTimerTask.java index 3fa01dd57..e8b283bff 100644 --- a/src/main/java/com/gmail/nossr50/runnables/skills/BleedTimerTask.java +++ b/src/main/java/com/gmail/nossr50/runnables/skills/BleedTimerTask.java @@ -2,6 +2,7 @@ package com.gmail.nossr50.runnables.skills; import com.gmail.nossr50.config.AdvancedConfig; import com.gmail.nossr50.datatypes.interactions.NotificationType; +import com.gmail.nossr50.events.fake.FakeEntityDamageByEntityEvent; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.MobHealthbarUtils; import com.gmail.nossr50.util.player.NotificationManager; @@ -12,6 +13,7 @@ import com.gmail.nossr50.util.sounds.SoundType; import org.bukkit.Bukkit; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; +import org.bukkit.event.entity.EntityDamageEvent; import org.bukkit.inventory.ItemStack; import org.bukkit.scheduler.BukkitRunnable; @@ -115,6 +117,10 @@ public class BleedTimerTask extends BukkitRunnable { // debugMessage+="TargetHealthBeforeDMG=["+String.valueOf(target.getHealth())+"], "; + //Fire a fake event + FakeEntityDamageByEntityEvent fakeEntityDamageByEntityEvent = (FakeEntityDamageByEntityEvent) CombatUtils.sendEntityDamageEvent(containerEntry.getValue().damageSource, target, EntityDamageEvent.DamageCause.CUSTOM, damage); + Bukkit.getPluginManager().callEvent(fakeEntityDamageByEntityEvent); + CombatUtils.dealNoInvulnerabilityTickDamageRupture(target, damage, containerEntry.getValue().damageSource, toolTier); double victimHealthAftermath = target.getHealth(); From c2bbe33fe80973b19fa4243bef90bf77dc6d20ba Mon Sep 17 00:00:00 2001 From: nossr50 Date: Fri, 28 Feb 2020 15:44:22 -0800 Subject: [PATCH 06/29] 2.1.118 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index fce0727f7..546a2c345 100755 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 com.gmail.nossr50.mcMMO mcMMO - 2.1.118-SNAPSHOT + 2.1.118 mcMMO https://github.com/mcMMO-Dev/mcMMO From 31a98791f3f044f9eb5f409ee8199d6328d0639d Mon Sep 17 00:00:00 2001 From: nossr50 Date: Fri, 28 Feb 2020 15:48:48 -0800 Subject: [PATCH 07/29] dev mode --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 546a2c345..6ab9046ff 100755 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 com.gmail.nossr50.mcMMO mcMMO - 2.1.118 + 2.1.119-SNAPSHOT mcMMO https://github.com/mcMMO-Dev/mcMMO From efea1c5d33b3cc8089542ff0eb1a0f9b4aafa924 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Fri, 28 Feb 2020 16:29:11 -0800 Subject: [PATCH 08/29] 1.16 Support part 1 --- Changelog.txt | 34 +++++++++++++++++++++++++++++++ src/main/resources/config.yml | 11 ++++++++++ src/main/resources/experience.yml | 19 +++++++++++++++++ src/main/resources/treasures.yml | 12 +++++------ 4 files changed, 70 insertions(+), 6 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index 276222851..bee0ee11c 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,3 +1,37 @@ +Version 2.1.119 + 1.16 Support + Added 'Ancient_Debris' with a value of 7777 to mining experience tables in experience.yml + Added 'Netherite_Scrap' to bonus drops for Mining in config.yml + Added 'Ancient_Debris' to bonus drops for Mining in config.yml + Added 'Basalt' with a value of 40 to mining experience tables in experience.yml + Added 'Crimson_Fungus' with a value of 50 to herbalism experience tables in experience.yml + Added 'Crimson_Fungus' to bonus drops for Herbalism in config.yml + Added 'Warped_Fungus' with a value of 50 to herbalism experience tables in experience.yml + Added 'Warped_Fungus' to bonus drops for Herbalism in config.yml + Added 'Warped_Nylium' with a value of 5 to mining experience tables in experience.yml + Added 'Warped_Nylium' to bonus drops for Mining in config.yml + Added 'Crimson_Nylium' with a value of 5 to mining experience tables in experience.yml + Added 'Crimson_Nylium' to bonus drops for Mining in config.yml + Added 'Crimson_Stem' with a value of 35 to woodcutting experience tables in experience.yml + Added 'Crimson_Roots' with a value of 35 to woodcutting experience tables in experience.yml + Added 'Warped_Stem' with a value of 35 to woodcutting experience tables in experience.yml + Added 'Warped_Roots' with a value of 35 to woodcutting experience tables in experience.yml + Added 'Ancient_Debris' with a value of 200 to smelting experience tables in experience.yml + Added 'Crimson_Stem' to bonus drops for Woodcutting in config.yml + Added 'Warped_Stem' to bonus drops for Woodcutting in config.yml + Added 'Nether_Sprouts' with a value of 10 to Herbalism experience tables in experience.yml + Added 'Shroomlight' with a value of 100 to Woodcutting experience tables in experience.yml + Added 'Shroomlight' to bonus drops for Woodcutting in config.yml + Added 'Soul_Soil' with a value of 50 to Excavation experience tables in experience.yml + Added 'Nether_Wart_Block' with a value of 20 to Woodcutting experience tables in experience.yml + Added 'Nether_Wart_Block' with a value of 20 to Herbalism experience tables in experience.yml + Added 'Warped_Wart_Block' with a value of 20 to Woodcutting experience tables in experience.yml + Added 'Warped_Wart_Block' with a value of 20 to Herbalism experience tables in experience.yml + Added 'Weeping_Vines' with a value of 10 to Herbalism experience tables in experience.yml + All excavation drops that can drop from soul_sand now also drop from soul_soil (edited treasures.yml) + + + Version 2.1.118 Fixed another dupe bug Blast Mining no longer reduces debris from explosions due to some issues with the Bukkit API diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index a73b3ddc7..1e6236b0b 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -427,6 +427,8 @@ Skills: ### Bonus_Drops: Herbalism: + Crimson_Fungus: true + Warped_Fungus: true Chorus_Fruit: true Chorus_Plant: true Beetroots: true @@ -464,6 +466,10 @@ Bonus_Drops: Peony: true Lily_Of_The_Valley: true Mining: + Warped_Nylium: true + Crimson_Nylium: true + Ancient_Debris: true + Netherite_Scrap: true Andesite: true Diorite: true Granite: true @@ -492,6 +498,11 @@ Bonus_Drops: Stone: true Cobblestone: true Woodcutting: + Shroomlight: true + Crimson_Stem: true + Warped_Stem: true + Crimson_Roots: true + Warped_Roots: true Acacia_Wood: true Acacia_Log: true Birch_Wood: true diff --git a/src/main/resources/experience.yml b/src/main/resources/experience.yml index 37e5921c8..f38eeeabd 100644 --- a/src/main/resources/experience.yml +++ b/src/main/resources/experience.yml @@ -247,7 +247,15 @@ Experience_Values: Snow: 20 Snow_Block: 40 Soul_Sand: 40 + Soul_Soil: 40 Woodcutting: + Nether_Wart_Block: 20 + Warped_Wart_Block: 20 + Shroomlight: 100 + Crimson_Stem: 35 + Warped_Stem: 35 + Crimson_Roots: 35 + Warped_Roots: 35 Oak_Log: 70 Spruce_Log: 80 Birch_Log: 90 @@ -276,6 +284,11 @@ Experience_Values: Brown_Mushroom_Block: 70 Mushroom_Stem: 80 Herbalism: + Nether_Wart_Block: 20 + Warped_Wart_Block: 20 + Nether_Sprouts: 10 + Crimson_Fungus: 50 + Warped_Fungus: 50 Bee_Nest: 200 Sweet_Berry_Bush: 50 Seagrass: 10 @@ -344,6 +357,7 @@ Experience_Values: Tall_Grass: 50 Large_Fern: 50 Vine: 10 + Weeping_Vines: 10 Lily_Pad: 100 White_Tulip: 150 Dandelion: 100 @@ -352,7 +366,11 @@ Experience_Values: Lily_Of_The_Valley: 150 Wither_Rose: 500 Mining: + Warped_Nylium: 5 + Crimson_Nylium: 5 + Ancient_Debris: 7777 Magma_Block: 30 + Basalt: 40 Tube_Coral_Block: 75 Brain_Coral_Block: 80 Bubble_Coral_Block: 70 @@ -421,6 +439,7 @@ Experience_Values: String: 1.8 Other: 1.5 Smelting: + Ancient_Debris: 200 Coal_Ore: 10 Diamond_Ore: 75 Emerald_Ore: 100 diff --git a/src/main/resources/treasures.yml b/src/main/resources/treasures.yml index e98f2db9a..077a628c8 100755 --- a/src/main/resources/treasures.yml +++ b/src/main/resources/treasures.yml @@ -451,7 +451,7 @@ Excavation: XP: 3000 Drop_Chance: 0.05 Drop_Level: 75 - Drops_From: [Dirt, Coarse_Dirt, Podzol, Grass_Block, Sand, Red_Sand, Gravel, Clay, Mycelium, Soul_Sand] + Drops_From: [Dirt, Coarse_Dirt, Podzol, Grass_Block, Sand, Red_Sand, Gravel, Clay, Mycelium, Soul_Sand, Soul_Soil] GUNPOWDER: Amount: 1 XP: 30 @@ -541,19 +541,19 @@ Excavation: XP: 3000 Drop_Chance: 0.05 Drop_Level: 25 - Drops_From: [Dirt, Coarse_Dirt, Podzol, Grass_Block, Sand, Red_Sand, Gravel, Clay, Mycelium, Soul_Sand] + Drops_From: [Dirt, Coarse_Dirt, Podzol, Grass_Block, Sand, Red_Sand, Gravel, Clay, Mycelium, Soul_Sand, Soul_Soil] MUSIC_DISC_CAT: Amount: 1 XP: 3000 Drop_Chance: 0.05 Drop_Level: 25 - Drops_From: [Dirt, Coarse_Dirt, Podzol, Grass_Block, Sand, Red_Sand, Gravel, Clay, Mycelium, Soul_Sand] + Drops_From: [Dirt, Coarse_Dirt, Podzol, Grass_Block, Sand, Red_Sand, Gravel, Clay, Mycelium, Soul_Sand, Soul_Soil] DIAMOND: Amount: 1 XP: 1000 Drop_Chance: 0.13 Drop_Level: 35 - Drops_From: [Dirt, Coarse_Dirt, Podzol, Grass_Block, Sand, Red_Sand, Gravel, Clay, Mycelium, Soul_Sand] + Drops_From: [Dirt, Coarse_Dirt, Podzol, Grass_Block, Sand, Red_Sand, Gravel, Clay, Mycelium, Soul_Sand, Soul_Soil] COCOA_BEANS: Amount: 1 XP: 100 @@ -565,13 +565,13 @@ Excavation: XP: 100 Drop_Chance: 0.5 Drop_Level: 85 - Drops_From: [Dirt, Coarse_Dirt, Podzol, Grass_Block, Sand, Red_Sand, Gravel, Mycelium, Soul_Sand] + Drops_From: [Dirt, Coarse_Dirt, Podzol, Grass_Block, Sand, Red_Sand, Gravel, Mycelium, Soul_Sand, Soul_Soil] NAME_TAG: Amount: 1 XP: 3000 Drop_Chance: 0.05 Drop_Level: 25 - Drops_From: [Dirt, Coarse_Dirt, Podzol, Grass_Block, Sand, Red_Sand, Gravel, Clay, Mycelium, Soul_Sand] + Drops_From: [Dirt, Coarse_Dirt, Podzol, Grass_Block, Sand, Red_Sand, Gravel, Clay, Mycelium, Soul_Sand, Soul_Soil] # # Settings for Hylian Luck # If you are in retro mode, Drop_Level is multiplied by 10. From 1101815f183d3049bb399627fbb92828acf97cfb Mon Sep 17 00:00:00 2001 From: nossr50 Date: Fri, 28 Feb 2020 16:44:37 -0800 Subject: [PATCH 09/29] 1.16 Support part 2 --- .../com/gmail/nossr50/util/ItemUtils.java | 12 +++++++-- .../gmail/nossr50/util/MaterialMapStore.java | 26 +++++++++++++++++++ .../com/gmail/nossr50/util/MaterialUtils.java | 4 +++ 3 files changed, 40 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/util/ItemUtils.java b/src/main/java/com/gmail/nossr50/util/ItemUtils.java index a635f3155..becd23cfc 100644 --- a/src/main/java/com/gmail/nossr50/util/ItemUtils.java +++ b/src/main/java/com/gmail/nossr50/util/ItemUtils.java @@ -266,7 +266,7 @@ public final class ItemUtils { * @return true if the item is armor, false otherwise */ public static boolean isMinecraftArmor(ItemStack item) { - return isLeatherArmor(item) || isGoldArmor(item) || isIronArmor(item) || isDiamondArmor(item) || isChainmailArmor(item); + return isLeatherArmor(item) || isGoldArmor(item) || isIronArmor(item) || isDiamondArmor(item) || isNetherriteTool(item) || isChainmailArmor(item); } /** @@ -345,6 +345,14 @@ public final class ItemUtils { } } + public static boolean isNetherriteArmor(ItemStack itemStack) { + return mcMMO.getMaterialMapStore().isNetherriteArmor(itemStack.getType()); + } + + public static boolean isNetherriteTool(ItemStack itemStack) { + return mcMMO.getMaterialMapStore().isNetherriteTool(itemStack.getType()); + } + /** * Checks to see if an item is a chainmail armor piece. * @@ -371,7 +379,7 @@ public final class ItemUtils { * @return true if the item is a tool, false otherwise */ public static boolean isMinecraftTool(ItemStack item) { - return isStoneTool(item) || isWoodTool(item) || isGoldTool(item) || isIronTool(item) || isDiamondTool(item) || isStringTool(item) || item.getType() == Material.TRIDENT; + return isStoneTool(item) || isWoodTool(item) || isGoldTool(item) || isIronTool(item) || isDiamondTool(item) || isNetherriteTool(item) || isStringTool(item) || item.getType() == Material.TRIDENT; } /** diff --git a/src/main/java/com/gmail/nossr50/util/MaterialMapStore.java b/src/main/java/com/gmail/nossr50/util/MaterialMapStore.java index ee9b39296..1dec55fa0 100644 --- a/src/main/java/com/gmail/nossr50/util/MaterialMapStore.java +++ b/src/main/java/com/gmail/nossr50/util/MaterialMapStore.java @@ -24,6 +24,8 @@ public class MaterialMapStore { private HashSet multiBlockPlant; private HashSet foodItemWhiteList; private HashSet glassBlocks; + private HashSet netherriteArmor; + private HashSet netherriteTools; public MaterialMapStore() { @@ -37,6 +39,8 @@ public class MaterialMapStore { multiBlockPlant = new HashSet<>(); foodItemWhiteList = new HashSet<>(); glassBlocks = new HashSet<>(); + netherriteArmor = new HashSet<>(); + netherriteTools = new HashSet<>(); fillHardcodedHashSets(); } @@ -93,6 +97,20 @@ public class MaterialMapStore { fillMultiBlockPlantSet(); fillFoodWhiteList(); fillGlassBlockWhiteList(); + fillNetherriteWhiteList(); + } + + private void fillNetherriteWhiteList() { + netherriteTools.add("netherrite_sword"); + netherriteTools.add("netherrite_axe"); + netherriteTools.add("netherrite_hoe"); + netherriteTools.add("netherrite_pickaxe"); + netherriteTools.add("netherrite_shovel"); + + netherriteArmor.add("netherrite_helmet"); + netherriteArmor.add("netherrite_chestplate"); + netherriteArmor.add("netherrite_leggings"); + netherriteArmor.add("netherrite_boots"); } private void fillGlassBlockWhiteList() { @@ -171,6 +189,14 @@ public class MaterialMapStore { foodItemWhiteList.add("tropical_fish"); } + public boolean isNetherriteArmor(Material material) { + return netherriteArmor.contains(material.getKey().getKey()); + } + + public boolean isNetherriteTool(Material material) { + return netherriteTools.contains(material.getKey().getKey()); + } + public boolean isGlass(Material material) { return glassBlocks.contains(material.getKey().getKey()); } diff --git a/src/main/java/com/gmail/nossr50/util/MaterialUtils.java b/src/main/java/com/gmail/nossr50/util/MaterialUtils.java index 8951a098a..0d7233222 100644 --- a/src/main/java/com/gmail/nossr50/util/MaterialUtils.java +++ b/src/main/java/com/gmail/nossr50/util/MaterialUtils.java @@ -7,6 +7,10 @@ public final class MaterialUtils { private MaterialUtils() {} protected static boolean isOre(Material data) { + //Netherrite Ore (Kind of) + if(data.getKey().getKey().equalsIgnoreCase("ancient_debris")) + return true; + switch (data) { case COAL_ORE: case DIAMOND_ORE: From d585b1c2f7dc3c1ac51f4b7895eed826d71cbd26 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Mon, 2 Mar 2020 14:52:51 -0800 Subject: [PATCH 10/29] 1.16 support part 3 --- Changelog.txt | 1 + .../com/gmail/nossr50/util/ItemUtils.java | 327 +---------- .../gmail/nossr50/util/MaterialMapStore.java | 530 +++++++++++++++++- .../com/gmail/nossr50/util/MaterialUtils.java | 18 +- 4 files changed, 545 insertions(+), 331 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index bee0ee11c..94c8a7330 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,5 +1,6 @@ Version 2.1.119 1.16 Support + mcMMO is now aware of turtle shell and treats it appropriately Added 'Ancient_Debris' with a value of 7777 to mining experience tables in experience.yml Added 'Netherite_Scrap' to bonus drops for Mining in config.yml Added 'Ancient_Debris' to bonus drops for Mining in config.yml diff --git a/src/main/java/com/gmail/nossr50/util/ItemUtils.java b/src/main/java/com/gmail/nossr50/util/ItemUtils.java index becd23cfc..8470946cd 100644 --- a/src/main/java/com/gmail/nossr50/util/ItemUtils.java +++ b/src/main/java/com/gmail/nossr50/util/ItemUtils.java @@ -22,15 +22,7 @@ public final class ItemUtils { * @return true if the item is a bow, false otherwise */ public static boolean isBow(ItemStack item) { - Material type = item.getType(); - - switch (type) { - case BOW: - return true; - - default: - return mcMMO.getModManager().isCustomBow(type); - } + return mcMMO.getMaterialMapStore().isBow(item.getType().getKey().getKey()); } public static boolean hasItemInEitherHand(Player player, Material material) { @@ -44,19 +36,7 @@ public final class ItemUtils { * @return true if the item is a sword, false otherwise */ public static boolean isSword(ItemStack item) { - Material type = item.getType(); - - switch (type) { - case DIAMOND_SWORD: - case GOLDEN_SWORD: - case IRON_SWORD: - case STONE_SWORD: - case WOODEN_SWORD: - return true; - - default: - return mcMMO.getModManager().isCustomSword(type); - } + return mcMMO.getMaterialMapStore().isSword(item.getType().getKey().getKey()); } /** @@ -66,19 +46,7 @@ public final class ItemUtils { * @return true if the item is a hoe, false otherwise */ public static boolean isHoe(ItemStack item) { - Material type = item.getType(); - - switch (type) { - case DIAMOND_HOE: - case GOLDEN_HOE: - case IRON_HOE: - case STONE_HOE: - case WOODEN_HOE: - return true; - - default: - return mcMMO.getModManager().isCustomHoe(type); - } + return mcMMO.getMaterialMapStore().isHoe(item.getType().getKey().getKey()); } /** @@ -88,19 +56,7 @@ public final class ItemUtils { * @return true if the item is a shovel, false otherwise */ public static boolean isShovel(ItemStack item) { - Material type = item.getType(); - - switch (type) { - case DIAMOND_SHOVEL: - case GOLDEN_SHOVEL: - case IRON_SHOVEL: - case STONE_SHOVEL: - case WOODEN_SHOVEL: - return true; - - default: - return mcMMO.getModManager().isCustomShovel(type); - } + return mcMMO.getMaterialMapStore().isShovel(item.getType().getKey().getKey()); } /** @@ -110,19 +66,7 @@ public final class ItemUtils { * @return true if the item is an axe, false otherwise */ public static boolean isAxe(ItemStack item) { - Material type = item.getType(); - - switch (type) { - case DIAMOND_AXE: - case GOLDEN_AXE: - case IRON_AXE: - case STONE_AXE: - case WOODEN_AXE: - return true; - - default: - return mcMMO.getModManager().isCustomAxe(type); - } + return mcMMO.getMaterialMapStore().isAxe(item.getType().getKey().getKey()); } /** @@ -132,19 +76,7 @@ public final class ItemUtils { * @return true if the item is a pickaxe, false otherwise */ public static boolean isPickaxe(ItemStack item) { - Material type = item.getType(); - - switch (type) { - case DIAMOND_PICKAXE: - case GOLDEN_PICKAXE: - case IRON_PICKAXE: - case STONE_PICKAXE: - case WOODEN_PICKAXE: - return true; - - default: - return mcMMO.getModManager().isCustomPickaxe(type); - } + return mcMMO.getMaterialMapStore().isPickAxe(item.getType().getKey().getKey()); } /** @@ -161,94 +93,6 @@ public final class ItemUtils { return item.getType() == Material.AIR; } - /** - * Checks if the item is a helmet. - * - * @param item Item to check - * @return true if the item is a helmet, false otherwise - */ - public static boolean isHelmet(ItemStack item) { - Material type = item.getType(); - - switch (type) { - case DIAMOND_HELMET: - case GOLDEN_HELMET: - case IRON_HELMET: - case CHAINMAIL_HELMET: - case LEATHER_HELMET: - return true; - - default: - return mcMMO.getModManager().isCustomHelmet(type); - } - } - - /** - * Checks if the item is a chestplate. - * - * @param item Item to check - * @return true if the item is a chestplate, false otherwise - */ - public static boolean isChestplate(ItemStack item) { - Material type = item.getType(); - - switch (type) { - case DIAMOND_CHESTPLATE: - case GOLDEN_CHESTPLATE: - case IRON_CHESTPLATE: - case CHAINMAIL_CHESTPLATE: - case LEATHER_CHESTPLATE: - return true; - - default: - return mcMMO.getModManager().isCustomChestplate(type); - } - } - - /** - * Checks if the item is a pair of pants. - * - * @param item Item to check - * @return true if the item is a pair of pants, false otherwise - */ - public static boolean isLeggings(ItemStack item) { - Material type = item.getType(); - - switch (type) { - case DIAMOND_LEGGINGS: - case GOLDEN_LEGGINGS: - case IRON_LEGGINGS: - case CHAINMAIL_LEGGINGS: - case LEATHER_LEGGINGS: - return true; - - default: - return mcMMO.getModManager().isCustomLeggings(type); - } - } - - /** - * Checks if the item is a pair of boots. - * - * @param item Item to check - * @return true if the item is a pair of boots, false otherwise - */ - public static boolean isBoots(ItemStack item) { - Material type = item.getType(); - - switch (type) { - case DIAMOND_BOOTS: - case GOLDEN_BOOTS: - case IRON_BOOTS: - case CHAINMAIL_BOOTS: - case LEATHER_BOOTS: - return true; - - default: - return mcMMO.getModManager().isCustomBoots(type); - } - } - /** * Checks to see if an item is a wearable armor piece. * @@ -256,17 +100,7 @@ public final class ItemUtils { * @return true if the item is armor, false otherwise */ public static boolean isArmor(ItemStack item) { - return isHelmet(item) || isChestplate(item) || isLeggings(item) || isBoots(item); - } - - /** - * Checks to see if an item is a wearable *vanilla* armor piece. - * - * @param item Item to check - * @return true if the item is armor, false otherwise - */ - public static boolean isMinecraftArmor(ItemStack item) { - return isLeatherArmor(item) || isGoldArmor(item) || isIronArmor(item) || isDiamondArmor(item) || isNetherriteTool(item) || isChainmailArmor(item); + return mcMMO.getMaterialMapStore().isArmor(item.getType()); } /** @@ -276,16 +110,7 @@ public final class ItemUtils { * @return true if the item is leather armor, false otherwise */ public static boolean isLeatherArmor(ItemStack item) { - switch (item.getType()) { - case LEATHER_BOOTS: - case LEATHER_CHESTPLATE: - case LEATHER_HELMET: - case LEATHER_LEGGINGS: - return true; - - default: - return false; - } + return mcMMO.getMaterialMapStore().isLeatherArmor(item.getType()); } /** @@ -295,16 +120,7 @@ public final class ItemUtils { * @return true if the item is gold armor, false otherwise */ public static boolean isGoldArmor(ItemStack item) { - switch (item.getType()) { - case GOLDEN_BOOTS: - case GOLDEN_CHESTPLATE: - case GOLDEN_HELMET: - case GOLDEN_LEGGINGS: - return true; - - default: - return false; - } + return mcMMO.getMaterialMapStore().isGoldArmor(item.getType().getKey().getKey()); } /** @@ -314,16 +130,7 @@ public final class ItemUtils { * @return true if the item is iron armor, false otherwise */ public static boolean isIronArmor(ItemStack item) { - switch (item.getType()) { - case IRON_BOOTS: - case IRON_CHESTPLATE: - case IRON_HELMET: - case IRON_LEGGINGS: - return true; - - default: - return false; - } + return mcMMO.getMaterialMapStore().isIronArmor(item.getType().getKey().getKey()); } /** @@ -333,24 +140,15 @@ public final class ItemUtils { * @return true if the item is diamond armor, false otherwise */ public static boolean isDiamondArmor(ItemStack item) { - switch (item.getType()) { - case DIAMOND_BOOTS: - case DIAMOND_CHESTPLATE: - case DIAMOND_HELMET: - case DIAMOND_LEGGINGS: - return true; - - default: - return false; - } + return mcMMO.getMaterialMapStore().isDiamondArmor(item.getType().getKey().getKey()); } public static boolean isNetherriteArmor(ItemStack itemStack) { - return mcMMO.getMaterialMapStore().isNetherriteArmor(itemStack.getType()); + return mcMMO.getMaterialMapStore().isNetherriteArmor(itemStack.getType().getKey().getKey()); } public static boolean isNetherriteTool(ItemStack itemStack) { - return mcMMO.getMaterialMapStore().isNetherriteTool(itemStack.getType()); + return mcMMO.getMaterialMapStore().isNetherriteTool(itemStack.getType().getKey().getKey()); } /** @@ -360,16 +158,7 @@ public final class ItemUtils { * @return true if the item is chainmail armor, false otherwise */ public static boolean isChainmailArmor(ItemStack item) { - switch (item.getType()) { - case CHAINMAIL_BOOTS: - case CHAINMAIL_CHESTPLATE: - case CHAINMAIL_HELMET: - case CHAINMAIL_LEGGINGS: - return true; - - default: - return false; - } + return mcMMO.getMaterialMapStore().isChainmailArmor(item.getType().getKey().getKey()); } /** @@ -379,7 +168,7 @@ public final class ItemUtils { * @return true if the item is a tool, false otherwise */ public static boolean isMinecraftTool(ItemStack item) { - return isStoneTool(item) || isWoodTool(item) || isGoldTool(item) || isIronTool(item) || isDiamondTool(item) || isNetherriteTool(item) || isStringTool(item) || item.getType() == Material.TRIDENT; + return mcMMO.getMaterialMapStore().isTool(item.getType().getKey().getKey()); } /** @@ -389,17 +178,7 @@ public final class ItemUtils { * @return true if the item is a stone tool, false otherwise */ public static boolean isStoneTool(ItemStack item) { - switch (item.getType()) { - case STONE_AXE: - case STONE_HOE: - case STONE_PICKAXE: - case STONE_SHOVEL: - case STONE_SWORD: - return true; - - default: - return false; - } + return mcMMO.getMaterialMapStore().isStoneTool(item.getType().getKey().getKey()); } /** @@ -409,17 +188,7 @@ public final class ItemUtils { * @return true if the item is a wooden tool, false otherwise */ public static boolean isWoodTool(ItemStack item) { - switch (item.getType()) { - case WOODEN_AXE: - case WOODEN_HOE: - case WOODEN_PICKAXE: - case WOODEN_SHOVEL: - case WOODEN_SWORD: - return true; - - default: - return false; - } + return mcMMO.getMaterialMapStore().isWoodTool(item.getType().getKey().getKey()); } /** @@ -429,15 +198,7 @@ public final class ItemUtils { * @return true if the item is a string tool, false otherwise */ public static boolean isStringTool(ItemStack item) { - switch (item.getType()) { - case BOW: - case CARROT_ON_A_STICK: - case FISHING_ROD: - return true; - - default: - return false; - } + return mcMMO.getMaterialMapStore().isStringTool(item.getType().getKey().getKey()); } /** @@ -447,17 +208,7 @@ public final class ItemUtils { * @return true if the item is a stone tool, false otherwise */ public static boolean isGoldTool(ItemStack item) { - switch (item.getType()) { - case GOLDEN_AXE: - case GOLDEN_HOE: - case GOLDEN_PICKAXE: - case GOLDEN_SHOVEL: - case GOLDEN_SWORD: - return true; - - default: - return false; - } + return mcMMO.getMaterialMapStore().isGoldTool(item.getType().getKey().getKey()); } /** @@ -467,20 +218,7 @@ public final class ItemUtils { * @return true if the item is an iron tool, false otherwise */ public static boolean isIronTool(ItemStack item) { - switch (item.getType()) { - case BUCKET: - case FLINT_AND_STEEL: - case IRON_AXE: - case IRON_HOE: - case IRON_PICKAXE: - case IRON_SHOVEL: - case IRON_SWORD: - case SHEARS: - return true; - - default: - return false; - } + return mcMMO.getMaterialMapStore().isIronTool(item.getType().getKey().getKey()); } /** @@ -490,17 +228,7 @@ public final class ItemUtils { * @return true if the item is a diamond tool, false otherwise */ public static boolean isDiamondTool(ItemStack item) { - switch (item.getType()) { - case DIAMOND_AXE: - case DIAMOND_HOE: - case DIAMOND_PICKAXE: - case DIAMOND_SHOVEL: - case DIAMOND_SWORD: - return true; - - default: - return false; - } + return mcMMO.getMaterialMapStore().isDiamondTool(item.getType().getKey().getKey()); } /** @@ -510,18 +238,7 @@ public final class ItemUtils { * @return true if the item is enchantable, false otherwise */ public static boolean isEnchantable(ItemStack item) { - switch (item.getType()) { - case ENCHANTED_BOOK: - case SHEARS: - case FISHING_ROD: - case CARROT_ON_A_STICK: - case FLINT_AND_STEEL: - case TRIDENT: - return true; - - default: - return isArmor(item) || isSword(item) || isAxe(item) || isShovel(item) || isPickaxe(item) || isBow(item); - } + return mcMMO.getMaterialMapStore().isEnchantable(item.getType().getKey().getKey()); } public static boolean isSmeltable(ItemStack item) { diff --git a/src/main/java/com/gmail/nossr50/util/MaterialMapStore.java b/src/main/java/com/gmail/nossr50/util/MaterialMapStore.java index 1dec55fa0..df45e59da 100644 --- a/src/main/java/com/gmail/nossr50/util/MaterialMapStore.java +++ b/src/main/java/com/gmail/nossr50/util/MaterialMapStore.java @@ -24,8 +24,35 @@ public class MaterialMapStore { private HashSet multiBlockPlant; private HashSet foodItemWhiteList; private HashSet glassBlocks; + private HashSet netherriteArmor; private HashSet netherriteTools; + private HashSet woodTools; + private HashSet stoneTools; + private HashSet leatherArmor; + private HashSet ironArmor; + private HashSet ironTools; + private HashSet stringTools; + private HashSet goldArmor; + private HashSet goldTools; + private HashSet chainmailArmor; + private HashSet diamondArmor; + private HashSet diamondTools; + private HashSet armors; + + private HashSet swords; + private HashSet axes; + private HashSet hoes; + private HashSet shovels; + private HashSet pickAxes; + private HashSet tridents; + private HashSet bows; + private HashSet tools; + + private HashSet enchantables; + + private HashSet ores; + public MaterialMapStore() { @@ -39,8 +66,35 @@ public class MaterialMapStore { multiBlockPlant = new HashSet<>(); foodItemWhiteList = new HashSet<>(); glassBlocks = new HashSet<>(); + + leatherArmor = new HashSet<>(); + ironArmor = new HashSet<>(); + chainmailArmor = new HashSet<>(); + goldArmor = new HashSet<>(); + diamondArmor = new HashSet<>(); netherriteArmor = new HashSet<>(); + armors = new HashSet<>(); + + woodTools = new HashSet<>(); + stoneTools = new HashSet<>(); + ironTools = new HashSet<>(); + goldTools = new HashSet<>(); + diamondTools = new HashSet<>(); netherriteTools = new HashSet<>(); + bows = new HashSet<>(); + stringTools = new HashSet<>(); + tools = new HashSet<>(); + + swords = new HashSet<>(); + axes = new HashSet<>(); + pickAxes = new HashSet<>(); + shovels = new HashSet<>(); + hoes = new HashSet<>(); + tridents = new HashSet<>(); + + enchantables = new HashSet<>(); + + ores = new HashSet<>(); fillHardcodedHashSets(); } @@ -97,20 +151,292 @@ public class MaterialMapStore { fillMultiBlockPlantSet(); fillFoodWhiteList(); fillGlassBlockWhiteList(); - fillNetherriteWhiteList(); + fillArmors(); + fillTools(); + fillEnchantables(); + fillOres(); } - private void fillNetherriteWhiteList() { + private void fillOres() { + ores.add("coal_ore"); + ores.add("diamond_ore"); + ores.add("nether_quartz_ore"); + ores.add("quartz_ore"); //Pre 1.13 + ores.add("gold_ore"); + ores.add("iron_ore"); + ores.add("lapis_ore"); + ores.add("redstone_ore"); + ores.add("emerald_ore"); + ores.add("ancient_debris"); + } + + private void fillArmors() { + fillLeatherArmorWhiteList(); + fillIronArmorWhiteList(); + fillChainmailWhiteList(); + fillGoldArmorWhiteList(); + fillDiamondArmorWhiteList(); + fillNetherriteArmorWhiteList(); + + //Add all armors to armors hashset + armors.addAll(leatherArmor); + armors.addAll(ironArmor); + armors.addAll(chainmailArmor); + armors.addAll(goldArmor); + armors.addAll(diamondArmor); + armors.addAll(netherriteArmor); + + armors.add("turtle_shell"); + } + + private void fillEnchantables() { + enchantables.addAll(armors); + enchantables.addAll(swords); + enchantables.addAll(axes); + enchantables.addAll(hoes); + enchantables.addAll(pickAxes); + enchantables.addAll(tridents); + enchantables.addAll(bows); + + enchantables.add("shears"); + enchantables.add("fishing_rod"); + enchantables.add("carrot_on_a_stick"); + enchantables.add("enchanted_book"); + enchantables.add("flint_and_steel"); + enchantables.add("turtle_shell"); + } + + private void fillTools() { + fillWoodToolsWhiteList(); + fillStoneToolsWhiteList(); + fillIronToolsWhiteList(); + fillGoldToolsWhiteList(); + fillDiamondToolsWhiteList(); + fillNetherriteToolsWhiteList(); + + fillSwords(); + fillAxes(); + fillPickAxes(); + fillHoes(); + fillShovels(); + fillTridents(); + fillStringTools(); + fillBows(); + + //Tools collection + tools.addAll(woodTools); + tools.addAll(stoneTools); + tools.addAll(ironTools); + tools.addAll(goldTools); + tools.addAll(diamondTools); + tools.addAll(netherriteTools); + tools.addAll(tridents); + tools.addAll(stringTools); + tools.addAll(bows); + } + + private void fillBows() { + bows.add("bow"); + } + + private void fillStringTools() { + stringTools.add("bow"); + stringTools.add("fishing_rod"); + stringTools.add("carrot_on_a_stick"); + } + + private void fillTridents() { + tridents.add("trident"); + } + + private void fillSwords() { + swords.add("wood_sword"); + swords.add("wooden_sword"); + swords.add("stone_sword"); + swords.add("iron_sword"); + swords.add("gold_sword"); + swords.add("golden_sword"); + swords.add("diamond_sword"); + swords.add("netherrite_sword"); + } + + private void fillAxes() { + axes.add("wood_axe"); + axes.add("wooden_axe"); + axes.add("stone_axe"); + axes.add("iron_axe"); + axes.add("gold_axe"); + axes.add("golden_axe"); + axes.add("diamond_axe"); + axes.add("netherrite_axe"); + } + + private void fillPickAxes() { + pickAxes.add("wood_pickaxe"); + pickAxes.add("wooden_pickaxe"); + pickAxes.add("stone_pickaxe"); + pickAxes.add("iron_pickaxe"); + pickAxes.add("gold_pickaxe"); + pickAxes.add("golden_pickaxe"); + pickAxes.add("diamond_pickaxe"); + pickAxes.add("netherrite_pickaxe"); + } + + private void fillHoes() { + hoes.add("wood_hoe"); + hoes.add("wooden_hoe"); + hoes.add("stone_hoe"); + hoes.add("iron_hoe"); + hoes.add("gold_hoe"); + hoes.add("golden_hoe"); + hoes.add("diamond_hoe"); + hoes.add("netherrite_hoe"); + } + + private void fillShovels() { + shovels.add("wood_shovel"); + shovels.add("wooden_shovel"); + shovels.add("stone_shovel"); + shovels.add("iron_shovel"); + shovels.add("gold_shovel"); + shovels.add("golden_shovel"); + shovels.add("diamond_shovel"); + shovels.add("netherrite_shovel"); + } + + private void fillLeatherArmorWhiteList() { + leatherArmor.add("leather_helmet"); + leatherArmor.add("leather_chestplate"); + leatherArmor.add("leather_leggings"); + leatherArmor.add("leather_boots"); + } + + private void fillIronArmorWhiteList() { + ironArmor.add("iron_helmet"); + ironArmor.add("iron_chestplate"); + ironArmor.add("iron_leggings"); + ironArmor.add("iron_boots"); + } + + private void fillChainmailWhiteList() { + chainmailArmor.add("chainmail_helmet"); + chainmailArmor.add("chainmail_chestplate"); + chainmailArmor.add("chainmail_leggings"); + chainmailArmor.add("chainmail_boots"); + } + + private void fillGoldArmorWhiteList() { + goldArmor.add("gold_helmet"); + goldArmor.add("gold_chestplate"); + goldArmor.add("gold_leggings"); + goldArmor.add("gold_boots"); + + //Gold became Golden post 1.13 + goldArmor.add("golden_helmet"); + goldArmor.add("golden_chestplate"); + goldArmor.add("golden_leggings"); + goldArmor.add("golden_boots"); + } + + private void fillDiamondArmorWhiteList() { + diamondArmor.add("diamond_helmet"); + diamondArmor.add("diamond_chestplate"); + diamondArmor.add("diamond_leggings"); + diamondArmor.add("diamond_boots"); + } + + private void fillNetherriteArmorWhiteList() { + netherriteArmor.add("netherrite_helmet"); + netherriteArmor.add("netherrite_chestplate"); + netherriteArmor.add("netherrite_leggings"); + netherriteArmor.add("netherrite_boots"); + } + + private void fillWoodToolsWhiteList() { + woodTools.add("wood_sword"); + woodTools.add("wood_axe"); + woodTools.add("wood_hoe"); + woodTools.add("wood_pickaxe"); + woodTools.add("wood_shovel"); + + //Wood became wooden post 1.13 + woodTools.add("wooden_sword"); + woodTools.add("wooden_axe"); + woodTools.add("wooden_hoe"); + woodTools.add("wooden_pickaxe"); + woodTools.add("wooden_shovel"); + } + + private void fillStoneToolsWhiteList() { + stoneTools.add("stone_sword"); + stoneTools.add("stone_axe"); + stoneTools.add("stone_hoe"); + stoneTools.add("stone_pickaxe"); + stoneTools.add("stone_shovel"); + } + + private void fillIronToolsWhiteList() { + ironTools.add("iron_sword"); + ironTools.add("iron_axe"); + ironTools.add("iron_hoe"); + ironTools.add("iron_pickaxe"); + ironTools.add("iron_shovel"); + + //Used for repair, remove in 2.2 + //TODO: Remove in 2.2 + //TODO: Remove in 2.2 + //TODO: Remove in 2.2 + //TODO: Remove in 2.2 + //TODO: Remove in 2.2 + //TODO: Remove in 2.2 + //TODO: Remove in 2.2 + //TODO: Remove in 2.2 + //TODO: Remove in 2.2 + //TODO: Remove in 2.2 + //TODO: Remove in 2.2 + //TODO: Remove in 2.2 + //TODO: Remove in 2.2 + //TODO: Remove in 2.2 + //TODO: Remove in 2.2 + //TODO: Remove in 2.2 + //TODO: Remove in 2.2 + //TODO: Remove in 2.2 + //TODO: Remove in 2.2 + //TODO: Remove in 2.2 + ironTools.add("bucket"); + ironTools.add("flint_and_steel"); + ironTools.add("shears"); + } + + private void fillGoldToolsWhiteList() { + goldTools.add("gold_sword"); + goldTools.add("gold_axe"); + goldTools.add("gold_hoe"); + goldTools.add("gold_pickaxe"); + goldTools.add("gold_shovel"); + + //Gold became golden post 1.13 + goldTools.add("golden_sword"); + goldTools.add("golden_axe"); + goldTools.add("golden_hoe"); + goldTools.add("golden_pickaxe"); + goldTools.add("golden_shovel"); + } + + private void fillDiamondToolsWhiteList() { + diamondTools.add("diamond_sword"); + diamondTools.add("diamond_axe"); + diamondTools.add("diamond_hoe"); + diamondTools.add("diamond_pickaxe"); + diamondTools.add("diamond_shovel"); + } + + private void fillNetherriteToolsWhiteList() { netherriteTools.add("netherrite_sword"); netherriteTools.add("netherrite_axe"); netherriteTools.add("netherrite_hoe"); netherriteTools.add("netherrite_pickaxe"); netherriteTools.add("netherrite_shovel"); - - netherriteArmor.add("netherrite_helmet"); - netherriteArmor.add("netherrite_chestplate"); - netherriteArmor.add("netherrite_leggings"); - netherriteArmor.add("netherrite_boots"); } private void fillGlassBlockWhiteList() { @@ -189,12 +515,198 @@ public class MaterialMapStore { foodItemWhiteList.add("tropical_fish"); } + /** + * Checks if a Material is used for Armor + * @param material target material + * @return true if it is used for armor + */ + public boolean isArmor(Material material) { + return isArmor(material.getKey().getKey()); + } + + /** + * Checks if the id provided is used as armor + * @param id target item id + * @return true if the item id matches armor + */ + public boolean isArmor(String id) { + return armors.contains(id); + } + + public boolean isTool(Material material) { + return isTool(material.getKey().getKey()); + } + + public boolean isTool(String id) { + return tools.contains(id); + } + + public boolean isEnchantable(Material material) { + return isEnchantable(material.getKey().getKey()); + } + + public boolean isEnchantable(String id) { + return enchantables.contains(id); + } + + public boolean isOre(Material material) { + return isOre(material.getKey().getKey()); + } + + public boolean isOre(String id) { + return ores.contains(id); + } + + public boolean isBow(Material material) { + return isBow(material.getKey().getKey()); + } + + public boolean isBow(String id) { + return bows.contains(id); + } + + public boolean isLeatherArmor(Material material) { + return isLeatherArmor(material.getKey().getKey()); + } + + public boolean isLeatherArmor(String id) { + return leatherArmor.contains(id); + } + + public boolean isIronArmor(Material material) { + return isIronArmor(material.getKey().getKey()); + } + + public boolean isIronArmor(String id) { + return ironArmor.contains(id); + } + + public boolean isGoldArmor(Material material) { + return isGoldArmor(material.getKey().getKey()); + } + + public boolean isGoldArmor(String id) { + return goldArmor.contains(id); + } + + public boolean isDiamondArmor(Material material) { + return isDiamondArmor(material.getKey().getKey()); + } + + public boolean isDiamondArmor(String id) { + return diamondArmor.contains(id); + } + + public boolean isChainmailArmor(Material material) { + return isChainmailArmor(material.getKey().getKey()); + } + + public boolean isChainmailArmor(String id) { + return chainmailArmor.contains(id); + } + public boolean isNetherriteArmor(Material material) { - return netherriteArmor.contains(material.getKey().getKey()); + return isNetherriteArmor(material.getKey().getKey()); + } + + public boolean isNetherriteArmor(String id) { + return netherriteArmor.contains(id); + } + + public boolean isWoodTool(Material material) { + return isWoodTool(material.getKey().getKey()); + } + + public boolean isWoodTool(String id) { + return woodTools.contains(id); + } + + public boolean isStoneTool(Material material) { + return isStoneTool(material.getKey().getKey()); + } + + public boolean isStoneTool(String id) { + return stoneTools.contains(id); + } + + public boolean isIronTool(Material material) { + return isIronTool(material.getKey().getKey()); + } + + public boolean isIronTool(String id) { + return ironTools.contains(id); + } + + public boolean isGoldTool(Material material) { + return isGoldTool(material.getKey().getKey()); + } + + public boolean isGoldTool(String id) { + return goldTools.contains(id); + } + + public boolean isDiamondTool(Material material) { + return isDiamondTool(material.getKey().getKey()); + } + + public boolean isDiamondTool(String id) { + return diamondTools.contains(id); + } + + public boolean isSword(Material material) { + return isSword(material.getKey().getKey()); + } + + public boolean isSword(String id) { + return swords.contains(id); + } + + public boolean isAxe(Material material) { + return isAxe(material.getKey().getKey()); + } + + public boolean isAxe(String id) { + return axes.contains(id); + } + + public boolean isPickAxe(Material material) { + return isPickAxe(material.getKey().getKey()); + } + + public boolean isPickAxe(String id) { + return pickAxes.contains(id); + } + + public boolean isShovel(Material material) { + return isShovel(material.getKey().getKey()); + } + + public boolean isShovel(String id) { + return shovels.contains(id); + } + + public boolean isHoe(Material material) { + return isHoe(material.getKey().getKey()); + } + + public boolean isHoe(String id) { + return hoes.contains(id); } public boolean isNetherriteTool(Material material) { - return netherriteTools.contains(material.getKey().getKey()); + return isNetherriteTool(material.getKey().getKey()); + } + + public boolean isNetherriteTool(String id) { + return netherriteTools.contains(id); + } + + public boolean isStringTool(Material material) { + return isStringTool(material.getKey().getKey()); + } + + public boolean isStringTool(String id) { + return stringTools.contains(id); } public boolean isGlass(Material material) { diff --git a/src/main/java/com/gmail/nossr50/util/MaterialUtils.java b/src/main/java/com/gmail/nossr50/util/MaterialUtils.java index 0d7233222..4a38eba2f 100644 --- a/src/main/java/com/gmail/nossr50/util/MaterialUtils.java +++ b/src/main/java/com/gmail/nossr50/util/MaterialUtils.java @@ -7,22 +7,6 @@ public final class MaterialUtils { private MaterialUtils() {} protected static boolean isOre(Material data) { - //Netherrite Ore (Kind of) - if(data.getKey().getKey().equalsIgnoreCase("ancient_debris")) - return true; - - switch (data) { - case COAL_ORE: - case DIAMOND_ORE: - case NETHER_QUARTZ_ORE: - case GOLD_ORE: - case IRON_ORE: - case LAPIS_ORE: - case REDSTONE_ORE: - case EMERALD_ORE: - return true; - default: - return mcMMO.getModManager().isCustomOre(data); - } + return mcMMO.getMaterialMapStore().isOre(data.getKey().getKey()); } } From 89a990f0cb53037db03488da20b7d15386d3ca7c Mon Sep 17 00:00:00 2001 From: nossr50 Date: Tue, 3 Mar 2020 16:37:13 -0800 Subject: [PATCH 11/29] Another dupe fix + 1.16 support part 4 --- Changelog.txt | 26 ++++++----- src/main/java/com/gmail/nossr50/mcMMO.java | 6 +-- .../nossr50/skills/mining/MiningManager.java | 11 ++--- .../nossr50/skills/swords/SwordsManager.java | 2 + .../gmail/nossr50/util/MaterialMapStore.java | 45 ++++++++++++++++++- .../nossr50/util/skills/CombatUtils.java | 37 ++------------- src/main/resources/config.yml | 1 + 7 files changed, 75 insertions(+), 53 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index 94c8a7330..0f9fb402f 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,37 +1,43 @@ Version 2.1.119 1.16 Support + Fixed another dupe bug mcMMO is now aware of turtle shell and treats it appropriately + mcMMO is now aware of chainmail armor and treats it appropriately + Calculations which change depend on the quality of your tool or armor has had netherrack support coded in + All excavation drops that can drop from soul_sand now also drop from soul_soil (edited treasures.yml) + + Added 'Bamboo_Sapling' to bonus drops for Herbalism in experience.yml Added 'Ancient_Debris' with a value of 7777 to mining experience tables in experience.yml - Added 'Netherite_Scrap' to bonus drops for Mining in config.yml - Added 'Ancient_Debris' to bonus drops for Mining in config.yml Added 'Basalt' with a value of 40 to mining experience tables in experience.yml Added 'Crimson_Fungus' with a value of 50 to herbalism experience tables in experience.yml - Added 'Crimson_Fungus' to bonus drops for Herbalism in config.yml Added 'Warped_Fungus' with a value of 50 to herbalism experience tables in experience.yml - Added 'Warped_Fungus' to bonus drops for Herbalism in config.yml Added 'Warped_Nylium' with a value of 5 to mining experience tables in experience.yml - Added 'Warped_Nylium' to bonus drops for Mining in config.yml Added 'Crimson_Nylium' with a value of 5 to mining experience tables in experience.yml - Added 'Crimson_Nylium' to bonus drops for Mining in config.yml Added 'Crimson_Stem' with a value of 35 to woodcutting experience tables in experience.yml Added 'Crimson_Roots' with a value of 35 to woodcutting experience tables in experience.yml Added 'Warped_Stem' with a value of 35 to woodcutting experience tables in experience.yml Added 'Warped_Roots' with a value of 35 to woodcutting experience tables in experience.yml Added 'Ancient_Debris' with a value of 200 to smelting experience tables in experience.yml - Added 'Crimson_Stem' to bonus drops for Woodcutting in config.yml - Added 'Warped_Stem' to bonus drops for Woodcutting in config.yml Added 'Nether_Sprouts' with a value of 10 to Herbalism experience tables in experience.yml Added 'Shroomlight' with a value of 100 to Woodcutting experience tables in experience.yml - Added 'Shroomlight' to bonus drops for Woodcutting in config.yml Added 'Soul_Soil' with a value of 50 to Excavation experience tables in experience.yml Added 'Nether_Wart_Block' with a value of 20 to Woodcutting experience tables in experience.yml Added 'Nether_Wart_Block' with a value of 20 to Herbalism experience tables in experience.yml Added 'Warped_Wart_Block' with a value of 20 to Woodcutting experience tables in experience.yml Added 'Warped_Wart_Block' with a value of 20 to Herbalism experience tables in experience.yml Added 'Weeping_Vines' with a value of 10 to Herbalism experience tables in experience.yml - All excavation drops that can drop from soul_sand now also drop from soul_soil (edited treasures.yml) + Added 'Ancient_Debris' to bonus drops for Mining in config.yml + Added 'Netherite_Scrap' to bonus drops for Mining in config.yml + Added 'Crimson_Fungus' to bonus drops for Herbalism in config.yml + Added 'Warped_Fungus' to bonus drops for Herbalism in config.yml + Added 'Warped_Nylium' to bonus drops for Mining in config.yml + Added 'Crimson_Nylium' to bonus drops for Mining in config.yml + Added 'Crimson_Stem' to bonus drops for Woodcutting in config.yml + Added 'Warped_Stem' to bonus drops for Woodcutting in config.yml + Added 'Shroomlight' to bonus drops for Woodcutting in config.yml + NOTES: You may have to edit your configs for this update to mcMMO, either do it manually or delete the config files to regenerate them. Version 2.1.118 Fixed another dupe bug diff --git a/src/main/java/com/gmail/nossr50/mcMMO.java b/src/main/java/com/gmail/nossr50/mcMMO.java index 0306f6d68..4169fd793 100644 --- a/src/main/java/com/gmail/nossr50/mcMMO.java +++ b/src/main/java/com/gmail/nossr50/mcMMO.java @@ -153,6 +153,9 @@ public class mcMMO extends JavaPlugin { modManager = new ModManager(); + //Init Material Maps + materialMapStore = new MaterialMapStore(); + loadConfigFiles(); if (!noErrorsInConfigFiles) { @@ -250,9 +253,6 @@ public class mcMMO extends JavaPlugin { getServer().getPluginManager().disablePlugin(this); } - //Init Material Maps - materialMapStore = new MaterialMapStore(); - //Init player level values playerLevelUtils = new PlayerLevelUtils(); 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 fba28df36..b8b4d4669 100644 --- a/src/main/java/com/gmail/nossr50/skills/mining/MiningManager.java +++ b/src/main/java/com/gmail/nossr50/skills/mining/MiningManager.java @@ -136,11 +136,11 @@ public class MiningManager extends SkillManager { List ores = new ArrayList(); - List newYieldList = new ArrayList<>(); + List notOres = new ArrayList<>(); for (Block targetBlock : event.blockList()) { //Containers usually have 0 XP unless someone edited their config in a very strange way if (ExperienceConfig.getInstance().getXp(PrimarySkillType.MINING, targetBlock) == 0 || targetBlock instanceof Container || mcMMO.getPlaceStore().isTrue(targetBlock)) { - newYieldList.add(targetBlock); + notOres.add(targetBlock); } else { ores.add(targetBlock.getState()); } @@ -156,7 +156,7 @@ public class MiningManager extends SkillManager { // float debrisYield = yield - debrisReduction; for (BlockState blockState : ores) { - if (Misc.getRandom().nextFloat() < (newYieldList.size() + oreBonus)) { + if (Misc.getRandom().nextFloat() < (notOres.size() + oreBonus)) { xp += Mining.getBlockXp(blockState); Misc.dropItem(Misc.getBlockCenter(blockState), new ItemStack(blockState.getType())); // Initial block that would have been dropped @@ -168,8 +168,9 @@ public class MiningManager extends SkillManager { } //Replace the event blocklist with the newYield list - event.blockList().clear(); - event.blockList().addAll(newYieldList); + event.setYield(0F); +// event.blockList().clear(); +// event.blockList().addAll(notOres); applyXpGain(xp, XPGainReason.PVE); } diff --git a/src/main/java/com/gmail/nossr50/skills/swords/SwordsManager.java b/src/main/java/com/gmail/nossr50/skills/swords/SwordsManager.java index e876957d8..3f3a16aa0 100644 --- a/src/main/java/com/gmail/nossr50/skills/swords/SwordsManager.java +++ b/src/main/java/com/gmail/nossr50/skills/swords/SwordsManager.java @@ -98,6 +98,8 @@ public class SwordsManager extends SkillManager { public int getToolTier(ItemStack itemStack) { + if(ItemUtils.isNetherriteTool(itemStack)) + return 5; if(ItemUtils.isDiamondTool(itemStack)) return 4; else if(ItemUtils.isIronTool(itemStack) || ItemUtils.isGoldTool(itemStack)) diff --git a/src/main/java/com/gmail/nossr50/util/MaterialMapStore.java b/src/main/java/com/gmail/nossr50/util/MaterialMapStore.java index df45e59da..afa42a3e9 100644 --- a/src/main/java/com/gmail/nossr50/util/MaterialMapStore.java +++ b/src/main/java/com/gmail/nossr50/util/MaterialMapStore.java @@ -2,6 +2,7 @@ package com.gmail.nossr50.util; import org.bukkit.Material; +import java.util.HashMap; import java.util.HashSet; import java.util.Locale; @@ -53,6 +54,8 @@ public class MaterialMapStore { private HashSet ores; + private HashMap tierValue; + public MaterialMapStore() { @@ -96,7 +99,9 @@ public class MaterialMapStore { ores = new HashSet<>(); - fillHardcodedHashSets(); + tierValue = new HashMap<>(); + + fillVanillaMaterialRegisters(); } public boolean isMultiBlockPlant(Material material) @@ -139,7 +144,7 @@ public class MaterialMapStore { return canMakeShroomyWhiteList.contains(material.getKey().getKey()); } - private void fillHardcodedHashSets() + private void fillVanillaMaterialRegisters() { fillAbilityBlackList(); fillToolBlackList(); @@ -155,6 +160,34 @@ public class MaterialMapStore { fillTools(); fillEnchantables(); fillOres(); + + fillTierMap(); + } + + private void fillTierMap() { + for(String id : leatherArmor) { + tierValue.put(id, 1); + } + + for(String id : ironArmor) { + tierValue.put(id, 2); + } + + for(String id : goldArmor) { + tierValue.put(id, 3); + } + + for(String id : chainmailArmor) { + tierValue.put(id, 3); + } + + for(String id : diamondArmor) { + tierValue.put(id, 6); + } + + for(String id : netherriteArmor) { + tierValue.put(id, 12); + } } private void fillOres() { @@ -1040,6 +1073,14 @@ public class MaterialMapStore { toolBlackList.add("stonecutter"); } + public int getTier(Material material) { + return getTier(material.getKey().getKey()); + } + + public int getTier(String id) { + return tierValue.getOrDefault(id, 1); //1 for unknown items + } + private void addToHashSet(String string, HashSet stringHashSet) { stringHashSet.add(string.toLowerCase(Locale.ENGLISH)); 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 42afeeca3..c653bce02 100644 --- a/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java +++ b/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java @@ -411,12 +411,9 @@ public final class CombatUtils { if(metadataValue.size() <= 0) return; - if(metadataValue != null) - { - OldName oldName = (OldName) metadataValue.get(0); - entity.setCustomName(oldName.asString()); - entity.setCustomNameVisible(false); - } + OldName oldName = (OldName) metadataValue.get(0); + entity.setCustomName(oldName.asString()); + entity.setCustomNameVisible(false); } /** @@ -480,33 +477,7 @@ public final class CombatUtils { * @return the armor quality of a specific Item Stack */ private static int getArmorQuality(ItemStack itemStack) { - int quality = 0; - - switch(itemStack.getType()) { - case LEATHER_HELMET: - case LEATHER_BOOTS: - case LEATHER_CHESTPLATE: - case LEATHER_LEGGINGS: - return 1; - case IRON_HELMET: - case IRON_BOOTS: - case IRON_CHESTPLATE: - case IRON_LEGGINGS: - return 2; - case GOLDEN_HELMET: - case GOLDEN_BOOTS: - case GOLDEN_CHESTPLATE: - case GOLDEN_LEGGINGS: - return 3; - case DIAMOND_HELMET: - case DIAMOND_BOOTS: - case DIAMOND_CHESTPLATE: - case DIAMOND_LEGGINGS: - return 6; - default: - return 1; - - } + return mcMMO.getMaterialMapStore().getTier(itemStack.getType().getKey().getKey()); } /** diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 1e6236b0b..348968fd5 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -427,6 +427,7 @@ Skills: ### Bonus_Drops: Herbalism: + Bamboo_Sapling: true Crimson_Fungus: true Warped_Fungus: true Chorus_Fruit: true From 3a81d94b3240273536e26c44a8f201351be94db5 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Tue, 3 Mar 2020 17:14:57 -0800 Subject: [PATCH 12/29] 1.16 support part 5 --- Changelog.txt | 31 +++++++----- .../config/skills/salvage/SalvageConfig.java | 2 + .../datatypes/skills/MaterialType.java | 7 +++ .../nossr50/skills/mining/MiningManager.java | 48 +++++++++++++++++-- .../java/com/gmail/nossr50/util/Misc.java | 23 +++++++++ .../gmail/nossr50/util/skills/SkillUtils.java | 5 ++ src/main/resources/repair.vanilla.yml | 33 +++++++++++++ src/main/resources/salvage.vanilla.yml | 40 +++++++++++++++- 8 files changed, 173 insertions(+), 16 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index 0f9fb402f..b54670dea 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,23 +1,28 @@ Version 2.1.119 1.16 Support Fixed another dupe bug + Fixed a bug that can cause blast mining to give out more rewards than intended + Blast Mining rewards are now randomized but still influenced by your blast mining rank mcMMO is now aware of turtle shell and treats it appropriately mcMMO is now aware of chainmail armor and treats it appropriately Calculations which change depend on the quality of your tool or armor has had netherrack support coded in All excavation drops that can drop from soul_sand now also drop from soul_soil (edited treasures.yml) + Added Netherrack armor/weapons/tools to repair.vanilla.yml + Added Netherrack armor/weapons/tools to salvage.vanilla.yml + Added 'Bamboo_Sapling' to bonus drops for Herbalism in experience.yml - Added 'Ancient_Debris' with a value of 7777 to mining experience tables in experience.yml - Added 'Basalt' with a value of 40 to mining experience tables in experience.yml - Added 'Crimson_Fungus' with a value of 50 to herbalism experience tables in experience.yml - Added 'Warped_Fungus' with a value of 50 to herbalism experience tables in experience.yml - Added 'Warped_Nylium' with a value of 5 to mining experience tables in experience.yml - Added 'Crimson_Nylium' with a value of 5 to mining experience tables in experience.yml - Added 'Crimson_Stem' with a value of 35 to woodcutting experience tables in experience.yml - Added 'Crimson_Roots' with a value of 35 to woodcutting experience tables in experience.yml - Added 'Warped_Stem' with a value of 35 to woodcutting experience tables in experience.yml - Added 'Warped_Roots' with a value of 35 to woodcutting experience tables in experience.yml - Added 'Ancient_Debris' with a value of 200 to smelting experience tables in experience.yml + Added 'Ancient_Debris' with a value of 7777 to Mining experience tables in experience.yml + Added 'Basalt' with a value of 40 to Mining experience tables in experience.yml + Added 'Crimson_Fungus' with a value of 50 to Herbalism experience tables in experience.yml + Added 'Warped_Fungus' with a value of 50 to Herbalism experience tables in experience.yml + Added 'Warped_Nylium' with a value of 5 to Mining experience tables in experience.yml + Added 'Crimson_Nylium' with a value of 5 to Mining experience tables in experience.yml + Added 'Crimson_Stem' with a value of 35 to Woodcutting experience tables in experience.yml + Added 'Crimson_Roots' with a value of 35 to Woodcutting experience tables in experience.yml + Added 'Warped_Stem' with a value of 35 to Woodcutting experience tables in experience.yml + Added 'Warped_Roots' with a value of 35 to Woodcutting experience tables in experience.yml + Added 'Ancient_Debris' with a value of 200 to Smelting experience tables in experience.yml Added 'Nether_Sprouts' with a value of 10 to Herbalism experience tables in experience.yml Added 'Shroomlight' with a value of 100 to Woodcutting experience tables in experience.yml Added 'Soul_Soil' with a value of 50 to Excavation experience tables in experience.yml @@ -38,6 +43,10 @@ Version 2.1.119 Added 'Shroomlight' to bonus drops for Woodcutting in config.yml NOTES: You may have to edit your configs for this update to mcMMO, either do it manually or delete the config files to regenerate them. + Here are the default configuration files if you wish to compare them to your own servers settings while updating your configs. + Netherrack is repaired using netherrack scraps for now, wait for 2.2 for a better version of repair. + Netherrack salvages into netherrack scraps for now, wait for 2.2 for a better version of salvage. + Version 2.1.118 Fixed another dupe bug 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 dc802c468..45a92c16b 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 @@ -75,6 +75,8 @@ public class SalvageConfig extends ConfigLoader { } else if (ItemUtils.isDiamondArmor(salvageItem) || ItemUtils.isDiamondTool(salvageItem)) { salvageMaterialType = MaterialType.DIAMOND; + } else if (ItemUtils.isNetherriteTool(salvageItem) || ItemUtils.isNetherriteArmor(salvageItem)) { + salvageMaterialType = MaterialType.NETHERRACK; } } else { diff --git a/src/main/java/com/gmail/nossr50/datatypes/skills/MaterialType.java b/src/main/java/com/gmail/nossr50/datatypes/skills/MaterialType.java index 62f7ed160..cf4807848 100644 --- a/src/main/java/com/gmail/nossr50/datatypes/skills/MaterialType.java +++ b/src/main/java/com/gmail/nossr50/datatypes/skills/MaterialType.java @@ -10,6 +10,7 @@ public enum MaterialType { IRON, GOLD, DIAMOND, + NETHERRACK, OTHER; public Material getDefaultMaterial() { @@ -35,6 +36,12 @@ public enum MaterialType { case DIAMOND: return Material.DIAMOND; + case NETHERRACK: + if(Material.getMaterial("netherrite_scrap") != null) + return Material.getMaterial("netherrite_scrap"); + else + return Material.GOLD_INGOT; + case OTHER: default: return null; 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 b8b4d4669..c30187d5d 100644 --- a/src/main/java/com/gmail/nossr50/skills/mining/MiningManager.java +++ b/src/main/java/com/gmail/nossr50/skills/mining/MiningManager.java @@ -17,6 +17,7 @@ import com.gmail.nossr50.util.player.NotificationManager; import com.gmail.nossr50.util.random.RandomChanceUtil; import com.gmail.nossr50.util.skills.RankUtils; import com.gmail.nossr50.util.skills.SkillUtils; +import org.apache.commons.lang.math.RandomUtils; import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.block.BlockState; @@ -131,6 +132,30 @@ public class MiningManager extends SkillManager { * @param yield The % of blocks to drop * @param event The {@link EntityExplodeEvent} */ + //TODO: Rewrite this garbage + //TODO: Rewrite this garbage + //TODO: Rewrite this garbage + //TODO: Rewrite this garbage + //TODO: Rewrite this garbage + //TODO: Rewrite this garbage + //TODO: Rewrite this garbage + //TODO: Rewrite this garbage + //TODO: Rewrite this garbage + //TODO: Rewrite this garbage + //TODO: Rewrite this garbage + //TODO: Rewrite this garbage + //TODO: Rewrite this garbage + //TODO: Rewrite this garbage + //TODO: Rewrite this garbage + //TODO: Rewrite this garbage + //TODO: Rewrite this garbage + //TODO: Rewrite this garbage + //TODO: Rewrite this garbage + //TODO: Rewrite this garbage + //TODO: Rewrite this garbage + //TODO: Rewrite this garbage + //TODO: Rewrite this garbage + //TODO: Rewrite this garbage public void blastMiningDropProcessing(float yield, EntityExplodeEvent event) { //Strip out only stuff that gives mining XP @@ -148,7 +173,7 @@ public class MiningManager extends SkillManager { int xp = 0; - float oreBonus = (float) (getOreBonus() / 100); +// float oreBonus = (float) (getOreBonus() / 100); //TODO: Pretty sure something is fucked with debrisReduction stuff // float debrisReduction = (float) (getDebrisReduction() / 100); int dropMultiplier = getDropMultiplier(); @@ -156,13 +181,14 @@ public class MiningManager extends SkillManager { // float debrisYield = yield - debrisReduction; for (BlockState blockState : ores) { - if (Misc.getRandom().nextFloat() < (notOres.size() + oreBonus)) { + if (RandomUtils.nextInt(ores.size()) >= (ores.size() / 2)) { xp += Mining.getBlockXp(blockState); Misc.dropItem(Misc.getBlockCenter(blockState), new ItemStack(blockState.getType())); // Initial block that would have been dropped for (int i = 1; i < dropMultiplier; i++) { - Mining.handleSilkTouchDrops(blockState); // Bonus drops - should drop the block & not the items + if(RandomUtils.nextInt(100) >= 75) + Mining.handleSilkTouchDrops(blockState); // Bonus drops - should drop the block & not the items } } } @@ -234,7 +260,21 @@ public class MiningManager extends SkillManager { * @return the Blast Mining tier */ public int getDropMultiplier() { - return getDropMultiplier(getBlastMiningTier()); + 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; + } } /** diff --git a/src/main/java/com/gmail/nossr50/util/Misc.java b/src/main/java/com/gmail/nossr50/util/Misc.java index f3746829b..cbb60ee46 100644 --- a/src/main/java/com/gmail/nossr50/util/Misc.java +++ b/src/main/java/com/gmail/nossr50/util/Misc.java @@ -144,6 +144,29 @@ public final class Misc { return location.getWorld().dropItem(location, itemStack); } + /** + * Drop an item at a given location. + * + * @param location The location to drop the item at + * @param itemStack The item to drop + * @return Dropped Item entity or null if invalid or cancelled + */ + public static Item dropItem(Location location, ItemStack itemStack, int count) { + if (itemStack.getType() == Material.AIR) { + return null; + } + + // We can't get the item until we spawn it and we want to make it cancellable, so we have a custom event. + McMMOItemSpawnEvent event = new McMMOItemSpawnEvent(location, itemStack); + mcMMO.p.getServer().getPluginManager().callEvent(event); + + if (event.isCancelled()) { + return null; + } + + return location.getWorld().dropItem(location, itemStack); + } + /** * Drop items at a given location. * diff --git a/src/main/java/com/gmail/nossr50/util/skills/SkillUtils.java b/src/main/java/com/gmail/nossr50/util/skills/SkillUtils.java index 7bc395adc..ad0605777 100644 --- a/src/main/java/com/gmail/nossr50/util/skills/SkillUtils.java +++ b/src/main/java/com/gmail/nossr50/util/skills/SkillUtils.java @@ -298,6 +298,11 @@ public class SkillUtils { public static int getRepairAndSalvageQuantities(Material itemMaterial, Material recipeMaterial) { int quantity = 0; + if(mcMMO.getMaterialMapStore().isNetherriteTool(itemMaterial) || mcMMO.getMaterialMapStore().isNetherriteArmor(itemMaterial)) { + //One netherrite bar requires 4 netherrite scraps + return 4; + } + for(Iterator recipeIterator = Bukkit.getServer().recipeIterator(); recipeIterator.hasNext();) { Recipe bukkitRecipe = recipeIterator.next(); diff --git a/src/main/resources/repair.vanilla.yml b/src/main/resources/repair.vanilla.yml index 49eec21d7..52cae9158 100644 --- a/src/main/resources/repair.vanilla.yml +++ b/src/main/resources/repair.vanilla.yml @@ -181,6 +181,39 @@ Repairables: DIAMOND_BOOTS: MinimumLevel: 0 XpMultiplier: 6 + + # + # Diamond repairables + ### + # Tools + NETHERRITE_SWORD: + MinimumLevel: 0 + XpMultiplier: .6 + NETHERRITE_SHOVEL: + MinimumLevel: 0 + XpMultiplier: .4 + NETHERRITE_PICKAXE: + MinimumLevel: 0 + XpMultiplier: 1.1 + NETHERRITE_AXE: + MinimumLevel: 0 + XpMultiplier: 1.1 + NETHERRITE_HOE: + MinimumLevel: 0 + XpMultiplier: .75 + # Armor + NETHERRITE_HELMET: + MinimumLevel: 0 + XpMultiplier: 7 + NETHERRITE_CHESTPLATE: + MinimumLevel: 0 + XpMultiplier: 7 + NETHERRITE_LEGGINGS: + MinimumLevel: 0 + XpMultiplier: 7 + NETHERRITE_BOOTS: + MinimumLevel: 0 + XpMultiplier: 7 # # Leather repairables ### diff --git a/src/main/resources/salvage.vanilla.yml b/src/main/resources/salvage.vanilla.yml index 4f39ce75f..55e969c05 100644 --- a/src/main/resources/salvage.vanilla.yml +++ b/src/main/resources/salvage.vanilla.yml @@ -12,7 +12,7 @@ ## This defaults to OTHER. # # MaterialType: This is the type of the material of the item to be salvaged, this is only important for permissions. -## Valid values are STRING, LEATHER, WOOD, STONE, IRON, GOLD, DIAMOND, and OTHER +## Valid values are STRING, LEATHER, WOOD, STONE, IRON, GOLD, DIAMOND, NETHERRACK, and OTHER ## This defaults to OTHER. # # SalvageMaterial: This is the material name of the item used to salvage this item. @@ -219,6 +219,44 @@ Salvageables: MinimumLevel: 50 XpMultiplier: 6 MaximumQuantity: 4 + + NETHERRITE_SWORD: + MinimumLevel: 50 + XpMultiplier: .5 + MaximumQuantity: 2 + NETHERRITE_SHOVEL: + MinimumLevel: 50 + XpMultiplier: .3 + MaximumQuantity: 1 + NETHERRITE_PICKAXE: + MinimumLevel: 50 + XpMultiplier: 1 + MaximumQuantity: 3 + NETHERRITE_AXE: + MinimumLevel: 50 + XpMultiplier: 1 + MaximumQuantity: 3 + NETHERRITE_HOE: + MinimumLevel: 50 + XpMultiplier: .5 + MaximumQuantity: 2 + # Armor + NETHERRITE_HELMET: + MinimumLevel: 50 + XpMultiplier: 6 + MaximumQuantity: 5 + NETHERRITE_CHESTPLATE: + MinimumLevel: 50 + XpMultiplier: 6 + MaximumQuantity: 8 + NETHERRITE_LEGGINGS: + MinimumLevel: 50 + XpMultiplier: 6 + MaximumQuantity: 7 + NETHERRITE_BOOTS: + MinimumLevel: 50 + XpMultiplier: 6 + MaximumQuantity: 4 # # Leather salvageables ### From 2644de5ab4ac4abddb61c1e6a7bff46fa4c00e8f Mon Sep 17 00:00:00 2001 From: nossr50 Date: Tue, 3 Mar 2020 17:19:46 -0800 Subject: [PATCH 13/29] 2.1.119 - 1.16 Support --- Changelog.txt | 4 ++++ pom.xml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Changelog.txt b/Changelog.txt index b54670dea..1b330a30d 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -44,9 +44,13 @@ Version 2.1.119 NOTES: You may have to edit your configs for this update to mcMMO, either do it manually or delete the config files to regenerate them. Here are the default configuration files if you wish to compare them to your own servers settings while updating your configs. + https://paste.gg/p/anonymous/bf8ba1a24c8c4f188da5f8b8ebfc2b35 (Keep scrolling) + Netherrack is repaired using netherrack scraps for now, wait for 2.2 for a better version of repair. Netherrack salvages into netherrack scraps for now, wait for 2.2 for a better version of salvage. + Repairing chainmail/etc will be tackled in 2.2 so don't expect that in this version + Version 2.1.118 Fixed another dupe bug diff --git a/pom.xml b/pom.xml index 6ab9046ff..81301eee4 100755 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 com.gmail.nossr50.mcMMO mcMMO - 2.1.119-SNAPSHOT + 2.1.119 mcMMO https://github.com/mcMMO-Dev/mcMMO From 325cbcad9d1c564cf9197d965b11fb237b72d1da Mon Sep 17 00:00:00 2001 From: nossr50 Date: Tue, 3 Mar 2020 17:52:02 -0800 Subject: [PATCH 14/29] 2.1.120 --- Changelog.txt | 10 ++- .../config/skills/salvage/SalvageConfig.java | 4 +- .../datatypes/skills/MaterialType.java | 8 +-- .../nossr50/skills/swords/SwordsManager.java | 2 +- .../com/gmail/nossr50/util/ItemUtils.java | 8 +-- .../gmail/nossr50/util/MaterialMapStore.java | 66 +++++++++---------- .../gmail/nossr50/util/skills/SkillUtils.java | 4 +- src/main/resources/repair.vanilla.yml | 20 +++--- src/main/resources/salvage.vanilla.yml | 20 +++--- 9 files changed, 73 insertions(+), 69 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index 1b330a30d..2d91bee29 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,3 +1,6 @@ +Version 2.1.120 + Fixed a bug involving the new netherite equipment + Version 2.1.119 1.16 Support Fixed another dupe bug @@ -8,8 +11,8 @@ Version 2.1.119 Calculations which change depend on the quality of your tool or armor has had netherrack support coded in All excavation drops that can drop from soul_sand now also drop from soul_soil (edited treasures.yml) - Added Netherrack armor/weapons/tools to repair.vanilla.yml - Added Netherrack armor/weapons/tools to salvage.vanilla.yml + Added netherite armor/weapons/tools to repair.vanilla.yml + Added netherite armor/weapons/tools to salvage.vanilla.yml Added 'Bamboo_Sapling' to bonus drops for Herbalism in experience.yml Added 'Ancient_Debris' with a value of 7777 to Mining experience tables in experience.yml @@ -42,7 +45,8 @@ Version 2.1.119 Added 'Warped_Stem' to bonus drops for Woodcutting in config.yml Added 'Shroomlight' to bonus drops for Woodcutting in config.yml - NOTES: You may have to edit your configs for this update to mcMMO, either do it manually or delete the config files to regenerate them. + NOTES: You will likely need to update repair.vanilla.yml, salvage.vanilla.yml and treasures.yml + You can just delete those config files to regenerate them fresh which is much faster if you don't have any custom settings in those files Here are the default configuration files if you wish to compare them to your own servers settings while updating your configs. https://paste.gg/p/anonymous/bf8ba1a24c8c4f188da5f8b8ebfc2b35 (Keep scrolling) 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 45a92c16b..58483cc2e 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 @@ -75,8 +75,8 @@ public class SalvageConfig extends ConfigLoader { } else if (ItemUtils.isDiamondArmor(salvageItem) || ItemUtils.isDiamondTool(salvageItem)) { salvageMaterialType = MaterialType.DIAMOND; - } else if (ItemUtils.isNetherriteTool(salvageItem) || ItemUtils.isNetherriteArmor(salvageItem)) { - salvageMaterialType = MaterialType.NETHERRACK; + } else if (ItemUtils.isNetheriteTool(salvageItem) || ItemUtils.isNetheriteArmor(salvageItem)) { + salvageMaterialType = MaterialType.NETHER; } } else { diff --git a/src/main/java/com/gmail/nossr50/datatypes/skills/MaterialType.java b/src/main/java/com/gmail/nossr50/datatypes/skills/MaterialType.java index cf4807848..2e6157a1f 100644 --- a/src/main/java/com/gmail/nossr50/datatypes/skills/MaterialType.java +++ b/src/main/java/com/gmail/nossr50/datatypes/skills/MaterialType.java @@ -10,7 +10,7 @@ public enum MaterialType { IRON, GOLD, DIAMOND, - NETHERRACK, + NETHER, OTHER; public Material getDefaultMaterial() { @@ -36,9 +36,9 @@ public enum MaterialType { case DIAMOND: return Material.DIAMOND; - case NETHERRACK: - if(Material.getMaterial("netherrite_scrap") != null) - return Material.getMaterial("netherrite_scrap"); + case NETHER: + if(Material.getMaterial("netherite_scrap") != null) + return Material.getMaterial("netherite_scrap"); else return Material.GOLD_INGOT; diff --git a/src/main/java/com/gmail/nossr50/skills/swords/SwordsManager.java b/src/main/java/com/gmail/nossr50/skills/swords/SwordsManager.java index 3f3a16aa0..d3bc09f8e 100644 --- a/src/main/java/com/gmail/nossr50/skills/swords/SwordsManager.java +++ b/src/main/java/com/gmail/nossr50/skills/swords/SwordsManager.java @@ -98,7 +98,7 @@ public class SwordsManager extends SkillManager { public int getToolTier(ItemStack itemStack) { - if(ItemUtils.isNetherriteTool(itemStack)) + if(ItemUtils.isNetheriteTool(itemStack)) return 5; if(ItemUtils.isDiamondTool(itemStack)) return 4; diff --git a/src/main/java/com/gmail/nossr50/util/ItemUtils.java b/src/main/java/com/gmail/nossr50/util/ItemUtils.java index 8470946cd..a0bfd5dee 100644 --- a/src/main/java/com/gmail/nossr50/util/ItemUtils.java +++ b/src/main/java/com/gmail/nossr50/util/ItemUtils.java @@ -143,12 +143,12 @@ public final class ItemUtils { return mcMMO.getMaterialMapStore().isDiamondArmor(item.getType().getKey().getKey()); } - public static boolean isNetherriteArmor(ItemStack itemStack) { - return mcMMO.getMaterialMapStore().isNetherriteArmor(itemStack.getType().getKey().getKey()); + public static boolean isNetheriteArmor(ItemStack itemStack) { + return mcMMO.getMaterialMapStore().isNetheriteArmor(itemStack.getType().getKey().getKey()); } - public static boolean isNetherriteTool(ItemStack itemStack) { - return mcMMO.getMaterialMapStore().isNetherriteTool(itemStack.getType().getKey().getKey()); + public static boolean isNetheriteTool(ItemStack itemStack) { + return mcMMO.getMaterialMapStore().isNetheriteTool(itemStack.getType().getKey().getKey()); } /** diff --git a/src/main/java/com/gmail/nossr50/util/MaterialMapStore.java b/src/main/java/com/gmail/nossr50/util/MaterialMapStore.java index afa42a3e9..6eae5afeb 100644 --- a/src/main/java/com/gmail/nossr50/util/MaterialMapStore.java +++ b/src/main/java/com/gmail/nossr50/util/MaterialMapStore.java @@ -26,8 +26,8 @@ public class MaterialMapStore { private HashSet foodItemWhiteList; private HashSet glassBlocks; - private HashSet netherriteArmor; - private HashSet netherriteTools; + private HashSet netheriteArmor; + private HashSet netheriteTools; private HashSet woodTools; private HashSet stoneTools; private HashSet leatherArmor; @@ -75,7 +75,7 @@ public class MaterialMapStore { chainmailArmor = new HashSet<>(); goldArmor = new HashSet<>(); diamondArmor = new HashSet<>(); - netherriteArmor = new HashSet<>(); + netheriteArmor = new HashSet<>(); armors = new HashSet<>(); woodTools = new HashSet<>(); @@ -83,7 +83,7 @@ public class MaterialMapStore { ironTools = new HashSet<>(); goldTools = new HashSet<>(); diamondTools = new HashSet<>(); - netherriteTools = new HashSet<>(); + netheriteTools = new HashSet<>(); bows = new HashSet<>(); stringTools = new HashSet<>(); tools = new HashSet<>(); @@ -185,7 +185,7 @@ public class MaterialMapStore { tierValue.put(id, 6); } - for(String id : netherriteArmor) { + for(String id : netheriteArmor) { tierValue.put(id, 12); } } @@ -209,7 +209,7 @@ public class MaterialMapStore { fillChainmailWhiteList(); fillGoldArmorWhiteList(); fillDiamondArmorWhiteList(); - fillNetherriteArmorWhiteList(); + fillnetheriteArmorWhiteList(); //Add all armors to armors hashset armors.addAll(leatherArmor); @@ -217,7 +217,7 @@ public class MaterialMapStore { armors.addAll(chainmailArmor); armors.addAll(goldArmor); armors.addAll(diamondArmor); - armors.addAll(netherriteArmor); + armors.addAll(netheriteArmor); armors.add("turtle_shell"); } @@ -245,7 +245,7 @@ public class MaterialMapStore { fillIronToolsWhiteList(); fillGoldToolsWhiteList(); fillDiamondToolsWhiteList(); - fillNetherriteToolsWhiteList(); + fillnetheriteToolsWhiteList(); fillSwords(); fillAxes(); @@ -262,7 +262,7 @@ public class MaterialMapStore { tools.addAll(ironTools); tools.addAll(goldTools); tools.addAll(diamondTools); - tools.addAll(netherriteTools); + tools.addAll(netheriteTools); tools.addAll(tridents); tools.addAll(stringTools); tools.addAll(bows); @@ -290,7 +290,7 @@ public class MaterialMapStore { swords.add("gold_sword"); swords.add("golden_sword"); swords.add("diamond_sword"); - swords.add("netherrite_sword"); + swords.add("netherite_sword"); } private void fillAxes() { @@ -301,7 +301,7 @@ public class MaterialMapStore { axes.add("gold_axe"); axes.add("golden_axe"); axes.add("diamond_axe"); - axes.add("netherrite_axe"); + axes.add("netherite_axe"); } private void fillPickAxes() { @@ -312,7 +312,7 @@ public class MaterialMapStore { pickAxes.add("gold_pickaxe"); pickAxes.add("golden_pickaxe"); pickAxes.add("diamond_pickaxe"); - pickAxes.add("netherrite_pickaxe"); + pickAxes.add("netherite_pickaxe"); } private void fillHoes() { @@ -323,7 +323,7 @@ public class MaterialMapStore { hoes.add("gold_hoe"); hoes.add("golden_hoe"); hoes.add("diamond_hoe"); - hoes.add("netherrite_hoe"); + hoes.add("netherite_hoe"); } private void fillShovels() { @@ -334,7 +334,7 @@ public class MaterialMapStore { shovels.add("gold_shovel"); shovels.add("golden_shovel"); shovels.add("diamond_shovel"); - shovels.add("netherrite_shovel"); + shovels.add("netherite_shovel"); } private void fillLeatherArmorWhiteList() { @@ -378,11 +378,11 @@ public class MaterialMapStore { diamondArmor.add("diamond_boots"); } - private void fillNetherriteArmorWhiteList() { - netherriteArmor.add("netherrite_helmet"); - netherriteArmor.add("netherrite_chestplate"); - netherriteArmor.add("netherrite_leggings"); - netherriteArmor.add("netherrite_boots"); + private void fillnetheriteArmorWhiteList() { + netheriteArmor.add("netherite_helmet"); + netheriteArmor.add("netherite_chestplate"); + netheriteArmor.add("netherite_leggings"); + netheriteArmor.add("netherite_boots"); } private void fillWoodToolsWhiteList() { @@ -464,12 +464,12 @@ public class MaterialMapStore { diamondTools.add("diamond_shovel"); } - private void fillNetherriteToolsWhiteList() { - netherriteTools.add("netherrite_sword"); - netherriteTools.add("netherrite_axe"); - netherriteTools.add("netherrite_hoe"); - netherriteTools.add("netherrite_pickaxe"); - netherriteTools.add("netherrite_shovel"); + private void fillnetheriteToolsWhiteList() { + netheriteTools.add("netherite_sword"); + netheriteTools.add("netherite_axe"); + netheriteTools.add("netherite_hoe"); + netheriteTools.add("netherite_pickaxe"); + netheriteTools.add("netherite_shovel"); } private void fillGlassBlockWhiteList() { @@ -638,12 +638,12 @@ public class MaterialMapStore { return chainmailArmor.contains(id); } - public boolean isNetherriteArmor(Material material) { - return isNetherriteArmor(material.getKey().getKey()); + public boolean isNetheriteArmor(Material material) { + return isNetheriteArmor(material.getKey().getKey()); } - public boolean isNetherriteArmor(String id) { - return netherriteArmor.contains(id); + public boolean isNetheriteArmor(String id) { + return netheriteArmor.contains(id); } public boolean isWoodTool(Material material) { @@ -726,12 +726,12 @@ public class MaterialMapStore { return hoes.contains(id); } - public boolean isNetherriteTool(Material material) { - return isNetherriteTool(material.getKey().getKey()); + public boolean isNetheriteTool(Material material) { + return isNetheriteTool(material.getKey().getKey()); } - public boolean isNetherriteTool(String id) { - return netherriteTools.contains(id); + public boolean isNetheriteTool(String id) { + return netheriteTools.contains(id); } public boolean isStringTool(Material material) { diff --git a/src/main/java/com/gmail/nossr50/util/skills/SkillUtils.java b/src/main/java/com/gmail/nossr50/util/skills/SkillUtils.java index ad0605777..a539c8bae 100644 --- a/src/main/java/com/gmail/nossr50/util/skills/SkillUtils.java +++ b/src/main/java/com/gmail/nossr50/util/skills/SkillUtils.java @@ -298,8 +298,8 @@ public class SkillUtils { public static int getRepairAndSalvageQuantities(Material itemMaterial, Material recipeMaterial) { int quantity = 0; - if(mcMMO.getMaterialMapStore().isNetherriteTool(itemMaterial) || mcMMO.getMaterialMapStore().isNetherriteArmor(itemMaterial)) { - //One netherrite bar requires 4 netherrite scraps + if(mcMMO.getMaterialMapStore().isNetheriteTool(itemMaterial) || mcMMO.getMaterialMapStore().isNetheriteArmor(itemMaterial)) { + //One netherite bar requires 4 netherite scraps return 4; } diff --git a/src/main/resources/repair.vanilla.yml b/src/main/resources/repair.vanilla.yml index 52cae9158..deaec375c 100644 --- a/src/main/resources/repair.vanilla.yml +++ b/src/main/resources/repair.vanilla.yml @@ -11,7 +11,7 @@ ## This defaults to OTHER. # # ItemMaterialCategory: This is the type of the material of the item to be repaired, this is only important for permissions. -## Valid values are STRING, LEATHER, WOOD, STONE, IRON, GOLD, DIAMOND, and OTHER +## Valid values are STRING, LEATHER, WOOD, STONE, IRON, GOLD, DIAMOND, NETHER, and OTHER ## This defaults to OTHER. # # RepairMaterial: This is the material name of the item used to repair this repairable. @@ -186,32 +186,32 @@ Repairables: # Diamond repairables ### # Tools - NETHERRITE_SWORD: + netherite_SWORD: MinimumLevel: 0 XpMultiplier: .6 - NETHERRITE_SHOVEL: + netherite_SHOVEL: MinimumLevel: 0 XpMultiplier: .4 - NETHERRITE_PICKAXE: + netherite_PICKAXE: MinimumLevel: 0 XpMultiplier: 1.1 - NETHERRITE_AXE: + netherite_AXE: MinimumLevel: 0 XpMultiplier: 1.1 - NETHERRITE_HOE: + netherite_HOE: MinimumLevel: 0 XpMultiplier: .75 # Armor - NETHERRITE_HELMET: + netherite_HELMET: MinimumLevel: 0 XpMultiplier: 7 - NETHERRITE_CHESTPLATE: + netherite_CHESTPLATE: MinimumLevel: 0 XpMultiplier: 7 - NETHERRITE_LEGGINGS: + netherite_LEGGINGS: MinimumLevel: 0 XpMultiplier: 7 - NETHERRITE_BOOTS: + netherite_BOOTS: MinimumLevel: 0 XpMultiplier: 7 # diff --git a/src/main/resources/salvage.vanilla.yml b/src/main/resources/salvage.vanilla.yml index 55e969c05..b5e35efc4 100644 --- a/src/main/resources/salvage.vanilla.yml +++ b/src/main/resources/salvage.vanilla.yml @@ -12,7 +12,7 @@ ## This defaults to OTHER. # # MaterialType: This is the type of the material of the item to be salvaged, this is only important for permissions. -## Valid values are STRING, LEATHER, WOOD, STONE, IRON, GOLD, DIAMOND, NETHERRACK, and OTHER +## Valid values are STRING, LEATHER, WOOD, STONE, IRON, GOLD, DIAMOND, NETHER, and OTHER ## This defaults to OTHER. # # SalvageMaterial: This is the material name of the item used to salvage this item. @@ -220,40 +220,40 @@ Salvageables: XpMultiplier: 6 MaximumQuantity: 4 - NETHERRITE_SWORD: + netherite_SWORD: MinimumLevel: 50 XpMultiplier: .5 MaximumQuantity: 2 - NETHERRITE_SHOVEL: + netherite_SHOVEL: MinimumLevel: 50 XpMultiplier: .3 MaximumQuantity: 1 - NETHERRITE_PICKAXE: + netherite_PICKAXE: MinimumLevel: 50 XpMultiplier: 1 MaximumQuantity: 3 - NETHERRITE_AXE: + netherite_AXE: MinimumLevel: 50 XpMultiplier: 1 MaximumQuantity: 3 - NETHERRITE_HOE: + netherite_HOE: MinimumLevel: 50 XpMultiplier: .5 MaximumQuantity: 2 # Armor - NETHERRITE_HELMET: + netherite_HELMET: MinimumLevel: 50 XpMultiplier: 6 MaximumQuantity: 5 - NETHERRITE_CHESTPLATE: + netherite_CHESTPLATE: MinimumLevel: 50 XpMultiplier: 6 MaximumQuantity: 8 - NETHERRITE_LEGGINGS: + netherite_LEGGINGS: MinimumLevel: 50 XpMultiplier: 6 MaximumQuantity: 7 - NETHERRITE_BOOTS: + netherite_BOOTS: MinimumLevel: 50 XpMultiplier: 6 MaximumQuantity: 4 From a7d2c901df2701d504c4176c9d8d352b5f54d10f Mon Sep 17 00:00:00 2001 From: nossr50 Date: Tue, 3 Mar 2020 17:52:18 -0800 Subject: [PATCH 15/29] 2.1.120 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 81301eee4..e618f8628 100755 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 com.gmail.nossr50.mcMMO mcMMO - 2.1.119 + 2.1.120 mcMMO https://github.com/mcMMO-Dev/mcMMO From 51e80f40dd3854545407a7a8c4b0b803fdc9b909 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Tue, 3 Mar 2020 17:57:51 -0800 Subject: [PATCH 16/29] sigh --- pom.xml | 2 +- src/main/resources/repair.vanilla.yml | 18 +++++++++--------- src/main/resources/salvage.vanilla.yml | 18 +++++++++--------- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/pom.xml b/pom.xml index e618f8628..55e343bcd 100755 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 com.gmail.nossr50.mcMMO mcMMO - 2.1.120 + 2.1.121-SNAPSHOT mcMMO https://github.com/mcMMO-Dev/mcMMO diff --git a/src/main/resources/repair.vanilla.yml b/src/main/resources/repair.vanilla.yml index deaec375c..357c1b6d1 100644 --- a/src/main/resources/repair.vanilla.yml +++ b/src/main/resources/repair.vanilla.yml @@ -186,32 +186,32 @@ Repairables: # Diamond repairables ### # Tools - netherite_SWORD: + NETHERITE_SWORD: MinimumLevel: 0 XpMultiplier: .6 - netherite_SHOVEL: + NETHERITE_SHOVEL: MinimumLevel: 0 XpMultiplier: .4 - netherite_PICKAXE: + NETHERITE_PICKAXE: MinimumLevel: 0 XpMultiplier: 1.1 - netherite_AXE: + NETHERITE_AXE: MinimumLevel: 0 XpMultiplier: 1.1 - netherite_HOE: + NETHERITE_HOE: MinimumLevel: 0 XpMultiplier: .75 # Armor - netherite_HELMET: + NETHERITE_HELMET: MinimumLevel: 0 XpMultiplier: 7 - netherite_CHESTPLATE: + NETHERITE_CHESTPLATE: MinimumLevel: 0 XpMultiplier: 7 - netherite_LEGGINGS: + NETHERITE_LEGGINGS: MinimumLevel: 0 XpMultiplier: 7 - netherite_BOOTS: + NETHERITE_BOOTS: MinimumLevel: 0 XpMultiplier: 7 # diff --git a/src/main/resources/salvage.vanilla.yml b/src/main/resources/salvage.vanilla.yml index b5e35efc4..f310af65d 100644 --- a/src/main/resources/salvage.vanilla.yml +++ b/src/main/resources/salvage.vanilla.yml @@ -220,40 +220,40 @@ Salvageables: XpMultiplier: 6 MaximumQuantity: 4 - netherite_SWORD: + NETHERITE_SWORD: MinimumLevel: 50 XpMultiplier: .5 MaximumQuantity: 2 - netherite_SHOVEL: + NETHERITE_SHOVEL: MinimumLevel: 50 XpMultiplier: .3 MaximumQuantity: 1 - netherite_PICKAXE: + NETHERITE_PICKAXE: MinimumLevel: 50 XpMultiplier: 1 MaximumQuantity: 3 - netherite_AXE: + NETHERITE_AXE: MinimumLevel: 50 XpMultiplier: 1 MaximumQuantity: 3 - netherite_HOE: + NETHERITE_HOE: MinimumLevel: 50 XpMultiplier: .5 MaximumQuantity: 2 # Armor - netherite_HELMET: + NETHERITE_HELMET: MinimumLevel: 50 XpMultiplier: 6 MaximumQuantity: 5 - netherite_CHESTPLATE: + NETHERITE_CHESTPLATE: MinimumLevel: 50 XpMultiplier: 6 MaximumQuantity: 8 - netherite_LEGGINGS: + NETHERITE_LEGGINGS: MinimumLevel: 50 XpMultiplier: 6 MaximumQuantity: 7 - netherite_BOOTS: + NETHERITE_BOOTS: MinimumLevel: 50 XpMultiplier: 6 MaximumQuantity: 4 From ff8c94bf449618050b606aedefdcc2a02aec2f71 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Tue, 3 Mar 2020 18:14:56 -0800 Subject: [PATCH 17/29] 2.1.121 --- Changelog.txt | 3 +++ pom.xml | 2 +- .../gmail/nossr50/config/skills/repair/RepairConfig.java | 5 +++++ .../gmail/nossr50/config/skills/salvage/SalvageConfig.java | 6 ++++++ 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Changelog.txt b/Changelog.txt index 2d91bee29..2baf285ac 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,3 +1,6 @@ +Version 2.1.121 + Fixed a netherite related bug that prevented mcMMO from functioning correctly + Version 2.1.120 Fixed a bug involving the new netherite equipment diff --git a/pom.xml b/pom.xml index 55e343bcd..c6e5046bf 100755 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 com.gmail.nossr50.mcMMO mcMMO - 2.1.121-SNAPSHOT + 2.1.121 mcMMO https://github.com/mcMMO-Dev/mcMMO 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 848ba8468..bd4a3a2cf 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 @@ -48,6 +48,11 @@ public class RepairConfig extends ConfigLoader { Material itemMaterial = Material.matchMaterial(key); if (itemMaterial == null) { + if(key.toLowerCase().contains("nether")) { + mcMMO.p.getLogger().info("No support for repair item "+key+ " in this version of Minecraft, skipping."); + continue; + } + reason.add("Invalid material: " + key); } 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 58483cc2e..d46a9af09 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 @@ -45,6 +45,12 @@ public class SalvageConfig extends ConfigLoader { Material itemMaterial = Material.matchMaterial(key); if (itemMaterial == null) { + + if(key.toLowerCase().contains("nether")) { + mcMMO.p.getLogger().info("No support for salvage item "+key+ " in this version of Minecraft, skipping."); + continue; + } + reason.add("Invalid material: " + key); } From 3aa9f385e59d841eecd88835d39298ba334f817c Mon Sep 17 00:00:00 2001 From: nossr50 Date: Tue, 3 Mar 2020 22:09:57 -0800 Subject: [PATCH 18/29] Wart blocks are now treated like leaves --- Changelog.txt | 4 ++++ pom.xml | 2 +- src/main/java/com/gmail/nossr50/util/MaterialMapStore.java | 2 ++ src/main/resources/experience.yml | 4 ++-- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index 2baf285ac..41f825e1f 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,3 +1,7 @@ +Version 2.1.122 + Changed the xp values for Nether_Wart_Block and Warped_Wart_Block from 20 to 1 for Woodcutting + mcMMO now treats Nether_Wart_Block and Warped_Wart_Block as leaves + Version 2.1.121 Fixed a netherite related bug that prevented mcMMO from functioning correctly diff --git a/pom.xml b/pom.xml index c6e5046bf..2b81a436f 100755 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 com.gmail.nossr50.mcMMO mcMMO - 2.1.121 + 2.1.122-SNAPSHOT mcMMO https://github.com/mcMMO-Dev/mcMMO diff --git a/src/main/java/com/gmail/nossr50/util/MaterialMapStore.java b/src/main/java/com/gmail/nossr50/util/MaterialMapStore.java index 6eae5afeb..1b3a295ff 100644 --- a/src/main/java/com/gmail/nossr50/util/MaterialMapStore.java +++ b/src/main/java/com/gmail/nossr50/util/MaterialMapStore.java @@ -806,6 +806,8 @@ public class MaterialMapStore { leavesWhiteList.add("dark_oak_leaves"); leavesWhiteList.add("jungle_leaves"); leavesWhiteList.add("spruce_leaves"); + leavesWhiteList.add("nether_wart_block"); + leavesWhiteList.add("warped_wart_block"); } private void fillMossyWhiteList() diff --git a/src/main/resources/experience.yml b/src/main/resources/experience.yml index f38eeeabd..ac7d99bbd 100644 --- a/src/main/resources/experience.yml +++ b/src/main/resources/experience.yml @@ -249,8 +249,8 @@ Experience_Values: Soul_Sand: 40 Soul_Soil: 40 Woodcutting: - Nether_Wart_Block: 20 - Warped_Wart_Block: 20 + Nether_Wart_Block: 1 + Warped_Wart_Block: 1 Shroomlight: 100 Crimson_Stem: 35 Warped_Stem: 35 From b9d05d8d670442bf0721564cfd37c45dd0144afa Mon Sep 17 00:00:00 2001 From: nossr50 Date: Tue, 3 Mar 2020 22:13:34 -0800 Subject: [PATCH 19/29] Move roots to herbalism xp tables --- Changelog.txt | 5 +++++ src/main/resources/experience.yml | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index 41f825e1f..038f3d32a 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,6 +1,11 @@ Version 2.1.122 Changed the xp values for Nether_Wart_Block and Warped_Wart_Block from 20 to 1 for Woodcutting + Changed the xp values for Nether_Wart_Block and Warped_Wart_Block from 20 to 3 for Herbalism mcMMO now treats Nether_Wart_Block and Warped_Wart_Block as leaves + Removed Crimson_Roots and Warped_Roots from Woodcutting XP tables in experience.yml + Added Crimson_Roots and Warped_Roots to Herbalism XP tables in experience.yml with a value of 6 XP + + Version 2.1.121 Fixed a netherite related bug that prevented mcMMO from functioning correctly diff --git a/src/main/resources/experience.yml b/src/main/resources/experience.yml index ac7d99bbd..ddf6c4f18 100644 --- a/src/main/resources/experience.yml +++ b/src/main/resources/experience.yml @@ -254,8 +254,6 @@ Experience_Values: Shroomlight: 100 Crimson_Stem: 35 Warped_Stem: 35 - Crimson_Roots: 35 - Warped_Roots: 35 Oak_Log: 70 Spruce_Log: 80 Birch_Log: 90 @@ -284,8 +282,10 @@ Experience_Values: Brown_Mushroom_Block: 70 Mushroom_Stem: 80 Herbalism: - Nether_Wart_Block: 20 - Warped_Wart_Block: 20 + Crimson_Roots: 6 + Warped_Roots: 6 + Nether_Wart_Block: 3 + Warped_Wart_Block: 3 Nether_Sprouts: 10 Crimson_Fungus: 50 Warped_Fungus: 50 From ce1051c3640ff2e8cb1d435bdcff62b26c4128b8 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Tue, 3 Mar 2020 22:24:35 -0800 Subject: [PATCH 20/29] 2.1.122 --- Changelog.txt | 3 +-- pom.xml | 2 +- .../nossr50/config/skills/repair/RepairConfig.java | 11 ++++------- .../nossr50/config/skills/salvage/SalvageConfig.java | 12 ++++-------- 4 files changed, 10 insertions(+), 18 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index 038f3d32a..4f141c2ae 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -4,8 +4,7 @@ Version 2.1.122 mcMMO now treats Nether_Wart_Block and Warped_Wart_Block as leaves Removed Crimson_Roots and Warped_Roots from Woodcutting XP tables in experience.yml Added Crimson_Roots and Warped_Roots to Herbalism XP tables in experience.yml with a value of 6 XP - - + Fixed some start up bugs for salvage/repair Version 2.1.121 Fixed a netherite related bug that prevented mcMMO from functioning correctly diff --git a/pom.xml b/pom.xml index 2b81a436f..5ae55d786 100755 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 com.gmail.nossr50.mcMMO mcMMO - 2.1.122-SNAPSHOT + 2.1.122 mcMMO https://github.com/mcMMO-Dev/mcMMO 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 bd4a3a2cf..ef381ebd6 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 @@ -48,12 +48,8 @@ public class RepairConfig extends ConfigLoader { Material itemMaterial = Material.matchMaterial(key); if (itemMaterial == null) { - if(key.toLowerCase().contains("nether")) { - mcMMO.p.getLogger().info("No support for repair item "+key+ " in this version of Minecraft, skipping."); - continue; - } - - reason.add("Invalid material: " + key); + mcMMO.p.getLogger().info("No support for repair item "+key+ " in this version of Minecraft, skipping."); + continue; } // Repair Material Type @@ -99,7 +95,8 @@ public class RepairConfig extends ConfigLoader { Material repairMaterial = (repairMaterialName == null ? repairMaterialType.getDefaultMaterial() : Material.matchMaterial(repairMaterialName)); if (repairMaterial == null) { - reason.add(key + " has an invalid repair material: " + repairMaterialName); + mcMMO.p.getLogger().info("Could not find a valid repair material for item named "+key+", skipping."); + continue; } // Maximum Durability 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 d46a9af09..3200d8139 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 @@ -45,13 +45,8 @@ public class SalvageConfig extends ConfigLoader { Material itemMaterial = Material.matchMaterial(key); if (itemMaterial == null) { - - if(key.toLowerCase().contains("nether")) { - mcMMO.p.getLogger().info("No support for salvage item "+key+ " in this version of Minecraft, skipping."); - continue; - } - - reason.add("Invalid material: " + key); + mcMMO.p.getLogger().info("No support for salvage item "+key+ " in this version of Minecraft, skipping."); + continue; } // Salvage Material Type @@ -99,7 +94,8 @@ public class SalvageConfig extends ConfigLoader { Material salvageMaterial = (salvageMaterialName == null ? salvageMaterialType.getDefaultMaterial() : Material.matchMaterial(salvageMaterialName)); if (salvageMaterial == null) { - reason.add(key + " has an invalid salvage material: " + salvageMaterialName); + mcMMO.p.getLogger().info("Could not find a salvage material for item named " + key + ", skipping."); + continue; } // Maximum Durability From 8f8dfcf5563de6054dadc3f653eb30a97854ad2e Mon Sep 17 00:00:00 2001 From: nossr50 Date: Tue, 3 Mar 2020 22:32:24 -0800 Subject: [PATCH 21/29] Update ability black lists --- Changelog.txt | 2 ++ pom.xml | 2 +- .../java/com/gmail/nossr50/util/MaterialMapStore.java | 10 ++++++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Changelog.txt b/Changelog.txt index 4f141c2ae..e93d018bf 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -6,6 +6,8 @@ Version 2.1.122 Added Crimson_Roots and Warped_Roots to Herbalism XP tables in experience.yml with a value of 6 XP Fixed some start up bugs for salvage/repair + You can either edit experience.yml yourself or delete it to regenerate a new one to get the new changes + Version 2.1.121 Fixed a netherite related bug that prevented mcMMO from functioning correctly diff --git a/pom.xml b/pom.xml index 5ae55d786..486bca171 100755 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 com.gmail.nossr50.mcMMO mcMMO - 2.1.122 + 2.1.123-SNAPSHOT mcMMO https://github.com/mcMMO-Dev/mcMMO diff --git a/src/main/java/com/gmail/nossr50/util/MaterialMapStore.java b/src/main/java/com/gmail/nossr50/util/MaterialMapStore.java index 1b3a295ff..518993e56 100644 --- a/src/main/java/com/gmail/nossr50/util/MaterialMapStore.java +++ b/src/main/java/com/gmail/nossr50/util/MaterialMapStore.java @@ -821,6 +821,16 @@ public class MaterialMapStore { private void fillAbilityBlackList() { + abilityBlackList.add("warped_fence_gate"); + abilityBlackList.add("crimson_fence_gate"); + abilityBlackList.add("warped_pressure_plate"); + abilityBlackList.add("crimson_pressure_plate"); + abilityBlackList.add("warped_button"); + abilityBlackList.add("crimson_button"); + abilityBlackList.add("warped_door"); + abilityBlackList.add("crimson_door"); + abilityBlackList.add("warped_trapdoor"); + abilityBlackList.add("crimson_trapdoor"); abilityBlackList.add("black_bed"); abilityBlackList.add("blue_bed"); abilityBlackList.add("brown_bed"); From 1bd4454a6bb9d51d7d62d7fd8e398ab21ea38994 Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Sat, 7 Mar 2020 23:19:44 +0000 Subject: [PATCH 22/29] Show correct minimum level in adept salvage message --- .../java/com/gmail/nossr50/skills/salvage/SalvageManager.java | 2 +- 1 file changed, 1 insertion(+), 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 063fd746e..7eab2c9dc 100644 --- a/src/main/java/com/gmail/nossr50/skills/salvage/SalvageManager.java +++ b/src/main/java/com/gmail/nossr50/skills/salvage/SalvageManager.java @@ -87,7 +87,7 @@ public class SalvageManager extends SkillManager { // Level check if (getSkillLevel() < minimumSalvageableLevel) { - NotificationManager.sendPlayerInformation(player, NotificationType.REQUIREMENTS_NOT_MET, "Salvage.Skills.Adept.Level", String.valueOf(RankUtils.getUnlockLevel(SubSkillType.SALVAGE_ARCANE_SALVAGE)), StringUtils.getPrettyItemString(item.getType())); + NotificationManager.sendPlayerInformation(player, NotificationType.REQUIREMENTS_NOT_MET, "Salvage.Skills.Adept.Level", String.valueOf(salvageable.getMinimumLevel()), StringUtils.getPrettyItemString(item.getType())); return; } From 5609f1cdde0439fdd3210203cfe663c39c21b027 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Wed, 11 Mar 2020 17:45:18 -0700 Subject: [PATCH 23/29] update changelog --- Changelog.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Changelog.txt b/Changelog.txt index e93d018bf..62a1a6d8f 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,3 +1,6 @@ +Version 2.1.123 + Adept Salvage message will now show the correct minimum level + Version 2.1.122 Changed the xp values for Nether_Wart_Block and Warped_Wart_Block from 20 to 1 for Woodcutting Changed the xp values for Nether_Wart_Block and Warped_Wart_Block from 20 to 3 for Herbalism From de71c60d6b7e9f6dbc5385d2fd62c7e5929d1227 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Wed, 11 Mar 2020 17:47:00 -0700 Subject: [PATCH 24/29] Weeping vines fix / twisted vines added --- Changelog.txt | 2 ++ src/main/resources/experience.yml | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Changelog.txt b/Changelog.txt index 62a1a6d8f..3ac699da0 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,5 +1,7 @@ Version 2.1.123 Adept Salvage message will now show the correct minimum level + 'Weeping_Vines' renamed to 'Weeping_Vines_Plant' in experience.yml (no edits necessary) + 'Twisted_Vines_Plant' added to Herbalism XP tables in experience.yml with a value of 10 Version 2.1.122 Changed the xp values for Nether_Wart_Block and Warped_Wart_Block from 20 to 1 for Woodcutting diff --git a/src/main/resources/experience.yml b/src/main/resources/experience.yml index ddf6c4f18..6dfddb987 100644 --- a/src/main/resources/experience.yml +++ b/src/main/resources/experience.yml @@ -357,7 +357,8 @@ Experience_Values: Tall_Grass: 50 Large_Fern: 50 Vine: 10 - Weeping_Vines: 10 + Weeping_Vines_Plant: 10 + Twisting_Vines_Plant: 10 Lily_Pad: 100 White_Tulip: 150 Dandelion: 100 From fd1b1fe1248c871ae736f40c691b5ee0f0c8ca1c Mon Sep 17 00:00:00 2001 From: nossr50 Date: Wed, 11 Mar 2020 17:52:35 -0700 Subject: [PATCH 25/29] treat new vines as multi block plants --- Changelog.txt | 1 + src/main/java/com/gmail/nossr50/util/MaterialMapStore.java | 2 ++ 2 files changed, 3 insertions(+) diff --git a/Changelog.txt b/Changelog.txt index 3ac699da0..c6713c103 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -2,6 +2,7 @@ Version 2.1.123 Adept Salvage message will now show the correct minimum level 'Weeping_Vines' renamed to 'Weeping_Vines_Plant' in experience.yml (no edits necessary) 'Twisted_Vines_Plant' added to Herbalism XP tables in experience.yml with a value of 10 + Weeping_Vines_Plant and Twisted_Vines_Plant are now flagged as multi-block plants in Herbalism Version 2.1.122 Changed the xp values for Nether_Wart_Block and Warped_Wart_Block from 20 to 1 for Woodcutting diff --git a/src/main/java/com/gmail/nossr50/util/MaterialMapStore.java b/src/main/java/com/gmail/nossr50/util/MaterialMapStore.java index 518993e56..659dd716e 100644 --- a/src/main/java/com/gmail/nossr50/util/MaterialMapStore.java +++ b/src/main/java/com/gmail/nossr50/util/MaterialMapStore.java @@ -774,6 +774,8 @@ public class MaterialMapStore { multiBlockPlant.add("large_fern"); multiBlockPlant.add("tall_grass"); multiBlockPlant.add("bamboo"); + multiBlockPlant.add("weeping_vines_plant"); + multiBlockPlant.add("twisted_vines_plant"); } private void fillShroomyWhiteList() From d525f754a7ab78895a5dfb54cc8cb15adbe4560d Mon Sep 17 00:00:00 2001 From: nossr50 Date: Wed, 11 Mar 2020 17:53:36 -0700 Subject: [PATCH 26/29] Add nether gold ore --- Changelog.txt | 1 + src/main/resources/experience.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/Changelog.txt b/Changelog.txt index c6713c103..8de2073e7 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,4 +1,5 @@ Version 2.1.123 + Added 'Nether_Gold_Ore' to Mining XP tables in experience.yml with a value of 1300 Adept Salvage message will now show the correct minimum level 'Weeping_Vines' renamed to 'Weeping_Vines_Plant' in experience.yml (no edits necessary) 'Twisted_Vines_Plant' added to Herbalism XP tables in experience.yml with a value of 10 diff --git a/src/main/resources/experience.yml b/src/main/resources/experience.yml index 6dfddb987..762c50c48 100644 --- a/src/main/resources/experience.yml +++ b/src/main/resources/experience.yml @@ -385,6 +385,7 @@ Experience_Values: End_Stone: 15 Glowstone: 15 Gold_Ore: 1300 + Nether_Gold_Ore: 1300 Terracotta: 30 Iron_Ore: 900 Lapis_Ore: 800 From 7865ad8934bbd02ca5c7cde0fbd541c270bf2b36 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Fri, 13 Mar 2020 15:15:00 -0700 Subject: [PATCH 27/29] 2.1.123 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 486bca171..1e09e6bf8 100755 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 com.gmail.nossr50.mcMMO mcMMO - 2.1.123-SNAPSHOT + 2.1.123 mcMMO https://github.com/mcMMO-Dev/mcMMO From 58174d339198622f72886bffc9eb139912f7e569 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Tue, 17 Mar 2020 15:42:25 -0700 Subject: [PATCH 28/29] dev mode --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 1e09e6bf8..df2ae3318 100755 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 com.gmail.nossr50.mcMMO mcMMO - 2.1.123 + 2.1.124-SNAPSHOT mcMMO https://github.com/mcMMO-Dev/mcMMO From f8dbace9f0a35bd41b3903ca2933bfee600cce3d Mon Sep 17 00:00:00 2001 From: nossr50 Date: Tue, 17 Mar 2020 16:00:32 -0700 Subject: [PATCH 29/29] add comment --- src/main/java/com/gmail/nossr50/listeners/EntityListener.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/com/gmail/nossr50/listeners/EntityListener.java b/src/main/java/com/gmail/nossr50/listeners/EntityListener.java index ab6b1cbae..b49e4c91b 100644 --- a/src/main/java/com/gmail/nossr50/listeners/EntityListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/EntityListener.java @@ -106,6 +106,7 @@ public class EntityListener implements Listener { Entity projectile = event.getProjectile(); + //Should be noted that there are API changes regarding Arrow from 1.13.2 to current versions of the game if (!(projectile instanceof Arrow)) { return; }