1
0
mirror of https://github.com/mcMMO-Dev/mcMMO.git synced 2026-02-18 09:43:00 +01:00

Compare commits

...

82 Commits

Author SHA1 Message Date
Shane Freeder
483553b89d add translation badge
is pretti?
2020-02-27 20:41:15 +00:00
Shane Freeder
6047a5579b Translated using Weblate (English (United States))
Currently translated at 100.0% (1021 of 1021 strings)

Translation: mcmmo/mcmmo-master
Translate-URL: https://translate.mcmmo.org/projects/mcmmo/mcmmo-master/en_US/
2020-02-27 20:26:56 +00:00
Shane Freeder
a94db1b88a Listen to me 2020-02-27 19:56:07 +00:00
Shane Freeder
f5a397d2d2 Translated using Weblate (English (United States))
Currently translated at 100.0% (1021 of 1021 strings)

Translation: mcmmo/mcmmo-master
Translate-URL: https://translate.mcmmo.org/projects/mcmmo/mcmmo-master/en_US/
2020-02-27 19:56:07 +00:00
Shane Freeder
05af15c06b Translated using Weblate (English (United States))
Currently translated at 100.0% (1021 of 1021 strings)

Translation: mcmmo/mcmmo-master
Translate-URL: https://translate.mcmmo.org/projects/mcmmo/mcmmo-master/en_US/
2020-02-27 19:56:07 +00:00
nossr50
0a59b79ef9 Dev mode 2020-02-27 10:50:56 -08:00
nossr50
441125dbd1 2.1.117 2020-02-27 07:36:41 -08:00
nossr50
eff1ce102f Merge branch 'master' of github.com:mcMMO-Dev/mcmmo 2020-02-24 16:01:18 -08:00
nossr50
705b57a30b dev mode 2020-02-24 16:01:10 -08:00
Shane Freeder
d4ba9d7605 Reduce mojang profile API call limit (Fixes #4121) 2020-02-22 11:12:52 +00:00
nossr50
4cd91350db 2.1.116 2020-02-20 17:35:33 -08:00
nossr50
6168309ec9 2.1.115 2020-02-19 17:41:47 -08:00
nossr50
95c403a467 More tweaks to GT 2020-02-19 17:31:00 -08:00
nossr50
a598796c99 More tweaks to GT 2020-02-19 17:20:05 -08:00
nossr50
a333f36fd8 Fix sneak check on GT 2020-02-19 16:19:19 -08:00
nossr50
7c6d5c476d Green Thumb requires a hoe, sneak to break with a hoe 2020-02-19 16:14:21 -08:00
nossr50
e2073ff9f7 Immature crop replanting, green thumb tweaks, replant accidental break
protection
2020-02-19 15:58:53 -08:00
nossr50
8f26544188 Immature plants will be replanted if weilding a hoe 2020-02-19 13:51:10 -08:00
nossr50
4e21f1a200 tweak and fix salvage result chance 2020-02-19 13:27:21 -08:00
nossr50
ab6dbe306d Fix potential NPE for salvage 2020-02-19 11:38:48 -08:00
Shane Freeder
38d64f207d Fix default permission for Critical Strikes 2020-02-12 02:06:49 +00:00
Shane Freeder
8e8024e3e1 update changelog 2020-02-09 22:50:28 +00:00
Shane Freeder
4f161812aa Use minimum level of salvagable properly 2020-02-09 22:47:20 +00:00
Shane Freeder
11ca0d9ff1 Fix 1.13.x archery compat 2020-02-04 23:36:54 +00:00
Shane Freeder
4eef4a3e41 Fix CCE from spectral arrows (Fixes #4114) 2020-02-04 23:29:51 +00:00
Shane Freeder
816b64cb70 Track spectral arrows for combat 2020-01-28 16:37:02 +00:00
Shane Freeder
dceee5554d Fix CombatUtils NPE due to arrows from unloaded players 2020-01-28 16:33:30 +00:00
nossr50
8094be46c8 Dev mode 2020-01-27 19:01:08 -08:00
nossr50
2525ce9abe 2.1.114 2020-01-27 18:53:39 -08:00
nossr50
ea70c937f2 Fix rank for new versions of MySQL 2020-01-27 18:45:19 -08:00
Shane Freeder
550a3df616 place SnowGolemExcavation exploit fix under the correct section 2020-01-28 00:12:50 +00:00
apachezy
657abb76a7 "EndermanEndermiteFarms" does not work. (#4111)
This error causes the "ExploitFix.EndermanEndermiteFarms" option in ExperienceConfig to not work.
2020-01-28 00:11:57 +00:00
Shane Freeder
0ffcff53b3 Further address locale issues (Targets #4083) 2020-01-26 17:48:14 +00:00
nossr50
33f4ac14b5 Add toggle for snow golem exploit to experience.yml - SnowGolemExcavation 2020-01-24 18:28:41 -08:00
nossr50
15d3119627 Berserk now breaks a soft block if it was used to activate it 2020-01-24 01:25:55 -08:00
nossr50
4fd94bfe29 2.1.113 2020-01-24 01:11:23 -08:00
nossr50
ac731258c7 Berserk now breaks glass and makes noise when doing so 2020-01-24 01:09:19 -08:00
nossr50
7b8c90d362 BlockCracker fix for infested stone bricks 2020-01-24 00:56:16 -08:00
nossr50
055391e908 Hacky fix for spigot bug 2020-01-24 00:43:18 -08:00
nossr50
cd6ce5a19d Correct changelog 2020-01-23 20:34:54 -08:00
nossr50
7441d2d8d6 Merge branch 'master' of github.com:mcMMO-Dev/mcmmo 2020-01-23 20:34:13 -08:00
nossr50
7b941baa1c Update changelog 2020-01-23 20:34:00 -08:00
Lane
0c1fa07079 Fixed typo in config for potato (#4096) 2020-01-17 07:23:28 +00:00
andrewkm
539cd7290e Retro mode documentation. (#4104)
This commit will save lives, believe me.
2020-01-17 07:21:31 +00:00
Shane Freeder
406429f4e3 Use ThreadedLocalRandom for RNG utils 2020-01-16 18:21:35 +00:00
t00thpick1
421a394f68 Another check for PTP exploit 2020-01-15 13:49:11 -08:00
t00thpick1
d4adb490e2 Fixing PTP exploit 2020-01-15 13:32:10 -08:00
nossr50
de5a8babc5 dev mode 2020-01-15 13:21:33 -08:00
nossr50
d892bfe83a 2.1.112 2020-01-14 20:10:33 -08:00
nossr50
ceaff0c862 SkillShot tweaks 2020-01-14 20:09:41 -08:00
nossr50
a118d8465e Sweet Berry Bush nerf 2020-01-14 19:57:38 -08:00
nossr50
7c156319be Skill Shot is now multiplicative instead of additive 2020-01-14 19:53:37 -08:00
nossr50
24b3bf1100 NPE fix for combat on unloaded profiles 2020-01-14 19:44:17 -08:00
nossr50
41bdca948a Update POM for 1.15.1 2020-01-13 19:28:28 -08:00
Shane Freeder
3cbbf1bee0 Move valid check higher up, no need to set additional metadata 2019-12-31 12:17:03 +00:00
Shane Freeder
8fd1af4cbf Don't cache mob infomation in the updater task 2019-12-31 12:16:12 +00:00
Shane Freeder
601297799f Enforce locale usage for enums to ensure correct casing (Fixes #4086) 2019-12-16 01:05:47 +00:00
nossr50
da98be88ad Update changelog 2019-12-10 21:51:41 -08:00
nossr50
1104f48ad5 2.1.111 2019-12-10 21:46:09 -08:00
nossr50
af50699de1 1.15 changes 2019-12-10 21:35:44 -08:00
Shane Freeder
1c71f1daf5 Update changelog 2019-11-13 19:56:07 +00:00
Shane Freeder
b7dd491c01 Prevent nesting of bleed damage
This commit prevents the nesting of damage event processing in general in
regards to bleed, health related stuff will need a further glance over down
the line, however; This will fix a major problematic area
2019-11-13 19:53:02 +00:00
nossr50
3ce0d7b972 dev mode 2019-11-10 19:51:47 -08:00
Robert Alan Chapton
9dcbccb010 Merge pull request #4078 from Ineusia/master
Missing Section Error Messages (Repair & Salvage Config)
2019-11-10 18:18:12 -08:00
Ineusia
c5cbab39b6 Update RepairConfig.java
Removed accidental whitespace
2019-11-10 11:56:32 -06:00
Ineusia
ca1906fbc5 Added error message for missing Salvageables section (rather than throw NPE) 2019-11-08 01:15:32 -06:00
Ineusia
7eab20ef56 Added error message for missing Repairables section (rather than throw NPE) 2019-11-08 01:11:29 -06:00
nossr50
188b0f9813 2.1.110 2019-10-18 15:48:53 -07:00
nossr50
e6c9cc6fdd Actually fixed BlockCracker + One more type of block can be cracked 2019-10-18 15:48:12 -07:00
nossr50
76ca7cc88f Additional dupe failsafes 2019-10-18 15:37:36 -07:00
nossr50
335d708848 Bump version 2019-10-18 15:24:46 -07:00
nossr50
b4179cb9a6 Fixed a dupe bug 2019-10-18 15:23:15 -07:00
Robert Alan Chapton
8bbf95e9da Merge pull request #4065 from Vyciokazz/master
locale_lt_LT.properties
2019-10-18 01:10:09 -07:00
nossr50
dc805825de 2.1.109 2019-10-17 20:16:01 -07:00
Robert Alan Chapton
871ca744d9 Merge pull request #4070 from Fabrimat/patch-4
Update locale_it.properties
2019-10-17 10:01:26 -07:00
Fabrizio La Rosa
1b091bdbd5 Update locale_it.properties
Fixed definetly /mctop and fixed special characters.
2019-10-17 13:37:00 +02:00
Robert Alan Chapton
110d9a633b Update FUNDING.yml 2019-10-02 13:26:34 -07:00
Robert Alan Chapton
584859318b Create FUNDING.yml 2019-10-02 13:06:56 -07:00
Robert A. C
1eb2c7b2d7 Merge pull request #4068 from ethernetcat/master
Update locale_ja_JP.properties
2019-10-01 14:37:21 -04:00
SNAKE
3310a12a95 Update locale_ja_JP.properties 2019-10-02 01:43:51 +09:00
Shane Freeder
6125b3fbd2 Don't spam incompatible WG error 2019-09-27 18:57:25 +01:00
Vyciokazz
1b889b8177 locale_lt_LT.properties
I translated in Lithuanian language manny required info for player and player skils, in time i update this translation.
2019-09-18 00:14:14 +03:00
64 changed files with 2235 additions and 641 deletions

12
.github/FUNDING.yml vendored Normal file
View File

@@ -0,0 +1,12 @@
# These are supported funding model platforms
github: [nossr50] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: nossr50 # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: https://paypal.me/nossr50 # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

11
1 Normal file
View File

@@ -0,0 +1,11 @@
SkillShot tweaks
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# On branch master
# Your branch is up to date with 'origin/master'.
#
# Changes to be committed:
# modified: src/main/java/com/gmail/nossr50/skills/archery/Archery.java
# modified: src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java
#

View File

@@ -1,5 +1,77 @@
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
Version 2.1.115
Green Thumb now requires a hoe to activate
Hoes no longer give free replants
You can sneak to break plants with a hoe in your hand (or just put the hoe away)
Using a hoe on non-fully grown crops will replant them as a convenience feature
New sound option in sounds.yml called 'ITEM_CONSUMED', plays when eating seeds for Green Thumb
Cocoa plants now require GT of at least 2 to start at the second stage of growth
Green Terra now boosts growth on Green Thumb by 1 stage (doesn't go above the maximum value though)
There is now a feature in place to prevent breaking a newly automatically replanted (via green thumb) crop from being breakable for a few seconds after it appears
Fixed a bug where Salvage always gave the best results
Fixed an issue with arrows causing exceptions with players not yet having data loaded
Spectral arrows are now tracked by mcMMO
Use minimum level of salvageable properly
Fix Axes Critical Strikes default permissions ( new fixed permission: mcmmo.ability.axes.criticalstrikes )
Fix potential null pointer exception for salvage
Updated locale entry 'Herbalism.SubSkill.GreenTerra.Description'
Version 2.1.114
Fix some more locale usages, should aim to further prevent issues with oddball locales
Fixed a bug where newer versions of MySQL did not like our rank command
Added a new setting to turn off the Snow Golem Exploit prevention to experience.yml next to the other exploit fixes
Fixed a bug which stopped the optional Endermite XP exploit fix from working
Version 2.1.113
Activating Berserk on a soft block (glass, snow, dirts) will break that material right away instead of only breaking subsequent blocks hit by the player
Berserk will now break glass and glass pane blocks
Hitting glass with berserk readied will activate it
Added GLASS settings to sounds.yml for Berserk
Fixed bug where BlockCracker didn't work on infested_stone_bricks
Fixed a bug where beacons could be duplicated
Check player's PTP world permissions before executing a party teleport
Improved how mcMMO handles randomness
Version 2.1.112
Correct locale usage for enum access, now enforces using the english locale to prevent issues with oddball locales for configs/commands
Fixed a NPE that can occur if a player engages in combat with specific skills before their profile is loaded
mcMMO is now more compatible with certain mob stacking plugins
Improved behaviour for mob health bars
Archery's Skill Shot bonus damage is now multiplicative instead of additive (nerfing early game skill shot ranks)
Sweet Berry Bush's default Herbalism XP is now 50 instead of 300 (Update your experience.yml or delete it to generate a new one)
Version 2.1.111
mcMMO is compatible with the following versions of MC: 1.15 / 1.14.4 / 1.14.3 / 1.14.2 / 1.14.1 / 1.14 / 1.13.2
Further prevent nesting of bleed damage calls
Warn about reparable/salvage configs with missing sections
Added Bee combat experience modifier to experience.yml (Update your experience.yml file, see notes)
Breaking a Bee Nest will result in Herbalism XP (Update your experience.yml file, see notes)
Breeding bees will now result in Taming XP (Update your experience.yml file, see notes)
NOTES:
You will need to update your experience.yml by hand or delete it to get XP from new things in 1.15
The default version of mcMMO's experience.yml looks like this: https://paste.gg/p/anonymous/15c34df6e60d45d9a3508b379a5e6514
You'll want to add Bee to combat XP section, and Bee_Nest to Herbalism XP, and Bee to Taming XP section.
Version 2.1.110
Fixed a dupe bug
Actually fixed Block Cracker
You can now crack Infested Stone Bricks with Block Cracker
Added Lithuanian locale (thanks Vyciokazz)
Version 2.1.109
Block Cracker will now correctly crack stone_bricks during Berserk again
Added Lily_Of_The_Valley to the Bonus Drops list in config.yml (you'll probably want to add this manually) which enables it to double drop
Added missing 1.14 blocks to ability/tool activation blacklists
Fixed spamming of incompatible worldguard version message
Updated Italian locale (thanks Fabrimat)
Version 2.1.108
Fixed an amusing exploit for easy leveling in Acrobatics

View File

@@ -1,6 +1,6 @@
# mcMMO
## The #1 RPG Mod for Minecraft
[![Translation status](https://translate.mcmmo.org/widgets/mcmmo/-/svg-badge.svg)](https://translate.mcmmo.org/engage/mcmmo/?utm_source=widget)
## Website
I'm working on a brand new website for mcMMO

View File

@@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.gmail.nossr50.mcMMO</groupId>
<artifactId>mcMMO</artifactId>
<version>2.1.109-SNAPSHOT</version>
<version>2.1.118-SNAPSHOT</version>
<name>mcMMO</name>
<url>https://github.com/mcMMO-Dev/mcMMO</url>
<scm>
@@ -167,7 +167,7 @@
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.14.4-R0.1-SNAPSHOT</version>
<version>1.15.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>

View File

@@ -11,6 +11,7 @@ import org.bukkit.command.CommandSender;
import java.io.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Locale;
public class McImportCommand implements CommandExecutor {
int fileAmount;
@@ -129,7 +130,7 @@ public class McImportCommand implements CommandExecutor {
}
FileWriter out = null;
String type = modConfigType.name().toLowerCase();
String type = modConfigType.name().toLowerCase(Locale.ENGLISH);
for (String modName : materialNames.keySet()) {
File outputFile = new File(outputFilePath, modName + "." + type + ".yml");

View File

@@ -11,13 +11,15 @@ import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import java.util.Locale;
public class ConvertExperienceCommand implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
switch (args.length) {
case 2:
FormulaType previousType = mcMMO.getFormulaManager().getPreviousFormulaType();
FormulaType newType = FormulaType.getFormulaType(args[1].toUpperCase());
FormulaType newType = FormulaType.getFormulaType(args[1].toUpperCase(Locale.ENGLISH));
if (newType == FormulaType.UNKNOWN) {
sender.sendMessage(LocaleLoader.getString("Commands.mcconvert.Experience.Invalid"));

View File

@@ -14,6 +14,8 @@ import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import java.util.Locale;
public class PartyItemShareCommand implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
@@ -32,7 +34,7 @@ public class PartyItemShareCommand implements CommandExecutor {
switch (args.length) {
case 2:
ShareMode mode = ShareMode.getShareMode(args[1].toUpperCase());
ShareMode mode = ShareMode.getShareMode(args[1].toUpperCase(Locale.ENGLISH));
if (mode == null) {
sender.sendMessage(LocaleLoader.getString("Commands.Usage.2", "party", "itemshare", "<NONE | EQUAL | RANDOM>"));
@@ -57,7 +59,7 @@ public class PartyItemShareCommand implements CommandExecutor {
}
try {
handleToggleItemShareCategory(party, ItemShareType.valueOf(args[1].toUpperCase()), toggle);
handleToggleItemShareCategory(party, ItemShareType.valueOf(args[1].toUpperCase(Locale.ENGLISH)), toggle);
}
catch (IllegalArgumentException ex) {
sender.sendMessage(LocaleLoader.getString("Commands.Usage.2", "party", "itemshare", "<loot | mining | herbalism | woodcutting | misc> <true | false>"));

View File

@@ -19,6 +19,7 @@ import com.gmail.nossr50.util.skills.SkillUtils;
import com.gmail.nossr50.worldguard.WorldGuardManager;
import com.gmail.nossr50.worldguard.WorldGuardUtils;
import com.google.common.collect.ImmutableList;
import org.bukkit.World;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
@@ -168,6 +169,23 @@ public class PtpCommand implements TabExecutor {
McMMOPlayer mcMMOTarget = UserManager.getPlayer(targetName);
Player target = mcMMOTarget.getPlayer();
if (Config.getInstance().getPTPCommandWorldPermissions()) {
World targetWorld = target.getWorld();
World playerWorld = player.getWorld();
if (!Permissions.partyTeleportAllWorlds(player)) {
if (!Permissions.partyTeleportWorld(target, targetWorld)) {
player.sendMessage(LocaleLoader.getString("Commands.ptp.NoWorldPermissions", targetWorld.getName()));
return;
}
else if (targetWorld != playerWorld && !Permissions.partyTeleportWorld(player, targetWorld)) {
player.sendMessage(LocaleLoader.getString("Commands.ptp.NoWorldPermissions", targetWorld.getName()));
return;
}
}
}
PartyTeleportRecord ptpRecord = mcMMOTarget.getPartyTeleportRecord();
if (!ptpRecord.isConfirmRequired()) {

View File

@@ -30,6 +30,7 @@ import org.bukkit.entity.Player;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import java.util.Set;
public abstract class SkillCommand implements TabExecutor {
@@ -134,7 +135,7 @@ public abstract class SkillCommand implements TabExecutor {
}
}
player.sendMessage(LocaleLoader.getString("Guides.Available", skillName, skillName.toLowerCase()));
player.sendMessage(LocaleLoader.getString("Guides.Available", skillName, skillName.toLowerCase(Locale.ENGLISH)));
}
private void sendSkillCommandHeader(Player player, McMMOPlayer mcMMOPlayer, int skillValue) {

View File

@@ -12,6 +12,7 @@ import org.bukkit.configuration.ConfigurationSection;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import java.util.Set;
public class Config extends AutoUpdateConfigLoader {
@@ -277,7 +278,7 @@ public class Config extends AutoUpdateConfigLoader {
/* Mob Healthbar */
public MobHealthbarType getMobHealthbarDefault() {
try {
return MobHealthbarType.valueOf(config.getString("Mob_Healthbar.Display_Type", "HEARTS").toUpperCase().trim());
return MobHealthbarType.valueOf(config.getString("Mob_Healthbar.Display_Type", "HEARTS").toUpperCase(Locale.ENGLISH).trim());
}
catch (IllegalArgumentException ex) {
return MobHealthbarType.HEARTS;

View File

@@ -144,6 +144,7 @@ public class ExperienceConfig extends AutoUpdateConfigLoader {
*/
/* EXPLOIT TOGGLES */
public boolean isSnowExploitPrevented() { return config.getBoolean("ExploitFix.SnowGolemExcavation", true); }
public boolean isEndermanEndermiteFarmingPrevented() { return config.getBoolean("ExploitFix.EndermanEndermiteFarms", true); }
public boolean isPistonCheatingPrevented() { return config.getBoolean("ExploitFix.PistonCheating", true); }
public boolean isPistonExploitPrevented() { return config.getBoolean("ExploitFix.Pistons", false); }

View File

@@ -5,6 +5,7 @@ import com.gmail.nossr50.util.StringUtils;
import org.bukkit.Material;
import java.util.HashSet;
import java.util.Locale;
public class ItemWeightConfig extends ConfigLoader {
private static ItemWeightConfig instance;
@@ -29,7 +30,7 @@ public class ItemWeightConfig extends ConfigLoader {
HashSet<Material> miscItems = new HashSet<Material>();
for (String item : config.getStringList("Party_Shareables.Misc_Items")) {
Material material = Material.getMaterial(item.toUpperCase());
Material material = Material.getMaterial(item.toUpperCase(Locale.ENGLISH));
if (material != null) {
miscItems.add(material);

View File

@@ -3,6 +3,7 @@ package com.gmail.nossr50.config.skills.repair;
import com.gmail.nossr50.config.ConfigLoader;
import com.gmail.nossr50.datatypes.skills.ItemType;
import com.gmail.nossr50.datatypes.skills.MaterialType;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.skills.repair.repairables.Repairable;
import com.gmail.nossr50.skills.repair.repairables.RepairableFactory;
import com.gmail.nossr50.util.ItemUtils;
@@ -26,6 +27,11 @@ public class RepairConfig extends ConfigLoader {
protected void loadKeys() {
repairables = new ArrayList<Repairable>();
if (!config.isConfigurationSection("Repairables")) {
mcMMO.p.getLogger().severe("Could not find Repairables section in " + fileName);
return;
}
ConfigurationSection section = config.getConfigurationSection("Repairables");
Set<String> keys = section.getKeys(false);

View File

@@ -3,6 +3,7 @@ package com.gmail.nossr50.config.skills.salvage;
import com.gmail.nossr50.config.ConfigLoader;
import com.gmail.nossr50.datatypes.skills.ItemType;
import com.gmail.nossr50.datatypes.skills.MaterialType;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.skills.salvage.salvageables.Salvageable;
import com.gmail.nossr50.skills.salvage.salvageables.SalvageableFactory;
import com.gmail.nossr50.util.ItemUtils;
@@ -13,6 +14,7 @@ import org.bukkit.inventory.ItemStack;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import java.util.Set;
public class SalvageConfig extends ConfigLoader {
@@ -27,6 +29,11 @@ public class SalvageConfig extends ConfigLoader {
protected void loadKeys() {
salvageables = new ArrayList<Salvageable>();
if (!config.isConfigurationSection("Salvageables")) {
mcMMO.p.getLogger().severe("Could not find Salvageables section in " + fileName);
return;
}
ConfigurationSection section = config.getConfigurationSection("Salvageables");
Set<String> keys = section.getKeys(false);
@@ -72,7 +79,7 @@ public class SalvageConfig extends ConfigLoader {
}
else {
try {
salvageMaterialType = MaterialType.valueOf(salvageMaterialTypeString.replace(" ", "_").toUpperCase());
salvageMaterialType = MaterialType.valueOf(salvageMaterialTypeString.replace(" ", "_").toUpperCase(Locale.ENGLISH));
}
catch (IllegalArgumentException ex) {
reason.add(key + " has an invalid MaterialType of " + salvageMaterialTypeString);
@@ -106,7 +113,7 @@ public class SalvageConfig extends ConfigLoader {
}
else {
try {
salvageItemType = ItemType.valueOf(salvageItemTypeString.replace(" ", "_").toUpperCase());
salvageItemType = ItemType.valueOf(salvageItemTypeString.replace(" ", "_").toUpperCase(Locale.ENGLISH));
}
catch (IllegalArgumentException ex) {
reason.add(key + " has an invalid ItemType of " + salvageItemTypeString);

View File

@@ -347,7 +347,7 @@ public final class SQLDatabaseManager implements DatabaseManager {
public List<PlayerStat> readLeaderboard(PrimarySkillType skill, int pageNumber, int statsPerPage) {
List<PlayerStat> stats = new ArrayList<PlayerStat>();
String query = skill == null ? ALL_QUERY_VERSION : skill.name().toLowerCase();
String query = skill == null ? ALL_QUERY_VERSION : skill.name().toLowerCase(Locale.ENGLISH);
ResultSet resultSet = null;
PreparedStatement statement = null;
Connection connection = null;
@@ -391,9 +391,9 @@ public final class SQLDatabaseManager implements DatabaseManager {
try {
connection = getConnection(PoolIdentifier.MISC);
for (PrimarySkillType primarySkillType : PrimarySkillType.NON_CHILD_SKILLS) {
String skillName = primarySkillType.name().toLowerCase();
String skillName = primarySkillType.name().toLowerCase(Locale.ENGLISH);
// Get count of all users with higher skill level than player
String sql = "SELECT COUNT(*) AS rank FROM " + tablePrefix + "users JOIN " + tablePrefix + "skills ON user_id = id WHERE " + skillName + " > 0 " +
String sql = "SELECT COUNT(*) AS 'rank' FROM " + tablePrefix + "users JOIN " + tablePrefix + "skills ON user_id = id WHERE " + skillName + " > 0 " +
"AND " + skillName + " > (SELECT " + skillName + " FROM " + tablePrefix + "users JOIN " + tablePrefix + "skills ON user_id = id " +
"WHERE user = ?)";
@@ -427,7 +427,7 @@ public final class SQLDatabaseManager implements DatabaseManager {
statement.close();
}
String sql = "SELECT COUNT(*) AS rank FROM " + tablePrefix + "users JOIN " + tablePrefix + "skills ON user_id = id " +
String sql = "SELECT COUNT(*) AS 'rank' FROM " + tablePrefix + "users JOIN " + tablePrefix + "skills ON user_id = id " +
"WHERE " + ALL_QUERY_VERSION + " > 0 " +
"AND " + ALL_QUERY_VERSION + " > " +
"(SELECT " + ALL_QUERY_VERSION + " " +
@@ -911,7 +911,7 @@ public final class SQLDatabaseManager implements DatabaseManager {
for (PrimarySkillType skill : PrimarySkillType.NON_CHILD_SKILLS) {
int cap = Config.getInstance().getLevelCap(skill);
if (cap != Integer.MAX_VALUE) {
statement = connection.prepareStatement("UPDATE `" + tablePrefix + "skills` SET `" + skill.name().toLowerCase() + "` = " + cap + " WHERE `" + skill.name().toLowerCase() + "` > " + cap);
statement = connection.prepareStatement("UPDATE `" + tablePrefix + "skills` SET `" + skill.name().toLowerCase(Locale.ENGLISH) + "` = " + cap + " WHERE `" + skill.name().toLowerCase(Locale.ENGLISH) + "` > " + cap);
statement.executeUpdate();
tryClose(statement);
}
@@ -951,7 +951,7 @@ public final class SQLDatabaseManager implements DatabaseManager {
break;
}
if (connection == null) {
throw new RuntimeException("getConnection() for " + identifier.name().toLowerCase() + " pool timed out. Increase max connections settings.");
throw new RuntimeException("getConnection() for " + identifier.name().toLowerCase(Locale.ENGLISH) + " pool timed out. Increase max connections settings.");
}
return connection;
}
@@ -1262,7 +1262,7 @@ public final class SQLDatabaseManager implements DatabaseManager {
mcMMO.p.getLogger().info("Indexing tables, this may take a while on larger databases");
for (PrimarySkillType skill : PrimarySkillType.NON_CHILD_SKILLS) {
String skill_name = skill.name().toLowerCase();
String skill_name = skill.name().toLowerCase(Locale.ENGLISH);
try {
statement.executeUpdate("ALTER TABLE `" + tablePrefix + "skills` ADD INDEX `idx_" + skill_name + "` (`" + skill_name + "`) USING BTREE");

View File

@@ -12,4 +12,5 @@ public class OldName extends FixedMetadataValue {
{
super(plugin, oldName);
}
}

View File

@@ -0,0 +1,17 @@
package com.gmail.nossr50.datatypes.meta;
import org.bukkit.metadata.FixedMetadataValue;
import org.bukkit.plugin.Plugin;
public class RecentlyReplantedCropMeta extends FixedMetadataValue {
/**
* Initializes a FixedMetadataValue with an Object
*
* @param owningPlugin the {@link Plugin} that created this metadata value
*/
public RecentlyReplantedCropMeta(Plugin owningPlugin, Boolean recentlyPlanted) {
super(owningPlugin, recentlyPlanted);
}
}

View File

@@ -849,7 +849,6 @@ public class McMMOPlayer {
return;
}
//TODO: This is hacky and temporary solution until skills are move to the new system
//Potential problems with this include skills with two super abilities (ie mining)
if(!skill.isSuperAbilityUnlocked(getPlayer()))

View File

@@ -3,6 +3,8 @@ package com.gmail.nossr50.datatypes.skills;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.StringUtils;
import java.util.Locale;
public enum SubSkillType {
/* !! Warning -- Do not let subskills share a name with any existing PrimarySkillType as it will clash with the static import !! */
@@ -157,7 +159,7 @@ public enum SubSkillType {
public String getPermissionNodeAddress()
{
//TODO: This could be optimized
return "mcmmo.ability." + getParentSkill().toString().toLowerCase() + "." + getConfigName(toString()).toLowerCase();
return "mcmmo.ability." + getParentSkill().toString().toLowerCase(Locale.ENGLISH) + "." + getConfigName(toString()).toLowerCase(Locale.ENGLISH);
}
/**

View File

@@ -1,6 +1,7 @@
package com.gmail.nossr50.datatypes.skills;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.BlockUtils;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.StringUtils;
@@ -198,7 +199,7 @@ public enum SuperAbilityType {
public boolean blockCheck(BlockState blockState) {
switch (this) {
case BERSERK:
return (BlockUtils.affectedByGigaDrillBreaker(blockState) || blockState.getType() == Material.SNOW);
return (BlockUtils.affectedByGigaDrillBreaker(blockState) || blockState.getType() == Material.SNOW || mcMMO.getMaterialMapStore().isGlass(blockState.getType()));
case GIGA_DRILL_BREAKER:
return BlockUtils.affectedByGigaDrillBreaker(blockState);

View File

@@ -33,6 +33,8 @@ import org.bukkit.event.EventPriority;
import org.bukkit.event.entity.EntityDamageEvent;
import org.bukkit.inventory.ItemStack;
import java.util.Locale;
public class Roll extends AcrobaticsSubSkill {
@@ -100,7 +102,7 @@ public class Roll extends AcrobaticsSubSkill {
*/
@Override
public String getPermissionNode() {
return ("mcmmo.ability."+getPrimaryKeyName()+"."+getConfigKeyName()).toLowerCase();
return ("mcmmo.ability."+getPrimaryKeyName()+"."+getConfigKeyName()).toLowerCase(Locale.ENGLISH);
}
/**

View File

@@ -14,7 +14,6 @@ import com.gmail.nossr50.events.fake.FakeBlockDamageEvent;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.skills.alchemy.Alchemy;
import com.gmail.nossr50.skills.excavation.ExcavationManager;
import com.gmail.nossr50.skills.herbalism.Herbalism;
import com.gmail.nossr50.skills.herbalism.HerbalismManager;
import com.gmail.nossr50.skills.mining.MiningManager;
import com.gmail.nossr50.skills.repair.Repair;
@@ -41,6 +40,7 @@ import org.bukkit.event.block.*;
import org.bukkit.inventory.ItemStack;
import org.bukkit.metadata.MetadataValue;
import java.util.HashSet;
import java.util.List;
public class BlockListener implements Listener {
@@ -53,25 +53,55 @@ public class BlockListener implements Listener {
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onBlockDropItemEvent(BlockDropItemEvent event)
{
for(Item item : event.getItems())
{
ItemStack is = new ItemStack(item.getItemStack());
//Track how many "things" are being dropped
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
int blockCount = 0;
if(is.getAmount() <= 0)
continue;
for(Item item : event.getItems()) {
//Track unique materials
uniqueMaterials.add(item.getItemStack().getType());
//TODO: Ignore this abomination its rewritten in 2.2
if(!Config.getInstance().getDoubleDropsEnabled(PrimarySkillType.MINING, is.getType())
&& !Config.getInstance().getDoubleDropsEnabled(PrimarySkillType.HERBALISM, is.getType())
//Count blocks as a second failsafe
if(item.getItemStack().getType().isBlock())
blockCount++;
}
if(uniqueMaterials.size() > 1) {
//Too many things are dropping, assume tile entities might be duped
//Technically this would also prevent something like coal from being bonus dropped if you placed a TE above a coal ore when mining it but that's pretty edge case and this is a good solution for now
dontRewardTE = true;
}
//If there are more than one block in the item list we can't really trust it and will back out of rewarding bonus drops
if(blockCount <= 1) {
for(Item item : event.getItems())
{
ItemStack is = new ItemStack(item.getItemStack());
if(is.getAmount() <= 0)
continue;
//TODO: Ignore this abomination its rewritten in 2.2
if(!Config.getInstance().getDoubleDropsEnabled(PrimarySkillType.MINING, is.getType())
&& !Config.getInstance().getDoubleDropsEnabled(PrimarySkillType.HERBALISM, is.getType())
&& !Config.getInstance().getDoubleDropsEnabled(PrimarySkillType.WOODCUTTING, is.getType()))
continue;
continue;
if (event.getBlock().getMetadata(mcMMO.BONUS_DROPS_METAKEY).size() > 0) {
BonusDropMeta bonusDropMeta = (BonusDropMeta) event.getBlock().getMetadata(mcMMO.BONUS_DROPS_METAKEY).get(0);
int bonusCount = bonusDropMeta.asInt();
//If we suspect TEs might be duped only reward block
if(dontRewardTE) {
if(!is.getType().isBlock()) {
continue;
}
}
for (int i = 0; i < bonusCount; i++) {
event.getBlock().getWorld().dropItemNaturally(event.getBlockState().getLocation(), is);
if (event.getBlock().getMetadata(mcMMO.BONUS_DROPS_METAKEY).size() > 0) {
BonusDropMeta bonusDropMeta = (BonusDropMeta) event.getBlock().getMetadata(mcMMO.BONUS_DROPS_METAKEY).get(0);
int bonusCount = bonusDropMeta.asInt();
for (int i = 0; i < bonusCount; i++) {
event.getBlock().getWorld().dropItemNaturally(event.getBlockState().getLocation(), is);
}
}
}
}
@@ -80,44 +110,6 @@ public class BlockListener implements Listener {
event.getBlock().removeMetadata(mcMMO.BONUS_DROPS_METAKEY, plugin);
}
/*@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onBlockDropItemEvent(BlockDropItemEvent event)
{
for(Item item : event.getItems())
{
ItemStack is = new ItemStack(item.getItemStack());
if(event.getBlock().getMetadata(mcMMO.doubleDrops).size() > 0)
{
List<MetadataValue> metadataValue = event.getBlock().getMetadata(mcMMO.doubleDrops);
BonusDrops bonusDrops = (BonusDrops) metadataValue.get(0);
Collection<ItemStack> potentialDrops = (Collection<ItemStack>) bonusDrops.value();
if(potentialDrops.contains(is))
{
event.getBlock().getState().getWorld().dropItemNaturally(event.getBlockState().getLocation(), is);
}
event.getBlock().removeMetadata(mcMMO.doubleDrops, plugin);
} else {
if(event.getBlock().getMetadata(mcMMO.tripleDrops).size() > 0) {
List<MetadataValue> metadataValue = event.getBlock().getMetadata(mcMMO.tripleDrops);
BonusDrops bonusDrops = (BonusDrops) metadataValue.get(0);
Collection<ItemStack> potentialDrops = (Collection<ItemStack>) bonusDrops.value();
if (potentialDrops.contains(is)) {
event.getBlock().getState().getWorld().dropItemNaturally(event.getBlockState().getLocation(), is);
event.getBlock().getState().getWorld().dropItemNaturally(event.getBlockState().getLocation(), is);
}
event.getBlock().removeMetadata(mcMMO.tripleDrops, plugin);
}
}
}
}*/
/**
* Monitor BlockPistonExtend events.
*
@@ -185,7 +177,7 @@ public class BlockListener implements Listener {
BlockState blockState = event.getNewState();
if(BlockUtils.shouldBeWatched(blockState))
if(ExperienceConfig.getInstance().isSnowExploitPrevented() && BlockUtils.shouldBeWatched(blockState))
{
mcMMO.getPlaceStore().setTrue(blockState.getBlock());
}
@@ -431,11 +423,6 @@ public class BlockListener implements Listener {
BlockState blockState = event.getBlock().getState();
ItemStack heldItem = player.getInventory().getItemInMainHand();
if (Herbalism.isRecentlyRegrown(blockState)) {
event.setCancelled(true);
return;
}
if (ItemUtils.isSword(heldItem)) {
HerbalismManager herbalismManager = UserManager.getPlayer(player).getHerbalismManager();
@@ -519,8 +506,23 @@ public class BlockListener implements Listener {
else if (mcMMOPlayer.getToolPreparationMode(ToolType.SHOVEL) && ItemUtils.isShovel(heldItem) && BlockUtils.affectedByGigaDrillBreaker(blockState) && Permissions.gigaDrillBreaker(player)) {
mcMMOPlayer.checkAbilityActivation(PrimarySkillType.EXCAVATION);
}
else if (mcMMOPlayer.getToolPreparationMode(ToolType.FISTS) && heldItem.getType() == Material.AIR && (BlockUtils.affectedByGigaDrillBreaker(blockState) || blockState.getType() == Material.SNOW || BlockUtils.affectedByBlockCracker(blockState) && Permissions.berserk(player))) {
else if (mcMMOPlayer.getToolPreparationMode(ToolType.FISTS) && heldItem.getType() == Material.AIR && (BlockUtils.affectedByGigaDrillBreaker(blockState)
|| mcMMO.getMaterialMapStore().isGlass(blockState.getType())
|| blockState.getType() == Material.SNOW
|| BlockUtils.affectedByBlockCracker(blockState) && Permissions.berserk(player))) {
mcMMOPlayer.checkAbilityActivation(PrimarySkillType.UNARMED);
if(mcMMOPlayer.getAbilityMode(SuperAbilityType.BERSERK)) {
if (SuperAbilityType.BERSERK.blockCheck(blockState) && EventUtils.simulateBlockBreak(blockState.getBlock(), player, true)) {
event.setInstaBreak(true);
if(blockState.getType().getKey().getKey().contains("glass")) {
SoundManager.worldSendSound(player.getWorld(), blockState.getLocation(), SoundType.GLASS);
} else {
SoundManager.sendSound(player, blockState.getLocation(), SoundType.POP);
}
}
}
}
}
@@ -594,16 +596,21 @@ public class BlockListener implements Listener {
blockState.update(true);
}
}
else if (mcMMOPlayer.getAbilityMode(SuperAbilityType.BERSERK) && heldItem.getType() == Material.AIR) {
if (SuperAbilityType.BERSERK.blockCheck(block.getState()) && EventUtils.simulateBlockBreak(block, player, true)) {
event.setInstaBreak(true);
SoundManager.sendSound(player, block.getLocation(), SoundType.POP);
}
else if (mcMMOPlayer.getUnarmedManager().canUseBlockCracker() && BlockUtils.affectedByBlockCracker(blockState) && EventUtils.simulateBlockBreak(block, player, true)) {
if (mcMMOPlayer.getUnarmedManager().blockCrackerCheck(blockState)) {
else if (mcMMOPlayer.getAbilityMode(SuperAbilityType.BERSERK) && (heldItem.getType() == Material.AIR || Config.getInstance().getUnarmedItemsAsUnarmed())) {
if (mcMMOPlayer.getUnarmedManager().canUseBlockCracker() && BlockUtils.affectedByBlockCracker(blockState)) {
if (EventUtils.simulateBlockBreak(block, player, true) && mcMMOPlayer.getUnarmedManager().blockCrackerCheck(blockState)) {
blockState.update();
}
}
else if (!event.getInstaBreak() && SuperAbilityType.BERSERK.blockCheck(blockState) && EventUtils.simulateBlockBreak(block, player, true)) {
event.setInstaBreak(true);
if(blockState.getType().getKey().getKey().contains("glass")) {
SoundManager.worldSendSound(player.getWorld(), block.getLocation(), SoundType.GLASS);
} else {
SoundManager.sendSound(player, block.getLocation(), SoundType.POP);
}
}
}
else if (mcMMOPlayer.getWoodcuttingManager().canUseLeafBlower(heldItem) && BlockUtils.isLeaves(blockState) && EventUtils.simulateBlockBreak(block, player, true)) {
event.setInstaBreak(true);

View File

@@ -81,7 +81,7 @@ public class EntityListener implements Listener {
//Prevent entities from giving XP if they target endermite
if(event.getTarget() instanceof Endermite)
{
if(event.getEntity().hasMetadata(mcMMO.entityMetadataKey))
if(!event.getEntity().hasMetadata(mcMMO.entityMetadataKey))
event.getEntity().setMetadata(mcMMO.entityMetadataKey, mcMMO.metadataValue);
}
}
@@ -319,6 +319,10 @@ public class EntityListener implements Listener {
return;
}
if (CombatUtils.isProcessingNoInvulnDamage()) {
return;
}
if (event.getEntity() instanceof ArmorStand) {
return;
}
@@ -377,12 +381,15 @@ public class EntityListener implements Listener {
}
//Deflect checks
UnarmedManager unarmedManager = UserManager.getPlayer(defendingPlayer).getUnarmedManager();
final McMMOPlayer mcMMOPlayer = UserManager.getPlayer(defendingPlayer);
if (mcMMOPlayer != null) {
UnarmedManager unarmedManager = mcMMOPlayer.getUnarmedManager();
if (unarmedManager.canDeflect()) {
if(unarmedManager.deflectCheck()) {
event.setCancelled(true);
return;
if (unarmedManager.canDeflect()) {
if (unarmedManager.deflectCheck()) {
event.setCancelled(true);
return;
}
}
}
} else {
@@ -837,27 +844,6 @@ public class EntityListener implements Listener {
}
}
/**
* Handle EntityExplode events that involve modifying the event.
*
* @param event
* The event to modify
*/
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
public void onEntityExplodeMonitor(EntityExplodeEvent event) {
/* WORLD BLACKLIST CHECK */
if(WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld()))
return;
Entity entity = event.getEntity();
if (!(entity instanceof TNTPrimed) || !entity.hasMetadata(mcMMO.tntsafeMetadataKey)) {
return;
}
event.blockList().clear();
}
/**
* Handle FoodLevelChange events that involve modifying the event.
*

View File

@@ -9,6 +9,7 @@ import org.bukkit.event.Event;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Locale;
public class InteractionManager {
private static HashMap<InteractType, ArrayList<Interaction>> interactRegister;
@@ -47,7 +48,7 @@ public class InteractionManager {
//Register skill
arrayRef.add(abstractSubSkill);
String lowerCaseName = abstractSubSkill.getConfigKeyName().toLowerCase();
String lowerCaseName = abstractSubSkill.getConfigKeyName().toLowerCase(Locale.ENGLISH);
//Register in name map
if(subSkillNameMap.get(lowerCaseName) == null)
@@ -64,7 +65,7 @@ public class InteractionManager {
*/
public static AbstractSubSkill getAbstractByName(String name)
{
return subSkillNameMap.get(name.toLowerCase());
return subSkillNameMap.get(name.toLowerCase(Locale.ENGLISH));
}
/**

View File

@@ -51,6 +51,8 @@ import org.bukkit.event.player.*;
import org.bukkit.inventory.EquipmentSlot;
import org.bukkit.inventory.ItemStack;
import java.util.Locale;
public class PlayerListener implements Listener {
private final mcMMO plugin;
@@ -909,12 +911,12 @@ public class PlayerListener implements Listener {
if (!Config.getInstance().getLocale().equalsIgnoreCase("en_US")) {
String message = event.getMessage();
String command = message.substring(1).split(" ")[0];
String lowerCaseCommand = command.toLowerCase();
String lowerCaseCommand = command.toLowerCase(Locale.ENGLISH);
// Do these ACTUALLY have to be lower case to work properly?
for (PrimarySkillType skill : PrimarySkillType.values()) {
String skillName = skill.toString().toLowerCase();
String localizedName = skill.getName().toLowerCase();
String skillName = skill.toString().toLowerCase(Locale.ENGLISH);
String localizedName = skill.getName().toLowerCase(Locale.ENGLISH);
if (lowerCaseCommand.equals(localizedName)) {
event.setMessage(message.replace(command, skillName));

View File

@@ -62,6 +62,7 @@ import java.io.InputStreamReader;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
public class mcMMO extends JavaPlugin {
/* Managers */
@@ -106,6 +107,7 @@ public class mcMMO extends JavaPlugin {
private static boolean isRetroModeEnabled;
/* Metadata Values */
public final static String REPLANT_META_KEY = "mcMMO: Recently Replanted";
public static final String FISH_HOOK_REF_METAKEY = "mcMMO: Fish Hook Tracker";
public static final String DODGE_TRACKER = "mcMMO: Dodge Tracker";
public static final String CUSTOM_DAMAGE_METAKEY = "mcMMO: Custom Damage";
@@ -115,7 +117,6 @@ public class mcMMO extends JavaPlugin {
public final static String furnaceMetadataKey = "mcMMO: Tracked Furnace";
public final static String tntMetadataKey = "mcMMO: Tracked TNT";
public final static String funfettiMetadataKey = "mcMMO: Funfetti";
public final static String tntsafeMetadataKey = "mcMMO: Safe TNT";
public final static String customNameKey = "mcMMO: Custom Name";
public final static String customVisibleKey = "mcMMO: Name Visibility";
public final static String droppedItemKey = "mcMMO: Tracked Item";
@@ -287,9 +288,9 @@ public class mcMMO extends JavaPlugin {
private ServerSoftwareType getServerSoftware()
{
if(Bukkit.getVersion().toLowerCase().contains("paper"))
if(Bukkit.getVersion().toLowerCase(Locale.ENGLISH).contains("paper"))
return ServerSoftwareType.PAPER;
else if(Bukkit.getVersion().toLowerCase().contains("spigot"))
else if(Bukkit.getVersion().toLowerCase(Locale.ENGLISH).contains("spigot"))
return ServerSoftwareType.SPIGOT;
else
return ServerSoftwareType.CRAFTBUKKIT;

View File

@@ -6,23 +6,20 @@ import org.bukkit.scheduler.BukkitRunnable;
public class MobHealthDisplayUpdaterTask extends BukkitRunnable {
private LivingEntity target;
private String oldName;
private boolean oldNameVisible;
public MobHealthDisplayUpdaterTask(LivingEntity target) {
if (target.isValid()) {
this.target = target;
this.oldName = target.getMetadata(mcMMO.customNameKey).get(0).asString();
this.oldNameVisible = target.getMetadata(mcMMO.customVisibleKey).get(0).asBoolean();
}
this.target = target;
}
@Override
public void run() {
if (target != null && target.isValid()) {
target.setCustomNameVisible(oldNameVisible);
target.setCustomName(oldName);
if (target.hasMetadata(mcMMO.customNameKey)) {
target.setCustomName(target.getMetadata(mcMMO.customNameKey).get(0).asString());
target.removeMetadata(mcMMO.customNameKey, mcMMO.p);
}
if (target.hasMetadata(mcMMO.customVisibleKey)) {
target.setCustomNameVisible(target.getMetadata(mcMMO.customVisibleKey).get(0).asBoolean());
target.removeMetadata(mcMMO.customVisibleKey, mcMMO.p);
}
}

View File

@@ -6,8 +6,10 @@ import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.party.PartyManager;
import com.gmail.nossr50.util.EventUtils;
import com.gmail.nossr50.util.Misc;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.skills.SkillUtils;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.entity.Player;
import org.bukkit.scheduler.BukkitRunnable;
@@ -51,6 +53,23 @@ public class TeleportationWarmup extends BukkitRunnable {
}
}
if (Config.getInstance().getPTPCommandWorldPermissions()) {
World targetWorld = targetPlayer.getWorld();
World playerWorld = teleportingPlayer.getWorld();
if (!Permissions.partyTeleportAllWorlds(teleportingPlayer)) {
if (!Permissions.partyTeleportWorld(targetPlayer, targetWorld)) {
teleportingPlayer.sendMessage(LocaleLoader.getString("Commands.ptp.NoWorldPermissions", targetWorld.getName()));
return;
}
else if (targetWorld != playerWorld && !Permissions.partyTeleportWorld(teleportingPlayer, targetWorld)) {
teleportingPlayer.sendMessage(LocaleLoader.getString("Commands.ptp.NoWorldPermissions", targetWorld.getName()));
return;
}
}
}
EventUtils.handlePartyTeleportEvent(teleportingPlayer, targetPlayer);
}
}

View File

@@ -0,0 +1,117 @@
package com.gmail.nossr50.runnables.skills;
import com.gmail.nossr50.datatypes.meta.RecentlyReplantedCropMeta;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.skills.ParticleEffectUtils;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.block.BlockState;
import org.bukkit.block.data.Ageable;
import org.bukkit.block.data.BlockData;
import org.bukkit.block.data.Directional;
import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.scheduler.BukkitRunnable;
public class DelayedCropReplant extends BukkitRunnable {
private final int desiredCropAge;
private final Location cropLocation;
private final Material cropMaterial;
private boolean wasImmaturePlant;
private final BlockBreakEvent blockBreakEvent;
private BlockFace cropFace;
/**
* Replants a crop after a delay setting the age to desiredCropAge
* @param cropState target {@link BlockState}
* @param desiredCropAge desired age of the crop
*/
public DelayedCropReplant(BlockBreakEvent blockBreakEvent, BlockState cropState, int desiredCropAge, boolean wasImmaturePlant) {
BlockData cropData = cropState.getBlockData();
if(cropData instanceof Directional) {
Directional cropDir = (Directional) cropData;
cropFace = cropDir.getFacing();
}
//The plant was either immature or something cancelled the event, therefor we need to treat it differently
this.blockBreakEvent = blockBreakEvent;
this.wasImmaturePlant = wasImmaturePlant;
this.cropMaterial = cropState.getType();
this.desiredCropAge = desiredCropAge;
this.cropLocation = cropState.getLocation();
}
@Override
public void run() {
Block cropBlock = cropLocation.getBlock();
BlockState currentState = cropBlock.getState();
//Remove the metadata marking the block as recently replanted
new markPlantAsOld(blockBreakEvent.getBlock().getLocation()).runTaskLater(mcMMO.p, 10);
if(blockBreakEvent.isCancelled()) {
wasImmaturePlant = true;
}
//Two kinds of air in Minecraft
if(currentState.getType().equals(cropMaterial) || currentState.getType().equals(Material.AIR) || currentState.getType().equals(Material.CAVE_AIR)) {
// if(currentState.getBlock().getRelative(BlockFace.DOWN))
//The space is not currently occupied by a block so we can fill it
cropBlock.setType(cropMaterial);
//Get new state (necessary?)
BlockState newState = cropBlock.getState();
BlockData newData = newState.getBlockData();
int age = 0;
//Crop age should always be 0 if the plant was immature
if(!wasImmaturePlant) {
age = desiredCropAge;
//Otherwise make the plant the desired age
}
if(newData instanceof Directional) {
//Cocoa Version
Directional directional = (Directional) newState.getBlockData();
directional.setFacing(cropFace);
newState.setBlockData(directional);
}
//Age the crop
Ageable ageable = (Ageable) newState.getBlockData();
ageable.setAge(age);
newState.setBlockData(ageable);
newState.update(true);
//Play an effect
ParticleEffectUtils.playGreenThumbEffect(cropLocation);
}
}
private class markPlantAsOld extends BukkitRunnable {
private final Location cropLoc;
public markPlantAsOld(Location cropLoc) {
this.cropLoc = cropLoc;
}
@Override
public void run() {
Block cropBlock = cropLoc.getBlock();
if(cropBlock.getMetadata(mcMMO.REPLANT_META_KEY).size() > 0)
cropBlock.setMetadata(mcMMO.REPLANT_META_KEY, new RecentlyReplantedCropMeta(mcMMO.p, false));
}
}
}

View File

@@ -66,10 +66,10 @@ public class Archery {
{
double damageBonusPercent = getDamageBonusPercent(player);
double newDamage = oldDamage + (oldDamage * damageBonusPercent);
return Math.min(newDamage, Archery.skillShotMaxBonusDamage);
return Math.min(newDamage, (oldDamage + Archery.skillShotMaxBonusDamage));
}
public static double getDamageBonusPercent(Player player) {
return ((RankUtils.getRank(player, SubSkillType.ARCHERY_SKILL_SHOT)) * AdvancedConfig.getInstance().getSkillShotRankDamageMultiplier()) / 100.0D;
return ((RankUtils.getRank(player, SubSkillType.ARCHERY_SKILL_SHOT)) * (AdvancedConfig.getInstance().getSkillShotRankDamageMultiplier()) / 100.0D);
}
}

View File

@@ -6,6 +6,7 @@ import com.gmail.nossr50.util.StringUtils;
import org.bukkit.configuration.file.YamlConfiguration;
import java.util.EnumSet;
import java.util.Locale;
public class ChildConfig extends AutoUpdateConfigLoader {
public ChildConfig() {
@@ -27,7 +28,7 @@ public class ChildConfig extends AutoUpdateConfigLoader {
for (String name : config.getStringList(StringUtils.getCapitalized(skill.name()))) {
try {
PrimarySkillType parentSkill = PrimarySkillType.valueOf(name.toUpperCase());
PrimarySkillType parentSkill = PrimarySkillType.valueOf(name.toUpperCase(Locale.ENGLISH));
FamilyTree.enforceNotChildSkill(parentSkill);
parentSkills.add(parentSkill);
}
@@ -45,7 +46,7 @@ public class ChildConfig extends AutoUpdateConfigLoader {
* If they're dedicated enough to have modified it, they can have the errors it may produce.
* Alternatively, this can be used to allow child skills to be parent skills, provided there are no circular dependencies this is an advanced sort of configuration.
*/
parentSkills.add(PrimarySkillType.valueOf(name.toUpperCase()));
parentSkills.add(PrimarySkillType.valueOf(name.toUpperCase(Locale.ENGLISH)));
}
}

View File

@@ -1,7 +1,5 @@
package com.gmail.nossr50.skills.herbalism;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.skills.SkillUtils;
import org.bukkit.Material;
import org.bukkit.block.BlockState;
@@ -58,14 +56,4 @@ public class Herbalism {
}
}
/**
* Check if the block has a recently grown crop from Green Thumb
*
* @param blockState
* The {@link BlockState} to check green thumb regrown for
* @return true if the block is recently regrown, false otherwise
*/
public static boolean isRecentlyRegrown(BlockState blockState) {
return blockState.hasMetadata(mcMMO.greenThumbDataKey) && !SkillUtils.cooldownExpired(blockState.getMetadata(mcMMO.greenThumbDataKey).get(0).asInt(), 1);
}
}

View File

@@ -7,6 +7,7 @@ import com.gmail.nossr50.datatypes.BlockSnapshot;
import com.gmail.nossr50.datatypes.experience.XPGainReason;
import com.gmail.nossr50.datatypes.experience.XPGainSource;
import com.gmail.nossr50.datatypes.interactions.NotificationType;
import com.gmail.nossr50.datatypes.meta.RecentlyReplantedCropMeta;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SubSkillType;
@@ -14,8 +15,8 @@ import com.gmail.nossr50.datatypes.skills.SuperAbilityType;
import com.gmail.nossr50.datatypes.skills.ToolType;
import com.gmail.nossr50.datatypes.treasure.HylianTreasure;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.runnables.skills.DelayedCropReplant;
import com.gmail.nossr50.runnables.skills.DelayedHerbalismXPCheckTask;
import com.gmail.nossr50.runnables.skills.HerbalismBlockUpdaterTask;
import com.gmail.nossr50.skills.SkillManager;
import com.gmail.nossr50.util.*;
import com.gmail.nossr50.util.player.NotificationManager;
@@ -24,6 +25,8 @@ import com.gmail.nossr50.util.random.RandomChanceUtil;
import com.gmail.nossr50.util.skills.RankUtils;
import com.gmail.nossr50.util.skills.SkillActivationType;
import com.gmail.nossr50.util.skills.SkillUtils;
import com.gmail.nossr50.util.sounds.SoundManager;
import com.gmail.nossr50.util.sounds.SoundType;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
@@ -35,7 +38,6 @@ import org.bukkit.entity.Player;
import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.PlayerInventory;
import org.bukkit.metadata.FixedMetadataValue;
import java.util.ArrayList;
import java.util.Collection;
@@ -135,6 +137,23 @@ public class HerbalismManager extends SkillManager {
return;
}
//Check if the plant was recently replanted
if(blockBreakEvent.getBlock().getBlockData() instanceof Ageable) {
Ageable ageableCrop = (Ageable) blockBreakEvent.getBlock().getBlockData();
if(blockBreakEvent.getBlock().getMetadata(mcMMO.REPLANT_META_KEY).size() >= 1) {
if(blockBreakEvent.getBlock().getMetadata(mcMMO.REPLANT_META_KEY).get(0).asBoolean()) {
if(isAgeableMature(ageableCrop)) {
blockBreakEvent.getBlock().removeMetadata(mcMMO.REPLANT_META_KEY, mcMMO.p);
} else {
//Crop is recently replanted to back out of destroying it
blockBreakEvent.setCancelled(true);
return;
}
}
}
}
/*
* There are single-block plants and multi-block plants in Minecraft
* In order to give out proper rewards, we need to collect all blocks that would be broken from this event
@@ -143,6 +162,9 @@ public class HerbalismManager extends SkillManager {
//Grab all broken blocks
HashSet<Block> brokenBlocks = getBrokenHerbalismBlocks(blockBreakEvent);
if(brokenBlocks.size() == 0)
return;
//Handle rewards, xp, ability interactions, etc
processHerbalismOnBlocksBroken(blockBreakEvent, brokenBlocks);
}
@@ -154,10 +176,23 @@ public class HerbalismManager extends SkillManager {
*/
private void processHerbalismOnBlocksBroken(BlockBreakEvent blockBreakEvent, HashSet<Block> brokenPlants) {
BlockState originalBreak = blockBreakEvent.getBlock().getState();
boolean greenThumbActivated = false;
//TODO: The design of Green Terra needs to change, this is a mess
if(Permissions.greenThumbPlant(getPlayer(), originalBreak.getType())) {
processGreenThumbPlants(originalBreak, isGreenTerraActive());
if(!getPlayer().isSneaking()) {
greenThumbActivated = processGreenThumbPlants(originalBreak, blockBreakEvent, isGreenTerraActive());
}
}
//When replanting a immature crop we cancel the block break event and back out
if(greenThumbActivated) {
if(originalBreak.getBlock().getBlockData() instanceof Ageable) {
Ageable ageableCrop = (Ageable) originalBreak.getBlock().getBlockData();
if(!isAgeableMature(ageableCrop)) {
return;
}
}
}
/*
@@ -339,9 +374,11 @@ public class HerbalismManager extends SkillManager {
//Calculate XP
if(plantData instanceof Ageable) {
Ageable plantAgeable = (Ageable) plantData;
if(isAgeableMature(plantAgeable) || isBizarreAgeable(plantData)) {
xpToReward += ExperienceConfig.getInstance().getXp(PrimarySkillType.HERBALISM, brokenBlockNewState.getType());
}
} else {
xpToReward += ExperienceConfig.getInstance().getXp(PrimarySkillType.HERBALISM, brokenPlantBlock.getType());
}
@@ -437,8 +474,7 @@ public class HerbalismManager extends SkillManager {
}
private HashSet<Block> getBrokenChorusBlocks(BlockState originalBreak) {
HashSet<Block> traversedBlocks = grabChorusTreeBrokenBlocksRecursive(originalBreak.getBlock(), new HashSet<>());
return traversedBlocks;
return grabChorusTreeBrokenBlocksRecursive(originalBreak.getBlock(), new HashSet<>());
}
private HashSet<Block> grabChorusTreeBrokenBlocksRecursive(Block currentBlock, HashSet<Block> traversed) {
@@ -630,15 +666,38 @@ public class HerbalismManager extends SkillManager {
return Herbalism.convertShroomThumb(blockState);
}
/**
* Starts the delayed replant task and turns
* @param desiredCropAge the desired age of the crop
* @param blockBreakEvent the {@link BlockBreakEvent} this crop was involved in
* @param cropState the {@link BlockState} of the crop
*/
private void startReplantTask(int desiredCropAge, BlockBreakEvent blockBreakEvent, BlockState cropState, boolean isImmature) {
//Mark the plant as recently replanted to avoid accidental breakage
new DelayedCropReplant(blockBreakEvent, cropState, desiredCropAge, isImmature).runTaskLater(mcMMO.p, 20 * 2);
blockBreakEvent.getBlock().setMetadata(mcMMO.REPLANT_META_KEY, new RecentlyReplantedCropMeta(mcMMO.p, true));
}
/**
* Process the Green Thumb ability for plants.
*
* @param blockState The {@link BlockState} to check ability activation for
* @param greenTerra boolean to determine if greenTerra is active or not
*/
private void processGreenThumbPlants(BlockState blockState, boolean greenTerra) {
if (!BlockUtils.isFullyGrown(blockState))
return;
private boolean processGreenThumbPlants(BlockState blockState, BlockBreakEvent blockBreakEvent, boolean greenTerra) {
if(!ItemUtils.isHoe(blockBreakEvent.getPlayer().getInventory().getItemInMainHand())) {
return false;
}
BlockData blockData = blockState.getBlockData();
if (!(blockData instanceof Ageable)) {
return false;
}
Ageable ageable = (Ageable) blockData;
//If the ageable is NOT mature and the player is NOT using a hoe, abort
Player player = getPlayer();
PlayerInventory playerInventory = player.getInventory();
@@ -670,37 +729,49 @@ public class HerbalismManager extends SkillManager {
break;
default:
return;
return false;
}
ItemStack seedStack = new ItemStack(seed);
if (!greenTerra && !RandomChanceUtil.checkRandomChanceExecutionSuccess(player, SubSkillType.HERBALISM_GREEN_THUMB, true)) {
return;
return false;
}
if (!processGrowingPlants(blockState, greenTerra)) {
return;
if (!playerInventory.containsAtLeast(seedStack, 1)) {
return false;
}
if(!ItemUtils.isHoe(getPlayer().getInventory().getItemInMainHand()))
{
if (!playerInventory.containsAtLeast(seedStack, 1)) {
return;
}
playerInventory.removeItem(seedStack);
player.updateInventory(); // Needed until replacement available
if (!processGrowingPlants(blockState, ageable, blockBreakEvent, greenTerra)) {
return false;
}
new HerbalismBlockUpdaterTask(blockState).runTaskLater(mcMMO.p, 0);
playerInventory.removeItem(seedStack);
player.updateInventory(); // Needed until replacement available
//Play sound
SoundManager.sendSound(player, player.getLocation(), SoundType.ITEM_CONSUMED);
return true;
// new HerbalismBlockUpdaterTask(blockState).runTaskLater(mcMMO.p, 0);
}
private boolean processGrowingPlants(BlockState blockState, boolean greenTerra) {
int greenThumbStage = getGreenThumbStage();
private boolean processGrowingPlants(BlockState blockState, Ageable ageable, BlockBreakEvent blockBreakEvent, boolean greenTerra) {
//This check is needed
if(isBizarreAgeable(ageable)) {
return false;
}
blockState.setMetadata(mcMMO.greenThumbDataKey, new FixedMetadataValue(mcMMO.p, (int) (System.currentTimeMillis() / Misc.TIME_CONVERSION_FACTOR)));
Ageable crops = (Ageable) blockState.getBlockData();
int finalAge = 0;
int greenThumbStage = getGreenThumbStage(greenTerra);
//Immature plants will start over at 0
if(!isAgeableMature(ageable)) {
// blockBreakEvent.setCancelled(true);
startReplantTask(0, blockBreakEvent, blockState, true);
// blockState.setType(Material.AIR);
blockBreakEvent.setDropItems(false);
return true;
}
switch (blockState.getType()) {
@@ -708,46 +779,47 @@ public class HerbalismManager extends SkillManager {
case CARROTS:
case WHEAT:
if (greenTerra) {
crops.setAge(3);
}
else {
crops.setAge(greenThumbStage);
}
finalAge = getGreenThumbStage(greenTerra);
break;
case BEETROOTS:
case NETHER_WART:
if (greenTerra || greenThumbStage > 2) {
crops.setAge(2);
finalAge = 2;
}
else if (greenThumbStage == 2) {
crops.setAge(1);
finalAge = 1;
}
else {
crops.setAge(0);
finalAge = 0;
}
break;
case COCOA:
if (greenTerra || getGreenThumbStage() > 1) {
crops.setAge(1);
if (getGreenThumbStage(greenTerra) >= 2) {
finalAge = 1;
}
else {
crops.setAge(0);
finalAge = 0;
}
break;
default:
return false;
}
blockState.setBlockData(crops);
//Start the delayed replant
startReplantTask(finalAge, blockBreakEvent, blockState, false);
return true;
}
private int getGreenThumbStage() {
private int getGreenThumbStage(boolean greenTerraActive) {
if(greenTerraActive)
return Math.min(RankUtils.getHighestRank(SubSkillType.HERBALISM_GREEN_THUMB),
RankUtils.getRank(getPlayer(), SubSkillType.HERBALISM_GREEN_THUMB) + 1);
return RankUtils.getRank(getPlayer(), SubSkillType.HERBALISM_GREEN_THUMB);
}
}

View File

@@ -134,6 +134,7 @@ public class MiningManager extends SkillManager {
int xp = 0;
float oreBonus = (float) (getOreBonus() / 100);
//TODO: Pretty sure something is fucked with debrisReduction stuff
float debrisReduction = (float) (getDebrisReduction() / 100);
int dropMultiplier = getDropMultiplier();
@@ -145,7 +146,8 @@ public class MiningManager extends SkillManager {
if (BlockUtils.isOre(blockState)) {
ores.add(blockState);
}
else {
//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);
}
}

View File

@@ -66,7 +66,7 @@ public class SalvageManager extends SkillManager {
Salvageable salvageable = mcMMO.getSalvageableManager().getSalvageable(item.getType());
if (item.getItemMeta().isUnbreakable()) {
if (item.getItemMeta() != null && item.getItemMeta().isUnbreakable()) {
NotificationManager.sendPlayerInformation(player, NotificationType.SUBSKILL_MESSAGE_FAILED, "Anvil.Unbreakable");
return;
}
@@ -82,11 +82,11 @@ public class SalvageManager extends SkillManager {
return;
}
/*int skillLevel = getSkillLevel();
int minimumSalvageableLevel = salvageable.getMinimumLevel();*/
/*int skillLevel = getSkillLevel();*/
int minimumSalvageableLevel = salvageable.getMinimumLevel();
// Level check
if (!RankUtils.hasUnlockedSubskill(player, SubSkillType.SALVAGE_SCRAP_COLLECTOR)) {
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()));
return;
}
@@ -118,8 +118,8 @@ public class SalvageManager extends SkillManager {
for(int x = 0; x < potentialSalvageYield-1; x++) {
if(RandomChanceUtil.rollDice(chanceOfSuccess, 100)) {
chanceOfSuccess-=2;
Math.max(chanceOfSuccess, 95);
chanceOfSuccess-=3;
chanceOfSuccess = Math.max(chanceOfSuccess, 90);
lotteryResults+=1;
}

View File

@@ -92,7 +92,14 @@ public class UnarmedManager extends SkillManager {
return false;
}
blockState.setType(Material.CRACKED_STONE_BRICKS);
blockState.getBlock().setType(Material.CRACKED_STONE_BRICKS);
return true;
case INFESTED_STONE_BRICKS:
if (!Unarmed.blockCrackerSmoothBrick) {
return false;
}
blockState.getBlock().setType(Material.INFESTED_CRACKED_STONE_BRICKS);
return true;
default:

View File

@@ -3,6 +3,7 @@ package com.gmail.nossr50.util;
import org.bukkit.Material;
import java.util.HashSet;
import java.util.Locale;
/**
* Stores hash tables for item and block names
@@ -22,6 +23,7 @@ public class MaterialMapStore {
private HashSet<String> canMakeShroomyWhiteList;
private HashSet<String> multiBlockPlant;
private HashSet<String> foodItemWhiteList;
private HashSet<String> glassBlocks;
public MaterialMapStore()
{
@@ -34,6 +36,7 @@ public class MaterialMapStore {
canMakeShroomyWhiteList = new HashSet<>();
multiBlockPlant = new HashSet<>();
foodItemWhiteList = new HashSet<>();
glassBlocks = new HashSet<>();
fillHardcodedHashSets();
}
@@ -89,6 +92,44 @@ public class MaterialMapStore {
fillShroomyWhiteList();
fillMultiBlockPlantSet();
fillFoodWhiteList();
fillGlassBlockWhiteList();
}
private void fillGlassBlockWhiteList() {
glassBlocks.add("glass");
glassBlocks.add("glass_pane");
glassBlocks.add("black_stained_glass");
glassBlocks.add("black_stained_glass_pane");
glassBlocks.add("blue_stained_glass");
glassBlocks.add("blue_stained_glass_pane");
glassBlocks.add("brown_stained_glass");
glassBlocks.add("brown_stained_glass_pane");
glassBlocks.add("cyan_stained_glass");
glassBlocks.add("cyan_stained_glass_pane");
glassBlocks.add("gray_stained_glass");
glassBlocks.add("gray_stained_glass_pane");
glassBlocks.add("green_stained_glass");
glassBlocks.add("green_stained_glass_pane");
glassBlocks.add("light_blue_stained_glass");
glassBlocks.add("light_blue_stained_glass_pane");
glassBlocks.add("light_gray_stained_glass");
glassBlocks.add("light_gray_stained_glass_pane");
glassBlocks.add("lime_stained_glass");
glassBlocks.add("lime_stained_glass_pane");
glassBlocks.add("magenta_stained_glass");
glassBlocks.add("magenta_stained_glass_pane");
glassBlocks.add("orange_stained_glass");
glassBlocks.add("orange_stained_glass_pane");
glassBlocks.add("pink_stained_glass");
glassBlocks.add("pink_stained_glass_pane");
glassBlocks.add("purple_stained_glass");
glassBlocks.add("purple_stained_glass_pane");
glassBlocks.add("red_stained_glass");
glassBlocks.add("red_stained_glass_pane");
glassBlocks.add("white_stained_glass");
glassBlocks.add("white_stained_glass_pane");
glassBlocks.add("yellow_stained_glass");
glassBlocks.add("yellow_stained_glass_pane");
}
private void fillFoodWhiteList() {
@@ -130,6 +171,10 @@ public class MaterialMapStore {
foodItemWhiteList.add("tropical_fish");
}
public boolean isGlass(Material material) {
return glassBlocks.contains(material.getKey().getKey());
}
public boolean isFood(Material material) {
return foodItemWhiteList.contains(material.getKey().getKey());
}
@@ -170,6 +215,8 @@ public class MaterialMapStore {
private void fillBlockCrackerWhiteList()
{
blockCrackerWhiteList.add("stone_bricks");
blockCrackerWhiteList.add("infested_stone_bricks");
}
private void fillHerbalismAbilityBlackList()
@@ -457,6 +504,6 @@ public class MaterialMapStore {
private void addToHashSet(String string, HashSet<String> stringHashSet)
{
stringHashSet.add(string.toLowerCase());
stringHashSet.add(string.toLowerCase(Locale.ENGLISH));
}
}

View File

@@ -13,6 +13,7 @@ import org.bukkit.inventory.ItemStack;
import org.bukkit.util.Vector;
import java.util.Collection;
import java.util.Locale;
import java.util.Random;
import java.util.Set;
@@ -225,7 +226,7 @@ public final class Misc {
String[] materialSplit = materialName.split("_");
if (materialSplit.length > 1) {
return materialSplit[0].toLowerCase();
return materialSplit[0].toLowerCase(Locale.ENGLISH);
}
return "UnknownMods";

View File

@@ -44,6 +44,11 @@ public final class MobHealthbarUtils {
return;
}
// Don't mangle invalid entities, they're not going to be rendered anyways
if (!target.isValid()) {
return;
}
String originalName = target.getName();
String oldName = target.getCustomName();
@@ -60,6 +65,7 @@ public final class MobHealthbarUtils {
return;
}
boolean oldNameVisible = target.isCustomNameVisible();
String newName = createHealthDisplay(Config.getInstance().getMobHealthbarDefault(), target, damage);

View File

@@ -16,6 +16,8 @@ import org.bukkit.permissions.Permission;
import org.bukkit.permissions.PermissionDefault;
import org.bukkit.plugin.PluginManager;
import java.util.Locale;
public final class Permissions {
private Permissions() {}
@@ -79,17 +81,17 @@ public final class Permissions {
public static boolean mcrefresh(Permissible permissible) { return (permissible.hasPermission("mcmmo.commands.mcrefresh")); }
public static boolean mcrefreshOthers(Permissible permissible) { return (permissible.hasPermission("mcmmo.commands.mcrefresh.others")); }
public static boolean mctop(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.commands.mctop." + skill.toString().toLowerCase()); }
public static boolean mctop(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.commands.mctop." + skill.toString().toLowerCase(Locale.ENGLISH)); }
public static boolean mmoedit(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.mmoedit"); }
public static boolean mmoeditOthers(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.mmoedit.others"); }
public static boolean skillreset(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.skillreset"); }
public static boolean skillreset(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.commands.skillreset." + skill.toString().toLowerCase()); }
public static boolean skillreset(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.commands.skillreset." + skill.toString().toLowerCase(Locale.ENGLISH)); }
public static boolean skillresetOthers(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.skillreset.others"); }
public static boolean skillresetOthers(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.commands.skillreset.others." + skill.toString().toLowerCase()); }
public static boolean skillresetOthers(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.commands.skillreset.others." + skill.toString().toLowerCase(Locale.ENGLISH)); }
public static boolean xplock(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.commands.xplock." + skill.toString().toLowerCase()); }
public static boolean xplock(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.commands.xplock." + skill.toString().toLowerCase(Locale.ENGLISH)); }
public static boolean xprateSet(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.xprate.set"); }
public static boolean xprateReset(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.xprate.reset"); }
@@ -111,16 +113,16 @@ public final class Permissions {
public static boolean hasRepairEnchantBypassPerk(Permissible permissible) { return permissible.hasPermission("mcmmo.perks.bypass.repairenchant"); }
public static boolean hasSalvageEnchantBypassPerk(Permissible permissible) { return permissible.hasPermission("mcmmo.perks.bypass.salvageenchant"); }
public static boolean lucky(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.perks.lucky." + skill.toString().toLowerCase()); }
public static boolean lucky(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.perks.lucky." + skill.toString().toLowerCase(Locale.ENGLISH)); }
/* XP PERKS */
public static boolean quadrupleXp(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.perks.xp.quadruple." + skill.toString().toLowerCase()); }
public static boolean tripleXp(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.perks.xp.triple." + skill.toString().toLowerCase()); }
public static boolean doubleAndOneHalfXp(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.perks.xp.150percentboost." + skill.toString().toLowerCase()); }
public static boolean doubleXp(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.perks.xp.double." + skill.toString().toLowerCase()); }
public static boolean oneAndOneHalfXp(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.perks.xp.50percentboost." + skill.toString().toLowerCase()); }
public static boolean oneAndOneTenthXp(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.perks.xp.10percentboost." + skill.toString().toLowerCase()); }
public static boolean customXpBoost(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.perks.xp.customboost." + skill.toString().toLowerCase()); }
public static boolean quadrupleXp(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.perks.xp.quadruple." + skill.toString().toLowerCase(Locale.ENGLISH)); }
public static boolean tripleXp(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.perks.xp.triple." + skill.toString().toLowerCase(Locale.ENGLISH)); }
public static boolean doubleAndOneHalfXp(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.perks.xp.150percentboost." + skill.toString().toLowerCase(Locale.ENGLISH)); }
public static boolean doubleXp(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.perks.xp.double." + skill.toString().toLowerCase(Locale.ENGLISH)); }
public static boolean oneAndOneHalfXp(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.perks.xp.50percentboost." + skill.toString().toLowerCase(Locale.ENGLISH)); }
public static boolean oneAndOneTenthXp(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.perks.xp.10percentboost." + skill.toString().toLowerCase(Locale.ENGLISH)); }
public static boolean customXpBoost(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.perks.xp.customboost." + skill.toString().toLowerCase(Locale.ENGLISH)); }
/* ACTIVATION PERKS */
public static boolean twelveSecondActivationBoost(Permissible permissible) { return permissible.hasPermission("mcmmo.perks.activationtime.twelveseconds"); }
@@ -136,11 +138,11 @@ public final class Permissions {
* SKILLS
*/
public static boolean skillEnabled(Permissible permissible, PrimarySkillType skill) {return permissible.hasPermission("mcmmo.skills." + skill.toString().toLowerCase()); }
public static boolean vanillaXpBoost(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.ability." + skill.toString().toLowerCase() + ".vanillaxpboost"); }
public static boolean skillEnabled(Permissible permissible, PrimarySkillType skill) {return permissible.hasPermission("mcmmo.skills." + skill.toString().toLowerCase(Locale.ENGLISH)); }
public static boolean vanillaXpBoost(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.ability." + skill.toString().toLowerCase(Locale.ENGLISH) + ".vanillaxpboost"); }
public static boolean isSubSkillEnabled(Permissible permissible, SubSkillType subSkillType) { return permissible.hasPermission(subSkillType.getPermissionNodeAddress()); }
public static boolean isSubSkillEnabled(Permissible permissible, AbstractSubSkill abstractSubSkill) { return permissible.hasPermission(abstractSubSkill.getPermissionNode()); }
public static boolean bonusDamage(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.ability." + skill.toString().toLowerCase() + ".bonusdamage"); }
public static boolean bonusDamage(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.ability." + skill.toString().toLowerCase(Locale.ENGLISH) + ".bonusdamage"); }
/* ACROBATICS */
public static boolean dodge(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.acrobatics.dodge"); }
@@ -163,8 +165,8 @@ public final class Permissions {
/* HERBALISM */
public static boolean greenTerra(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.herbalism.greenterra"); }
public static boolean greenThumbBlock(Permissible permissible, Material material) { return permissible.hasPermission("mcmmo.ability.herbalism.greenthumb.blocks." + material.toString().replace("_", "").toLowerCase()); }
public static boolean greenThumbPlant(Permissible permissible, Material material) { return permissible.hasPermission("mcmmo.ability.herbalism.greenthumb.plants." + material.toString().replace("_", "").toLowerCase()); }
public static boolean greenThumbBlock(Permissible permissible, Material material) { return permissible.hasPermission("mcmmo.ability.herbalism.greenthumb.blocks." + material.toString().replace("_", "").toLowerCase(Locale.ENGLISH)); }
public static boolean greenThumbPlant(Permissible permissible, Material material) { return permissible.hasPermission("mcmmo.ability.herbalism.greenthumb.plants." + material.toString().replace("_", "").toLowerCase(Locale.ENGLISH)); }
/* MINING */
public static boolean biggerBombs(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.mining.blastmining.biggerbombs"); }
@@ -173,15 +175,15 @@ public final class Permissions {
public static boolean superBreaker(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.mining.superbreaker"); }
/* REPAIR */
public static boolean repairItemType(Permissible permissible, ItemType repairItemType) { return permissible.hasPermission("mcmmo.ability.repair." + repairItemType.toString().toLowerCase() + "repair"); }
public static boolean repairMaterialType(Permissible permissible, MaterialType repairMaterialType) { return permissible.hasPermission("mcmmo.ability.repair." + repairMaterialType.toString().toLowerCase() + "repair"); }
public static boolean repairItemType(Permissible permissible, ItemType repairItemType) { return permissible.hasPermission("mcmmo.ability.repair." + repairItemType.toString().toLowerCase(Locale.ENGLISH) + "repair"); }
public static boolean repairMaterialType(Permissible permissible, MaterialType repairMaterialType) { return permissible.hasPermission("mcmmo.ability.repair." + repairMaterialType.toString().toLowerCase(Locale.ENGLISH) + "repair"); }
/* SALVAGE */
public static boolean advancedSalvage(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.salvage.advancedsalvage"); }
public static boolean arcaneSalvage(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.salvage.arcanesalvage"); }
public static boolean salvageItemType(Permissible permissible, ItemType salvageItemType) { return permissible.hasPermission("mcmmo.ability.salvage." + salvageItemType.toString().toLowerCase() + "salvage"); }
public static boolean salvageMaterialType(Permissible permissible, MaterialType salvageMaterialType) { return permissible.hasPermission("mcmmo.ability.salvage." + salvageMaterialType.toString().toLowerCase() + "salvage"); }
public static boolean salvageItemType(Permissible permissible, ItemType salvageItemType) { return permissible.hasPermission("mcmmo.ability.salvage." + salvageItemType.toString().toLowerCase(Locale.ENGLISH) + "salvage"); }
public static boolean salvageMaterialType(Permissible permissible, MaterialType salvageMaterialType) { return permissible.hasPermission("mcmmo.ability.salvage." + salvageMaterialType.toString().toLowerCase(Locale.ENGLISH) + "salvage"); }
/* SMELTING */
public static boolean fluxMining(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.smelting.fluxmining"); }
@@ -191,7 +193,7 @@ public final class Permissions {
public static boolean serratedStrikes(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.swords.serratedstrikes"); }
/* TAMING */
public static boolean callOfTheWild(Permissible permissible, EntityType type) { return permissible.hasPermission("mcmmo.ability.taming.callofthewild." + type.toString().toLowerCase()); }
public static boolean callOfTheWild(Permissible permissible, EntityType type) { return permissible.hasPermission("mcmmo.ability.taming.callofthewild." + type.toString().toLowerCase(Locale.ENGLISH)); }
/* UNARMED */
public static boolean berserk(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.unarmed.berserk"); }
@@ -204,7 +206,7 @@ public final class Permissions {
*/
public static boolean partySizeBypass(Permissible permissible) { return permissible.hasPermission("mcmmo.bypass.partylimit" ); }
public static boolean party(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.party"); }
public static boolean partySubcommand(Permissible permissible, PartySubcommandType subcommand) { return permissible.hasPermission("mcmmo.commands.party." + subcommand.toString().toLowerCase()); }
public static boolean partySubcommand(Permissible permissible, PartySubcommandType subcommand) { return permissible.hasPermission("mcmmo.commands.party." + subcommand.toString().toLowerCase(Locale.ENGLISH)); }
public static boolean friendlyFire(Permissible permissible) { return permissible.hasPermission("mcmmo.party.friendlyfire"); }
/* TELEPORT */

View File

@@ -7,6 +7,8 @@ import org.bukkit.block.data.Ageable;
import org.bukkit.block.data.BlockData;
import org.bukkit.entity.EntityType;
import java.util.Locale;
public class StringUtils {
/**
@@ -17,7 +19,7 @@ public class StringUtils {
* @return the capitalized string
*/
public static String getCapitalized(String target) {
return target.substring(0, 1).toUpperCase() + target.substring(1).toLowerCase();
return target.substring(0, 1).toUpperCase() + target.substring(1).toLowerCase(Locale.ENGLISH);
}
public static String getPrettyItemString(Material material) {

View File

@@ -17,6 +17,7 @@ import org.bukkit.entity.Player;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
/**
* This class handles many of the JSON components that mcMMO makes and uses
@@ -545,7 +546,7 @@ public class TextComponentFactory {
TextComponent unlockMessage = new TextComponent("");
unlockMessage.setText(LocaleLoader.getString("JSON.SkillUnlockMessage", subSkillType.getLocaleName(), RankUtils.getRank(player, subSkillType)));
unlockMessage.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, getSubSkillHoverComponent(player, subSkillType)));
unlockMessage.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/"+subSkillType.getParentSkill().toString().toLowerCase()));
unlockMessage.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/"+subSkillType.getParentSkill().toString().toLowerCase(Locale.ENGLISH)));
return unlockMessage;
}
}

View File

@@ -28,6 +28,7 @@ import org.bukkit.command.PluginCommand;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
public final class CommandRegistrationManager {
private CommandRegistrationManager() {};
@@ -36,8 +37,8 @@ public final class CommandRegistrationManager {
private static void registerSkillCommands() {
for (PrimarySkillType skill : PrimarySkillType.values()) {
String commandName = skill.toString().toLowerCase();
String localizedName = skill.getName().toLowerCase();
String commandName = skill.toString().toLowerCase(Locale.ENGLISH);
String localizedName = skill.getName().toLowerCase(Locale.ENGLISH);
PluginCommand command;

View File

@@ -17,6 +17,7 @@ import org.bukkit.entity.Player;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
public final class CommandUtils {
public static final List<String> TRUE_FALSE_OPTIONS = ImmutableList.of("on", "off", "true", "false", "enabled", "disabled");
@@ -302,7 +303,7 @@ public final class CommandUtils {
break;
}
if (playerName.toLowerCase().contains(partialName.toLowerCase())) {
if (playerName.toLowerCase(Locale.ENGLISH).contains(partialName.toLowerCase(Locale.ENGLISH))) {
// Partial match
matchedPlayers.add(playerName);
}

View File

@@ -12,7 +12,7 @@ import com.gmail.nossr50.util.skills.SkillActivationType;
import org.bukkit.entity.Player;
import java.text.DecimalFormat;
import java.util.Random;
import java.util.concurrent.ThreadLocalRandom;
public class RandomChanceUtil
{
@@ -78,9 +78,7 @@ public class RandomChanceUtil
}
public static boolean rollDice(double chanceOfSuccess, int bound) {
Random random = new Random();
return chanceOfSuccess > random.nextInt(bound);
return chanceOfSuccess > ThreadLocalRandom.current().nextInt(bound);
}
/**
@@ -100,8 +98,6 @@ public class RandomChanceUtil
{
double chanceOfSuccess = calculateChanceOfSuccess(randomChance);
Random random = new Random();
//Check the odds
return rollDice(chanceOfSuccess, 100);
}

View File

@@ -203,7 +203,7 @@ public class ScoreboardWrapper {
revertTask = new ScoreboardChangeTask().runTaskLater(mcMMO.p, ticks);
// TODO is there any way to do the time that looks acceptable?
// player.sendMessage(LocaleLoader.getString("Commands.Scoreboard.Timer", StringUtils.capitalize(sidebarType.toString().toLowerCase()), ticks / 20F));
// player.sendMessage(LocaleLoader.getString("Commands.Scoreboard.Timer", StringUtils.capitalize(sidebarType.toString().toLowerCase(Locale.ENGLISH)), ticks / 20F));
if(UserManager.getPlayer(playerName) == null)
return;

View File

@@ -48,6 +48,12 @@ public final class CombatUtils {
}
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
//Make sure the profiles been loaded
if(mcMMOPlayer == null) {
return;
}
SwordsManager swordsManager = mcMMOPlayer.getSwordsManager();
double initialDamage = event.getDamage();
double finalDamage = initialDamage;
@@ -94,6 +100,12 @@ public final class CombatUtils {
Map<DamageModifier, Double> modifiers = getModifiers(event);
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
//Make sure the profiles been loaded
if(mcMMOPlayer == null) {
return;
}
AxesManager axesManager = mcMMOPlayer.getAxesManager();
if (axesManager.canActivateAbility()) {
@@ -137,6 +149,12 @@ public final class CombatUtils {
double finalDamage = initialDamage;
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
//Make sure the profiles been loaded
if(mcMMOPlayer == null) {
return;
}
UnarmedManager unarmedManager = mcMMOPlayer.getUnarmedManager();
if (unarmedManager.canActivateAbility()) {
@@ -203,10 +221,16 @@ public final class CombatUtils {
}
private static void processArcheryCombat(LivingEntity target, Player player, EntityDamageByEntityEvent event, Arrow arrow) {
private static void processArcheryCombat(LivingEntity target, Player player, EntityDamageByEntityEvent event, Projectile arrow) {
double initialDamage = event.getDamage();
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
//Make sure the profiles been loaded
if(mcMMOPlayer == null) {
return;
}
ArcheryManager archeryManager = mcMMOPlayer.getArcheryManager();
double finalDamage = event.getDamage();
@@ -224,7 +248,8 @@ public final class CombatUtils {
}
if (archeryManager.canSkillShot()) {
finalDamage+=archeryManager.skillShot(initialDamage);
//Not Additive
finalDamage = archeryManager.skillShot(initialDamage);
}
if (archeryManager.canDaze(target)) {
@@ -355,8 +380,8 @@ public final class CombatUtils {
}
}
}
else if (entityType == EntityType.ARROW) {
Arrow arrow = (Arrow) damager;
else if (entityType == EntityType.ARROW || entityType == EntityType.SPECTRAL_ARROW) {
Projectile arrow = (Projectile) damager;
ProjectileSource projectileSource = arrow.getShooter();
if (projectileSource != null && projectileSource instanceof Player && PrimarySkillType.ARCHERY.shouldProcess(target)) {
@@ -554,6 +579,11 @@ public final class CombatUtils {
target.damage(damage);
}
private static boolean processingNoInvulnDamage;
public static boolean isProcessingNoInvulnDamage() {
return processingNoInvulnDamage;
}
public static void dealNoInvulnerabilityTickDamage(LivingEntity target, double damage, Entity attacker) {
if (target.isDead()) {
return;
@@ -564,7 +594,11 @@ public final class CombatUtils {
// potentially mis-attributing the death cause; calling a fake event would partially fix this, but this and setting the last damage
// cause do have issues around plugin observability. This is not a perfect solution, but it appears to be the best one here
// We also set no damage ticks to 0, to ensure that damage is applied for this case, and reset it back to the original value
// Snapshot current state so we can pop up properly
boolean wasMetaSet = target.getMetadata(mcMMO.CUSTOM_DAMAGE_METAKEY).size() != 0;
boolean wasProcessing = processingNoInvulnDamage;
// set markers
processingNoInvulnDamage = true;
target.setMetadata(mcMMO.CUSTOM_DAMAGE_METAKEY, mcMMO.metadataValue);
int noDamageTicks = target.getNoDamageTicks();
target.setNoDamageTicks(0);
@@ -572,6 +606,8 @@ public final class CombatUtils {
target.setNoDamageTicks(noDamageTicks);
if (!wasMetaSet)
target.removeMetadata(mcMMO.CUSTOM_DAMAGE_METAKEY, mcMMO.p);
if (!wasProcessing)
processingNoInvulnDamage = false;
}
public static void dealNoInvulnerabilityTickDamageRupture(LivingEntity target, double damage, Entity attacker, int toolTier) {

View File

@@ -1,6 +1,8 @@
package com.gmail.nossr50.util.skills;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.util.sounds.SoundManager;
import com.gmail.nossr50.util.sounds.SoundType;
import org.bukkit.Effect;
import org.bukkit.Location;
import org.bukkit.Material;
@@ -14,6 +16,12 @@ public final class ParticleEffectUtils {
private ParticleEffectUtils() {};
public static void playGreenThumbEffect(Location location) {
World world = location.getWorld();
playSmokeEffect(location);
SoundManager.worldSendSoundMaxPitch(world, location, SoundType.POP);
}
public static void playBleedEffect(LivingEntity livingEntity) {
if (!Config.getInstance().getBleedEffectEnabled()) {
return;
@@ -27,7 +35,7 @@ public final class ParticleEffectUtils {
return;
}
playSmokeEffect(player);
playSmokeEffect(player.getLocation());
}
public static void playFluxEffect(Location location) {
@@ -35,12 +43,17 @@ public final class ParticleEffectUtils {
return;
}
if(location.getWorld() == null)
return;
location.getWorld().playEffect(location, Effect.MOBSPAWNER_FLAMES, 1);
}
public static void playSmokeEffect(LivingEntity livingEntity) {
Location location = livingEntity.getEyeLocation();
World world = livingEntity.getWorld();
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);

View File

@@ -39,6 +39,11 @@ public class SoundManager {
world.playSound(location, getSound(soundType), getVolume(soundType), getPitch(soundType));
}
public static void worldSendSoundMaxPitch(World world, Location location, SoundType soundType) {
if(SoundConfig.getInstance().getIsEnabled(soundType))
world.playSound(location, getSound(soundType), getVolume(soundType), 2.0F);
}
/**
* All volume is multiplied by the master volume to get its final value
* @param soundType target soundtype
@@ -91,6 +96,10 @@ public class SoundManager {
return Sound.BLOCK_CONDUIT_AMBIENT;
case BLEED:
return Sound.ENTITY_ENDER_EYE_DEATH;
case GLASS:
return Sound.BLOCK_GLASS_BREAK;
case ITEM_CONSUMED:
return Sound.ITEM_BOTTLE_EMPTY;
default:
return null;
}

View File

@@ -14,6 +14,8 @@ public enum SoundType {
ABILITY_ACTIVATED_GENERIC,
ABILITY_ACTIVATED_BERSERK,
BLEED,
GLASS,
ITEM_CONSUMED,
TIRED;
public boolean usesCustomPitch()

View File

@@ -15,7 +15,7 @@ import java.util.*;
import java.util.concurrent.Callable;
public class UUIDFetcher implements Callable<Map<String, UUID>> {
private static final int PROFILES_PER_REQUEST = 50;
private static final int PROFILES_PER_REQUEST = 10;
private static final long RATE_LIMIT = 100L;
private static final String PROFILE_URL = "https://api.mojang.com/profiles/minecraft";
private final List<String> names;

View File

@@ -1,6 +1,5 @@
package com.gmail.nossr50.worldguard;
import com.gmail.nossr50.mcMMO;
import com.sk89q.worldedit.bukkit.BukkitAdapter;
import com.sk89q.worldedit.bukkit.BukkitPlayer;
import com.sk89q.worldguard.WorldGuard;

View File

@@ -96,6 +96,9 @@ public class WorldGuardUtils {
private static boolean isCompatibleVersion(Plugin plugin) {
//Check that the version of WG is at least version 7.xx
boolean allClassesFound = true;
if (detectedIncompatibleWG) {
return false;
}
if (!plugin.getDescription().getVersion().startsWith("7")) {
markWGIncompatible();

View File

@@ -442,7 +442,7 @@ Bonus_Drops:
Melon_Slice: true
Nether_Wart: true
Potatoes: true
Potatoe: true
Potato: true
Pumpkin: true
Red_Mushroom: true
Sugar_Cane: true
@@ -462,6 +462,7 @@ Bonus_Drops:
Lilac: true
Rose_Bush: true
Peony: true
Lily_Of_The_Valley: true
Mining:
Andesite: true
Diorite: true

View File

@@ -34,6 +34,7 @@ ExploitFix:
LavaStoneAndCobbleFarming: true
TreeFellerReducedXP: true
PistonCheating: true
SnowGolemExcavation: true
Experience_Bars:
# Turn this to false if you wanna disable XP bars
Enable: true
@@ -275,7 +276,8 @@ Experience_Values:
Brown_Mushroom_Block: 70
Mushroom_Stem: 80
Herbalism:
Sweet_Berry_Bush: 300
Bee_Nest: 200
Sweet_Berry_Bush: 50
Seagrass: 10
Tall_Seagrass: 10
Kelp: 3
@@ -441,6 +443,7 @@ Experience_Values:
Cat: 500
Fox: 1000
Panda: 1000
Bee: 100
Combat:
Multiplier:
Animals: 1.0
@@ -502,4 +505,5 @@ Experience_Values:
Ravager: 4.0
Trader_Llama: 1.0
Wandering_trader: 1.0
Bee: 1.5

View File

@@ -47,15 +47,12 @@ JSON.Hover.SuperAbility=[[DARK_PURPLE]]{0}&r
JSON.Hover.MaxRankSkillName=[[GOLD]]{0}&r
JSON.Hover.AtSymbolSkills=[[YELLOW]]@
JSON.Hover.AtSymbolURL=[[YELLOW]]@
#This is the message sent to players when an ability is activated
JSON.Notification.SuperAbility={0}
#These are the JSON Strings used for SubSkills
JSON.Acrobatics.Roll.Interaction.Activated=Test [[RED]]Rolled Test
JSON.Acrobatics.SubSkill.Roll.Details.Tips=If you hold sneak while falling you can prevent up to twice the damage that you would normally take!
Anvil.SingleItemStack=[[RED]]You cannot salvage or repair item stacks that have more than one item, split the stack first.
#DO NOT USE COLOR CODES IN THE JSON KEYS
#COLORS ARE DEFINED IN advanced.yml IF YOU WISH TO CHANGE THEM
@@ -160,7 +157,6 @@ Alchemy.Ability.Locked.0=LOCKED UNTIL {0}+ SKILL (CATALYSIS)
Alchemy.SkillName=ALCHEMY
#ARCHERY
Archery.SubSkill.SkillShot.Name=Skill Shot
Archery.SubSkill.SkillShot.Description=Increases damage done with bows
Archery.SubSkill.SkillShot.Stat=Skill Shot Bonus Damage
@@ -270,7 +266,7 @@ Herbalism.Ability.Lower=[[GRAY]]You lower your Hoe.
Herbalism.Ability.Ready=[[DARK_AQUA]]You [[GOLD]]ready[[DARK_AQUA]] your Hoe.
Herbalism.Ability.ShroomThumb.Fail=**SHROOM THUMB FAIL**
Herbalism.SubSkill.GreenTerra.Name=Green Terra
Herbalism.SubSkill.GreenTerra.Description=Spread the Terra, 3x Drops
Herbalism.SubSkill.GreenTerra.Description=Spread the Terra, 3x Drops, Boosts Green Thumb
Herbalism.SubSkill.GreenTerra.Stat=Green Terra Duration
Herbalism.SubSkill.GreenThumb.Name=Green Thumb
Herbalism.SubSkill.GreenThumb.Description=Auto-Plants crops when harvesting
@@ -319,7 +315,6 @@ Mining.SubSkill.BiggerBombs.Description=Increases TNT explosion radius
Mining.SubSkill.DemolitionsExpertise.Name=Demolitions Expertise
Mining.SubSkill.DemolitionsExpertise.Description=Decreases damage from TNT explosions
Mining.SubSkill.DemolitionsExpertise.Stat=Demolitions Expert Damage Decrease
Mining.Listener=Mining:
Mining.SkillName=MINING
Mining.Skills.SuperBreaker.Off=**Super Breaker has worn off**
@@ -329,7 +324,7 @@ Mining.Skills.SuperBreaker.Other.On=[[GREEN]]{0}[[DARK_GREEN]] has used [[RED]]S
Mining.Skills.SuperBreaker.Refresh=[[GREEN]]Your [[YELLOW]]Super Breaker [[GREEN]]ability is refreshed!
#Blast Mining
Mining.Blast.Boom=[[GRAY]]**BOOM**
Mining.Blast.Cooldown=
Mining.Blast.Cooldown=test
Mining.Blast.Effect=+{0} ore yield, -{1} debris yield, {2}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!
@@ -577,14 +572,14 @@ Commands.Ability.Toggle=Ability use has been toggled for [[YELLOW]]{0}
Commands.AdminChat.Off=Admin Chat only [[RED]]Off
Commands.AdminChat.On=Admin Chat only [[GREEN]]On
Commands.AdminToggle=[[GREEN]]- Toggle admin chat
Commands.Chat.Console=*Console*
Commands.Chat.Console= *Console*
Commands.Cooldowns.Header=[[GOLD]]--= [[GREEN]]mcMMO Ability Cooldowns[[GOLD]] =--
Commands.Cooldowns.Row.N=\ [[RED]]{0}[[WHITE]] - [[GOLD]]{1} seconds left
Commands.Cooldowns.Row.Y=\ [[AQUA]]{0}[[WHITE]] - [[DARK_GREEN]]Ready!
Commands.Cooldowns.Row.N= [[RED]]{0}[[WHITE]] - [[GOLD]]{1} seconds left
Commands.Cooldowns.Row.Y= [[AQUA]]{0}[[WHITE]] - [[DARK_GREEN]]Ready!
Commands.Database.CooldownMS=You must wait {0} milliseconds before using this command again.
Commands.Database.Processing=Your previous command is still being processed. Please wait.
Commands.Disabled=This command is disabled.
Commands.DoesNotExist= [[RED]]Player does not exist in the database!
Commands.DoesNotExist=[[RED]]Player does not exist in the database!
Commands.GodMode.Disabled=mcMMO Godmode Disabled
Commands.GodMode.Enabled=mcMMO Godmode Enabled
Commands.AdminChatSpy.Enabled=mcMMO Party Chat Spy Enabled
@@ -759,7 +754,7 @@ Party.NotOwner=[[DARK_RED]]You are not the party leader.
Party.Target.NotOwner=[[DARK_RED]]{0} is not the party leader.
Party.Owner.New=[[GREEN]]{0} is the new party leader.
Party.Owner.NotLeader=[[DARK_RED]]You are no longer the party leader.
Party.Owner.Player =[[GREEN]]You are now the party leader.
Party.Owner.Player=[[GREEN]]You are now the party leader.
Party.Password.None=[[RED]]This party is password protected. Please provide a password to join.
Party.Password.Incorrect=[[RED]]Party password is incorrect.
Party.Password.Set=[[GREEN]]Party password set to {0}
@@ -839,7 +834,6 @@ Commands.Event.Stop.Subtitle=[[GREEN]]I hope you had fun!
Commands.Event.XP=[[DARK_AQUA]]XP Rate is now [[GOLD]]{0}[[DARK_AQUA]]x
Commands.xprate.started.0=[[GOLD]]XP EVENT FOR mcMMO HAS STARTED!
Commands.xprate.started.1=[[GOLD]]mcMMO XP RATE IS NOW {0}x!
# Admin Notifications
Server.ConsoleName=[[YELLOW]][Server]
Notifications.Admin.XPRate.Start.Self=[[GRAY]]You have set the global XP rate multiplier to [[GOLD]]{0}x
@@ -848,16 +842,14 @@ Notifications.Admin.XPRate.End.Others={0} [[GRAY]]has ended the XP rate event
Notifications.Admin.XPRate.Start.Others={0} [[GRAY]]has started or modified an XP rate event with global multiplier {1}x
Notifications.Admin.Format.Others=[[GOLD]]([[GREEN]]mcMMO [[DARK_AQUA]]Admin[[GOLD]]) [[GRAY]]{0}
Notifications.Admin.Format.Self=[[GOLD]]([[GREEN]]mcMMO[[GOLD]]) [[GRAY]]{0}
# Event
XPRate.Event=[[GOLD]]mcMMO is currently in an XP rate event! XP rate is {0}x!
#GUIDES
Guides.Available=[[GRAY]]Guide for {0} available - type /{1} ? [page]
Guides.Header=[[GOLD]]-=[[GREEN]]{0} Guide[[GOLD]]=-
Guides.Page.Invalid=Not a valid page number!
Guides.Page.OutOfRange=That page does not exist, there are only {0} total pages.
Guides.Usage= Usage is /{0} ? [page]
Guides.Usage=Usage is /{0} ? [page]
##Acrobatics
Guides.Acrobatics.Section.0=[[DARK_AQUA]]About Acrobatics:\n[[YELLOW]]Acrobatics is the art of moving Gracefuly in mcMMO.\n[[YELLOW]]It provides combat bonuses and environment damage bonuses.\n\n[[DARK_AQUA]]XP GAIN:\n[[YELLOW]]To gain XP in this skill you need to perform a dodge\n[[YELLOW]]in combat or survive falls from heights that damage you.
Guides.Acrobatics.Section.1=[[DARK_AQUA]]How does Rolling work?\n[[YELLOW]]You have a passive chance when you take fall damage\n[[YELLOW]]to negate the damage done. You can hold the sneak button to\n[[YELLOW]]double your chances during the fall.\n[[YELLOW]]This triggers a Graceful Roll instead of a standard one.\n[[YELLOW]]Graceful Rolls are like regular rolls but are twice as likely to\n[[YELLOW]]occur and provide more damage safety than regular rolls.\n[[YELLOW]]Rolling chance is tied to your skill level
@@ -955,7 +947,7 @@ Guides.Woodcutting.Section.1=[[DARK_AQUA]]How does Tree Feller work?\n[[YELLOW]]
Guides.Woodcutting.Section.2=[[DARK_AQUA]]How does Leaf Blower work?\n[[YELLOW]]Leaf Blower is a passive ability that will cause leaf\n[[YELLOW]]blocks to break instantly when hit with an axe. By default,\n[[YELLOW]]this ability unlocks at level 100.
Guides.Woodcutting.Section.3=[[DARK_AQUA]]How do Double Drops work?\n[[YELLOW]]This passive ability gives you a chance to obtain an extra\n[[YELLOW]]block for every log you chop.
#INSPECT
Inspect.Offline= [[RED]]You do not have permission to inspect offline players!
Inspect.Offline=[[RED]]You do not have permission to inspect offline players!
Inspect.OfflineStats=mcMMO Stats for Offline Player [[YELLOW]]{0}
Inspect.Stats=[[GREEN]]mcMMO Stats for [[YELLOW]]{0}
Inspect.TooFar=You are too far away to inspect that player!
@@ -980,7 +972,7 @@ Skills.Disarmed=[[DARK_RED]]You have been disarmed!
Skills.Header=-----[] [[GREEN]]{0}[[RED]] []-----
Skills.NeedMore=[[DARK_RED]]You need more [[GRAY]]{0}
Skills.NeedMore.Extra=[[DARK_RED]]You need more [[GRAY]]{0}{1}
Skills.Parents= PARENTS
Skills.Parents=PARENTS
Skills.Stats={0}[[GREEN]]{1}[[DARK_AQUA]] XP([[GRAY]]{2}[[DARK_AQUA]]/[[GRAY]]{3}[[DARK_AQUA]])
Skills.ChildStats={0}[[GREEN]]{1}
Skills.MaxXP=Max

File diff suppressed because it is too large Load Diff

View File

@@ -118,14 +118,14 @@ XPBar.Complex.Template={0} [[DARK_AQUA]] {4}[[WHITE]]% [[DARK_AQUA]]([[WHITE]]{1
# ACROBATICS
Acrobatics.Ability.Proc=[[GREEN]]**\u512a\u96c5\u306b\u7740\u5730\u3057\u305f**
Acrobatics.Combat.Proc=[[GREEN]]**\u8eb1\u3057\u305f**
Acrobatics.SubSkill.Roll.Stats=[[GOLD]]\u53d7\u3051\u8eab \u78ba\u7387 [[YELLOW]]{0}%[[GOLD]] \u4e0a\u4f4d\u53d7\u3051\u8eab \u78ba\u7387[[YELLOW]] {1}%
Acrobatics.SubSkill.Roll.Stats=[[GOLD]]\u53d7\u3051\u8eab \u78ba\u7387 [[YELLOW]]{0}%[[GOLD]] \u512a\u96c5\u306a\u53d7\u3051\u8eab \u78ba\u7387[[YELLOW]] {1}%
Acrobatics.SubSkill.Roll.Stat=\u53d7\u3051\u8eab \u78ba\u7387
Acrobatics.SubSkill.Roll.Stat.Extra=\u4e0a\u4f4d\u53d7\u3051\u8eab \u78ba\u7387
Acrobatics.SubSkill.Roll.Stat.Extra=\u512a\u96c5\u306a\u53d7\u3051\u8eab \u78ba\u7387
Acrobatics.SubSkill.Roll.Name=\u53d7\u3051\u8eab
Acrobatics.SubSkill.Roll.Description=\u30c0\u30e1\u30fc\u30b8\u3092\u907f\u3051\u308b\u70ba\u306b\u843d\u4e0b\u6642\u306b\u53d7\u3051\u8eab\u3059\u308b\u3002
Acrobatics.SubSkill.Roll.Chance=\u53d7\u3051\u8eab \u78ba\u7387: [[YELLOW]]{0}
Acrobatics.SubSkill.Roll.GraceChance=\u4e0a\u4f4d\u53d7\u3051\u8eab \u78ba\u7387: [[YELLOW]]{0}
Acrobatics.SubSkill.GracefulRoll.Name=\u4e0a\u4f4d\u53d7\u3051\u8eab
Acrobatics.SubSkill.Roll.GraceChance=\u512a\u96c5\u306a\u53d7\u3051\u8eab \u78ba\u7387: [[YELLOW]]{0}
Acrobatics.SubSkill.GracefulRoll.Name=\u512a\u96c5\u306a\u53d7\u3051\u8eab
Acrobatics.SubSkill.GracefulRoll.Description=\u53d7\u3051\u8eab\u306e\u4e8c\u500d\u306e\u52b9\u679c\u3092\u767a\u63ee\u3059\u308b\u3002
Acrobatics.SubSkill.Dodge.Name=\u8eb1\u3059
Acrobatics.SubSkill.Dodge.Description=\u653b\u6483\u3067\u53d7\u3051\u308b\u30c0\u30e1\u30fc\u30b8\u3092\u534a\u6e1b\u3059\u308b\u3002
@@ -193,10 +193,10 @@ Axes.SubSkill.GreaterImpact.Name=\u30b0\u30ec\u30fc\u30bf\u30fc\u30a4\u30f3\u30d
Axes.SubSkill.GreaterImpact.Description=\u9632\u5177\u306e\u306a\u3044\u6575\u306b\u8ffd\u52a0\u30c0\u30e1\u30fc\u30b8\u3092\u4e0e\u3048\u308b\u3002
Axes.Listener=\u65a7:
Axes.SkillName=\u65a7
Axes.Skills.SS.Off=**\u30b9\u30ab\u30eb\u30b9\u30d7\u30ea\u30c3\u30bf\u30fc \u3092\u6469\u640d\u3057\u305f**
Axes.Skills.SS.Off=**\u30b9\u30ab\u30eb\u30b9\u30d7\u30ea\u30c3\u30bf\u30fc \u3092\u6d88\u8017\u3057\u305f**
Axes.Skills.SS.On=[[GREEN]]**\u30b9\u30ab\u30eb\u30b9\u30d7\u30ea\u30c3\u30bf\u30fc \u30a2\u30af\u30c6\u30a3\u30d9\u30fc\u30c8**
Axes.Skills.SS.Refresh=[[YELLOW]]\u30b9\u30ab\u30eb\u30b9\u30d7\u30ea\u30c3\u30bf\u30fc [[GREEN]]\u30a2\u30d3\u30ea\u30c6\u30a3\u304c\u56de\u5fa9\u3057\u307e\u3057\u305f\uff01
Axes.Skills.SS.Other.Off=[[YELLOW]]{0}\u304c [[WHITE]]\u30b9\u30ab\u30eb\u30b9\u30d7\u30ea\u30c3\u30bf\u30fc [[GREEN]]\u3092\u6469\u640d\u3057\u305f
Axes.Skills.SS.Other.Off=[[YELLOW]]{0}\u304c [[WHITE]]\u30b9\u30ab\u30eb\u30b9\u30d7\u30ea\u30c3\u30bf\u30fc [[GREEN]]\u3092\u6d88\u8017\u3057\u305f
Axes.Skills.SS.Other.On=[[GREEN]]{0}[[DARK_GREEN]]\u304c [[RED]]\u30b9\u30ab\u30eb\u30b9\u30d7\u30ea\u30c3\u30bf\u30fc [[DARK_GREEN]]\u3092\u4f7f\u3063\u305f\uff01
# EXCAVATION
@@ -212,10 +212,10 @@ Excavation.SubSkill.Archaeology.Stat.Extra=\u8003\u53e4\u5b66 \u7d4c\u9a13\u5024
Excavation.Listener=\u6398\u524a:
Excavation.SkillName=\u6398\u524a
Excavation.Skills.GigaDrillBreaker.Off=**\u30ae\u30ac\u30c9\u30ea\u30eb\u30d6\u30ec\u30fc\u30ab\u30fc \u3092\u6469\u640d\u3057\u305f**
Excavation.Skills.GigaDrillBreaker.Off=**\u30ae\u30ac\u30c9\u30ea\u30eb\u30d6\u30ec\u30fc\u30ab\u30fc \u3092\u6d88\u8017\u3057\u305f**
Excavation.Skills.GigaDrillBreaker.On=[[GREEN]]**\u30ae\u30ac\u30c9\u30ea\u30eb\u30d6\u30ec\u30fc\u30ab\u30fc \u30a2\u30af\u30c6\u30a3\u30d9\u30fc\u30c8**
Excavation.Skills.GigaDrillBreaker.Refresh=[[YELLOW]]\u30ae\u30ac\u30c9\u30ea\u30eb\u30d6\u30ec\u30fc\u30ab\u30fc [[GREEN]]\u30a2\u30d3\u30ea\u30c6\u30a3\u304c\u56de\u5fa9\u3057\u307e\u3057\u305f\uff01
Excavation.Skills.GigaDrillBreaker.Other.Off=[[YELLOW]]{0}\u304c [[WHITE]]\u30ae\u30ac\u30c9\u30ea\u30eb\u30d6\u30ec\u30fc\u30ab\u30fc [[GREEN]]\u3092\u6469\u640d\u3057\u305f
Excavation.Skills.GigaDrillBreaker.Other.Off=[[YELLOW]]{0}\u304c [[WHITE]]\u30ae\u30ac\u30c9\u30ea\u30eb\u30d6\u30ec\u30fc\u30ab\u30fc [[GREEN]]\u3092\u6d88\u8017\u3057\u305f
Excavation.Skills.GigaDrillBreaker.Other.On=[[GREEN]]{0}[[DARK_GREEN]]\u304c [[RED]]\u30ae\u30ac\u30c9\u30ea\u30eb\u30d6\u30ec\u30fc\u30ab\u30fc [[DARK_GREEN]]\u3092\u4f7f\u3063\u305f\uff01
# FISHING
@@ -284,10 +284,10 @@ Herbalism.SubSkill.ShroomThumb.Stat=\u30ad\u30ce\u30b3\u306e\u89aa\u6307 \u78ba\
Herbalism.HylianLuck=[[GREEN]]\u30cf\u30a4\u30e9\u30eb\u306e\u904b\u306f\u4eca\u65e5\u306e\u3042\u306a\u305f\u306b\u3064\u3044\u3066\u3044\u307e\u3059\uff01
Herbalism.Listener=\u8fb2\u696d:
Herbalism.SkillName=\u8fb2\u696d
Herbalism.Skills.GTe.Off=**\u304c\u3059\u308a\u6e1b\u3063\u305f \u3092\u6469\u640d\u3057\u305f**
Herbalism.Skills.GTe.On=[[GREEN]]**\u304c\u3059\u308a\u6e1b\u3063\u305f \u30a2\u30af\u30c6\u30a3\u30d9\u30fc\u30c8**
Herbalism.Skills.GTe.Refresh=[[YELLOW]]\u304c\u3059\u308a\u6e1b\u3063\u305f [[GREEN]]\u30a2\u30d3\u30ea\u30c6\u30a3\u304c\u56de\u5fa9\u3057\u307e\u3057\u305f\uff01
Herbalism.Skills.GTe.Other.Off=[[YELLOW]]{0}\u304c [[WHITE]]\u304c\u3059\u308a\u6e1b\u3063\u305f [[GREEN]]\u3092\u6469\u640d\u3057\u305f
Herbalism.Skills.GTe.Off=**\u30b0\u30ea\u30fc\u30f3\u30c6\u30e9 \u3092\u6d88\u8017\u3057\u305f**
Herbalism.Skills.GTe.On=[[GREEN]]**\u30b0\u30ea\u30fc\u30f3\u30c6\u30e9 \u30a2\u30af\u30c6\u30a3\u30d9\u30fc\u30c8**
Herbalism.Skills.GTe.Refresh=[[YELLOW]]\u30b0\u30ea\u30fc\u30f3\u30c6\u30e9 [[GREEN]]\u30a2\u30d3\u30ea\u30c6\u30a3\u304c\u56de\u5fa9\u3057\u307e\u3057\u305f\uff01
Herbalism.Skills.GTe.Other.Off=[[YELLOW]]{0}\u304c [[WHITE]]\u30b0\u30ea\u30fc\u30f3\u30c6\u30e9 [[GREEN]]\u3092\u6d88\u8017\u3057\u305f
Herbalism.Skills.GTe.Other.On=[[GREEN]]{0}[[DARK_GREEN]]\u304c [[RED]]\u30b0\u30ea\u30fc\u30f3\u30c6\u30e9 [[DARK_GREEN]]\u3092\u4f7f\u3063\u305f\uff01
# MINING
@@ -313,10 +313,10 @@ Mining.SubSkill.DemolitionsExpertise.Description=TNT\u306b\u3088\u308b\u30c0\u30
Mining.SubSkill.DemolitionsExpertise.Stat=\u89e3\u4f53\u30a8\u30ad\u30b9\u30d1\u30fc\u30c8\u306e\u30c0\u30e1\u30fc\u30b8\u8efd\u6e1b
Mining.Listener=\u63a1\u6398:
Mining.SkillName=\u63a1\u6398
Mining.Skills.SuperBreaker.Off=**\u30b9\u30fc\u30d1\u30fc\u30d6\u30ec\u30fc\u30ab\u30fc \u3092\u6469\u640d\u3057\u305f**
Mining.Skills.SuperBreaker.Off=**\u30b9\u30fc\u30d1\u30fc\u30d6\u30ec\u30fc\u30ab\u30fc \u3092\u6d88\u8017\u3057\u305f**
Mining.Skills.SuperBreaker.On=[[GREEN]]**\u30b9\u30fc\u30d1\u30fc\u30d6\u30ec\u30fc\u30ab\u30fc \u30a2\u30af\u30c6\u30a3\u30d9\u30fc\u30c8**
Mining.Skills.SuperBreaker.Refresh=[[YELLOW]]\u30b9\u30fc\u30d1\u30fc\u30d6\u30ec\u30fc\u30ab\u30fc [[GREEN]]\u30a2\u30d3\u30ea\u30c6\u30a3\u304c\u56de\u5fa9\u3057\u307e\u3057\u305f\uff01
Mining.Skills.SuperBreaker.Other.Off=[[YELLOW]]{0}\u304c [[WHITE]]\u30b9\u30fc\u30d1\u30fc\u30d6\u30ec\u30fc\u30ab\u30fc [[GREEN]]\u3092\u6469\u640d\u3057\u305f
Mining.Skills.SuperBreaker.Other.Off=[[YELLOW]]{0}\u304c [[WHITE]]\u30b9\u30fc\u30d1\u30fc\u30d6\u30ec\u30fc\u30ab\u30fc [[GREEN]]\u3092\u6d88\u8017\u3057\u305f
Mining.Skills.SuperBreaker.Other.On=[[GREEN]]{0}[[DARK_GREEN]]\u304c [[RED]]\u30b9\u30fc\u30d1\u30fc\u30d6\u30ec\u30fc\u30ab\u30fc [[DARK_GREEN]]\u3092\u4f7f\u3063\u305f\uff01
# Blast Mining
@@ -428,10 +428,10 @@ Swords.Effect.4=\u92f8\u6b6f\u72b6\u306e\u653b\u6483\u306e\u7834\u88c2+
Swords.Effect.5={0} Tick \u7834\u88c2
Swords.Listener=\u5263:
Swords.SkillName=\u5263
Swords.Skills.SS.Off=**\u92f8\u6b6f\u72b6\u306e\u653b\u6483 \u3092\u6469\u640d\u3057\u305f**
Swords.Skills.SS.Off=**\u92f8\u6b6f\u72b6\u306e\u653b\u6483 \u3092\u6d88\u8017\u3057\u305f**
Swords.Skills.SS.On=[[GREEN]]**\u92f8\u6b6f\u72b6\u306e\u653b\u6483 \u30a2\u30af\u30c6\u30a3\u30d9\u30fc\u30c8**
Swords.Skills.SS.Refresh=[[YELLOW]]\u92f8\u6b6f\u72b6\u306e\u653b\u6483 [[GREEN]]\u30a2\u30d3\u30ea\u30c6\u30a3\u304c\u56de\u5fa9\u3057\u307e\u3057\u305f\uff01
Swords.Skills.SS.Other.Off=[[YELLOW]]{0}\u304c [[WHITE]]\u92f8\u6b6f\u72b6\u306e\u653b\u6483 [[GREEN]]\u3092\u6469\u640d\u3057\u305f
Swords.Skills.SS.Other.Off=[[YELLOW]]{0}\u304c [[WHITE]]\u92f8\u6b6f\u72b6\u306e\u653b\u6483 [[GREEN]]\u3092\u6d88\u8017\u3057\u305f
Swords.Skills.SS.Other.On=[[GREEN]]{0}[[DARK_GREEN]] \u304c [[RED]]\u92f8\u6b6f\u72b6\u306e\u653b\u6483 [[DARK_GREEN]]\u3092\u4f7f\u3063\u305f\uff01
# TAMING
@@ -515,10 +515,10 @@ Unarmed.SubSkill.BlockCracker.Name=\u30d6\u30ed\u30c3\u30af\u30af\u30e9\u30c3\u3
Unarmed.SubSkill.BlockCracker.Description=\u62f3\u3067\u5ca9\u3092\u7834\u58ca\u3059\u308b\u3002
Unarmed.Listener=\u7d20\u624b:
Unarmed.SkillName=\u7d20\u624b
Unarmed.Skills.Berserk.Off=**\u30d0\u30fc\u30b5\u30fc\u30ab\u30fc \u3092\u6469\u640d\u3057\u305f**
Unarmed.Skills.Berserk.Off=**\u30d0\u30fc\u30b5\u30fc\u30ab\u30fc \u3092\u6d88\u8017\u3057\u305f**
Unarmed.Skills.Berserk.On=[[GREEN]]**\u30d0\u30fc\u30b5\u30fc\u30ab\u30fc \u30a2\u30af\u30c6\u30a3\u30d9\u30fc\u30c8**
Unarmed.Skills.Berserk.Refresh=[[YELLOW]]\u30d0\u30fc\u30b5\u30fc\u30ab\u30fc [[GREEN]]\u30a2\u30d3\u30ea\u30c6\u30a3\u304c\u56de\u5fa9\u3057\u307e\u3057\u305f\uff01
Unarmed.Skills.Berserk.Other.Off=[[YELLOW]]{0}\u304c [[WHITE]]\u30d0\u30fc\u30b5\u30fc\u30ab\u30fc [[GREEN]]\u3092\u6469\u640d\u3057\u305f
Unarmed.Skills.Berserk.Other.Off=[[YELLOW]]{0}\u304c [[WHITE]]\u30d0\u30fc\u30b5\u30fc\u30ab\u30fc [[GREEN]]\u3092\u6d88\u8017\u3057\u305f
Unarmed.Skills.Berserk.Other.On=[[GREEN]]{0}[[DARK_GREEN]]\u304c [[RED]]\u30d0\u30fc\u30b5\u30fc\u30ab\u30fc [[DARK_GREEN]]\u3092\u4f7f\u3063\u305f\uff01
# WOODCUTTING
@@ -541,10 +541,10 @@ Woodcutting.SubSkill.NaturesBounty.Name=\u81ea\u7136\u306e\u6075\u307f
Woodcutting.SubSkill.NaturesBounty.Description=\u81ea\u7136\u304b\u3089\u7d4c\u9a13\u5024\u3092\u96c6\u3081\u308b\u3002
Woodcutting.Listener=\u6728\u3053\u308a:
Woodcutting.SkillName=\u6728\u3053\u308a
Woodcutting.Skills.TreeFeller.Off=**\u30c4\u30ea\u30fc\u30d5\u30a7\u30e9\u30fc \u3092\u6469\u640d\u3057\u305f**
Woodcutting.Skills.TreeFeller.Off=**\u30c4\u30ea\u30fc\u30d5\u30a7\u30e9\u30fc \u3092\u6d88\u8017\u3057\u305f**
Woodcutting.Skills.TreeFeller.On=[[GREEN]]**\u30c4\u30ea\u30fc\u30d5\u30a7\u30e9\u30fc \u30a2\u30af\u30c6\u30a3\u30d9\u30fc\u30c8**
Woodcutting.Skills.TreeFeller.Refresh=[[YELLOW]]\u30c4\u30ea\u30fc\u30d5\u30a7\u30e9\u30fc [[GREEN]]\u30a2\u30d3\u30ea\u30c6\u30a3\u304c\u56de\u5fa9\u3057\u307e\u3057\u305f\uff01
Woodcutting.Skills.TreeFeller.Other.Off=[[YELLOW]]{0}\u304c [[WHITE]]\u30c4\u30ea\u30fc\u30d5\u30a7\u30e9\u30fc [[GREEN]]\u3092\u6469\u640d\u3057\u305f
Woodcutting.Skills.TreeFeller.Other.Off=[[YELLOW]]{0}\u304c [[WHITE]]\u30c4\u30ea\u30fc\u30d5\u30a7\u30e9\u30fc [[GREEN]]\u3092\u6d88\u8017\u3057\u305f
Woodcutting.Skills.TreeFeller.Other.On=[[GREEN]]{0}[[DARK_GREEN]]\u304c [[RED]]\u30c4\u30ea\u30fc\u30d5\u30a7\u30e9\u30fc [[DARK_GREEN]]\u3092\u4f7f\u3063\u305f\uff01
Woodcutting.Skills.TreeFeller.Splinter=\u65a7\u306f\u4f55\u5341\u3082\u306e\u7834\u7247\u306b\u7815\u3051\u305f\uff01
Woodcutting.Skills.TreeFeller.Threshold=\u6728\u304c\u5927\u304d\u3059\u304e\u308b\uff01
@@ -988,19 +988,19 @@ Skills.Parents= PARENTS
Skills.Stats={0}[[GREEN]]{1}[[DARK_AQUA]] XP([[GRAY]]{2}[[DARK_AQUA]]/[[GRAY]]{3}[[DARK_AQUA]])
Skills.ChildStats={0}[[GREEN]]{1}
Skills.MaxXP=\u6700\u5927
Skills.TooTired=\u305d\u306e\u30a2\u30d3\u30ea\u30c6\u30a3\u3092\u518d\u3073\u4f7f\u3046\u306e\u306b\u306f\u98fd\u304d\u904e\u304e\u3066\u3044\u307e\u3059\u3002 [[YELLOW]]({0}\u79d2)
Skills.TooTired=\u305d\u306e\u30a2\u30d3\u30ea\u30c6\u30a3\u3092\u518d\u3073\u4f7f\u3046\u306e\u306b\u306f\u75b2\u308c\u904e\u304e\u3066\u3044\u307e\u3059\u3002 [[YELLOW]]({0}\u79d2)
Skills.Cancelled=[[GOLD]]{0} [[RED]]\u30ad\u30e3\u30f3\u30bb\u30eb\uff01
Skills.ConfirmOrCancel=[[GREEN]]\u3082\u3046\u4e00\u5ea6\u53f3\u30af\u30ea\u30c3\u30af\u3057\u3066[[GOLD]]{0}[[GREEN]]\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \u30ad\u30e3\u30f3\u30bb\u30eb\u3059\u308b\u306b\u306f\u5de6\u30af\u30ea\u30c3\u30af\u3057\u3066\u304f\u3060\u3055\u3044\u3002
Skills.AbilityGateRequirementFail=[[GRAY]]\u3053\u306e\u30a2\u30d3\u30ea\u30c6\u30a3\u3092\u4f7f\u3046\u305f\u3081\u306b\u306f[[YELLOW]]{0}[[GRAY]]\u30ec\u30d9\u30eb\u306e[[DARK_AQUA]]{1}[[GRAY]]\u304c\u5fc5\u8981\u3067\u3059\u3002
# STATISTICS
Stats.Header.Combat=[[GOLD]]-=\u30b3\u30f3\u30d0\u30c3\u30c8\u30b9\u30ad\u30eb=-
Stats.Header.Combat=[[GOLD]]-=\u6226\u95d8\u30b9\u30ad\u30eb=-
Stats.Header.Gathering=[[GOLD]]-=\u53ce\u96c6\u30b9\u30ad\u30eb=-
Stats.Header.Misc=[[GOLD]]-=\u305d\u306e\u4ed6\u306e\u30b9\u30ad\u30eb=-
Stats.Own.Stats=[[GREEN]][mcMMO] \u7d71\u8a08
# PERKS
Perks.XP.Name=\u7d4c\u9a13
Perks.XP.Name=\u7d4c\u9a13\u5024
Perks.XP.Desc=\u7279\u5b9a\u306e\u30b9\u30ad\u30eb\u306e\u30d6\u30fc\u30b9\u30c8XP\u3092\u53d7\u3051\u53d6\u308b\u3002
Perks.Lucky.Name=\u30e9\u30c3\u30ad\u30fc
Perks.Lucky.Desc={0}\u306e\u30b9\u30ad\u30eb\u3068\u80fd\u529b\u306b\u300133.3\uff05\u306e\u30a2\u30af\u30c6\u30a3\u30d9\u30fc\u30c8\u306e\u78ba\u7387\u3092\u4e0e\u3048\u307e\u3059\u3002

File diff suppressed because it is too large Load Diff

View File

@@ -273,7 +273,7 @@ permissions:
description: Allows access to all Axes abilities
children:
mcmmo.ability.axes.axemastery: true
mcmmo.ability.axes.criticalhit: true
mcmmo.ability.axes.criticalstrikes: true
mcmmo.ability.axes.greaterimpact: true
mcmmo.ability.axes.armorimpact: true
mcmmo.ability.axes.skullsplitter: true
@@ -282,8 +282,8 @@ permissions:
description: Adds damage to axes
mcmmo.ability.axes.axemastery:
description: Allows bonus damage from Axes
mcmmo.ability.axes.criticalhit:
description: Allows access to the Critical Hit ability
mcmmo.ability.axes.criticalstrikes:
description: Allows access to the Critical Strikes ability
mcmmo.ability.axes.greaterimpact:
description: Allows access to the Greater Impact ability
mcmmo.ability.axes.armorimpact:

View File

@@ -4,6 +4,14 @@ Sounds:
# 1.0 = Max volume
# 0.0 = No Volume
MasterVolume: 1.0
ITEM_CONSUMED:
Enable: true
Volume: 1.0
Pitch: 1.0
GLASS:
Enable: true
Volume: 1.0
Pitch: 1.0
ANVIL:
Enable: true
Volume: 1.0

View File

@@ -443,6 +443,7 @@ Enchantment_Drop_Rates:
LEGENDARY: 0.75
#
# Settings for Excavation's Archaeology
# If you are in retro mode, Drop_Level is multiplied by 10.
###
Excavation:
CAKE:
@@ -573,6 +574,7 @@ Excavation:
Drops_From: [Dirt, Coarse_Dirt, Podzol, Grass_Block, Sand, Red_Sand, Gravel, Clay, Mycelium, Soul_Sand]
#
# Settings for Hylian Luck
# If you are in retro mode, Drop_Level is multiplied by 10.
###
Hylian_Luck:
MELON_SEEDS:
@@ -630,7 +632,8 @@ Hylian_Luck:
Drop_Level: 0
Drops_From: [Pots]
#
# Settings for Shake
# Settings for Shake
# If you are in retro mode, Drop_Level is multiplied by 10.
###
Shake:
BLAZE:

View File

@@ -245,7 +245,7 @@ public class PotionConfigGenerator {
if (target.equals("II")) { // hacks
return target;
}
return target.substring(0, 1).toUpperCase() + target.substring(1).toLowerCase();
return target.substring(0, 1).toUpperCase() + target.substring(1).toLowerCase(Locale.ENGLISH);
}
private static String getName(PotionEffectType type) {