merge master

This commit is contained in:
nossr50 2023-04-03 12:12:17 -07:00
commit 68d4a179f1
18 changed files with 188 additions and 149 deletions

View File

@ -49,4 +49,4 @@ jobs:
# 4. Build via Maven # 4. Build via Maven
- name: Build via Maven - name: Build via Maven
run: mvn verify -B --file pom.xml run: mvn verify -B --file pom.xml -DdisableXmlReport=true

View File

@ -49,6 +49,30 @@ Version 2.2.000
New Power Level Command New Power Level Command
This power level command gives you a view of all your current masteries, it also provides a summary of your power level. This power level command gives you a view of all your current masteries, it also provides a summary of your power level.
Version 2.1.219
Added support for various new things from Minecraft 1.20
Fixed double drop issue with Beetroots
Added 'Camel' to taming experience in experience.yml
Added 'Sniffer' to taming experience in experience.yml
Added 'Snifflet' to taming experience in experience.yml
Added 'Pitcher_Plant' to bonus drops in config.yml
Added 'Torchflower' to bonus drops in config.yml
Added 'Pink_Petals' to bonus drops in config.yml
Added 'Cherry_Log' to bonus drops in config.yml
Added 'Cherry_Wood' to bonus drops in config.yml
Added 'Camel' to combat experience in experience.yml
Added 'Sniffer' to combat experience in experience.yml
Added 'Snifflet' to combat experience in experience.yml
Added 'Torchflower' to herbalism experience in experience.yml
Added 'Pitcher_Plant' to herbalism experience in experience.yml
Added 'Pink_Petals' to herbalism experience in experience.yml
Added 'Cherry_Log' to woodcutting experience in experience.yml
Added 'Cherry_Wood' to woodcutting experience in experience.yml
Added 'Stripped_Cherry_Log' to woodcutting experience in experience.yml
Added 'Stripped_Cherry_Wood' to woodcutting experience in experience.yml
Added 'Skills.Mining.BlastMining.Bonus_Drops.Enabled' to advanced.yml to enable/disable bonus drops from Blast Mining
NOTE: There are plans to add experience and potentially subskills for discovering items via the new brushing mechanic, but this will have to wait for new Spigot API to become available
Version 2.1.218 Version 2.1.218
Fixed locale pt_BR type (thanks MrPowerGamerBR) Fixed locale pt_BR type (thanks MrPowerGamerBR)
Updated Russian Locale (thanks imDaniX) Updated Russian Locale (thanks imDaniX)

14
pom.xml
View File

@ -254,37 +254,37 @@
<dependency> <dependency>
<groupId>net.kyori</groupId> <groupId>net.kyori</groupId>
<artifactId>adventure-text-serializer-gson</artifactId> <artifactId>adventure-text-serializer-gson</artifactId>
<version>4.11.0</version> <version>4.13.0</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>net.kyori</groupId> <groupId>net.kyori</groupId>
<artifactId>adventure-api</artifactId> <artifactId>adventure-api</artifactId>
<version>4.11.0</version> <version>4.13.0</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>net.kyori</groupId> <groupId>net.kyori</groupId>
<artifactId>adventure-nbt</artifactId> <artifactId>adventure-nbt</artifactId>
<version>4.11.0</version> <version>4.13.0</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>net.kyori</groupId> <groupId>net.kyori</groupId>
<artifactId>adventure-key</artifactId> <artifactId>adventure-key</artifactId>
<version>4.11.0</version> <version>4.13.0</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>net.kyori</groupId> <groupId>net.kyori</groupId>
<artifactId>adventure-text-serializer-gson-legacy-impl</artifactId> <artifactId>adventure-text-serializer-gson-legacy-impl</artifactId>
<version>4.11.0</version> <version>4.13.0</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>net.kyori</groupId> <groupId>net.kyori</groupId>
<artifactId>adventure-platform-bukkit</artifactId> <artifactId>adventure-platform-bukkit</artifactId>
<version>4.1.2</version> <version>4.3.0</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>net.kyori</groupId> <groupId>net.kyori</groupId>
<artifactId>adventure-platform-api</artifactId> <artifactId>adventure-platform-api</artifactId>
<version>4.1.2</version> <version>4.3.0</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.maven.scm</groupId> <groupId>org.apache.maven.scm</groupId>

View File

@ -24,8 +24,10 @@ public class McnotifyCommand implements TabExecutor {
McMMOPlayer mcMMOPlayer = UserManager.getPlayer((Player) sender); McMMOPlayer mcMMOPlayer = UserManager.getPlayer((Player) sender);
//Not Loaded yet //Not Loaded yet
if (mcMMOPlayer == null) if (mcMMOPlayer == null) {
sender.sendMessage(LocaleLoader.getString("Profile.PendingLoad")); sender.sendMessage(LocaleLoader.getString("Profile.PendingLoad"));
return true;
}
sender.sendMessage(LocaleLoader.getString("Commands.Notifications." + (mcMMOPlayer.useChatNotifications() ? "Off" : "On"))); sender.sendMessage(LocaleLoader.getString("Commands.Notifications." + (mcMMOPlayer.useChatNotifications() ? "Off" : "On")));
mcMMOPlayer.toggleChatNotifications(); mcMMOPlayer.toggleChatNotifications();

View File

@ -47,21 +47,28 @@ public class InspectCommand implements TabExecutor {
sender.sendMessage(LocaleLoader.getString("Inspect.OfflineStats", playerName)); sender.sendMessage(LocaleLoader.getString("Inspect.OfflineStats", playerName));
// Sum power level
int powerLevel = 0;
sender.sendMessage(LocaleLoader.getString("Stats.Header.Gathering")); sender.sendMessage(LocaleLoader.getString("Stats.Header.Gathering"));
for (PrimarySkillType skill : mcMMO.p.getSkillTools().GATHERING_SKILLS) { for (PrimarySkillType skill : mcMMO.p.getSkillTools().GATHERING_SKILLS) {
sender.sendMessage(CommandUtils.displaySkill(profile, skill)); sender.sendMessage(CommandUtils.displaySkill(profile, skill));
powerLevel += profile.getSkillLevel(skill);
} }
sender.sendMessage(LocaleLoader.getString("Stats.Header.Combat")); sender.sendMessage(LocaleLoader.getString("Stats.Header.Combat"));
for (PrimarySkillType skill : mcMMO.p.getSkillTools().COMBAT_SKILLS) { for (PrimarySkillType skill : mcMMO.p.getSkillTools().COMBAT_SKILLS) {
sender.sendMessage(CommandUtils.displaySkill(profile, skill)); sender.sendMessage(CommandUtils.displaySkill(profile, skill));
powerLevel += profile.getSkillLevel(skill);
} }
sender.sendMessage(LocaleLoader.getString("Stats.Header.Misc")); sender.sendMessage(LocaleLoader.getString("Stats.Header.Misc"));
for (PrimarySkillType skill : mcMMO.p.getSkillTools().MISC_SKILLS) { for (PrimarySkillType skill : mcMMO.p.getSkillTools().MISC_SKILLS) {
sender.sendMessage(CommandUtils.displaySkill(profile, skill)); sender.sendMessage(CommandUtils.displaySkill(profile, skill));
powerLevel += profile.getSkillLevel(skill);
} }
sender.sendMessage(LocaleLoader.getString("Commands.PowerLevel", powerLevel));
} else { } else {
Player target = mcMMOPlayer.getPlayer(); Player target = mcMMOPlayer.getPlayer();
boolean isVanished = false; boolean isVanished = false;
@ -95,9 +102,7 @@ public class InspectCommand implements TabExecutor {
CommandUtils.printCombatSkills(target, sender); CommandUtils.printCombatSkills(target, sender);
CommandUtils.printMiscSkills(target, sender); CommandUtils.printMiscSkills(target, sender);
if (!isVanished) { sender.sendMessage(LocaleLoader.getString("Commands.PowerLevel", mcMMOPlayer.getPowerLevel()));
sender.sendMessage(LocaleLoader.getString("Commands.PowerLevel", mcMMOPlayer.getPowerLevel()));
}
} }
return true; return true;

View File

@ -777,6 +777,10 @@ public class AdvancedConfig extends BukkitConfig {
return config.getDouble("Skills.Mining.BlastMining.OreBonus.Rank_" + rank); return config.getDouble("Skills.Mining.BlastMining.OreBonus.Rank_" + rank);
} }
public boolean isBlastMiningBonusDropsEnabled() {
return config.getBoolean("Skills.Mining.BlastMining.Bonus_Drops.Enabled", true);
}
public double getDebrisReduction(int rank) { public double getDebrisReduction(int rank) {
return config.getDouble("Skills.Mining.BlastMining.DebrisReduction.Rank_" + rank); return config.getDouble("Skills.Mining.BlastMining.DebrisReduction.Rank_" + rank);
} }

View File

@ -27,40 +27,6 @@ public enum PrimarySkillType {
TAMING, TAMING,
UNARMED, UNARMED,
WOODCUTTING; WOODCUTTING;
// boolean issueWarning = true;
/*
* Everything below here will be removed in 2.2 (Tridents & Crossbows)
* Everything below here will be removed in 2.2 (Tridents & Crossbows)
* Everything below here will be removed in 2.2 (Tridents & Crossbows)
* Everything below here will be removed in 2.2 (Tridents & Crossbows)
* Everything below here will be removed in 2.2 (Tridents & Crossbows)
* Everything below here will be removed in 2.2 (Tridents & Crossbows)
* Everything below here will be removed in 2.2 (Tridents & Crossbows)
* Everything below here will be removed in 2.2 (Tridents & Crossbows)
* Everything below here will be removed in 2.2 (Tridents & Crossbows)
* Everything below here will be removed in 2.2 (Tridents & Crossbows)
* Everything below here will be removed in 2.2 (Tridents & Crossbows)
* Everything below here will be removed in 2.2 (Tridents & Crossbows)
* Everything below here will be removed in 2.2 (Tridents & Crossbows)
* Everything below here will be removed in 2.2 (Tridents & Crossbows)
* Everything below here will be removed in 2.2 (Tridents & Crossbows)
* Everything below here will be removed in 2.2 (Tridents & Crossbows)
*/
// private void processWarning() {
// if(issueWarning) {
// StackTraceElement[] stackTraceElements = Thread.currentThread().getStackTrace();
// Bukkit.getScheduler().scheduleSyncDelayedTask(mcMMO.p, () -> {
// mcMMO.p.getLogger().severe("A plugin that hooks into mcMMO via the mcMMO API is using soon to be deprecated API calls. Contact the plugin author and inform them to update their code before it breaks.");
// mcMMO.p.getLogger().severe("Deprecation Call from: " + stackTraceElements[2].toString());
// mcMMO.p.getLogger().severe("This warning will not repeat itself. Nothing is broken for now, but in the future it will be.");
// });
//
// issueWarning = !issueWarning;
// }
// }
/** /**
* WARNING: Being removed in an upcoming update, you should be using mcMMO.getSkillTools() instead * WARNING: Being removed in an upcoming update, you should be using mcMMO.getSkillTools() instead

View File

@ -38,6 +38,7 @@ import org.bukkit.event.block.*;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import java.util.HashSet; import java.util.HashSet;
import java.util.Locale;
public class BlockListener implements Listener { public class BlockListener implements Listener {
private final mcMMO plugin; private final mcMMO plugin;
@ -56,6 +57,12 @@ public class BlockListener implements Listener {
return; return;
} }
int tileEntityTolerance = 1;
// beetroot hotfix, potentially other plants may need this fix
if(event.getBlockState().getType() == Material.BEETROOTS)
tileEntityTolerance = 2;
//Track how many "things" are being dropped //Track how many "things" are being dropped
HashSet<Material> uniqueMaterials = new HashSet<>(); HashSet<Material> uniqueMaterials = new HashSet<>();
boolean dontRewardTE = false; //If we suspect TEs are mixed in with other things don't reward bonus drops for anything that isn't a block boolean dontRewardTE = false; //If we suspect TEs are mixed in with other things don't reward bonus drops for anything that isn't a block
@ -70,7 +77,7 @@ public class BlockListener implements Listener {
blockCount++; blockCount++;
} }
if(uniqueMaterials.size() > 1) { if(uniqueMaterials.size() > tileEntityTolerance) {
//Too many things are dropping, assume tile entities might be duped //Too many things are dropping, assume tile entities might be duped
//Technically this would also prevent something like coal from being bonus dropped if you placed a TE above a coal ore when mining it but that's pretty edge case and this is a good solution for now //Technically this would also prevent something like coal from being bonus dropped if you placed a TE above a coal ore when mining it but that's pretty edge case and this is a good solution for now
dontRewardTE = true; dontRewardTE = true;

View File

@ -361,40 +361,30 @@ public class EntityListener implements Listener {
//Friendly fire checks //Friendly fire checks
if (defender instanceof Player defendingPlayer) { if (defender instanceof Player defendingPlayer) {
Player attackingPlayer;
//If the attacker is a Player or a projectile belonging to a player //If the attacker is a Player or a projectile belonging to a player
if(attacker instanceof Projectile || attacker instanceof Player) { if(attacker instanceof Projectile projectile) {
if(attacker instanceof Projectile projectile) { if(projectile.getShooter() instanceof Player attackingPlayer && !attackingPlayer.equals(defendingPlayer)) {
if(((Projectile) attacker).getShooter() instanceof Player) { //Check for party friendly fire and cancel the event
attackingPlayer = (Player) projectile.getShooter(); if (checkParties(event, defendingPlayer, attackingPlayer)) {
return;
}
}
//Check for party friendly fire and cancel the event //Deflect checks
if (checkParties(event, defendingPlayer, attackingPlayer)) final McMMOPlayer mcMMOPlayer = UserManager.getPlayer(defendingPlayer);
{ if (mcMMOPlayer != null) {
UnarmedManager unarmedManager = mcMMOPlayer.getUnarmedManager();
if (unarmedManager.canDeflect()) {
if (projectile instanceof Arrow && unarmedManager.deflectCheck()) {
event.setCancelled(true);
return; return;
} }
} }
//Deflect checks
final McMMOPlayer mcMMOPlayer = UserManager.getPlayer(defendingPlayer);
if (mcMMOPlayer != null) {
UnarmedManager unarmedManager = mcMMOPlayer.getUnarmedManager();
if (unarmedManager.canDeflect()) {
if (projectile instanceof Arrow && unarmedManager.deflectCheck()) {
event.setCancelled(true);
return;
}
}
}
} else {
attackingPlayer = (Player) attacker;
//Check for party friendly fire and cancel the event
if (checkParties(event, defendingPlayer, attackingPlayer))
return;
} }
} else if (attacker instanceof Player attackingPlayer){
if (checkParties(event, defendingPlayer, attackingPlayer))
return;
} }
} }

View File

@ -40,10 +40,7 @@ import org.bukkit.inventory.PlayerInventory;
import org.bukkit.scheduler.BukkitRunnable; import org.bukkit.scheduler.BukkitRunnable;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import java.util.ArrayList; import java.util.*;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
public class HerbalismManager extends SkillManager { public class HerbalismManager extends SkillManager {
public HerbalismManager(McMMOPlayer mcMMOPlayer) { public HerbalismManager(McMMOPlayer mcMMOPlayer) {
@ -771,35 +768,39 @@ public class HerbalismManager extends SkillManager {
PlayerInventory playerInventory = player.getInventory(); PlayerInventory playerInventory = player.getInventory();
Material seed; Material seed;
switch (blockState.getType()) { switch (blockState.getType().getKey().getKey().toLowerCase(Locale.ROOT)) {
case CARROTS: case "carrots":
seed = Material.CARROT; seed = Material.matchMaterial("CARROT");
break; break;
case WHEAT: case "wheat":
seed = Material.WHEAT_SEEDS; seed = Material.matchMaterial("WHEAT_SEEDS");
break; break;
case NETHER_WART: case "nether_wart":
seed = Material.NETHER_WART; seed = Material.getMaterial("NETHER_WART");
break; break;
case POTATOES: case "potatoes":
seed = Material.POTATO; seed = Material.matchMaterial("POTATO");
break; break;
case BEETROOTS: case "beetroots":
seed = Material.BEETROOT_SEEDS; seed = Material.matchMaterial("BEETROOT_SEEDS");
break; break;
case COCOA: case "cocoa":
seed = Material.COCOA_BEANS; seed = Material.matchMaterial("COCOA_BEANS");
break; break;
case "torchflower":
seed = Material.matchMaterial("TORCHFLOWER_SEEDS");
break;
default: default:
return false; return false;
} }
ItemStack seedStack = new ItemStack(seed); ItemStack seedStack = new ItemStack(seed);
if (ItemUtils.isAxe(blockBreakEvent.getPlayer().getInventory().getItemInMainHand()) if (ItemUtils.isAxe(blockBreakEvent.getPlayer().getInventory().getItemInMainHand())
@ -850,17 +851,17 @@ public class HerbalismManager extends SkillManager {
return true; return true;
} }
switch (blockState.getType()) { switch (blockState.getType().getKey().getKey()) {
case POTATOES: case "potatoes":
case CARROTS: case "carrots":
case WHEAT: case "wheat":
finalAge = getGreenThumbStage(greenTerra); finalAge = getGreenThumbStage(greenTerra);
break; break;
case BEETROOTS: case "beetroots":
case NETHER_WART: case "nether_wart":
if (greenTerra || greenThumbStage > 2) { if (greenTerra || greenThumbStage > 2) {
finalAge = 2; finalAge = 2;
@ -871,9 +872,9 @@ public class HerbalismManager extends SkillManager {
else { else {
finalAge = 0; finalAge = 0;
} }
break; break;
case COCOA: case "cocoa":
if (getGreenThumbStage(greenTerra) >= 2) { if (getGreenThumbStage(greenTerra) >= 2) {
finalAge = 1; finalAge = 1;
@ -887,6 +888,7 @@ public class HerbalismManager extends SkillManager {
return false; return false;
} }
//Start the delayed replant //Start the delayed replant
startReplantTask(finalAge, blockBreakEvent, blockState, false); startReplantTask(finalAge, blockBreakEvent, blockState, false);
return true; return true;

View File

@ -1,6 +1,7 @@
package com.gmail.nossr50.skills.mining; package com.gmail.nossr50.skills.mining;
import com.gmail.nossr50.api.ItemSpawnReason; import com.gmail.nossr50.api.ItemSpawnReason;
import com.gmail.nossr50.config.AdvancedConfig;
import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.config.experience.ExperienceConfig;
import com.gmail.nossr50.datatypes.experience.XPGainReason; import com.gmail.nossr50.datatypes.experience.XPGainReason;
import com.gmail.nossr50.datatypes.interactions.NotificationType; import com.gmail.nossr50.datatypes.interactions.NotificationType;
@ -216,7 +217,7 @@ public class MiningManager extends SkillManager {
Misc.spawnItem(getPlayer(), Misc.getBlockCenter(blockState), new ItemStack(blockState.getType()), ItemSpawnReason.BLAST_MINING_ORES); // Initial block that would have been dropped Misc.spawnItem(getPlayer(), Misc.getBlockCenter(blockState), new ItemStack(blockState.getType()), ItemSpawnReason.BLAST_MINING_ORES); // Initial block that would have been dropped
if (!mcMMO.getPlaceStore().isTrue(blockState)) { if (mcMMO.p.getAdvancedConfig().isBlastMiningBonusDropsEnabled() && !mcMMO.getPlaceStore().isTrue(blockState)) {
for (int i = 1; i < dropMultiplier; i++) { for (int i = 1; i < dropMultiplier; i++) {
// Bukkit.broadcastMessage("Bonus Drop on Ore: "+blockState.getType().toString()); // Bukkit.broadcastMessage("Bonus Drop on Ore: "+blockState.getType().toString());
Misc.spawnItem(getPlayer(), Misc.getBlockCenter(blockState), new ItemStack(blockState.getType()), ItemSpawnReason.BLAST_MINING_ORES_BONUS_DROP); // Initial block that would have been dropped Misc.spawnItem(getPlayer(), Misc.getBlockCenter(blockState), new ItemStack(blockState.getType()), ItemSpawnReason.BLAST_MINING_ORES_BONUS_DROP); // Initial block that would have been dropped
@ -303,21 +304,16 @@ public class MiningManager extends SkillManager {
* @return the Blast Mining tier * @return the Blast Mining tier
*/ */
public int getDropMultiplier() { public int getDropMultiplier() {
switch(getBlastMiningTier()) { if (mcMMO.p.getAdvancedConfig().isBlastMiningBonusDropsEnabled()) {
case 8: return 0;
case 7:
return 3;
case 6:
case 5:
case 4:
case 3:
return 2;
case 2:
case 1:
return 1;
default:
return 0;
} }
return switch (getBlastMiningTier()) {
case 8, 7 -> 3;
case 6, 5, 4, 3 -> 2;
case 2, 1 -> 1;
default -> 0;
};
} }
/** /**

View File

@ -22,6 +22,7 @@ import org.jetbrains.annotations.Nullable;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Locale;
public final class ItemUtils { public final class ItemUtils {
/** /**
@ -413,31 +414,31 @@ public final class ItemUtils {
*/ */
public static boolean isHerbalismDrop(ItemStack item) { public static boolean isHerbalismDrop(ItemStack item) {
//TODO: 1.14 This needs to be updated //TODO: 1.14 This needs to be updated
switch (item.getType()) { switch (item.getType().getKey().getKey().toLowerCase()) {
case WHEAT: case "wheat":
case WHEAT_SEEDS: case "wheat_seeds":
case CARROT: case "carrot":
case CHORUS_FRUIT: case "chorus_fruit":
case CHORUS_FLOWER: case "chorus_flower":
case POTATO: case "potato":
case BEETROOT: case "beetroot":
case BEETROOTS: case "beetroots":
case BEETROOT_SEEDS: case "beetroot_seeds":
case NETHER_WART: case "nether_wart":
case BROWN_MUSHROOM: case "brown_mushroom":
case RED_MUSHROOM: case "red_mushroom":
case ROSE_BUSH: case "rose_bush":
case DANDELION: case "dandelion":
case CACTUS: case "cactus":
case SUGAR_CANE: case "sugar_cane":
case MELON: case "melon":
case MELON_SEEDS: case "melon_seeds":
case PUMPKIN: case "pumpkin":
case PUMPKIN_SEEDS: case "pumpkin_seeds":
case LILY_PAD: case "lily_pad":
case VINE: case "vine":
case TALL_GRASS: case "tall_grass":
case COCOA_BEANS: case "cocoa_beans":
return true; return true;
default: default:
@ -445,6 +446,7 @@ public final class ItemUtils {
} }
} }
/** /**
* Checks to see if an item is a mob drop. * Checks to see if an item is a mob drop.
* *

View File

@ -1017,6 +1017,7 @@ public class MaterialMapStore {
private void fillTreeFellerDestructibleWhiteList() private void fillTreeFellerDestructibleWhiteList()
{ {
treeFellerDestructibleWhiteList.add("oak_leaves"); treeFellerDestructibleWhiteList.add("oak_leaves");
treeFellerDestructibleWhiteList.add("cherry_leaves");
treeFellerDestructibleWhiteList.add("acacia_leaves"); treeFellerDestructibleWhiteList.add("acacia_leaves");
treeFellerDestructibleWhiteList.add("birch_leaves"); treeFellerDestructibleWhiteList.add("birch_leaves");
treeFellerDestructibleWhiteList.add("dark_oak_leaves"); treeFellerDestructibleWhiteList.add("dark_oak_leaves");
@ -1171,6 +1172,7 @@ public class MaterialMapStore {
private void fillToolBlackList() private void fillToolBlackList()
{ {
toolBlackList.add("chiseled_bookshelf");
toolBlackList.add("black_bed"); toolBlackList.add("black_bed");
toolBlackList.add("blue_bed"); toolBlackList.add("blue_bed");
toolBlackList.add("brown_bed"); toolBlackList.add("brown_bed");
@ -1256,17 +1258,28 @@ public class MaterialMapStore {
toolBlackList.add("yellow_shulker_box"); toolBlackList.add("yellow_shulker_box");
toolBlackList.add("shulker_box"); toolBlackList.add("shulker_box");
toolBlackList.add("acacia_sign"); toolBlackList.add("acacia_sign");
toolBlackList.add("acacia_hanging_sign");
toolBlackList.add("acacia_wall_sign"); toolBlackList.add("acacia_wall_sign");
toolBlackList.add("birch_sign"); toolBlackList.add("birch_sign");
toolBlackList.add("birch_hanging_sign");
toolBlackList.add("birch_wall_sign"); toolBlackList.add("birch_wall_sign");
toolBlackList.add("dark_oak_sign"); toolBlackList.add("dark_oak_sign");
toolBlackList.add("dark_oak_hanging_sign");
toolBlackList.add("dark_oak_wall_sign"); toolBlackList.add("dark_oak_wall_sign");
toolBlackList.add("jungle_sign"); toolBlackList.add("jungle_sign");
toolBlackList.add("jungle_hanging_sign");
toolBlackList.add("jungle_wall_sign"); toolBlackList.add("jungle_wall_sign");
toolBlackList.add("spruce_sign"); toolBlackList.add("spruce_sign");
toolBlackList.add("spruce_hanging_sign");
toolBlackList.add("spruce_wall_sign"); toolBlackList.add("spruce_wall_sign");
toolBlackList.add("oak_sign"); toolBlackList.add("oak_sign");
toolBlackList.add("oak_hanging_sign");
toolBlackList.add("oak_wall_sign"); toolBlackList.add("oak_wall_sign");
toolBlackList.add("cherry_sign");
toolBlackList.add("cherry_hanging_sign");
toolBlackList.add("cherry_wall_sign");
toolBlackList.add("stripped_cherry_log");
toolBlackList.add("stripped_cherry_wood");
toolBlackList.add("stripped_acacia_log"); toolBlackList.add("stripped_acacia_log");
toolBlackList.add("stripped_acacia_wood"); toolBlackList.add("stripped_acacia_wood");
toolBlackList.add("stripped_birch_log"); toolBlackList.add("stripped_birch_log");
@ -1308,6 +1321,7 @@ public class MaterialMapStore {
toolBlackList.add("lodestone"); toolBlackList.add("lodestone");
toolBlackList.add("respawn_anchor"); toolBlackList.add("respawn_anchor");
toolBlackList.add("sweet_berry_bush"); toolBlackList.add("sweet_berry_bush");
toolBlackList.add("smithing_table");
} }
public boolean isIntendedToolPickaxe(@NotNull Material material) { public boolean isIntendedToolPickaxe(@NotNull Material material) {

View File

@ -8,6 +8,7 @@ import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SubSkillType; import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.events.fake.FakeEntityDamageByEntityEvent; import com.gmail.nossr50.events.fake.FakeEntityDamageByEntityEvent;
import com.gmail.nossr50.events.fake.FakeEntityDamageEvent;
import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.metadata.MobMetaFlagType; import com.gmail.nossr50.metadata.MobMetaFlagType;
import com.gmail.nossr50.metadata.MobMetadataService; import com.gmail.nossr50.metadata.MobMetadataService;
@ -885,8 +886,14 @@ public final class CombatUtils {
return false; return false;
} }
public static boolean canDamage(@NotNull Entity attacker, @NotNull Entity target, @NotNull DamageCause damageCause, double damage) { public static boolean canDamage(@Nullable Entity attacker, @NotNull Entity target, @NotNull DamageCause damageCause, double damage) {
EntityDamageEvent damageEvent = new FakeEntityDamageByEntityEvent(attacker, target, damageCause, damage); EntityDamageEvent damageEvent;
if (attacker != null) {
damageEvent = new FakeEntityDamageByEntityEvent(attacker, target, damageCause, damage);
} else {
damageEvent = new FakeEntityDamageEvent(target, damageCause, damage);
}
mcMMO.p.getServer().getPluginManager().callEvent(damageEvent); mcMMO.p.getServer().getPluginManager().callEvent(damageEvent);
return !damageEvent.isCancelled(); return !damageEvent.isCancelled();

View File

@ -299,6 +299,8 @@ Skills:
RetroMode: 1000 RetroMode: 1000
BlastMining: BlastMining:
Bonus_Drops:
Enabled: true
# BlastDamageDecrease Ranks: % of damage reduced from TNT explosions # BlastDamageDecrease Ranks: % of damage reduced from TNT explosions
BlastDamageDecrease: BlastDamageDecrease:
Rank_1: 0.0 Rank_1: 0.0

View File

@ -468,6 +468,9 @@ Green_Thumb_Replanting_Crops:
### ###
Bonus_Drops: Bonus_Drops:
Herbalism: Herbalism:
Pitcher_Plant: true
Torchflower: true
Pink_Petals: true
Glow_Berries: true Glow_Berries: true
Cave_Vines: true Cave_Vines: true
Cave_Vines_Plant: true Cave_Vines_Plant: true
@ -605,6 +608,8 @@ Bonus_Drops:
Acacia_Log: true Acacia_Log: true
Birch_Wood: true Birch_Wood: true
Birch_Log: true Birch_Log: true
Cherry_Wood: true
Cherry_Log: true
Dark_Oak_Wood: true Dark_Oak_Wood: true
Dark_Oak_Log: true Dark_Oak_Log: true
Oak_Wood: true Oak_Wood: true

View File

@ -277,18 +277,21 @@ Experience_Values:
Crimson_Stem: 35 Crimson_Stem: 35
Warped_Stem: 35 Warped_Stem: 35
Oak_Log: 70 Oak_Log: 70
Cherry_Log: 105
Spruce_Log: 80 Spruce_Log: 80
Birch_Log: 90 Birch_Log: 90
Jungle_Log: 100 Jungle_Log: 100
Acacia_Log: 90 Acacia_Log: 90
Dark_Oak_Log: 90 Dark_Oak_Log: 90
Stripped_Oak_Log: 70 Stripped_Oak_Log: 70
Stripped_Cherry_Log: 105
Stripped_Spruce_Log: 80 Stripped_Spruce_Log: 80
Stripped_Birch_Log: 90 Stripped_Birch_Log: 90
Stripped_Jungle_Log: 100 Stripped_Jungle_Log: 100
Stripped_Acacia_Log: 90 Stripped_Acacia_Log: 90
Stripped_Dark_Oak_Log: 90 Stripped_Dark_Oak_Log: 90
Stripped_Oak_Wood: 70 Stripped_Oak_Wood: 70
Stripped_Cherry_Wood: 70
Stripped_Spruce_Wood: 80 Stripped_Spruce_Wood: 80
Stripped_Birch_Wood: 90 Stripped_Birch_Wood: 90
Stripped_Jungle_Wood: 100 Stripped_Jungle_Wood: 100
@ -298,6 +301,7 @@ Experience_Values:
Stripped_Crimson_Stem: 50 Stripped_Crimson_Stem: 50
Stripped_Warped_Stem: 50 Stripped_Warped_Stem: 50
Oak_Wood: 70 Oak_Wood: 70
Cherry_Wood: 105
Spruce_Wood: 70 Spruce_Wood: 70
Birch_Wood: 70 Birch_Wood: 70
Jungle_Wood: 70 Jungle_Wood: 70
@ -310,6 +314,8 @@ Experience_Values:
Brown_Mushroom_Block: 70 Brown_Mushroom_Block: 70
Mushroom_Stem: 80 Mushroom_Stem: 80
Herbalism: Herbalism:
Pitcher_Plant: 160
Pink_Petals: 10
Small_Dripleaf: 140 Small_Dripleaf: 140
Big_Dripleaf: 140 Big_Dripleaf: 140
Cave_Vines: 90 Cave_Vines: 90
@ -401,6 +407,7 @@ Experience_Values:
Cornflower: 150 Cornflower: 150
Lily_Of_The_Valley: 150 Lily_Of_The_Valley: 150
Wither_Rose: 500 Wither_Rose: 500
Torchflower: 90
Mining: Mining:
Sculk: 4 Sculk: 4
Sculk_Vein: 3 Sculk_Vein: 3
@ -541,6 +548,9 @@ Experience_Values:
Cobbled_Deepslate: 5 Cobbled_Deepslate: 5
Taming: Taming:
Animal_Taming: Animal_Taming:
Camel: 1300
Sniffer: 1500
Snifflet: 900
Llama: 1200 Llama: 1200
Wolf: 250 Wolf: 250
Ocelot: 500 Ocelot: 500
@ -633,3 +643,6 @@ Experience_Values:
Frog: 1.7 Frog: 1.7
Warden: 6.0 Warden: 6.0
Tadpole: 0.2 Tadpole: 0.2
Sniffer: 1.1
Snifflet: 1.1
Camel: 1.2

View File

@ -999,12 +999,12 @@ Skills.Parents=主技能
Skills.Stats={0}&a{1}&3 XP(&7{2}&3/&7{3}&3) Skills.Stats={0}&a{1}&3 XP(&7{2}&3/&7{3}&3)
Skills.ChildStats={0}&a{1} Skills.ChildStats={0}&a{1}
Skills.MaxXP=最大 Skills.MaxXP=最大
Skills.TooTired=你太累了暂时无法使用该技能.&e({0}s) Skills.TooTired=你太累了,暂时无法使用该技能.&e({0}s)
Skills.TooTired.Named=&7(&6{0}&e {1}s&7) Skills.TooTired.Named=&7(&6{0}&e {1}s&7)
Skills.TooTired.Extra=&6{0} &e技能冷却时间 - {1} Skills.TooTired.Extra=&6{0} &e技能冷却时间 - {1}
Skills.Cancelled=&6{0} &c已取消! Skills.Cancelled=&6{0} &c已取消!
Skills.ConfirmOrCancel=&a再次右键以确定 &6{0}&a. 左键取消. Skills.ConfirmOrCancel=&a再次右键以确定 &6{0}&a. 左键取消.
Skills.AbilityGateRequirementFail=&7你需要 &e{0}&7 级以上的 &3{1}&7 来使用这个能力. Skills.AbilityGateRequirementFail=&7你还需要提升 &e{0}&7 级 &3{1}&7 才能使用这个能力.
#数据 #数据
Stats.Header.Combat=&6-=格斗技能=- Stats.Header.Combat=&6-=格斗技能=-
Stats.Header.Gathering=&6-=采集技能=- Stats.Header.Gathering=&6-=采集技能=-
@ -1066,7 +1066,7 @@ Commands.Description.addlevels=给玩家增加 mcMMO 等级
Commands.Description.adminchat=切换 mcMMO 管理员聊天或发送管理员聊天信息 Commands.Description.adminchat=切换 mcMMO 管理员聊天或发送管理员聊天信息
Commands.Description.addxp=给玩家增加 mcMMO 经验 Commands.Description.addxp=给玩家增加 mcMMO 经验
Commands.Description.hardcore=修改 mcMMO hardcore 百分比或切换 hardcore 模式开/关 Commands.Description.hardcore=修改 mcMMO hardcore 百分比或切换 hardcore 模式开/关
Commands.Description.inspect=查看玩家详细的 mcMMO 信息 Commands.Description.inspect=查看玩家的 mcMMO 详细信息
Commands.Description.mcability=切换 mcMMO 技能右键激活 开/关 Commands.Description.mcability=切换 mcMMO 技能右键激活 开/关
Commands.Description.mccooldown=查看所有mcMMO技能冷却时间 Commands.Description.mccooldown=查看所有mcMMO技能冷却时间
Commands.Description.mcchatspy=切换对完聊天监视开/关 Commands.Description.mcchatspy=切换对完聊天监视开/关
@ -1095,8 +1095,8 @@ Commands.Description.vampirism=更改 mcMMO 榨取百分比 或切换 vampirism
Commands.Description.xplock=锁定指定 mcMMO 技能的经验条 Commands.Description.xplock=锁定指定 mcMMO 技能的经验条
Commands.Description.xprate=更改 mcMMO 经验倍率或开启一个 mcMMO 经验翻倍事件 Commands.Description.xprate=更改 mcMMO 经验倍率或开启一个 mcMMO 经验翻倍事件
#更新检查器 #更新检查器
UpdateChecker.Outdated=你正在使用这一个旧版本的 mcMMO! UpdateChecker.Outdated=你正在使用旧版本的 mcMMO!
UpdateChecker.NewAvailable=Spigot 上有一个新版本. UpdateChecker.NewAvailable=Spigot 上有一个新版本.
#记分板抬头 #记分板抬头
Scoreboard.Header.PlayerStats=&emcMMO 统计 Scoreboard.Header.PlayerStats=&emcMMO 统计
Scoreboard.Header.PlayerCooldowns=&emcMMO 冷却 Scoreboard.Header.PlayerCooldowns=&emcMMO 冷却
@ -1111,7 +1111,7 @@ Scoreboard.Misc.Cooldown=&d冷却
Scoreboard.Misc.Overall=&6总体 Scoreboard.Misc.Overall=&6总体
Scoreboard.Misc.Ability=能力 Scoreboard.Misc.Ability=能力
#数据库恢复 #数据库恢复
Profile.PendingLoad=&c你的mcMMO玩家数据未加载. Profile.PendingLoad=&c你的mcMMO玩家数据未正常加载.
Profile.Loading.Success=&a你的mcMMO数据已加载 Profile.Loading.Success=&a你的mcMMO数据已加载
Profile.Loading.Failure=&cmcMMO 无法加载你的数据. 请联系 &b服务器管理员反馈你的问题.\n&e你可以继续在服务器游玩, 但是你 &l没有mcMMO等级&e 并且你获得的任何经验都 &l不会被保存&e. Profile.Loading.Failure=&cmcMMO 无法加载你的数据. 请联系 &b服务器管理员反馈你的问题.\n&e你可以继续在服务器游玩, 但是你 &l没有mcMMO等级&e 并且你获得的任何经验都 &l不会被保存&e.
Profile.Loading.AdminFailureNotice=&4[A]&c mcMMO 无法加载玩家 &e{0}&c 的数据. &d请检查你的数据库. Profile.Loading.AdminFailureNotice=&4[A]&c mcMMO 无法加载玩家 &e{0}&c 的数据. &d请检查你的数据库.
@ -1141,4 +1141,4 @@ Chat.Channel.Off=&6(&amcMMO-聊天&6) &7你的聊天消息将不再自动发送
Chat.Spy.Party=&6[&eSPY&6-&a{2}&6] &r{0} &b→ &r{1} Chat.Spy.Party=&6[&eSPY&6-&a{2}&6] &r{0} &b→ &r{1}
Broadcasts.LevelUpMilestone=&6(&amcMMO&6) {0}&7 的 &3{2}&7 技能等级提升到了 &a{1}&7! Broadcasts.LevelUpMilestone=&6(&amcMMO&6) {0}&7 的 &3{2}&7 技能等级提升到了 &a{1}&7!
Broadcasts.PowerLevelUpMilestone=&6(&amcMMO&6) {0}&7 总等级已达到 &a{1}&7! Broadcasts.PowerLevelUpMilestone=&6(&amcMMO&6) {0}&7 总等级已达到 &a{1}&7!
Scoreboard.Recovery=正在尝试恢复 mcMMO 记分牌... Scoreboard.Recovery=正在尝试恢复 mcMMO 记分牌...