mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2026-02-20 18:53:11 +01:00
Compare commits
2 Commits
dev-charge
...
javadocs
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3b249aa4e6 | ||
|
|
1a2d586086 |
@@ -7,15 +7,7 @@ Key:
|
|||||||
! Change
|
! Change
|
||||||
- Removal
|
- Removal
|
||||||
|
|
||||||
Version 1.5.02-dev
|
Version 1.5.01-dev
|
||||||
+ Added new active ability "Charge" to Taming!
|
|
||||||
+ Added option to config.yml for Chimaera Wings to stop using bed spawn points
|
|
||||||
= Fixed bug where no Mining XP was granted when Flux Mining was successful
|
|
||||||
= Fixed bug where MobHealthbarTypes were not saved between server restarts
|
|
||||||
! Changed Flux Mining mechanics. In order to use the ability, you need to infuse a pickaxe with furnace powers first.
|
|
||||||
! Scoreboard tips are only shown a couple of times to the player, instead of once per login session
|
|
||||||
|
|
||||||
Version 1.5.01
|
|
||||||
+ Added new child skill; Salvage
|
+ Added new child skill; Salvage
|
||||||
+ Added UUID support!
|
+ Added UUID support!
|
||||||
+ Added SQL connection pooling and async loading!
|
+ Added SQL connection pooling and async loading!
|
||||||
@@ -64,7 +56,6 @@ Version 1.5.01
|
|||||||
! Changed Alchemy XP distribution. XP is granted based on the stage of the potion.
|
! Changed Alchemy XP distribution. XP is granted based on the stage of the potion.
|
||||||
! Changed behavior of the Blast Mining ability "Demolition Expert"; now only decreases damage for the ability user
|
! Changed behavior of the Blast Mining ability "Demolition Expert"; now only decreases damage for the ability user
|
||||||
! Updated for new getOnlinePlayers() behavior
|
! Updated for new getOnlinePlayers() behavior
|
||||||
! Updated for new blocks and entities
|
|
||||||
! Changed McMMOPlayerDeathPenaltyEvent to get fired after hardcore penalty calculations, use McMMOPlayerPreDeathPenaltyEvent for old behavior
|
! Changed McMMOPlayerDeathPenaltyEvent to get fired after hardcore penalty calculations, use McMMOPlayerPreDeathPenaltyEvent for old behavior
|
||||||
! Moved Refresh_Chunks setting from hidden.yml to config.yml
|
! Moved Refresh_Chunks setting from hidden.yml to config.yml
|
||||||
- Removed salvage ability from Repair, salvage has it's own (child) skill now
|
- Removed salvage ability from Repair, salvage has it's own (child) skill now
|
||||||
|
|||||||
11
README.md
11
README.md
@@ -1,8 +1,8 @@
|
|||||||
# mcMMO
|
# mcMMO
|
||||||
## The RPG lovers mod
|
## The RPG lovers mod
|
||||||
|
|
||||||
### Builds
|
### Dev builds
|
||||||
Currently, you can obtain our builds via the Spigot resource page: http://www.spigotmc.org/resources/mcmmo.2445/
|
Our latest development builds are available ~~[here](http://ci.mcmmo.info)~~. Unfortunately, the mcMMO site is down; a temporary dev build location is hosted [here](http://ci.ecocitycraft.com/job/mcMMO/).
|
||||||
|
|
||||||
### Brief Description
|
### Brief Description
|
||||||
The goal of mcMMO is to take core Minecraft game mechanics and expand them into add an extensive and quality RPG experience. Everything in mcMMO has been carefully thought out and is constantly being improved upon. Currently, mcMMO adds fourteen unique skills to train and level in. Each of these skills is highly customizable through our configuration files, allowing server admins to tweak mcMMO to best suit the needs of his or her server. Know that the mcMMO team is dedicated to providing an ever-evolving experience, and that we carefully read all feedback and bug reports in order to evaluate and balance the mechanics of mcMMO in every update.
|
The goal of mcMMO is to take core Minecraft game mechanics and expand them into add an extensive and quality RPG experience. Everything in mcMMO has been carefully thought out and is constantly being improved upon. Currently, mcMMO adds fourteen unique skills to train and level in. Each of these skills is highly customizable through our configuration files, allowing server admins to tweak mcMMO to best suit the needs of his or her server. Know that the mcMMO team is dedicated to providing an ever-evolving experience, and that we carefully read all feedback and bug reports in order to evaluate and balance the mechanics of mcMMO in every update.
|
||||||
@@ -10,10 +10,11 @@ The goal of mcMMO is to take core Minecraft game mechanics and expand them into
|
|||||||
## About the Team
|
## About the Team
|
||||||
|
|
||||||
mcMMO is currently developed by a team of individuals from all over the world.
|
mcMMO is currently developed by a team of individuals from all over the world.
|
||||||
|
### Glorious Leader
|
||||||
### Developers
|
|
||||||
[]
|
[]
|
||||||
(https://github.com/gmcferrin)
|
(https://github.com/gmcferrin)
|
||||||
|
|
||||||
|
### Developers
|
||||||
[]
|
[]
|
||||||
(https://github.com/bm01)
|
(https://github.com/bm01)
|
||||||
[]
|
[]
|
||||||
@@ -47,4 +48,4 @@ Required Libraries:
|
|||||||
* EMetrics
|
* EMetrics
|
||||||
* Bukkit
|
* Bukkit
|
||||||
|
|
||||||
http://www.spigotmc.org/resources/mcmmo.2445/ for more up to date information.
|
http://dev.bukkit.org/server-mods/mcmmo for more up to date information.
|
||||||
|
|||||||
40
pom.xml
40
pom.xml
@@ -2,7 +2,7 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>com.gmail.nossr50.mcMMO</groupId>
|
<groupId>com.gmail.nossr50.mcMMO</groupId>
|
||||||
<artifactId>mcMMO</artifactId>
|
<artifactId>mcMMO</artifactId>
|
||||||
<version>1.5.02-SNAPSHOT</version>
|
<version>1.5.01-SNAPSHOT</version>
|
||||||
<name>mcMMO</name>
|
<name>mcMMO</name>
|
||||||
<url>https://github.com/mcMMO-Dev/mcMMO</url>
|
<url>https://github.com/mcMMO-Dev/mcMMO</url>
|
||||||
<issueManagement>
|
<issueManagement>
|
||||||
@@ -77,8 +77,7 @@
|
|||||||
<includes>
|
<includes>
|
||||||
<include>com.turt2live.metrics:MetricsExtension</include>
|
<include>com.turt2live.metrics:MetricsExtension</include>
|
||||||
<include>commons-logging:commons-logging</include>
|
<include>commons-logging:commons-logging</include>
|
||||||
<include>org.apache.tomcat:tomcat-jdbc</include>
|
<include>net.snaq:dbpool</include>
|
||||||
<include>org.apache.tomcat:tomcat-juli</include>
|
|
||||||
</includes>
|
</includes>
|
||||||
</artifactSet>
|
</artifactSet>
|
||||||
<relocations>
|
<relocations>
|
||||||
@@ -91,12 +90,8 @@
|
|||||||
<shadedPattern>com.gmail.nossr50.commons.logging</shadedPattern>
|
<shadedPattern>com.gmail.nossr50.commons.logging</shadedPattern>
|
||||||
</relocation>
|
</relocation>
|
||||||
<relocation>
|
<relocation>
|
||||||
<pattern>org.apache.juli</pattern>
|
<pattern>net.snaq</pattern>
|
||||||
<shadedPattern>com.gmail.nossr50.database.tomcat.juli</shadedPattern>
|
<shadedPattern>com.gmail.nossr50.dbpool</shadedPattern>
|
||||||
</relocation>
|
|
||||||
<relocation>
|
|
||||||
<pattern>org.apache.tomcat</pattern>
|
|
||||||
<shadedPattern>com.gmail.nossr50.database.tomcat</shadedPattern>
|
|
||||||
</relocation>
|
</relocation>
|
||||||
</relocations>
|
</relocations>
|
||||||
</configuration>
|
</configuration>
|
||||||
@@ -120,8 +115,12 @@
|
|||||||
</build>
|
</build>
|
||||||
<repositories>
|
<repositories>
|
||||||
<repository>
|
<repository>
|
||||||
<id>spigot-repo</id>
|
<id>bukkit-repo</id>
|
||||||
<url>https://hub.spigotmc.org/nexus/content/groups/public/</url>
|
<url>http://repo.bukkit.org/content/groups/public/</url>
|
||||||
|
</repository>
|
||||||
|
<repository>
|
||||||
|
<id>md_5-releases</id>
|
||||||
|
<url>http://repo.md-5.net/content/repositories/releases/</url>
|
||||||
</repository>
|
</repository>
|
||||||
<repository>
|
<repository>
|
||||||
<id>Plugin MetricsExtension</id>
|
<id>Plugin MetricsExtension</id>
|
||||||
@@ -132,7 +131,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.bukkit</groupId>
|
<groupId>org.bukkit</groupId>
|
||||||
<artifactId>bukkit</artifactId>
|
<artifactId>bukkit</artifactId>
|
||||||
<version>1.8-R0.1-SNAPSHOT</version>
|
<version>1.7.10-R0.1-SNAPSHOT</version>
|
||||||
<type>jar</type>
|
<type>jar</type>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
@@ -148,23 +147,26 @@
|
|||||||
<version>0.0.5-SNAPSHOT</version>
|
<version>0.0.5-SNAPSHOT</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.tomcat</groupId>
|
<groupId>net.snaq</groupId>
|
||||||
<artifactId>tomcat-jdbc</artifactId>
|
<artifactId>dbpool</artifactId>
|
||||||
<version>7.0.52</version>
|
<version>5.1</version>
|
||||||
<scope>compile</scope>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<distributionManagement>
|
<distributionManagement>
|
||||||
<repository>
|
<repository>
|
||||||
<id>drtshock-releases</id>
|
<id>md_5-releases</id>
|
||||||
<url>https://ci.drtshock.net/plugin/repository/everything/com/gmail/nossr50/mcMMO/</url>
|
<url>http://repo.md-5.net/content/repositories/releases/</url>
|
||||||
</repository>
|
</repository>
|
||||||
|
<snapshotRepository>
|
||||||
|
<id>md_5-snapshots</id>
|
||||||
|
<url>http://repo.md-5.net/content/repositories/snapshots/</url>
|
||||||
|
</snapshotRepository>
|
||||||
</distributionManagement>
|
</distributionManagement>
|
||||||
<properties>
|
<properties>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
</properties>
|
</properties>
|
||||||
<ciManagement>
|
<ciManagement>
|
||||||
<system>Jenkins</system>
|
<system>Jenkins</system>
|
||||||
<url>https://ci.drtshock.net/job/mcmmo/</url>
|
<url>http://ci.ecocitycraft.com/job/mcMMO</url>
|
||||||
</ciManagement>
|
</ciManagement>
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
@@ -11,34 +11,106 @@ import com.gmail.nossr50.util.player.UserManager;
|
|||||||
public final class AbilityAPI {
|
public final class AbilityAPI {
|
||||||
private AbilityAPI() {}
|
private AbilityAPI() {}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if the ability "Berserk" is active.
|
||||||
|
* </br>
|
||||||
|
* This function is designed for API usage.
|
||||||
|
*
|
||||||
|
* @param player The {@link Player} to check
|
||||||
|
*
|
||||||
|
* @return true if "Berserk" is active
|
||||||
|
*/
|
||||||
public static boolean berserkEnabled(Player player) {
|
public static boolean berserkEnabled(Player player) {
|
||||||
return UserManager.getPlayer(player).getAbilityMode(AbilityType.BERSERK);
|
return UserManager.getPlayer(player).getAbilityMode(AbilityType.BERSERK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if the ability "Giga Drill Breaker" is active.
|
||||||
|
* </br>
|
||||||
|
* This function is designed for API usage.
|
||||||
|
*
|
||||||
|
* @param player The {@link Player} to check
|
||||||
|
*
|
||||||
|
* @return true if "Giga Drill Breaker" is active
|
||||||
|
*/
|
||||||
public static boolean gigaDrillBreakerEnabled(Player player) {
|
public static boolean gigaDrillBreakerEnabled(Player player) {
|
||||||
return UserManager.getPlayer(player).getAbilityMode(AbilityType.GIGA_DRILL_BREAKER);
|
return UserManager.getPlayer(player).getAbilityMode(AbilityType.GIGA_DRILL_BREAKER);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if the ability "Green Terra" is active.
|
||||||
|
* </br>
|
||||||
|
* This function is designed for API usage.
|
||||||
|
*
|
||||||
|
* @param player The {@link Player} to check
|
||||||
|
*
|
||||||
|
* @return true if "Green Terra" is active
|
||||||
|
*/
|
||||||
public static boolean greenTerraEnabled(Player player) {
|
public static boolean greenTerraEnabled(Player player) {
|
||||||
return UserManager.getPlayer(player).getAbilityMode(AbilityType.GREEN_TERRA);
|
return UserManager.getPlayer(player).getAbilityMode(AbilityType.GREEN_TERRA);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if the ability "Serrated Strikes" is active.
|
||||||
|
* </br>
|
||||||
|
* This function is designed for API usage.
|
||||||
|
*
|
||||||
|
* @param player The {@link Player} to check
|
||||||
|
*
|
||||||
|
* @return true if "Serrated Strikes" is active
|
||||||
|
*/
|
||||||
public static boolean serratedStrikesEnabled(Player player) {
|
public static boolean serratedStrikesEnabled(Player player) {
|
||||||
return UserManager.getPlayer(player).getAbilityMode(AbilityType.SERRATED_STRIKES);
|
return UserManager.getPlayer(player).getAbilityMode(AbilityType.SERRATED_STRIKES);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if the ability "Skull Splitter" is active.
|
||||||
|
* </br>
|
||||||
|
* This function is designed for API usage.
|
||||||
|
*
|
||||||
|
* @param player The {@link Player} to check
|
||||||
|
*
|
||||||
|
* @return true if "Skull Splitter" is active
|
||||||
|
*/
|
||||||
public static boolean skullSplitterEnabled(Player player) {
|
public static boolean skullSplitterEnabled(Player player) {
|
||||||
return UserManager.getPlayer(player).getAbilityMode(AbilityType.SKULL_SPLITTER);
|
return UserManager.getPlayer(player).getAbilityMode(AbilityType.SKULL_SPLITTER);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if the ability "Super Breaker" is active.
|
||||||
|
* </br>
|
||||||
|
* This function is designed for API usage.
|
||||||
|
*
|
||||||
|
* @param player The {@link Player} to check
|
||||||
|
*
|
||||||
|
* @return true if "Super Breaker" is active
|
||||||
|
*/
|
||||||
public static boolean superBreakerEnabled(Player player) {
|
public static boolean superBreakerEnabled(Player player) {
|
||||||
return UserManager.getPlayer(player).getAbilityMode(AbilityType.SUPER_BREAKER);
|
return UserManager.getPlayer(player).getAbilityMode(AbilityType.SUPER_BREAKER);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if the ability "Tree Feller" is active.
|
||||||
|
* </br>
|
||||||
|
* This function is designed for API usage.
|
||||||
|
*
|
||||||
|
* @param player The {@link Player} to check
|
||||||
|
*
|
||||||
|
* @return true if "Tree Feller" is active
|
||||||
|
*/
|
||||||
public static boolean treeFellerEnabled(Player player) {
|
public static boolean treeFellerEnabled(Player player) {
|
||||||
return UserManager.getPlayer(player).getAbilityMode(AbilityType.TREE_FELLER);
|
return UserManager.getPlayer(player).getAbilityMode(AbilityType.TREE_FELLER);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if any ability is active.
|
||||||
|
* </br>
|
||||||
|
* This function is designed for API usage.
|
||||||
|
*
|
||||||
|
* @param player The {@link Player} to check
|
||||||
|
*
|
||||||
|
* @return true if any ability is active
|
||||||
|
*/
|
||||||
public static boolean isAnyAbilityEnabled(Player player) {
|
public static boolean isAnyAbilityEnabled(Player player) {
|
||||||
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
|
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
|
||||||
|
|
||||||
@@ -51,38 +123,110 @@ public final class AbilityAPI {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reset the ability cooldowns for a player
|
||||||
|
* </br>
|
||||||
|
* This function is designed for API usage.
|
||||||
|
*
|
||||||
|
* @param player The {@link Player} to reset the cooldowns for
|
||||||
|
*/
|
||||||
public static void resetCooldowns(Player player) {
|
public static void resetCooldowns(Player player) {
|
||||||
UserManager.getPlayer(player).resetCooldowns();
|
UserManager.getPlayer(player).resetCooldowns();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the cooldown for the "Berserk" ability
|
||||||
|
* </br>
|
||||||
|
* This function is designed for API usage.
|
||||||
|
*
|
||||||
|
* @param player The {@link Player} to set the cooldown for
|
||||||
|
* @param cooldown The cooldown length to set
|
||||||
|
*/
|
||||||
public static void setBerserkCooldown(Player player, long cooldown) {
|
public static void setBerserkCooldown(Player player, long cooldown) {
|
||||||
UserManager.getPlayer(player).setAbilityDATS(AbilityType.BERSERK, cooldown);
|
UserManager.getPlayer(player).setAbilityDATS(AbilityType.BERSERK, cooldown);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the cooldown for the "Giga Drill Breaker" ability
|
||||||
|
* </br>
|
||||||
|
* This function is designed for API usage.
|
||||||
|
*
|
||||||
|
* @param player The {@link Player} to set the cooldown for
|
||||||
|
* @param cooldown The cooldown length to set
|
||||||
|
*/
|
||||||
public static void setGigaDrillBreakerCooldown(Player player, long cooldown) {
|
public static void setGigaDrillBreakerCooldown(Player player, long cooldown) {
|
||||||
UserManager.getPlayer(player).setAbilityDATS(AbilityType.GIGA_DRILL_BREAKER, cooldown);
|
UserManager.getPlayer(player).setAbilityDATS(AbilityType.GIGA_DRILL_BREAKER, cooldown);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the cooldown for the "Green Terra" ability
|
||||||
|
* </br>
|
||||||
|
* This function is designed for API usage.
|
||||||
|
*
|
||||||
|
* @param player The {@link Player} to set the cooldown for
|
||||||
|
* @param cooldown The cooldown length to set
|
||||||
|
*/
|
||||||
public static void setGreenTerraCooldown(Player player, long cooldown) {
|
public static void setGreenTerraCooldown(Player player, long cooldown) {
|
||||||
UserManager.getPlayer(player).setAbilityDATS(AbilityType.GREEN_TERRA, cooldown);
|
UserManager.getPlayer(player).setAbilityDATS(AbilityType.GREEN_TERRA, cooldown);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the cooldown for the "Serrated Strikes" ability
|
||||||
|
* </br>
|
||||||
|
* This function is designed for API usage.
|
||||||
|
*
|
||||||
|
* @param player The {@link Player} to set the cooldown for
|
||||||
|
* @param cooldown The cooldown length to set
|
||||||
|
*/
|
||||||
public static void setSerratedStrikesCooldown(Player player, long cooldown) {
|
public static void setSerratedStrikesCooldown(Player player, long cooldown) {
|
||||||
UserManager.getPlayer(player).setAbilityDATS(AbilityType.SERRATED_STRIKES, cooldown);
|
UserManager.getPlayer(player).setAbilityDATS(AbilityType.SERRATED_STRIKES, cooldown);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the cooldown for the "Skull Splitter" ability
|
||||||
|
* </br>
|
||||||
|
* This function is designed for API usage.
|
||||||
|
*
|
||||||
|
* @param player The {@link Player} to set the cooldown for
|
||||||
|
* @param cooldown The cooldown length to set
|
||||||
|
*/
|
||||||
public static void setSkullSplitterCooldown(Player player, long cooldown) {
|
public static void setSkullSplitterCooldown(Player player, long cooldown) {
|
||||||
UserManager.getPlayer(player).setAbilityDATS(AbilityType.SKULL_SPLITTER, cooldown);
|
UserManager.getPlayer(player).setAbilityDATS(AbilityType.SKULL_SPLITTER, cooldown);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the cooldown for the "Super Breaker" ability
|
||||||
|
* </br>
|
||||||
|
* This function is designed for API usage.
|
||||||
|
*
|
||||||
|
* @param player The {@link Player} to set the cooldown for
|
||||||
|
* @param cooldown The cooldown length to set
|
||||||
|
*/
|
||||||
public static void setSuperBreakerCooldown(Player player, long cooldown) {
|
public static void setSuperBreakerCooldown(Player player, long cooldown) {
|
||||||
UserManager.getPlayer(player).setAbilityDATS(AbilityType.SUPER_BREAKER, cooldown);
|
UserManager.getPlayer(player).setAbilityDATS(AbilityType.SUPER_BREAKER, cooldown);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the cooldown for the "Tree Feller" ability
|
||||||
|
* </br>
|
||||||
|
* This function is designed for API usage.
|
||||||
|
*
|
||||||
|
* @param player The {@link Player} to set the cooldown for
|
||||||
|
* @param cooldown The cooldown length to set
|
||||||
|
*/
|
||||||
public static void setTreeFellerCooldown(Player player, long cooldown) {
|
public static void setTreeFellerCooldown(Player player, long cooldown) {
|
||||||
UserManager.getPlayer(player).setAbilityDATS(AbilityType.TREE_FELLER, cooldown);
|
UserManager.getPlayer(player).setAbilityDATS(AbilityType.TREE_FELLER, cooldown);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a LivingEntity is bleeding
|
||||||
|
* </br>
|
||||||
|
* This function is designed for API usage.
|
||||||
|
*
|
||||||
|
* @param entity The {@link LivingEntity} to check
|
||||||
|
* @return true if entity is bleeding, false otherwise
|
||||||
|
*/
|
||||||
public static boolean isBleeding(LivingEntity entity) {
|
public static boolean isBleeding(LivingEntity entity) {
|
||||||
return BleedTimerTask.isBleeding(entity);
|
return BleedTimerTask.isBleeding(entity);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -71,6 +71,8 @@ public final class ChatAPI {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if a player is currently talking in party chat.
|
* Check if a player is currently talking in party chat.
|
||||||
|
* </br>
|
||||||
|
* This function is designed for API usage.
|
||||||
*
|
*
|
||||||
* @param player The player to check
|
* @param player The player to check
|
||||||
* @return true if the player is using party chat, false otherwise
|
* @return true if the player is using party chat, false otherwise
|
||||||
@@ -81,6 +83,8 @@ public final class ChatAPI {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if a player is currently talking in party chat.
|
* Check if a player is currently talking in party chat.
|
||||||
|
* </br>
|
||||||
|
* This function is designed for API usage.
|
||||||
*
|
*
|
||||||
* @param playerName The name of the player to check
|
* @param playerName The name of the player to check
|
||||||
* @return true if the player is using party chat, false otherwise
|
* @return true if the player is using party chat, false otherwise
|
||||||
@@ -91,6 +95,8 @@ public final class ChatAPI {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if a player is currently talking in admin chat.
|
* Check if a player is currently talking in admin chat.
|
||||||
|
* </br>
|
||||||
|
* This function is designed for API usage.
|
||||||
*
|
*
|
||||||
* @param player The player to check
|
* @param player The player to check
|
||||||
* @return true if the player is using admin chat, false otherwise
|
* @return true if the player is using admin chat, false otherwise
|
||||||
@@ -101,6 +107,8 @@ public final class ChatAPI {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if a player is currently talking in admin chat.
|
* Check if a player is currently talking in admin chat.
|
||||||
|
* </br>
|
||||||
|
* This function is designed for API usage.
|
||||||
*
|
*
|
||||||
* @param playerName The name of the player to check
|
* @param playerName The name of the player to check
|
||||||
* @return true if the player is using admin chat, false otherwise
|
* @return true if the player is using admin chat, false otherwise
|
||||||
@@ -111,6 +119,8 @@ public final class ChatAPI {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Toggle the party chat mode of a player.
|
* Toggle the party chat mode of a player.
|
||||||
|
* </br>
|
||||||
|
* This function is designed for API usage.
|
||||||
*
|
*
|
||||||
* @param player The player to toggle party chat on.
|
* @param player The player to toggle party chat on.
|
||||||
*/
|
*/
|
||||||
@@ -120,6 +130,8 @@ public final class ChatAPI {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Toggle the party chat mode of a player.
|
* Toggle the party chat mode of a player.
|
||||||
|
* </br>
|
||||||
|
* This function is designed for API usage.
|
||||||
*
|
*
|
||||||
* @param playerName The name of the player to toggle party chat on.
|
* @param playerName The name of the player to toggle party chat on.
|
||||||
*/
|
*/
|
||||||
@@ -129,6 +141,8 @@ public final class ChatAPI {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Toggle the admin chat mode of a player.
|
* Toggle the admin chat mode of a player.
|
||||||
|
* </br>
|
||||||
|
* This function is designed for API usage.
|
||||||
*
|
*
|
||||||
* @param player The player to toggle admin chat on.
|
* @param player The player to toggle admin chat on.
|
||||||
*/
|
*/
|
||||||
@@ -138,6 +152,8 @@ public final class ChatAPI {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Toggle the admin chat mode of a player.
|
* Toggle the admin chat mode of a player.
|
||||||
|
* </br>
|
||||||
|
* This function is designed for API usage.
|
||||||
*
|
*
|
||||||
* @param playerName The name of the player to toggle party chat on.
|
* @param playerName The name of the player to toggle party chat on.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -192,6 +192,14 @@ public final class PartyAPI {
|
|||||||
return PartyManager.getOnlineMembers(player);
|
return PartyManager.getOnlineMembers(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check is a certain party has an ally
|
||||||
|
* </br>
|
||||||
|
* This function is designed for API usage.
|
||||||
|
*
|
||||||
|
* @param partyName The name of the party to check
|
||||||
|
* @return true if the party has an ally, false otherwise
|
||||||
|
*/
|
||||||
public static boolean hasAlly(String partyName) {
|
public static boolean hasAlly(String partyName) {
|
||||||
return getAllyName(partyName) != null;
|
return getAllyName(partyName) != null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ public class TamingCommand extends SkillCommand {
|
|||||||
private String goreChance;
|
private String goreChance;
|
||||||
private String goreChanceLucky;
|
private String goreChanceLucky;
|
||||||
|
|
||||||
private boolean canCharge;
|
|
||||||
private boolean canBeastLore;
|
private boolean canBeastLore;
|
||||||
private boolean canGore;
|
private boolean canGore;
|
||||||
private boolean canSharpenedClaws;
|
private boolean canSharpenedClaws;
|
||||||
@@ -44,7 +43,6 @@ public class TamingCommand extends SkillCommand {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void permissionsCheck(Player player) {
|
protected void permissionsCheck(Player player) {
|
||||||
canCharge = Permissions.charge(player);
|
|
||||||
canBeastLore = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.BEAST_LORE);
|
canBeastLore = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.BEAST_LORE);
|
||||||
canCallWild = Permissions.callOfTheWild(player, EntityType.HORSE) || Permissions.callOfTheWild(player, EntityType.WOLF) || Permissions.callOfTheWild(player, EntityType.OCELOT);
|
canCallWild = Permissions.callOfTheWild(player, EntityType.HORSE) || Permissions.callOfTheWild(player, EntityType.WOLF) || Permissions.callOfTheWild(player, EntityType.OCELOT);
|
||||||
canEnvironmentallyAware = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.ENVIROMENTALLY_AWARE);
|
canEnvironmentallyAware = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.ENVIROMENTALLY_AWARE);
|
||||||
@@ -60,10 +58,6 @@ public class TamingCommand extends SkillCommand {
|
|||||||
protected List<String> effectsDisplay() {
|
protected List<String> effectsDisplay() {
|
||||||
List<String> messages = new ArrayList<String>();
|
List<String> messages = new ArrayList<String>();
|
||||||
|
|
||||||
if (canCharge) {
|
|
||||||
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Taming.Effect.20"), LocaleLoader.getString("Taming.Effect.21")));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (canBeastLore) {
|
if (canBeastLore) {
|
||||||
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Taming.Effect.0"), LocaleLoader.getString("Taming.Effect.1")));
|
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Taming.Effect.0"), LocaleLoader.getString("Taming.Effect.1")));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -200,7 +200,7 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (getSkullSplitterModifier() < 1) {
|
if (getSkullSplitterModifier() < 1) {
|
||||||
reason.add("Skills.Axes.SkullSplitter.DamageModifier should be at least 1!");
|
reason.add("Skills.Axes.SkullSplitter.DamagerModifier should be at least 1!");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* FISHING */
|
/* FISHING */
|
||||||
@@ -733,7 +733,7 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
|
|||||||
public double getImpactChance() { return config.getDouble("Skills.Axes.ArmorImpact.Chance", 25.0D); }
|
public double getImpactChance() { return config.getDouble("Skills.Axes.ArmorImpact.Chance", 25.0D); }
|
||||||
public double getArmorImpactMaxDurabilityDamage() { return config.getDouble("Skills.Axes.ArmorImpact.MaxPercentageDurabilityDamage", 20.0D); }
|
public double getArmorImpactMaxDurabilityDamage() { return config.getDouble("Skills.Axes.ArmorImpact.MaxPercentageDurabilityDamage", 20.0D); }
|
||||||
|
|
||||||
public double getSkullSplitterModifier() { return config.getDouble("Skills.Axes.SkullSplitter.DamageModifier", 2.0D); }
|
public double getSkullSplitterModifier() { return config.getDouble("Skills.Axes.SkullSplitter.DamagerModifier", 2.0D); }
|
||||||
|
|
||||||
/* EXCAVATION */
|
/* EXCAVATION */
|
||||||
//Nothing to configure, everything is already configurable in config.yml
|
//Nothing to configure, everything is already configurable in config.yml
|
||||||
@@ -802,9 +802,6 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
|
|||||||
public int getSmeltingVanillaXPBoostMultiplier(Smelting.Tier tier) { return config.getInt("Skills.Smelting.VanillaXPMultiplier.Rank_" + tier.toNumerical()); }
|
public int getSmeltingVanillaXPBoostMultiplier(Smelting.Tier tier) { return config.getInt("Skills.Smelting.VanillaXPMultiplier.Rank_" + tier.toNumerical()); }
|
||||||
|
|
||||||
/* SWORDS */
|
/* SWORDS */
|
||||||
public double getBleedDamagePlayer() { return config.getDouble("Skills.Swords.Bleed.DamagePlayer", 1.0); }
|
|
||||||
public double getBleedDamageMobs() { return config.getDouble("Skills.Swords.Bleed.DamageMobs", 2.0); }
|
|
||||||
|
|
||||||
public int getBleedMaxTicks() { return config.getInt("Skills.Swords.Bleed.MaxTicks", 3); }
|
public int getBleedMaxTicks() { return config.getInt("Skills.Swords.Bleed.MaxTicks", 3); }
|
||||||
public int getBleedBaseTicks() { return config.getInt("Skills.Swords.Bleed.BaseTicks", 2); }
|
public int getBleedBaseTicks() { return config.getInt("Skills.Swords.Bleed.BaseTicks", 2); }
|
||||||
|
|
||||||
|
|||||||
@@ -280,7 +280,6 @@ public class Config extends AutoUpdateConfigLoader {
|
|||||||
/* Scoreboards */
|
/* Scoreboards */
|
||||||
public boolean getPowerLevelTagsEnabled() { return config.getBoolean("Scoreboard.Power_Level_Tags", false); }
|
public boolean getPowerLevelTagsEnabled() { return config.getBoolean("Scoreboard.Power_Level_Tags", false); }
|
||||||
public boolean getAllowKeepBoard() { return config.getBoolean("Scoreboard.Allow_Keep", true); }
|
public boolean getAllowKeepBoard() { return config.getBoolean("Scoreboard.Allow_Keep", true); }
|
||||||
public int getTipsAmount() { return config.getInt("Scoreboard.Tips_Amount", 5); }
|
|
||||||
public boolean getShowStatsAfterLogin() { return config.getBoolean("Scoreboard.Show_Stats_After_Login", false); }
|
public boolean getShowStatsAfterLogin() { return config.getBoolean("Scoreboard.Show_Stats_After_Login", false); }
|
||||||
public boolean getScoreboardRainbows() { return config.getBoolean("Scoreboard.Rainbows", false); }
|
public boolean getScoreboardRainbows() { return config.getBoolean("Scoreboard.Rainbows", false); }
|
||||||
public boolean getShowAbilityNames() { return config.getBoolean("Scoreboard.Ability_Names", true); }
|
public boolean getShowAbilityNames() { return config.getBoolean("Scoreboard.Ability_Names", true); }
|
||||||
@@ -373,21 +372,16 @@ public class Config extends AutoUpdateConfigLoader {
|
|||||||
public Material getChimaeraItem() { return Material.matchMaterial(config.getString("Items.Chimaera_Wing.Item_Name", "Feather")); }
|
public Material getChimaeraItem() { return Material.matchMaterial(config.getString("Items.Chimaera_Wing.Item_Name", "Feather")); }
|
||||||
public boolean getChimaeraEnabled() { return config.getBoolean("Items.Chimaera_Wing.Enabled", true); }
|
public boolean getChimaeraEnabled() { return config.getBoolean("Items.Chimaera_Wing.Enabled", true); }
|
||||||
public boolean getChimaeraPreventUseUnderground() { return config.getBoolean("Items.Chimaera_Wing.Prevent_Use_Underground", true); }
|
public boolean getChimaeraPreventUseUnderground() { return config.getBoolean("Items.Chimaera_Wing.Prevent_Use_Underground", true); }
|
||||||
public boolean getChimaeraUseBedSpawn() { return config.getBoolean("Items.Chimaera_Wing.Use_Bed_Spawn", true); }
|
|
||||||
public int getChimaeraCooldown() { return config.getInt("Items.Chimaera_Wing.Cooldown", 240); }
|
public int getChimaeraCooldown() { return config.getInt("Items.Chimaera_Wing.Cooldown", 240); }
|
||||||
public int getChimaeraWarmup() { return config.getInt("Items.Chimaera_Wing.Warmup", 5); }
|
public int getChimaeraWarmup() { return config.getInt("Items.Chimaera_Wing.Warmup", 5); }
|
||||||
public int getChimaeraRecentlyHurtCooldown() { return config.getInt("Items.Chimaera_Wing.RecentlyHurt_Cooldown", 60); }
|
public int getChimaeraRecentlyHurtCooldown() { return config.getInt("Items.Chimaera_Wing.RecentlyHurt_Cooldown", 60); }
|
||||||
public boolean getChimaeraSoundEnabled() { return config.getBoolean("Items.Chimaera_Wing.Sound_Enabled", true); }
|
public boolean getChimaeraSoundEnabled() { return config.getBoolean("Items.Chimaera_Wing.Sound_Enabled", true); }
|
||||||
|
|
||||||
public boolean getFluxPickaxeEnabled() { return config.getBoolean("Items.Flux_Pickaxe.Enabled", true); }
|
|
||||||
public boolean getFluxPickaxeSoundEnabled() { return config.getBoolean("Items.Flux_Pickaxe.Sound_Enabled", true); }
|
|
||||||
|
|
||||||
/* Particles */
|
/* Particles */
|
||||||
public boolean getAbilityActivationEffectEnabled() { return config.getBoolean("Particles.Ability_Activation", true); }
|
public boolean getAbilityActivationEffectEnabled() { return config.getBoolean("Particles.Ability_Activation", true); }
|
||||||
public boolean getAbilityDeactivationEffectEnabled() { return config.getBoolean("Particles.Ability_Deactivation", true); }
|
public boolean getAbilityDeactivationEffectEnabled() { return config.getBoolean("Particles.Ability_Deactivation", true); }
|
||||||
public boolean getBleedEffectEnabled() { return config.getBoolean("Particles.Bleed", true); }
|
|
||||||
public boolean getDodgeEffectEnabled() { return config.getBoolean("Particles.Dodge", true); }
|
public boolean getDodgeEffectEnabled() { return config.getBoolean("Particles.Dodge", true); }
|
||||||
public boolean getFluxEffectEnabled() { return config.getBoolean("Particles.Flux", true); }
|
public boolean getBleedEffectEnabled() { return config.getBoolean("Particles.Bleed", true); }
|
||||||
public boolean getGreaterImpactEffectEnabled() { return config.getBoolean("Particles.Greater_Impact", true); }
|
public boolean getGreaterImpactEffectEnabled() { return config.getBoolean("Particles.Greater_Impact", true); }
|
||||||
public boolean getCallOfTheWildEffectEnabled() { return config.getBoolean("Particles.Call_of_the_Wild", true); }
|
public boolean getCallOfTheWildEffectEnabled() { return config.getBoolean("Particles.Call_of_the_Wild", true); }
|
||||||
public boolean getLevelUpEffectsEnabled() { return config.getBoolean("Particles.LevelUp_Enabled", true); }
|
public boolean getLevelUpEffectsEnabled() { return config.getBoolean("Particles.LevelUp_Enabled", true); }
|
||||||
|
|||||||
@@ -198,7 +198,6 @@ public class ExperienceConfig extends AutoUpdateConfigLoader {
|
|||||||
public double getCombatXP(EntityType entity) { return config.getDouble("Experience.Combat.Multiplier." + StringUtils.getPrettyEntityTypeString(entity).replace(" ", "_")); }
|
public double getCombatXP(EntityType entity) { return config.getDouble("Experience.Combat.Multiplier." + StringUtils.getPrettyEntityTypeString(entity).replace(" ", "_")); }
|
||||||
public double getAnimalsXP() { return config.getDouble("Experience.Combat.Multiplier.Animals", 1.0); }
|
public double getAnimalsXP() { return config.getDouble("Experience.Combat.Multiplier.Animals", 1.0); }
|
||||||
public double getWitherSkeletonXP() { return config.getDouble("Experience.Combat.Multiplier.Wither_Skeleton", 4.0); }
|
public double getWitherSkeletonXP() { return config.getDouble("Experience.Combat.Multiplier.Wither_Skeleton", 4.0); }
|
||||||
public double getElderGuardianXP() { return config.getDouble("Experience.Combat.Multiplier.Elder_Guardian", 4.0); }
|
|
||||||
|
|
||||||
/* Materials */
|
/* Materials */
|
||||||
public int getXp(SkillType skill, Material material) { return config.getInt("Experience." + StringUtils.getCapitalized(skill.toString()) + "." + StringUtils.getPrettyItemString(material).replace(" ", "_")); }
|
public int getXp(SkillType skill, Material material) { return config.getInt("Experience." + StringUtils.getCapitalized(skill.toString()) + "." + StringUtils.getPrettyItemString(material).replace(" ", "_")); }
|
||||||
@@ -369,5 +368,4 @@ public class ExperienceConfig extends AutoUpdateConfigLoader {
|
|||||||
public int getWoodcuttingTreeXP(TreeSpecies species) { return config.getInt("Experience.Woodcutting." + StringUtils.getPrettyTreeSpeciesString(species).replace(" ", "_")); }
|
public int getWoodcuttingTreeXP(TreeSpecies species) { return config.getInt("Experience.Woodcutting." + StringUtils.getPrettyTreeSpeciesString(species).replace(" ", "_")); }
|
||||||
public int getWoodcuttingXPHugeBrownMushroom() { return config.getInt("Experience.Woodcutting.Huge_Mushroom_Brown", 70); }
|
public int getWoodcuttingXPHugeBrownMushroom() { return config.getInt("Experience.Woodcutting.Huge_Mushroom_Brown", 70); }
|
||||||
public int getWoodcuttingXPHugeRedMushroom() { return config.getInt("Experience.Woodcutting.Huge_Mushroom_Red", 70); }
|
public int getWoodcuttingXPHugeRedMushroom() { return config.getInt("Experience.Woodcutting.Huge_Mushroom_Red", 70); }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import java.util.HashMap;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.bukkit.ChatColor;
|
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.configuration.ConfigurationSection;
|
import org.bukkit.configuration.ConfigurationSection;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
@@ -118,14 +117,11 @@ public class PotionConfig extends ConfigLoader {
|
|||||||
short dataValue = Short.parseShort(potion_section.getName());
|
short dataValue = Short.parseShort(potion_section.getName());
|
||||||
|
|
||||||
String name = potion_section.getString("Name");
|
String name = potion_section.getString("Name");
|
||||||
if (name != null) {
|
|
||||||
name = ChatColor.translateAlternateColorCodes('&', name);
|
|
||||||
}
|
|
||||||
|
|
||||||
List<String> lore = new ArrayList<String>();
|
List<String> lore = new ArrayList<String>();
|
||||||
if (potion_section.contains("Lore")) {
|
if (potion_section.contains("Lore")) {
|
||||||
for (String line : potion_section.getStringList("Lore")) {
|
for (String line : potion_section.getStringList("Lore")) {
|
||||||
lore.add(ChatColor.translateAlternateColorCodes('&', line));
|
lore.add(line);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import java.util.ArrayList;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.bukkit.ChatColor;
|
|
||||||
import org.bukkit.DyeColor;
|
import org.bukkit.DyeColor;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.configuration.ConfigurationSection;
|
import org.bukkit.configuration.ConfigurationSection;
|
||||||
@@ -57,7 +56,6 @@ public class TreasureConfig extends ConfigLoader {
|
|||||||
public List<ShakeTreasure> shakeFromMushroomCow = new ArrayList<ShakeTreasure>();
|
public List<ShakeTreasure> shakeFromMushroomCow = new ArrayList<ShakeTreasure>();
|
||||||
public List<ShakeTreasure> shakeFromPig = new ArrayList<ShakeTreasure>();
|
public List<ShakeTreasure> shakeFromPig = new ArrayList<ShakeTreasure>();
|
||||||
public List<ShakeTreasure> shakeFromPigZombie = new ArrayList<ShakeTreasure>();
|
public List<ShakeTreasure> shakeFromPigZombie = new ArrayList<ShakeTreasure>();
|
||||||
public List<ShakeTreasure> shakeFromPlayer = new ArrayList<ShakeTreasure>();
|
|
||||||
public List<ShakeTreasure> shakeFromSheep = new ArrayList<ShakeTreasure>();
|
public List<ShakeTreasure> shakeFromSheep = new ArrayList<ShakeTreasure>();
|
||||||
public List<ShakeTreasure> shakeFromSkeleton = new ArrayList<ShakeTreasure>();
|
public List<ShakeTreasure> shakeFromSkeleton = new ArrayList<ShakeTreasure>();
|
||||||
public List<ShakeTreasure> shakeFromSlime = new ArrayList<ShakeTreasure>();
|
public List<ShakeTreasure> shakeFromSlime = new ArrayList<ShakeTreasure>();
|
||||||
@@ -176,11 +174,6 @@ public class TreasureConfig extends ConfigLoader {
|
|||||||
else if (materialName.contains("INK_SACK")) {
|
else if (materialName.contains("INK_SACK")) {
|
||||||
material = Material.INK_SACK;
|
material = Material.INK_SACK;
|
||||||
}
|
}
|
||||||
else if (materialName.contains("INVENTORY")) {
|
|
||||||
// Use magic material BED_BLOCK to know that we're grabbing something from the inventory and not a normal treasure
|
|
||||||
shakeFromPlayer.add(new ShakeTreasure(new ItemStack(Material.BED_BLOCK, 1, (byte) 0), 1, getInventoryStealDropChance(), getInventoryStealDropLevel()));
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
else {
|
else {
|
||||||
material = Material.matchMaterial(materialName);
|
material = Material.matchMaterial(materialName);
|
||||||
}
|
}
|
||||||
@@ -243,22 +236,6 @@ public class TreasureConfig extends ConfigLoader {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
item = new Potion(PotionType.valueOf(potionType.toUpperCase().trim())).toItemStack(amount);
|
item = new Potion(PotionType.valueOf(potionType.toUpperCase().trim())).toItemStack(amount);
|
||||||
|
|
||||||
if (config.contains(type + "." + treasureName + ".Custom_Name")) {
|
|
||||||
ItemMeta itemMeta = item.getItemMeta();
|
|
||||||
itemMeta.setDisplayName(ChatColor.translateAlternateColorCodes('&', config.getString(type + "." + treasureName + ".Custom_Name")));
|
|
||||||
item.setItemMeta(itemMeta);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (config.contains(type + "." + treasureName + ".Lore")) {
|
|
||||||
ItemMeta itemMeta = item.getItemMeta();
|
|
||||||
List<String> lore = new ArrayList<String>();
|
|
||||||
for (String s : config.getStringList(type + "." + treasureName + ".Lore")) {
|
|
||||||
lore.add(ChatColor.translateAlternateColorCodes('&', s));
|
|
||||||
}
|
|
||||||
itemMeta.setLore(lore);
|
|
||||||
item.setItemMeta(itemMeta);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch (IllegalArgumentException ex) {
|
catch (IllegalArgumentException ex) {
|
||||||
reason.add("Invalid Potion_Type: " + potionType);
|
reason.add("Invalid Potion_Type: " + potionType);
|
||||||
@@ -272,22 +249,6 @@ public class TreasureConfig extends ConfigLoader {
|
|||||||
dye.setColor(DyeColor.valueOf(color.toUpperCase().trim()));
|
dye.setColor(DyeColor.valueOf(color.toUpperCase().trim()));
|
||||||
|
|
||||||
item = dye.toItemStack(amount);
|
item = dye.toItemStack(amount);
|
||||||
|
|
||||||
if (config.contains(type + "." + treasureName + ".Custom_Name")) {
|
|
||||||
ItemMeta itemMeta = item.getItemMeta();
|
|
||||||
itemMeta.setDisplayName(ChatColor.translateAlternateColorCodes('&', config.getString(type + "." + treasureName + ".Custom_Name")));
|
|
||||||
item.setItemMeta(itemMeta);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (config.contains(type + "." + treasureName + ".Lore")) {
|
|
||||||
ItemMeta itemMeta = item.getItemMeta();
|
|
||||||
List<String> lore = new ArrayList<String>();
|
|
||||||
for (String s : config.getStringList(type + "." + treasureName + ".Lore")) {
|
|
||||||
lore.add(ChatColor.translateAlternateColorCodes('&', s));
|
|
||||||
}
|
|
||||||
itemMeta.setLore(lore);
|
|
||||||
item.setItemMeta(itemMeta);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch (IllegalArgumentException ex) {
|
catch (IllegalArgumentException ex) {
|
||||||
reason.add("Invalid Dye_Color: " + color);
|
reason.add("Invalid Dye_Color: " + color);
|
||||||
@@ -298,17 +259,13 @@ public class TreasureConfig extends ConfigLoader {
|
|||||||
|
|
||||||
if (config.contains(type + "." + treasureName + ".Custom_Name")) {
|
if (config.contains(type + "." + treasureName + ".Custom_Name")) {
|
||||||
ItemMeta itemMeta = item.getItemMeta();
|
ItemMeta itemMeta = item.getItemMeta();
|
||||||
itemMeta.setDisplayName(ChatColor.translateAlternateColorCodes('&', config.getString(type + "." + treasureName + ".Custom_Name")));
|
itemMeta.setDisplayName(config.getString(type + "." + treasureName + ".Custom_Name"));
|
||||||
item.setItemMeta(itemMeta);
|
item.setItemMeta(itemMeta);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.contains(type + "." + treasureName + ".Lore")) {
|
if (config.contains(type + "." + treasureName + ".Lore")) {
|
||||||
ItemMeta itemMeta = item.getItemMeta();
|
ItemMeta itemMeta = item.getItemMeta();
|
||||||
List<String> lore = new ArrayList<String>();
|
itemMeta.setLore(config.getStringList(type + "." + treasureName + ".Lore"));
|
||||||
for (String s : config.getStringList(type + "." + treasureName + ".Lore")) {
|
|
||||||
lore.add(ChatColor.translateAlternateColorCodes('&', s));
|
|
||||||
}
|
|
||||||
itemMeta.setLore(lore);
|
|
||||||
item.setItemMeta(itemMeta);
|
item.setItemMeta(itemMeta);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -359,9 +316,6 @@ public class TreasureConfig extends ConfigLoader {
|
|||||||
else if (type.equals("Shake.PIG_ZOMBIE")) {
|
else if (type.equals("Shake.PIG_ZOMBIE")) {
|
||||||
shakeFromPigZombie.add(shakeTreasure);
|
shakeFromPigZombie.add(shakeTreasure);
|
||||||
}
|
}
|
||||||
else if (type.equals("Shake.PLAYER")) {
|
|
||||||
shakeFromPlayer.add(shakeTreasure);
|
|
||||||
}
|
|
||||||
else if (type.equals("Shake.SHEEP")) {
|
else if (type.equals("Shake.SHEEP")) {
|
||||||
shakeFromSheep.add(shakeTreasure);
|
shakeFromSheep.add(shakeTreasure);
|
||||||
}
|
}
|
||||||
@@ -481,11 +435,6 @@ public class TreasureConfig extends ConfigLoader {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean getInventoryStealEnabled() { return config.contains("Shake.PLAYER.INVENTORY"); }
|
|
||||||
public boolean getInventoryStealStacks() { return config.getBoolean("Shake.PLAYER.INVENTORY.Whole_Stacks"); }
|
|
||||||
public double getInventoryStealDropChance() { return config.getDouble("Shake.PLAYER.INVENTORY.Drop_Chance"); }
|
|
||||||
public int getInventoryStealDropLevel() { return config.getInt("Shake.PLAYER.INVENTORY.Drop_Level"); }
|
|
||||||
|
|
||||||
public double getItemDropRate(int tier, Rarity rarity) { return config.getDouble("Item_Drop_Rates.Tier_" + tier + "." + rarity.toString()); }
|
public double getItemDropRate(int tier, Rarity rarity) { return config.getDouble("Item_Drop_Rates.Tier_" + tier + "." + rarity.toString()); }
|
||||||
public double getEnchantmentDropRate(int tier, Rarity rarity) { return config.getDouble("Enchantment_Drop_Rates.Tier_" + tier + "." + rarity.toString()); }
|
public double getEnchantmentDropRate(int tier, Rarity rarity) { return config.getDouble("Enchantment_Drop_Rates.Tier_" + tier + "." + rarity.toString()); }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ public interface DatabaseManager {
|
|||||||
/**
|
/**
|
||||||
* Retrieve rank info into a HashMap from SkillType to the rank.
|
* Retrieve rank info into a HashMap from SkillType to the rank.
|
||||||
* <p>
|
* <p>
|
||||||
* The special value <code>null</code> is used to represent the Power
|
* The special value {@code null} is used to represent the Power
|
||||||
* Level rank (the combination of all skill levels).
|
* Level rank (the combination of all skill levels).
|
||||||
*
|
*
|
||||||
* @param playerName The name of the user to retrieve the rankings for
|
* @param playerName The name of the user to retrieve the rankings for
|
||||||
|
|||||||
@@ -300,7 +300,7 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
|
|||||||
writer.append(profile.getSkillXpLevel(SkillType.SWORDS)).append(":");
|
writer.append(profile.getSkillXpLevel(SkillType.SWORDS)).append(":");
|
||||||
writer.append(profile.getSkillXpLevel(SkillType.AXES)).append(":");
|
writer.append(profile.getSkillXpLevel(SkillType.AXES)).append(":");
|
||||||
writer.append(profile.getSkillXpLevel(SkillType.ACROBATICS)).append(":");
|
writer.append(profile.getSkillXpLevel(SkillType.ACROBATICS)).append(":");
|
||||||
writer.append((int) profile.getAbilityDATS(AbilityType.CHARGE)).append(":");
|
writer.append(":");
|
||||||
writer.append(profile.getSkillLevel(SkillType.TAMING)).append(":");
|
writer.append(profile.getSkillLevel(SkillType.TAMING)).append(":");
|
||||||
writer.append(profile.getSkillXpLevel(SkillType.TAMING)).append(":");
|
writer.append(profile.getSkillXpLevel(SkillType.TAMING)).append(":");
|
||||||
writer.append((int) profile.getAbilityDATS(AbilityType.BERSERK)).append(":");
|
writer.append((int) profile.getAbilityDATS(AbilityType.BERSERK)).append(":");
|
||||||
@@ -320,7 +320,6 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
|
|||||||
writer.append(profile.getSkillLevel(SkillType.ALCHEMY)).append(":");
|
writer.append(profile.getSkillLevel(SkillType.ALCHEMY)).append(":");
|
||||||
writer.append(profile.getSkillXpLevel(SkillType.ALCHEMY)).append(":");
|
writer.append(profile.getSkillXpLevel(SkillType.ALCHEMY)).append(":");
|
||||||
writer.append(uuid.toString()).append(":");
|
writer.append(uuid.toString()).append(":");
|
||||||
writer.append(profile.getScoreboardTipsShown()).append(":");
|
|
||||||
writer.append("\r\n");
|
writer.append("\r\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -408,7 +407,7 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
|
|||||||
out.append("0:"); // SwordsXp
|
out.append("0:"); // SwordsXp
|
||||||
out.append("0:"); // AxesXp
|
out.append("0:"); // AxesXp
|
||||||
out.append("0:"); // AcrobaticsXp
|
out.append("0:"); // AcrobaticsXp
|
||||||
out.append("0:"); // DATS
|
out.append(":");
|
||||||
out.append("0:"); // Taming
|
out.append("0:"); // Taming
|
||||||
out.append("0:"); // TamingXp
|
out.append("0:"); // TamingXp
|
||||||
out.append("0:"); // DATS
|
out.append("0:"); // DATS
|
||||||
@@ -427,7 +426,7 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
|
|||||||
out.append("0:"); // Alchemy
|
out.append("0:"); // Alchemy
|
||||||
out.append("0:"); // AlchemyXp
|
out.append("0:"); // AlchemyXp
|
||||||
out.append(uuid != null ? uuid.toString() : "NULL").append(":"); // UUID
|
out.append(uuid != null ? uuid.toString() : "NULL").append(":"); // UUID
|
||||||
out.append("0:"); // Scoreboard tips shown
|
|
||||||
// Add more in the same format as the line above
|
// Add more in the same format as the line above
|
||||||
|
|
||||||
out.newLine();
|
out.newLine();
|
||||||
@@ -889,15 +888,6 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (character[23].isEmpty()) {
|
|
||||||
// Addition of "Charge" Taming ability
|
|
||||||
// Version 1.5.02
|
|
||||||
line = line.replace(character[23], "0:");
|
|
||||||
if (oldVersion == null) {
|
|
||||||
oldVersion = "1.5.02";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// If they're valid, rewrite them to the file.
|
// If they're valid, rewrite them to the file.
|
||||||
if (character.length == 42) {
|
if (character.length == 42) {
|
||||||
writer.append(line).append("\r\n");
|
writer.append(line).append("\r\n");
|
||||||
@@ -962,14 +952,6 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
|
|||||||
oldVersion = "1.5.01";
|
oldVersion = "1.5.01";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (character.length <= 42) {
|
|
||||||
// Addition of scoreboard tips auto disable
|
|
||||||
// Version 1.5.02
|
|
||||||
newLine.append("0").append(":");
|
|
||||||
if (oldVersion == null) {
|
|
||||||
oldVersion = "1.5.02";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Remove any blanks that shouldn't be there, and validate the other fields
|
// Remove any blanks that shouldn't be there, and validate the other fields
|
||||||
String[] newCharacter = newLine.toString().split(":");
|
String[] newCharacter = newLine.toString().split(":");
|
||||||
@@ -1105,7 +1087,6 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
|
|||||||
Map<SkillType, Float> skillsXp = new EnumMap<SkillType, Float>(SkillType.class); // Skill & XP
|
Map<SkillType, Float> skillsXp = new EnumMap<SkillType, Float>(SkillType.class); // Skill & XP
|
||||||
Map<AbilityType, Integer> skillsDATS = new EnumMap<AbilityType, Integer>(AbilityType.class); // Ability & Cooldown
|
Map<AbilityType, Integer> skillsDATS = new EnumMap<AbilityType, Integer>(AbilityType.class); // Ability & Cooldown
|
||||||
MobHealthbarType mobHealthbarType;
|
MobHealthbarType mobHealthbarType;
|
||||||
int scoreboardTipsShown;
|
|
||||||
|
|
||||||
// TODO on updates, put new values in a try{} ?
|
// TODO on updates, put new values in a try{} ?
|
||||||
|
|
||||||
@@ -1123,7 +1104,7 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
|
|||||||
skillsXp.put(SkillType.FISHING, (float) Integer.valueOf(character[35]));
|
skillsXp.put(SkillType.FISHING, (float) Integer.valueOf(character[35]));
|
||||||
skillsXp.put(SkillType.ALCHEMY, (float) Integer.valueOf(character[40]));
|
skillsXp.put(SkillType.ALCHEMY, (float) Integer.valueOf(character[40]));
|
||||||
|
|
||||||
skillsDATS.put(AbilityType.CHARGE, Integer.valueOf(character[23]));
|
// Taming - Unused
|
||||||
skillsDATS.put(AbilityType.SUPER_BREAKER, Integer.valueOf(character[32]));
|
skillsDATS.put(AbilityType.SUPER_BREAKER, Integer.valueOf(character[32]));
|
||||||
// Repair - Unused
|
// Repair - Unused
|
||||||
skillsDATS.put(AbilityType.TREE_FELLER, Integer.valueOf(character[28]));
|
skillsDATS.put(AbilityType.TREE_FELLER, Integer.valueOf(character[28]));
|
||||||
@@ -1150,14 +1131,8 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
|
|||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
uuid = null;
|
uuid = null;
|
||||||
}
|
}
|
||||||
try {
|
|
||||||
scoreboardTipsShown = Integer.valueOf(character[41]);
|
|
||||||
}
|
|
||||||
catch (Exception e) {
|
|
||||||
scoreboardTipsShown = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return new PlayerProfile(character[0], uuid, skills, skillsXp, skillsDATS, mobHealthbarType, scoreboardTipsShown);
|
return new PlayerProfile(character[0], uuid, skills, skillsXp, skillsDATS, mobHealthbarType);
|
||||||
}
|
}
|
||||||
|
|
||||||
private Map<SkillType, Integer> getSkillMapFromLine(String[] character) {
|
private Map<SkillType, Integer> getSkillMapFromLine(String[] character) {
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import java.util.EnumMap;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Properties;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.concurrent.locks.ReentrantLock;
|
import java.util.concurrent.locks.ReentrantLock;
|
||||||
|
|
||||||
@@ -28,18 +29,19 @@ import com.gmail.nossr50.datatypes.skills.SkillType;
|
|||||||
import com.gmail.nossr50.runnables.database.UUIDUpdateAsyncTask;
|
import com.gmail.nossr50.runnables.database.UUIDUpdateAsyncTask;
|
||||||
import com.gmail.nossr50.util.Misc;
|
import com.gmail.nossr50.util.Misc;
|
||||||
|
|
||||||
import org.apache.tomcat.jdbc.pool.DataSource;
|
import snaq.db.ConnectionPool;
|
||||||
import org.apache.tomcat.jdbc.pool.PoolProperties;
|
|
||||||
|
|
||||||
public final class SQLDatabaseManager implements DatabaseManager {
|
public final class SQLDatabaseManager implements DatabaseManager {
|
||||||
private static final String ALL_QUERY_VERSION = "taming+mining+woodcutting+repair+unarmed+herbalism+excavation+archery+swords+axes+acrobatics+fishing+alchemy";
|
private static final String ALL_QUERY_VERSION = "taming+mining+woodcutting+repair+unarmed+herbalism+excavation+archery+swords+axes+acrobatics+fishing+alchemy";
|
||||||
private String tablePrefix = Config.getInstance().getMySQLTablePrefix();
|
private String tablePrefix = Config.getInstance().getMySQLTablePrefix();
|
||||||
|
|
||||||
|
private final int POOL_FETCH_TIMEOUT = 360000;
|
||||||
|
|
||||||
private final Map<UUID, Integer> cachedUserIDs = new HashMap<UUID, Integer>();
|
private final Map<UUID, Integer> cachedUserIDs = new HashMap<UUID, Integer>();
|
||||||
|
|
||||||
private DataSource miscPool;
|
private ConnectionPool miscPool;
|
||||||
private DataSource loadPool;
|
private ConnectionPool loadPool;
|
||||||
private DataSource savePool;
|
private ConnectionPool savePool;
|
||||||
|
|
||||||
private ReentrantLock massUpdateLock = new ReentrantLock();
|
private ReentrantLock massUpdateLock = new ReentrantLock();
|
||||||
|
|
||||||
@@ -56,54 +58,44 @@ public final class SQLDatabaseManager implements DatabaseManager {
|
|||||||
//throw e; // aborts onEnable() Riking if you want to do this, fully implement it.
|
//throw e; // aborts onEnable() Riking if you want to do this, fully implement it.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Properties connectionProperties = new Properties();
|
||||||
PoolProperties poolProperties = new PoolProperties();
|
connectionProperties.put("user", Config.getInstance().getMySQLUserName());
|
||||||
poolProperties.setDriverClassName("com.mysql.jdbc.Driver");
|
connectionProperties.put("password", Config.getInstance().getMySQLUserPassword());
|
||||||
poolProperties.setUrl(connectionString);
|
connectionProperties.put("autoReconnect", "true");
|
||||||
poolProperties.setUsername(Config.getInstance().getMySQLUserName());
|
connectionProperties.put("cachePrepStmts", "true");
|
||||||
poolProperties.setPassword(Config.getInstance().getMySQLUserPassword());
|
connectionProperties.put("prepStmtCacheSize", "64");
|
||||||
poolProperties.setMaxIdle(Config.getInstance().getMySQLMaxPoolSize(PoolIdentifier.MISC));
|
connectionProperties.put("prepStmtCacheSqlLimit", "2048");
|
||||||
poolProperties.setMaxActive(Config.getInstance().getMySQLMaxConnections(PoolIdentifier.MISC));
|
connectionProperties.put("useServerPrepStmts", "true");
|
||||||
poolProperties.setInitialSize(0);
|
miscPool = new ConnectionPool("mcMMO-Misc-Pool",
|
||||||
poolProperties.setMaxWait(-1);
|
0 /*No Minimum really needed*/,
|
||||||
poolProperties.setRemoveAbandoned(true);
|
Config.getInstance().getMySQLMaxPoolSize(PoolIdentifier.MISC) /*max pool size */,
|
||||||
poolProperties.setRemoveAbandonedTimeout(60);
|
Config.getInstance().getMySQLMaxConnections(PoolIdentifier.MISC) /*max num connections*/,
|
||||||
poolProperties.setTestOnBorrow(true);
|
400 /* idle timeout of connections */,
|
||||||
poolProperties.setValidationQuery("SELECT 1");
|
connectionString,
|
||||||
poolProperties.setValidationInterval(30000);
|
connectionProperties);
|
||||||
miscPool = new DataSource(poolProperties);
|
loadPool = new ConnectionPool("mcMMO-Load-Pool",
|
||||||
poolProperties = new PoolProperties();
|
1 /*Minimum of one*/,
|
||||||
poolProperties.setDriverClassName("com.mysql.jdbc.Driver");
|
Config.getInstance().getMySQLMaxPoolSize(PoolIdentifier.LOAD) /*max pool size */,
|
||||||
poolProperties.setUrl(connectionString);
|
Config.getInstance().getMySQLMaxConnections(PoolIdentifier.LOAD) /*max num connections*/,
|
||||||
poolProperties.setUsername(Config.getInstance().getMySQLUserName());
|
400 /* idle timeout of connections */,
|
||||||
poolProperties.setPassword(Config.getInstance().getMySQLUserPassword());
|
connectionString,
|
||||||
poolProperties.setInitialSize(0);
|
connectionProperties);
|
||||||
poolProperties.setMaxIdle(Config.getInstance().getMySQLMaxPoolSize(PoolIdentifier.SAVE));
|
savePool = new ConnectionPool("mcMMO-Save-Pool",
|
||||||
poolProperties.setMaxActive(Config.getInstance().getMySQLMaxConnections(PoolIdentifier.SAVE));
|
1 /*Minimum of one*/,
|
||||||
poolProperties.setMaxWait(-1);
|
Config.getInstance().getMySQLMaxPoolSize(PoolIdentifier.SAVE) /*max pool size */,
|
||||||
poolProperties.setRemoveAbandoned(true);
|
Config.getInstance().getMySQLMaxConnections(PoolIdentifier.SAVE) /*max num connections*/,
|
||||||
poolProperties.setRemoveAbandonedTimeout(60);
|
400 /* idle timeout of connections */,
|
||||||
poolProperties.setTestOnBorrow(true);
|
connectionString,
|
||||||
poolProperties.setValidationQuery("SELECT 1");
|
connectionProperties);
|
||||||
poolProperties.setValidationInterval(30000);
|
miscPool.init(); // Init first connection
|
||||||
savePool = new DataSource(poolProperties);
|
miscPool.registerShutdownHook(); // Auto release on jvm exit just in case
|
||||||
poolProperties = new PoolProperties();
|
loadPool.init();
|
||||||
poolProperties.setDriverClassName("com.mysql.jdbc.Driver");
|
loadPool.registerShutdownHook();
|
||||||
poolProperties.setUrl(connectionString);
|
savePool.init();
|
||||||
poolProperties.setUsername(Config.getInstance().getMySQLUserName());
|
savePool.registerShutdownHook();
|
||||||
poolProperties.setPassword(Config.getInstance().getMySQLUserPassword());
|
|
||||||
poolProperties.setInitialSize(0);
|
|
||||||
poolProperties.setMaxIdle(Config.getInstance().getMySQLMaxPoolSize(PoolIdentifier.LOAD));
|
|
||||||
poolProperties.setMaxActive(Config.getInstance().getMySQLMaxConnections(PoolIdentifier.LOAD));
|
|
||||||
poolProperties.setMaxWait(-1);
|
|
||||||
poolProperties.setRemoveAbandoned(true);
|
|
||||||
poolProperties.setRemoveAbandonedTimeout(60);
|
|
||||||
poolProperties.setTestOnBorrow(true);
|
|
||||||
poolProperties.setValidationQuery("SELECT 1");
|
|
||||||
poolProperties.setValidationInterval(30000);
|
|
||||||
loadPool = new DataSource(poolProperties);
|
|
||||||
|
|
||||||
checkStructure();
|
checkStructure();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void purgePowerlessUsers() {
|
public void purgePowerlessUsers() {
|
||||||
@@ -315,26 +307,24 @@ public final class SQLDatabaseManager implements DatabaseManager {
|
|||||||
statement.close();
|
statement.close();
|
||||||
|
|
||||||
statement = connection.prepareStatement("UPDATE " + tablePrefix + "cooldowns SET "
|
statement = connection.prepareStatement("UPDATE " + tablePrefix + "cooldowns SET "
|
||||||
+ " taming = ?, mining = ?, woodcutting = ?, unarmed = ?"
|
+ " mining = ?, woodcutting = ?, unarmed = ?"
|
||||||
+ ", herbalism = ?, excavation = ?, swords = ?"
|
+ ", herbalism = ?, excavation = ?, swords = ?"
|
||||||
+ ", axes = ?, blast_mining = ? WHERE user_id = ?");
|
+ ", axes = ?, blast_mining = ? WHERE user_id = ?");
|
||||||
statement.setLong(1, profile.getAbilityDATS(AbilityType.CHARGE));
|
statement.setLong(1, profile.getAbilityDATS(AbilityType.SUPER_BREAKER));
|
||||||
statement.setLong(2, profile.getAbilityDATS(AbilityType.SUPER_BREAKER));
|
statement.setLong(2, profile.getAbilityDATS(AbilityType.TREE_FELLER));
|
||||||
statement.setLong(3, profile.getAbilityDATS(AbilityType.TREE_FELLER));
|
statement.setLong(3, profile.getAbilityDATS(AbilityType.BERSERK));
|
||||||
statement.setLong(4, profile.getAbilityDATS(AbilityType.BERSERK));
|
statement.setLong(4, profile.getAbilityDATS(AbilityType.GREEN_TERRA));
|
||||||
statement.setLong(5, profile.getAbilityDATS(AbilityType.GREEN_TERRA));
|
statement.setLong(5, profile.getAbilityDATS(AbilityType.GIGA_DRILL_BREAKER));
|
||||||
statement.setLong(6, profile.getAbilityDATS(AbilityType.GIGA_DRILL_BREAKER));
|
statement.setLong(6, profile.getAbilityDATS(AbilityType.SERRATED_STRIKES));
|
||||||
statement.setLong(7, profile.getAbilityDATS(AbilityType.SERRATED_STRIKES));
|
statement.setLong(7, profile.getAbilityDATS(AbilityType.SKULL_SPLITTER));
|
||||||
statement.setLong(8, profile.getAbilityDATS(AbilityType.SKULL_SPLITTER));
|
statement.setLong(8, profile.getAbilityDATS(AbilityType.BLAST_MINING));
|
||||||
statement.setLong(9, profile.getAbilityDATS(AbilityType.BLAST_MINING));
|
statement.setInt(9, id);
|
||||||
statement.setInt(10, id);
|
|
||||||
success = (statement.executeUpdate() != 0);
|
success = (statement.executeUpdate() != 0);
|
||||||
statement.close();
|
statement.close();
|
||||||
|
|
||||||
statement = connection.prepareStatement("UPDATE " + tablePrefix + "huds SET mobhealthbar = ?, scoreboardtips = ? WHERE user_id = ?");
|
statement = connection.prepareStatement("UPDATE " + tablePrefix + "huds SET mobhealthbar = ? WHERE user_id = ?");
|
||||||
statement.setString(1, profile.getMobHealthbarType() == null ? Config.getInstance().getMobHealthbarDefault().name() : profile.getMobHealthbarType().name());
|
statement.setString(1, profile.getMobHealthbarType() == null ? Config.getInstance().getMobHealthbarDefault().name() : profile.getMobHealthbarType().name());
|
||||||
statement.setInt(2, profile.getScoreboardTipsShown());
|
statement.setInt(2, id);
|
||||||
statement.setInt(3, id);
|
|
||||||
success = (statement.executeUpdate() != 0);
|
success = (statement.executeUpdate() != 0);
|
||||||
statement.close();
|
statement.close();
|
||||||
}
|
}
|
||||||
@@ -643,7 +633,7 @@ public final class SQLDatabaseManager implements DatabaseManager {
|
|||||||
+ "s.taming, s.mining, s.repair, s.woodcutting, s.unarmed, s.herbalism, s.excavation, s.archery, s.swords, s.axes, s.acrobatics, s.fishing, s.alchemy, "
|
+ "s.taming, s.mining, s.repair, s.woodcutting, s.unarmed, s.herbalism, s.excavation, s.archery, s.swords, s.axes, s.acrobatics, s.fishing, s.alchemy, "
|
||||||
+ "e.taming, e.mining, e.repair, e.woodcutting, e.unarmed, e.herbalism, e.excavation, e.archery, e.swords, e.axes, e.acrobatics, e.fishing, e.alchemy, "
|
+ "e.taming, e.mining, e.repair, e.woodcutting, e.unarmed, e.herbalism, e.excavation, e.archery, e.swords, e.axes, e.acrobatics, e.fishing, e.alchemy, "
|
||||||
+ "c.taming, c.mining, c.repair, c.woodcutting, c.unarmed, c.herbalism, c.excavation, c.archery, c.swords, c.axes, c.acrobatics, c.blast_mining, "
|
+ "c.taming, c.mining, c.repair, c.woodcutting, c.unarmed, c.herbalism, c.excavation, c.archery, c.swords, c.axes, c.acrobatics, c.blast_mining, "
|
||||||
+ "h.mobhealthbar, h.scoreboardtips, u.uuid "
|
+ "h.mobhealthbar, u.uuid "
|
||||||
+ "FROM " + tablePrefix + "users u "
|
+ "FROM " + tablePrefix + "users u "
|
||||||
+ "JOIN " + tablePrefix + "skills s ON (u.id = s.user_id) "
|
+ "JOIN " + tablePrefix + "skills s ON (u.id = s.user_id) "
|
||||||
+ "JOIN " + tablePrefix + "experience e ON (u.id = e.user_id) "
|
+ "JOIN " + tablePrefix + "experience e ON (u.id = e.user_id) "
|
||||||
@@ -732,7 +722,7 @@ public final class SQLDatabaseManager implements DatabaseManager {
|
|||||||
+ "s.taming, s.mining, s.repair, s.woodcutting, s.unarmed, s.herbalism, s.excavation, s.archery, s.swords, s.axes, s.acrobatics, s.fishing, s.alchemy, "
|
+ "s.taming, s.mining, s.repair, s.woodcutting, s.unarmed, s.herbalism, s.excavation, s.archery, s.swords, s.axes, s.acrobatics, s.fishing, s.alchemy, "
|
||||||
+ "e.taming, e.mining, e.repair, e.woodcutting, e.unarmed, e.herbalism, e.excavation, e.archery, e.swords, e.axes, e.acrobatics, e.fishing, e.alchemy, "
|
+ "e.taming, e.mining, e.repair, e.woodcutting, e.unarmed, e.herbalism, e.excavation, e.archery, e.swords, e.axes, e.acrobatics, e.fishing, e.alchemy, "
|
||||||
+ "c.taming, c.mining, c.repair, c.woodcutting, c.unarmed, c.herbalism, c.excavation, c.archery, c.swords, c.axes, c.acrobatics, c.blast_mining, "
|
+ "c.taming, c.mining, c.repair, c.woodcutting, c.unarmed, c.herbalism, c.excavation, c.archery, c.swords, c.axes, c.acrobatics, c.blast_mining, "
|
||||||
+ "h.mobhealthbar, h.scoreboardtips, u.uuid "
|
+ "h.mobhealthbar, u.uuid "
|
||||||
+ "FROM " + tablePrefix + "users u "
|
+ "FROM " + tablePrefix + "users u "
|
||||||
+ "JOIN " + tablePrefix + "skills s ON (u.id = s.user_id) "
|
+ "JOIN " + tablePrefix + "skills s ON (u.id = s.user_id) "
|
||||||
+ "JOIN " + tablePrefix + "experience e ON (u.id = e.user_id) "
|
+ "JOIN " + tablePrefix + "experience e ON (u.id = e.user_id) "
|
||||||
@@ -933,6 +923,7 @@ public final class SQLDatabaseManager implements DatabaseManager {
|
|||||||
* Checks that the database structure is present and correct
|
* Checks that the database structure is present and correct
|
||||||
*/
|
*/
|
||||||
private void checkStructure() {
|
private void checkStructure() {
|
||||||
|
|
||||||
PreparedStatement statement = null;
|
PreparedStatement statement = null;
|
||||||
Statement createStatement = null;
|
Statement createStatement = null;
|
||||||
ResultSet resultSet = null;
|
ResultSet resultSet = null;
|
||||||
@@ -967,7 +958,6 @@ public final class SQLDatabaseManager implements DatabaseManager {
|
|||||||
createStatement.executeUpdate("CREATE TABLE IF NOT EXISTS `" + tablePrefix + "huds` ("
|
createStatement.executeUpdate("CREATE TABLE IF NOT EXISTS `" + tablePrefix + "huds` ("
|
||||||
+ "`user_id` int(10) unsigned NOT NULL,"
|
+ "`user_id` int(10) unsigned NOT NULL,"
|
||||||
+ "`mobhealthbar` varchar(50) NOT NULL DEFAULT '" + Config.getInstance().getMobHealthbarDefault() + "',"
|
+ "`mobhealthbar` varchar(50) NOT NULL DEFAULT '" + Config.getInstance().getMobHealthbarDefault() + "',"
|
||||||
+ "`scoreboardtips` int(10) NOT NULL DEFAULT '0',"
|
|
||||||
+ "PRIMARY KEY (`user_id`)) "
|
+ "PRIMARY KEY (`user_id`)) "
|
||||||
+ "DEFAULT CHARSET=latin1;");
|
+ "DEFAULT CHARSET=latin1;");
|
||||||
createStatement.close();
|
createStatement.close();
|
||||||
@@ -1104,13 +1094,13 @@ public final class SQLDatabaseManager implements DatabaseManager {
|
|||||||
Connection connection = null;
|
Connection connection = null;
|
||||||
switch (identifier) {
|
switch (identifier) {
|
||||||
case LOAD:
|
case LOAD:
|
||||||
connection = loadPool.getConnection();
|
connection = loadPool.getConnection(POOL_FETCH_TIMEOUT);
|
||||||
break;
|
break;
|
||||||
case MISC:
|
case MISC:
|
||||||
connection = miscPool.getConnection();
|
connection = miscPool.getConnection(POOL_FETCH_TIMEOUT);
|
||||||
break;
|
break;
|
||||||
case SAVE:
|
case SAVE:
|
||||||
connection = savePool.getConnection();
|
connection = savePool.getConnection(POOL_FETCH_TIMEOUT);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (connection == null) {
|
if (connection == null) {
|
||||||
@@ -1168,10 +1158,6 @@ public final class SQLDatabaseManager implements DatabaseManager {
|
|||||||
checkUpgradeAddUUIDs(statement);
|
checkUpgradeAddUUIDs(statement);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case ADD_SCOREBOARD_TIPS:
|
|
||||||
checkUpgradeAddScoreboardTips(statement);
|
|
||||||
return;
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -1213,10 +1199,9 @@ public final class SQLDatabaseManager implements DatabaseManager {
|
|||||||
statement.execute();
|
statement.execute();
|
||||||
statement.close();
|
statement.close();
|
||||||
|
|
||||||
statement = connection.prepareStatement("INSERT IGNORE INTO " + tablePrefix + "huds (user_id, mobhealthbar, scoreboardtips) VALUES (?, ?, ?)");
|
statement = connection.prepareStatement("INSERT IGNORE INTO " + tablePrefix + "huds (user_id, mobhealthbar) VALUES (?, ?)");
|
||||||
statement.setInt(1, id);
|
statement.setInt(1, id);
|
||||||
statement.setString(2, Config.getInstance().getMobHealthbarDefault().name());
|
statement.setString(2, Config.getInstance().getMobHealthbarDefault().name());
|
||||||
statement.setInt(3, 0);
|
|
||||||
statement.execute();
|
statement.execute();
|
||||||
statement.close();
|
statement.close();
|
||||||
}
|
}
|
||||||
@@ -1241,7 +1226,6 @@ public final class SQLDatabaseManager implements DatabaseManager {
|
|||||||
Map<AbilityType, Integer> skillsDATS = new EnumMap<AbilityType, Integer>(AbilityType.class); // Ability & Cooldown
|
Map<AbilityType, Integer> skillsDATS = new EnumMap<AbilityType, Integer>(AbilityType.class); // Ability & Cooldown
|
||||||
MobHealthbarType mobHealthbarType;
|
MobHealthbarType mobHealthbarType;
|
||||||
UUID uuid;
|
UUID uuid;
|
||||||
int scoreboardTipsShown;
|
|
||||||
|
|
||||||
final int OFFSET_SKILLS = 0; // TODO update these numbers when the query
|
final int OFFSET_SKILLS = 0; // TODO update these numbers when the query
|
||||||
// changes (a new skill is added)
|
// changes (a new skill is added)
|
||||||
@@ -1277,7 +1261,7 @@ public final class SQLDatabaseManager implements DatabaseManager {
|
|||||||
skillsXp.put(SkillType.FISHING, result.getFloat(OFFSET_XP + 12));
|
skillsXp.put(SkillType.FISHING, result.getFloat(OFFSET_XP + 12));
|
||||||
skillsXp.put(SkillType.ALCHEMY, result.getFloat(OFFSET_XP + 13));
|
skillsXp.put(SkillType.ALCHEMY, result.getFloat(OFFSET_XP + 13));
|
||||||
|
|
||||||
skillsDATS.put(AbilityType.CHARGE, result.getInt(OFFSET_DATS + 1));
|
// Taming - Unused - result.getInt(OFFSET_DATS + 1)
|
||||||
skillsDATS.put(AbilityType.SUPER_BREAKER, result.getInt(OFFSET_DATS + 2));
|
skillsDATS.put(AbilityType.SUPER_BREAKER, result.getInt(OFFSET_DATS + 2));
|
||||||
// Repair - Unused - result.getInt(OFFSET_DATS + 3)
|
// Repair - Unused - result.getInt(OFFSET_DATS + 3)
|
||||||
skillsDATS.put(AbilityType.TREE_FELLER, result.getInt(OFFSET_DATS + 4));
|
skillsDATS.put(AbilityType.TREE_FELLER, result.getInt(OFFSET_DATS + 4));
|
||||||
@@ -1291,19 +1275,12 @@ public final class SQLDatabaseManager implements DatabaseManager {
|
|||||||
skillsDATS.put(AbilityType.BLAST_MINING, result.getInt(OFFSET_DATS + 12));
|
skillsDATS.put(AbilityType.BLAST_MINING, result.getInt(OFFSET_DATS + 12));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
mobHealthbarType = MobHealthbarType.valueOf(result.getString(OFFSET_OTHER + 1));
|
mobHealthbarType = MobHealthbarType.valueOf(result.getString(OFFSET_OTHER + 2));
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
mobHealthbarType = Config.getInstance().getMobHealthbarDefault();
|
mobHealthbarType = Config.getInstance().getMobHealthbarDefault();
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
|
||||||
scoreboardTipsShown = result.getInt(OFFSET_OTHER + 2);
|
|
||||||
}
|
|
||||||
catch (Exception e) {
|
|
||||||
scoreboardTipsShown = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
uuid = UUID.fromString(result.getString(OFFSET_OTHER + 3));
|
uuid = UUID.fromString(result.getString(OFFSET_OTHER + 3));
|
||||||
}
|
}
|
||||||
@@ -1311,7 +1288,7 @@ public final class SQLDatabaseManager implements DatabaseManager {
|
|||||||
uuid = null;
|
uuid = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return new PlayerProfile(playerName, uuid, skills, skillsXp, skillsDATS, mobHealthbarType, scoreboardTipsShown);
|
return new PlayerProfile(playerName, uuid, skills, skillsXp, skillsDATS, mobHealthbarType);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void printErrors(SQLException ex) {
|
private void printErrors(SQLException ex) {
|
||||||
@@ -1368,16 +1345,6 @@ public final class SQLDatabaseManager implements DatabaseManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void checkUpgradeAddScoreboardTips(final Statement statement) throws SQLException {
|
|
||||||
try {
|
|
||||||
statement.executeQuery("SELECT `scoreboardtips` FROM `" + tablePrefix + "huds` LIMIT 1");
|
|
||||||
}
|
|
||||||
catch (SQLException ex) {
|
|
||||||
mcMMO.p.getLogger().info("Updating mcMMO MySQL tables for scoreboard tips...");
|
|
||||||
statement.executeUpdate("ALTER TABLE `" + tablePrefix + "huds` ADD `scoreboardtips` int(10) NOT NULL DEFAULT '0' ;");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void checkUpgradeAddSQLIndexes(final Statement statement) throws SQLException {
|
private void checkUpgradeAddSQLIndexes(final Statement statement) throws SQLException {
|
||||||
ResultSet resultSet = null;
|
ResultSet resultSet = null;
|
||||||
|
|
||||||
@@ -1627,9 +1594,9 @@ public final class SQLDatabaseManager implements DatabaseManager {
|
|||||||
@Override
|
@Override
|
||||||
public void onDisable() {
|
public void onDisable() {
|
||||||
mcMMO.p.debug("Releasing connection pool resource...");
|
mcMMO.p.debug("Releasing connection pool resource...");
|
||||||
miscPool.close();
|
miscPool.release();
|
||||||
loadPool.close();
|
loadPool.release();
|
||||||
savePool.close();
|
savePool.release();
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum PoolIdentifier {
|
public enum PoolIdentifier {
|
||||||
|
|||||||
@@ -9,6 +9,5 @@ public enum UpgradeType {
|
|||||||
DROP_SPOUT,
|
DROP_SPOUT,
|
||||||
ADD_ALCHEMY,
|
ADD_ALCHEMY,
|
||||||
ADD_UUIDS,
|
ADD_UUIDS,
|
||||||
ADD_UUIDS_PARTY,
|
ADD_UUIDS_PARTY;
|
||||||
ADD_SCOREBOARD_TIPS;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,8 +8,6 @@ import java.util.UUID;
|
|||||||
import org.bukkit.GameMode;
|
import org.bukkit.GameMode;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Sound;
|
import org.bukkit.Sound;
|
||||||
import org.bukkit.entity.EntityType;
|
|
||||||
import org.bukkit.entity.LivingEntity;
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.metadata.FixedMetadataValue;
|
import org.bukkit.metadata.FixedMetadataValue;
|
||||||
@@ -30,7 +28,6 @@ import com.gmail.nossr50.locale.LocaleLoader;
|
|||||||
import com.gmail.nossr50.party.PartyManager;
|
import com.gmail.nossr50.party.PartyManager;
|
||||||
import com.gmail.nossr50.party.ShareHandler;
|
import com.gmail.nossr50.party.ShareHandler;
|
||||||
import com.gmail.nossr50.runnables.skills.AbilityDisableTask;
|
import com.gmail.nossr50.runnables.skills.AbilityDisableTask;
|
||||||
import com.gmail.nossr50.runnables.skills.BleedTimerTask;
|
|
||||||
import com.gmail.nossr50.runnables.skills.ToolLowerTask;
|
import com.gmail.nossr50.runnables.skills.ToolLowerTask;
|
||||||
import com.gmail.nossr50.skills.SkillManager;
|
import com.gmail.nossr50.skills.SkillManager;
|
||||||
import com.gmail.nossr50.skills.acrobatics.AcrobaticsManager;
|
import com.gmail.nossr50.skills.acrobatics.AcrobaticsManager;
|
||||||
@@ -46,7 +43,6 @@ import com.gmail.nossr50.skills.repair.RepairManager;
|
|||||||
import com.gmail.nossr50.skills.salvage.SalvageManager;
|
import com.gmail.nossr50.skills.salvage.SalvageManager;
|
||||||
import com.gmail.nossr50.skills.smelting.SmeltingManager;
|
import com.gmail.nossr50.skills.smelting.SmeltingManager;
|
||||||
import com.gmail.nossr50.skills.swords.SwordsManager;
|
import com.gmail.nossr50.skills.swords.SwordsManager;
|
||||||
import com.gmail.nossr50.skills.taming.Taming;
|
|
||||||
import com.gmail.nossr50.skills.taming.TamingManager;
|
import com.gmail.nossr50.skills.taming.TamingManager;
|
||||||
import com.gmail.nossr50.skills.unarmed.UnarmedManager;
|
import com.gmail.nossr50.skills.unarmed.UnarmedManager;
|
||||||
import com.gmail.nossr50.skills.woodcutting.WoodcuttingManager;
|
import com.gmail.nossr50.skills.woodcutting.WoodcuttingManager;
|
||||||
@@ -54,8 +50,6 @@ import com.gmail.nossr50.util.EventUtils;
|
|||||||
import com.gmail.nossr50.util.Misc;
|
import com.gmail.nossr50.util.Misc;
|
||||||
import com.gmail.nossr50.util.Permissions;
|
import com.gmail.nossr50.util.Permissions;
|
||||||
import com.gmail.nossr50.util.StringUtils;
|
import com.gmail.nossr50.util.StringUtils;
|
||||||
import com.gmail.nossr50.util.player.UserManager;
|
|
||||||
import com.gmail.nossr50.util.scoreboards.ScoreboardManager;
|
|
||||||
import com.gmail.nossr50.util.skills.ParticleEffectUtils;
|
import com.gmail.nossr50.util.skills.ParticleEffectUtils;
|
||||||
import com.gmail.nossr50.util.skills.PerksUtils;
|
import com.gmail.nossr50.util.skills.PerksUtils;
|
||||||
import com.gmail.nossr50.util.skills.SkillUtils;
|
import com.gmail.nossr50.util.skills.SkillUtils;
|
||||||
@@ -591,6 +585,10 @@ public class McMMOPlayer {
|
|||||||
party.addOnlineMember(this.getPlayer());
|
party.addOnlineMember(this.getPlayer());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void logoutParty() {
|
||||||
|
party.removeOnlineMember(this.getPlayer());
|
||||||
|
}
|
||||||
|
|
||||||
public int getItemShareModifier() {
|
public int getItemShareModifier() {
|
||||||
if (itemShareModifier < 10) {
|
if (itemShareModifier < 10) {
|
||||||
setItemShareModifier(10);
|
setItemShareModifier(10);
|
||||||
@@ -742,21 +740,6 @@ public class McMMOPlayer {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
LivingEntity livingEntity = null;
|
|
||||||
|
|
||||||
if (ability == AbilityType.CHARGE) {
|
|
||||||
livingEntity = this.getTamingManager().getTarget(20);
|
|
||||||
|
|
||||||
if (!this.getTamingManager().isEntityTypeNearby(EntityType.WOLF, Taming.wolfCommandRange, true)) {
|
|
||||||
player.sendMessage(LocaleLoader.getString("Taming.Skills.Charge.NoneNearby"));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
else if (livingEntity == null) {
|
|
||||||
player.sendMessage(LocaleLoader.getString("Taming.Skills.Charge.NoTarget"));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (EventUtils.callPlayerAbilityActivateEvent(player, skill).isCancelled()) {
|
if (EventUtils.callPlayerAbilityActivateEvent(player, skill).isCancelled()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -780,10 +763,6 @@ public class McMMOPlayer {
|
|||||||
SkillUtils.handleAbilitySpeedIncrease(player);
|
SkillUtils.handleAbilitySpeedIncrease(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ability == AbilityType.CHARGE) {
|
|
||||||
this.getTamingManager().handleCharge(livingEntity);
|
|
||||||
}
|
|
||||||
|
|
||||||
new AbilityDisableTask(this, ability).runTaskLater(mcMMO.p, ticks * Misc.TICK_CONVERSION_FACTOR);
|
new AbilityDisableTask(this, ability).runTaskLater(mcMMO.p, ticks * Misc.TICK_CONVERSION_FACTOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -825,11 +804,6 @@ public class McMMOPlayer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ability == AbilityType.CHARGE && !this.getTamingManager().isEntityTypeNearby(EntityType.WOLF, Taming.wolfCommandRange, true)) {
|
|
||||||
player.sendMessage(LocaleLoader.getString("Taming.Skills.Charge.NoneNearby"));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Config.getInstance().getAbilityMessagesEnabled()) {
|
if (Config.getInstance().getAbilityMessagesEnabled()) {
|
||||||
player.sendMessage(tool.getRaiseTool());
|
player.sendMessage(tool.getRaiseTool());
|
||||||
}
|
}
|
||||||
@@ -905,28 +879,4 @@ public class McMMOPlayer {
|
|||||||
public FixedMetadataValue getPlayerMetadata() {
|
public FixedMetadataValue getPlayerMetadata() {
|
||||||
return playerMetadata;
|
return playerMetadata;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* This method is called by PlayerQuitEvent to tear down the mcMMOPlayer.
|
|
||||||
*
|
|
||||||
* @param syncSave if true, data is saved synchronously
|
|
||||||
*/
|
|
||||||
public void logout(boolean syncSave) {
|
|
||||||
Player thisPlayer = getPlayer();
|
|
||||||
resetAbilityMode();
|
|
||||||
BleedTimerTask.bleedOut(thisPlayer);
|
|
||||||
|
|
||||||
if (syncSave) {
|
|
||||||
getProfile().save();
|
|
||||||
} else {
|
|
||||||
getProfile().scheduleAsyncSave();
|
|
||||||
}
|
|
||||||
|
|
||||||
UserManager.remove(thisPlayer);
|
|
||||||
ScoreboardManager.teardownPlayer(thisPlayer);
|
|
||||||
|
|
||||||
if (inParty()) {
|
|
||||||
party.removeOnlineMember(thisPlayer);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,7 +28,6 @@ public class PlayerProfile {
|
|||||||
|
|
||||||
/* HUDs */
|
/* HUDs */
|
||||||
private MobHealthbarType mobHealthbarType;
|
private MobHealthbarType mobHealthbarType;
|
||||||
private int scoreboardTipsShown;
|
|
||||||
|
|
||||||
/* Skill Data */
|
/* Skill Data */
|
||||||
private final Map<SkillType, Integer> skills = new HashMap<SkillType, Integer>(); // Skill & Level
|
private final Map<SkillType, Integer> skills = new HashMap<SkillType, Integer>(); // Skill & Level
|
||||||
@@ -49,7 +48,6 @@ public class PlayerProfile {
|
|||||||
this.playerName = playerName;
|
this.playerName = playerName;
|
||||||
|
|
||||||
mobHealthbarType = Config.getInstance().getMobHealthbarDefault();
|
mobHealthbarType = Config.getInstance().getMobHealthbarDefault();
|
||||||
scoreboardTipsShown = 0;
|
|
||||||
|
|
||||||
for (AbilityType abilityType : AbilityType.values()) {
|
for (AbilityType abilityType : AbilityType.values()) {
|
||||||
abilityDATS.put(abilityType, 0);
|
abilityDATS.put(abilityType, 0);
|
||||||
@@ -72,11 +70,10 @@ public class PlayerProfile {
|
|||||||
this.loaded = isLoaded;
|
this.loaded = isLoaded;
|
||||||
}
|
}
|
||||||
|
|
||||||
public PlayerProfile(String playerName, UUID uuid, Map<SkillType, Integer> levelData, Map<SkillType, Float> xpData, Map<AbilityType, Integer> cooldownData, MobHealthbarType mobHealthbarType, int scoreboardTipsShown) {
|
public PlayerProfile(String playerName, UUID uuid, Map<SkillType, Integer> levelData, Map<SkillType, Float> xpData, Map<AbilityType, Integer> cooldownData, MobHealthbarType mobHealthbarType) {
|
||||||
this.playerName = playerName;
|
this.playerName = playerName;
|
||||||
this.uuid = uuid;
|
this.uuid = uuid;
|
||||||
this.mobHealthbarType = mobHealthbarType;
|
this.mobHealthbarType = mobHealthbarType;
|
||||||
this.scoreboardTipsShown = scoreboardTipsShown;
|
|
||||||
|
|
||||||
skills.putAll(levelData);
|
skills.putAll(levelData);
|
||||||
skillsXp.putAll(xpData);
|
skillsXp.putAll(xpData);
|
||||||
@@ -95,7 +92,7 @@ public class PlayerProfile {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TODO should this part be synchronized?
|
// TODO should this part be synchronized?
|
||||||
PlayerProfile profileCopy = new PlayerProfile(playerName, uuid, ImmutableMap.copyOf(skills), ImmutableMap.copyOf(skillsXp), ImmutableMap.copyOf(abilityDATS), mobHealthbarType, scoreboardTipsShown);
|
PlayerProfile profileCopy = new PlayerProfile(playerName, uuid, ImmutableMap.copyOf(skills), ImmutableMap.copyOf(skillsXp), ImmutableMap.copyOf(abilityDATS), mobHealthbarType);
|
||||||
changed = !mcMMO.getDatabaseManager().saveUser(profileCopy);
|
changed = !mcMMO.getDatabaseManager().saveUser(profileCopy);
|
||||||
|
|
||||||
if (changed) {
|
if (changed) {
|
||||||
@@ -130,25 +127,9 @@ public class PlayerProfile {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setMobHealthbarType(MobHealthbarType mobHealthbarType) {
|
public void setMobHealthbarType(MobHealthbarType mobHealthbarType) {
|
||||||
changed = true;
|
|
||||||
|
|
||||||
this.mobHealthbarType = mobHealthbarType;
|
this.mobHealthbarType = mobHealthbarType;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getScoreboardTipsShown() {
|
|
||||||
return scoreboardTipsShown;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setScoreboardTipsShown(int scoreboardTipsShown) {
|
|
||||||
changed = true;
|
|
||||||
|
|
||||||
this.scoreboardTipsShown = scoreboardTipsShown;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void increaseTipsShown() {
|
|
||||||
setScoreboardTipsShown(getScoreboardTipsShown() + 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Cooldowns
|
* Cooldowns
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -60,13 +60,6 @@ public enum AbilityType {
|
|||||||
"Swords.Skills.SS.Refresh",
|
"Swords.Skills.SS.Refresh",
|
||||||
"Swords.Skills.SS.Other.Off"),
|
"Swords.Skills.SS.Other.Off"),
|
||||||
|
|
||||||
CHARGE(
|
|
||||||
"Taming.Skills.Charge.On",
|
|
||||||
"Taming.Skills.Charge.Off",
|
|
||||||
"Taming.Skills.Charge.Other.On",
|
|
||||||
"Taming.Skills.Charge.Refresh",
|
|
||||||
"Taming.Skills.Charge.Other.Off"),
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Has cooldown - but has to share a skill with Super Breaker, so needs special treatment
|
* Has cooldown - but has to share a skill with Super Breaker, so needs special treatment
|
||||||
*/
|
*/
|
||||||
@@ -92,30 +85,67 @@ public enum AbilityType {
|
|||||||
this.abilityPlayerOff = abilityPlayerOff;
|
this.abilityPlayerOff = abilityPlayerOff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the cooldown time in seconds for this ability
|
||||||
|
*
|
||||||
|
* @return cooldown time in seconds
|
||||||
|
*/
|
||||||
public int getCooldown() {
|
public int getCooldown() {
|
||||||
return Config.getInstance().getCooldown(this);
|
return Config.getInstance().getCooldown(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the maximum length in seconds for this ability
|
||||||
|
*
|
||||||
|
* @return maximum length in seconds
|
||||||
|
*/
|
||||||
public int getMaxLength() {
|
public int getMaxLength() {
|
||||||
return Config.getInstance().getMaxLength(this);
|
return Config.getInstance().getMaxLength(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the locale string for when the ability activates
|
||||||
|
*
|
||||||
|
* @return localized activation message
|
||||||
|
*/
|
||||||
public String getAbilityOn() {
|
public String getAbilityOn() {
|
||||||
return LocaleLoader.getString(this.abilityOn);
|
return LocaleLoader.getString(this.abilityOn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the locale string for when the ability deactivates
|
||||||
|
*
|
||||||
|
* @return localized deactivation message
|
||||||
|
*/
|
||||||
public String getAbilityOff() {
|
public String getAbilityOff() {
|
||||||
return LocaleLoader.getString(this.abilityOff);
|
return LocaleLoader.getString(this.abilityOff);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the locale string for nearby players when someone activates this ability
|
||||||
|
*
|
||||||
|
* @param player {@link Player} object that activates this ability
|
||||||
|
* @return localized activation message
|
||||||
|
*/
|
||||||
public String getAbilityPlayer(Player player) {
|
public String getAbilityPlayer(Player player) {
|
||||||
return LocaleLoader.getString(this.abilityPlayer, player.getName());
|
return LocaleLoader.getString(this.abilityPlayer, player.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the locale string for nearby players when someone deactivates this ability
|
||||||
|
*
|
||||||
|
* @param player {@link Player} object that deactivates this ability
|
||||||
|
* @return localized deactivation message
|
||||||
|
*/
|
||||||
public String getAbilityPlayerOff(Player player) {
|
public String getAbilityPlayerOff(Player player) {
|
||||||
return LocaleLoader.getString(this.abilityPlayerOff, player.getName());
|
return LocaleLoader.getString(this.abilityPlayerOff, player.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get ability refresh message
|
||||||
|
*
|
||||||
|
* @return Localized ability refresh message
|
||||||
|
*/
|
||||||
public String getAbilityRefresh() {
|
public String getAbilityRefresh() {
|
||||||
return LocaleLoader.getString(this.abilityRefresh);
|
return LocaleLoader.getString(this.abilityRefresh);
|
||||||
}
|
}
|
||||||
@@ -159,9 +189,6 @@ public enum AbilityType {
|
|||||||
case BLAST_MINING:
|
case BLAST_MINING:
|
||||||
return Permissions.remoteDetonation(player);
|
return Permissions.remoteDetonation(player);
|
||||||
|
|
||||||
case CHARGE:
|
|
||||||
return Permissions.charge(player);
|
|
||||||
|
|
||||||
case GIGA_DRILL_BREAKER:
|
case GIGA_DRILL_BREAKER:
|
||||||
return Permissions.gigaDrillBreaker(player);
|
return Permissions.gigaDrillBreaker(player);
|
||||||
|
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ public enum SkillType {
|
|||||||
SALVAGE(SalvageManager.class, Color.ORANGE, ImmutableList.of(SecondaryAbility.ADVANCED_SALVAGE, SecondaryAbility.ARCANE_SALVAGE)),
|
SALVAGE(SalvageManager.class, Color.ORANGE, ImmutableList.of(SecondaryAbility.ADVANCED_SALVAGE, SecondaryAbility.ARCANE_SALVAGE)),
|
||||||
SMELTING(SmeltingManager.class, Color.YELLOW, ImmutableList.of(SecondaryAbility.FLUX_MINING, SecondaryAbility.FUEL_EFFICIENCY, SecondaryAbility.SECOND_SMELT)),
|
SMELTING(SmeltingManager.class, Color.YELLOW, ImmutableList.of(SecondaryAbility.FLUX_MINING, SecondaryAbility.FUEL_EFFICIENCY, SecondaryAbility.SECOND_SMELT)),
|
||||||
SWORDS(SwordsManager.class, Color.fromRGB(178, 34, 34), AbilityType.SERRATED_STRIKES, ToolType.SWORD, ImmutableList.of(SecondaryAbility.BLEED, SecondaryAbility.COUNTER)),
|
SWORDS(SwordsManager.class, Color.fromRGB(178, 34, 34), AbilityType.SERRATED_STRIKES, ToolType.SWORD, ImmutableList.of(SecondaryAbility.BLEED, SecondaryAbility.COUNTER)),
|
||||||
TAMING(TamingManager.class, Color.PURPLE, AbilityType.CHARGE, ToolType.BONE, ImmutableList.of(SecondaryAbility.BEAST_LORE, SecondaryAbility.CALL_OF_THE_WILD, SecondaryAbility.ENVIROMENTALLY_AWARE, SecondaryAbility.FAST_FOOD, SecondaryAbility.GORE, SecondaryAbility.HOLY_HOUND, SecondaryAbility.SHARPENED_CLAWS, SecondaryAbility.SHOCK_PROOF, SecondaryAbility.THICK_FUR, SecondaryAbility.PUMMEL)),
|
TAMING(TamingManager.class, Color.PURPLE, ImmutableList.of(SecondaryAbility.BEAST_LORE, SecondaryAbility.CALL_OF_THE_WILD, SecondaryAbility.ENVIROMENTALLY_AWARE, SecondaryAbility.FAST_FOOD, SecondaryAbility.GORE, SecondaryAbility.HOLY_HOUND, SecondaryAbility.SHARPENED_CLAWS, SecondaryAbility.SHOCK_PROOF, SecondaryAbility.THICK_FUR, SecondaryAbility.PUMMEL)),
|
||||||
UNARMED(UnarmedManager.class, Color.BLACK, AbilityType.BERSERK, ToolType.FISTS, ImmutableList.of(SecondaryAbility.BLOCK_CRACKER, SecondaryAbility.DEFLECT, SecondaryAbility.DISARM, SecondaryAbility.IRON_ARM, SecondaryAbility.IRON_GRIP)),
|
UNARMED(UnarmedManager.class, Color.BLACK, AbilityType.BERSERK, ToolType.FISTS, ImmutableList.of(SecondaryAbility.BLOCK_CRACKER, SecondaryAbility.DEFLECT, SecondaryAbility.DISARM, SecondaryAbility.IRON_ARM, SecondaryAbility.IRON_GRIP)),
|
||||||
WOODCUTTING(WoodcuttingManager.class, Color.OLIVE, AbilityType.TREE_FELLER, ToolType.AXE, ImmutableList.of(SecondaryAbility.LEAF_BLOWER, SecondaryAbility.WOODCUTTING_DOUBLE_DROPS));
|
WOODCUTTING(WoodcuttingManager.class, Color.OLIVE, AbilityType.TREE_FELLER, ToolType.AXE, ImmutableList.of(SecondaryAbility.LEAF_BLOWER, SecondaryAbility.WOODCUTTING_DOUBLE_DROPS));
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import com.gmail.nossr50.util.ItemUtils;
|
|||||||
|
|
||||||
public enum ToolType {
|
public enum ToolType {
|
||||||
AXE(LocaleLoader.getString("Axes.Ability.Lower"), LocaleLoader.getString("Axes.Ability.Ready")),
|
AXE(LocaleLoader.getString("Axes.Ability.Lower"), LocaleLoader.getString("Axes.Ability.Ready")),
|
||||||
BONE(LocaleLoader.getString("Taming.Ability.Lower"), LocaleLoader.getString("Taming.Ability.Ready")),
|
|
||||||
FISTS(LocaleLoader.getString("Unarmed.Ability.Lower"), LocaleLoader.getString("Unarmed.Ability.Ready")),
|
FISTS(LocaleLoader.getString("Unarmed.Ability.Lower"), LocaleLoader.getString("Unarmed.Ability.Ready")),
|
||||||
HOE(LocaleLoader.getString("Herbalism.Ability.Lower"), LocaleLoader.getString("Herbalism.Ability.Ready")),
|
HOE(LocaleLoader.getString("Herbalism.Ability.Lower"), LocaleLoader.getString("Herbalism.Ability.Ready")),
|
||||||
PICKAXE(LocaleLoader.getString("Mining.Ability.Lower"), LocaleLoader.getString("Mining.Ability.Ready")),
|
PICKAXE(LocaleLoader.getString("Mining.Ability.Lower"), LocaleLoader.getString("Mining.Ability.Ready")),
|
||||||
@@ -42,9 +41,6 @@ public enum ToolType {
|
|||||||
case AXE:
|
case AXE:
|
||||||
return ItemUtils.isAxe(itemStack);
|
return ItemUtils.isAxe(itemStack);
|
||||||
|
|
||||||
case BONE:
|
|
||||||
return itemStack.getType() == Material.BONE;
|
|
||||||
|
|
||||||
case FISTS:
|
case FISTS:
|
||||||
return itemStack.getType() == Material.AIR;
|
return itemStack.getType() == Material.AIR;
|
||||||
|
|
||||||
|
|||||||
@@ -260,7 +260,7 @@ public class BlockListener implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (ItemUtils.isFluxPickaxe(heldItem) && !heldItem.containsEnchantment(Enchantment.SILK_TOUCH)) {
|
else if (ItemUtils.isPickaxe(heldItem) && !heldItem.containsEnchantment(Enchantment.SILK_TOUCH)) {
|
||||||
SmeltingManager smeltingManager = UserManager.getPlayer(player).getSmeltingManager();
|
SmeltingManager smeltingManager = UserManager.getPlayer(player).getSmeltingManager();
|
||||||
|
|
||||||
if (smeltingManager.canUseFluxMining(blockState)) {
|
if (smeltingManager.canUseFluxMining(blockState)) {
|
||||||
|
|||||||
@@ -39,10 +39,10 @@ import com.gmail.nossr50.datatypes.party.Party;
|
|||||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||||
import com.gmail.nossr50.datatypes.skills.AbilityType;
|
import com.gmail.nossr50.datatypes.skills.AbilityType;
|
||||||
import com.gmail.nossr50.datatypes.skills.SkillType;
|
import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||||
import com.gmail.nossr50.datatypes.skills.ToolType;
|
|
||||||
import com.gmail.nossr50.locale.LocaleLoader;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
import com.gmail.nossr50.party.ShareHandler;
|
import com.gmail.nossr50.party.ShareHandler;
|
||||||
import com.gmail.nossr50.runnables.player.PlayerProfileLoadingTask;
|
import com.gmail.nossr50.runnables.player.PlayerProfileLoadingTask;
|
||||||
|
import com.gmail.nossr50.runnables.skills.BleedTimerTask;
|
||||||
import com.gmail.nossr50.skills.fishing.FishingManager;
|
import com.gmail.nossr50.skills.fishing.FishingManager;
|
||||||
import com.gmail.nossr50.skills.herbalism.HerbalismManager;
|
import com.gmail.nossr50.skills.herbalism.HerbalismManager;
|
||||||
import com.gmail.nossr50.skills.mining.MiningManager;
|
import com.gmail.nossr50.skills.mining.MiningManager;
|
||||||
@@ -62,6 +62,7 @@ import com.gmail.nossr50.util.MobHealthbarUtils;
|
|||||||
import com.gmail.nossr50.util.Motd;
|
import com.gmail.nossr50.util.Motd;
|
||||||
import com.gmail.nossr50.util.Permissions;
|
import com.gmail.nossr50.util.Permissions;
|
||||||
import com.gmail.nossr50.util.player.UserManager;
|
import com.gmail.nossr50.util.player.UserManager;
|
||||||
|
import com.gmail.nossr50.util.scoreboards.ScoreboardManager;
|
||||||
import com.gmail.nossr50.util.skills.SkillUtils;
|
import com.gmail.nossr50.util.skills.SkillUtils;
|
||||||
|
|
||||||
public class PlayerListener implements Listener {
|
public class PlayerListener implements Listener {
|
||||||
@@ -360,7 +361,16 @@ public class PlayerListener implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
|
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
|
||||||
mcMMOPlayer.logout(false);
|
|
||||||
|
mcMMOPlayer.resetAbilityMode();
|
||||||
|
BleedTimerTask.bleedOut(player);
|
||||||
|
mcMMOPlayer.getProfile().scheduleAsyncSave();
|
||||||
|
UserManager.remove(player);
|
||||||
|
ScoreboardManager.teardownPlayer(player);
|
||||||
|
|
||||||
|
if (mcMMOPlayer.inParty()) {
|
||||||
|
mcMMOPlayer.logoutParty();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -523,10 +533,10 @@ public class PlayerListener implements Listener {
|
|||||||
|
|
||||||
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
|
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
|
||||||
ItemStack heldItem = player.getItemInHand();
|
ItemStack heldItem = player.getItemInHand();
|
||||||
Block block = event.getClickedBlock();
|
|
||||||
|
|
||||||
switch (event.getAction()) {
|
switch (event.getAction()) {
|
||||||
case RIGHT_CLICK_BLOCK:
|
case RIGHT_CLICK_BLOCK:
|
||||||
|
Block block = event.getClickedBlock();
|
||||||
BlockState blockState = block.getState();
|
BlockState blockState = block.getState();
|
||||||
|
|
||||||
/* ACTIVATION & ITEM CHECKS */
|
/* ACTIVATION & ITEM CHECKS */
|
||||||
@@ -577,7 +587,6 @@ public class PlayerListener implements Listener {
|
|||||||
mcMMOPlayer.processAbilityActivation(SkillType.SWORDS);
|
mcMMOPlayer.processAbilityActivation(SkillType.SWORDS);
|
||||||
mcMMOPlayer.processAbilityActivation(SkillType.UNARMED);
|
mcMMOPlayer.processAbilityActivation(SkillType.UNARMED);
|
||||||
mcMMOPlayer.processAbilityActivation(SkillType.WOODCUTTING);
|
mcMMOPlayer.processAbilityActivation(SkillType.WOODCUTTING);
|
||||||
mcMMOPlayer.processAbilityActivation(SkillType.TAMING);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ITEM CHECKS */
|
/* ITEM CHECKS */
|
||||||
@@ -592,12 +601,6 @@ public class PlayerListener implements Listener {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case LEFT_CLICK_AIR:
|
case LEFT_CLICK_AIR:
|
||||||
if (mcMMOPlayer.getToolPreparationMode(ToolType.BONE) && ToolType.BONE.inHand(heldItem)) {
|
|
||||||
mcMMOPlayer.checkAbilityActivation(SkillType.TAMING);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Fallthrough
|
|
||||||
|
|
||||||
case LEFT_CLICK_BLOCK:
|
case LEFT_CLICK_BLOCK:
|
||||||
|
|
||||||
if (!player.isSneaking()) {
|
if (!player.isSneaking()) {
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import java.io.IOException;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.bukkit.Material;
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.HandlerList;
|
import org.bukkit.event.HandlerList;
|
||||||
import org.bukkit.metadata.FixedMetadataValue;
|
import org.bukkit.metadata.FixedMetadataValue;
|
||||||
@@ -52,7 +51,6 @@ import com.gmail.nossr50.skills.repair.repairables.SimpleRepairableManager;
|
|||||||
import com.gmail.nossr50.skills.salvage.salvageables.Salvageable;
|
import com.gmail.nossr50.skills.salvage.salvageables.Salvageable;
|
||||||
import com.gmail.nossr50.skills.salvage.salvageables.SalvageableManager;
|
import com.gmail.nossr50.skills.salvage.salvageables.SalvageableManager;
|
||||||
import com.gmail.nossr50.skills.salvage.salvageables.SimpleSalvageableManager;
|
import com.gmail.nossr50.skills.salvage.salvageables.SimpleSalvageableManager;
|
||||||
import com.gmail.nossr50.skills.smelting.SmeltingManager;
|
|
||||||
import com.gmail.nossr50.util.ChimaeraWing;
|
import com.gmail.nossr50.util.ChimaeraWing;
|
||||||
import com.gmail.nossr50.util.HolidayManager;
|
import com.gmail.nossr50.util.HolidayManager;
|
||||||
import com.gmail.nossr50.util.LogFilter;
|
import com.gmail.nossr50.util.LogFilter;
|
||||||
@@ -457,14 +455,6 @@ public class mcMMO extends JavaPlugin {
|
|||||||
if (Config.getInstance().getChimaeraEnabled()) {
|
if (Config.getInstance().getChimaeraEnabled()) {
|
||||||
getServer().addRecipe(ChimaeraWing.getChimaeraWingRecipe());
|
getServer().addRecipe(ChimaeraWing.getChimaeraWingRecipe());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Config.getInstance().getFluxPickaxeEnabled()) {
|
|
||||||
getServer().addRecipe(SmeltingManager.getFluxPickaxeRecipe(Material.DIAMOND_PICKAXE));
|
|
||||||
getServer().addRecipe(SmeltingManager.getFluxPickaxeRecipe(Material.GOLD_PICKAXE));
|
|
||||||
getServer().addRecipe(SmeltingManager.getFluxPickaxeRecipe(Material.IRON_PICKAXE));
|
|
||||||
getServer().addRecipe(SmeltingManager.getFluxPickaxeRecipe(Material.STONE_PICKAXE));
|
|
||||||
getServer().addRecipe(SmeltingManager.getFluxPickaxeRecipe(Material.WOOD_PICKAXE));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void scheduleTasks() {
|
private void scheduleTasks() {
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ public class UUIDUpdateAsyncTask extends BukkitRunnable {
|
|||||||
private static final int MAX_LOOKUP = Math.max(HiddenConfig.getInstance().getUUIDConvertAmount(), 100);
|
private static final int MAX_LOOKUP = Math.max(HiddenConfig.getInstance().getUUIDConvertAmount(), 100);
|
||||||
private static final int RATE_LIMIT = HiddenConfig.getInstance().getMojangRateLimit();
|
private static final int RATE_LIMIT = HiddenConfig.getInstance().getMojangRateLimit();
|
||||||
private static final long LIMIT_PERIOD = HiddenConfig.getInstance().getMojangLimitPeriod();
|
private static final long LIMIT_PERIOD = HiddenConfig.getInstance().getMojangLimitPeriod();
|
||||||
private static final int BATCH_SIZE = MAX_LOOKUP * 3;
|
private static final int BATCH_SIZE = 5000;
|
||||||
|
|
||||||
private List<String> userNames;
|
private List<String> userNames;
|
||||||
private int size;
|
private int size;
|
||||||
@@ -68,17 +68,6 @@ public class UUIDUpdateAsyncTask extends BukkitRunnable {
|
|||||||
fetchedUUIDs.putAll(new UUIDFetcher(userNamesSection).call());
|
fetchedUUIDs.putAll(new UUIDFetcher(userNamesSection).call());
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
// Handle 429
|
|
||||||
if (e.getMessage().contains("429")) {
|
|
||||||
try {
|
|
||||||
Thread.sleep(LIMIT_PERIOD);
|
|
||||||
} catch (InterruptedException ex) {
|
|
||||||
e.printStackTrace();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
plugin.getLogger().log(Level.SEVERE, "Unable to fetch UUIDs!", e);
|
plugin.getLogger().log(Level.SEVERE, "Unable to fetch UUIDs!", e);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -88,7 +77,7 @@ public class UUIDUpdateAsyncTask extends BukkitRunnable {
|
|||||||
size = userNames.size();
|
size = userNames.size();
|
||||||
|
|
||||||
Misc.printProgress(checkedUsers, DatabaseManager.progressInterval, startMillis);
|
Misc.printProgress(checkedUsers, DatabaseManager.progressInterval, startMillis);
|
||||||
if (fetchedUUIDs.size() >= BATCH_SIZE) {
|
if (fetchedUUIDs.size() > BATCH_SIZE) {
|
||||||
mcMMO.getDatabaseManager().saveUserUUIDs(fetchedUUIDs);
|
mcMMO.getDatabaseManager().saveUserUUIDs(fetchedUUIDs);
|
||||||
fetchedUUIDs = new HashMap<String, UUID>();
|
fetchedUUIDs = new HashMap<String, UUID>();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ import org.bukkit.entity.LivingEntity;
|
|||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.scheduler.BukkitRunnable;
|
import org.bukkit.scheduler.BukkitRunnable;
|
||||||
|
|
||||||
import com.gmail.nossr50.config.AdvancedConfig;
|
|
||||||
import com.gmail.nossr50.locale.LocaleLoader;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
import com.gmail.nossr50.util.skills.CombatUtils;
|
import com.gmail.nossr50.util.skills.CombatUtils;
|
||||||
import com.gmail.nossr50.util.skills.ParticleEffectUtils;
|
import com.gmail.nossr50.util.skills.ParticleEffectUtils;
|
||||||
@@ -29,10 +28,10 @@ public class BleedTimerTask extends BukkitRunnable {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
double damage;
|
int damage;
|
||||||
|
|
||||||
if (entity instanceof Player) {
|
if (entity instanceof Player) {
|
||||||
damage = AdvancedConfig.getInstance().getBleedDamagePlayer();
|
damage = 1;
|
||||||
Player player = (Player) entity;
|
Player player = (Player) entity;
|
||||||
|
|
||||||
if (!player.isOnline()) {
|
if (!player.isOnline()) {
|
||||||
@@ -45,14 +44,14 @@ public class BleedTimerTask extends BukkitRunnable {
|
|||||||
ParticleEffectUtils.playBleedEffect(entity);
|
ParticleEffectUtils.playBleedEffect(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
entry.setValue(entry.getValue() - 1);
|
entry.setValue(entry.getValue() - damage);
|
||||||
|
|
||||||
if (entry.getValue() <= 0) {
|
if (entry.getValue() <= 0) {
|
||||||
player.sendMessage(LocaleLoader.getString("Swords.Combat.Bleeding.Stopped"));
|
player.sendMessage(LocaleLoader.getString("Swords.Combat.Bleeding.Stopped"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
damage = AdvancedConfig.getInstance().getBleedDamageMobs();
|
damage = 2;
|
||||||
|
|
||||||
// Anticipate the entity's death to prevent CME because of our EntityDeathEvent listener
|
// Anticipate the entity's death to prevent CME because of our EntityDeathEvent listener
|
||||||
if (entity.getHealth() - damage > 0) {
|
if (entity.getHealth() - damage > 0) {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package com.gmail.nossr50.runnables.skills;
|
|||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Sound;
|
import org.bukkit.Sound;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.entity.LivingEntity;
|
import org.bukkit.entity.Creature;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.scheduler.BukkitRunnable;
|
import org.bukkit.scheduler.BukkitRunnable;
|
||||||
|
|
||||||
@@ -11,20 +11,20 @@ import com.gmail.nossr50.config.AdvancedConfig;
|
|||||||
import com.gmail.nossr50.util.Misc;
|
import com.gmail.nossr50.util.Misc;
|
||||||
|
|
||||||
public class KrakenAttackTask extends BukkitRunnable {
|
public class KrakenAttackTask extends BukkitRunnable {
|
||||||
private LivingEntity kraken;
|
private Creature kraken;
|
||||||
private Player player;
|
private Player player;
|
||||||
private Location location;
|
private Location location;
|
||||||
private final boolean GLOBAL_EFFECTS = AdvancedConfig.getInstance().getKrakenGlobalEffectsEnabled();
|
private final boolean GLOBAL_EFFECTS = AdvancedConfig.getInstance().getKrakenGlobalEffectsEnabled();
|
||||||
private final String DEFEAT_MESSAGE = AdvancedConfig.getInstance().getPlayerDefeatMessage();
|
private final String DEFEAT_MESSAGE = AdvancedConfig.getInstance().getPlayerDefeatMessage();
|
||||||
private final String ESCAPE_MESSAGE = AdvancedConfig.getInstance().getPlayerEscapeMessage();
|
private final String ESCAPE_MESSAGE = AdvancedConfig.getInstance().getPlayerEscapeMessage();
|
||||||
|
|
||||||
public KrakenAttackTask(LivingEntity kraken2, Player player) {
|
public KrakenAttackTask(Creature kraken, Player player) {
|
||||||
this.kraken = kraken2;
|
this.kraken = kraken;
|
||||||
this.player = player;
|
this.player = player;
|
||||||
}
|
}
|
||||||
|
|
||||||
public KrakenAttackTask(LivingEntity kraken2, Player player, Location location) {
|
public KrakenAttackTask(Creature kraken, Player player, Location location) {
|
||||||
this.kraken = kraken2;
|
this.kraken = kraken;
|
||||||
this.player = player;
|
this.player = player;
|
||||||
this.location = location;
|
this.location = location;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,10 +19,26 @@ public final class Acrobatics {
|
|||||||
|
|
||||||
private Acrobatics() {};
|
private Acrobatics() {};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Calculates how much damage should be dealt when Dodging
|
||||||
|
*
|
||||||
|
* @param damage the base damage
|
||||||
|
* @param damageModifier the damage modifier
|
||||||
|
*
|
||||||
|
* @return modified damage
|
||||||
|
*/
|
||||||
protected static double calculateModifiedDodgeDamage(double damage, double damageModifier) {
|
protected static double calculateModifiedDodgeDamage(double damage, double damageModifier) {
|
||||||
return Math.max(damage / damageModifier, 1.0);
|
return Math.max(damage / damageModifier, 1.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Calculates how much damage should be dealt when Rolling
|
||||||
|
*
|
||||||
|
* @param damage the base damage
|
||||||
|
* @param damageThreshold the damage threshold
|
||||||
|
*
|
||||||
|
* @return modified damage
|
||||||
|
*/
|
||||||
protected static double calculateModifiedRollDamage(double damage, double damageThreshold) {
|
protected static double calculateModifiedRollDamage(double damage, double damageThreshold) {
|
||||||
return Math.max(damage - damageThreshold, 0.0);
|
return Math.max(damage - damageThreshold, 0.0);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,10 +28,22 @@ public class AcrobaticsManager extends SkillManager {
|
|||||||
super(mcMMOPlayer, SkillType.ACROBATICS);
|
super(mcMMOPlayer, SkillType.ACROBATICS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if the player is allowed to use Roll,
|
||||||
|
* checks permissions and exploit prevention.
|
||||||
|
*
|
||||||
|
* @return true if the player is allowed to use Roll
|
||||||
|
*/
|
||||||
public boolean canRoll() {
|
public boolean canRoll() {
|
||||||
return !exploitPrevention() && Permissions.secondaryAbilityEnabled(getPlayer(), SecondaryAbility.ROLL);
|
return !exploitPrevention() && Permissions.secondaryAbilityEnabled(getPlayer(), SecondaryAbility.ROLL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if the player is allowed to use Dodge
|
||||||
|
*
|
||||||
|
* @param damager {@link Entity} that caused damage
|
||||||
|
* @return true if the player can Dodge damage from damager
|
||||||
|
*/
|
||||||
public boolean canDodge(Entity damager) {
|
public boolean canDodge(Entity damager) {
|
||||||
if (Permissions.secondaryAbilityEnabled(getPlayer(), SecondaryAbility.DODGE)) {
|
if (Permissions.secondaryAbilityEnabled(getPlayer(), SecondaryAbility.DODGE)) {
|
||||||
if (damager instanceof LightningStrike && Acrobatics.dodgeLightningDisabled) {
|
if (damager instanceof LightningStrike && Acrobatics.dodgeLightningDisabled) {
|
||||||
@@ -152,10 +164,23 @@ public class AcrobaticsManager extends SkillManager {
|
|||||||
return fallTries + 1 > maxTries;
|
return fallTries + 1 > maxTries;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a fall is fatal
|
||||||
|
*
|
||||||
|
* @param damage amount of damage taken from the fall
|
||||||
|
* @return true if the fall is fatal, false otherwise
|
||||||
|
*/
|
||||||
private boolean isFatal(double damage) {
|
private boolean isFatal(double damage) {
|
||||||
return getPlayer().getHealth() - damage <= 0;
|
return getPlayer().getHealth() - damage <= 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Calculate the amount of XP gained from falling
|
||||||
|
*
|
||||||
|
* @param damage amount of damage taken in the fall
|
||||||
|
* @param isRoll boolean if the player was rolling
|
||||||
|
* @return amount of XP gained
|
||||||
|
*/
|
||||||
private float calculateRollXP(double damage, boolean isRoll) {
|
private float calculateRollXP(double damage, boolean isRoll) {
|
||||||
ItemStack boots = getPlayer().getInventory().getBoots();
|
ItemStack boots = getPlayer().getInventory().getBoots();
|
||||||
float xp = (float) (damage * (isRoll ? Acrobatics.rollXpModifier : Acrobatics.fallXpModifier));
|
float xp = (float) (damage * (isRoll ? Acrobatics.rollXpModifier : Acrobatics.fallXpModifier));
|
||||||
|
|||||||
@@ -23,6 +23,12 @@ public class Archery {
|
|||||||
|
|
||||||
public static final double DISTANCE_XP_MULTIPLIER = 0.025;
|
public static final double DISTANCE_XP_MULTIPLIER = 0.025;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Increment tracked arrow count for a LivingEntity,
|
||||||
|
* if the entity isn't tracked yet it will get added to the tracker.
|
||||||
|
*
|
||||||
|
* @param livingEntity the {@link LivingEntity} to increment the arrow count for
|
||||||
|
*/
|
||||||
protected static void incrementTrackerValue(LivingEntity livingEntity) {
|
protected static void incrementTrackerValue(LivingEntity livingEntity) {
|
||||||
for (TrackedEntity trackedEntity : trackedEntities) {
|
for (TrackedEntity trackedEntity : trackedEntities) {
|
||||||
if (trackedEntity.getLivingEntity().getEntityId() == livingEntity.getEntityId()) {
|
if (trackedEntity.getLivingEntity().getEntityId() == livingEntity.getEntityId()) {
|
||||||
@@ -34,6 +40,11 @@ public class Archery {
|
|||||||
addToTracker(livingEntity); // If the entity isn't tracked yet
|
addToTracker(livingEntity); // If the entity isn't tracked yet
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add a LivingEntity to the tracker.
|
||||||
|
*
|
||||||
|
* @param livingEntity the {@link LivingEntity} to add.
|
||||||
|
*/
|
||||||
protected static void addToTracker(LivingEntity livingEntity) {
|
protected static void addToTracker(LivingEntity livingEntity) {
|
||||||
TrackedEntity trackedEntity = new TrackedEntity(livingEntity);
|
TrackedEntity trackedEntity = new TrackedEntity(livingEntity);
|
||||||
|
|
||||||
@@ -41,6 +52,11 @@ public class Archery {
|
|||||||
trackedEntities.add(trackedEntity);
|
trackedEntities.add(trackedEntity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove a TrackedEntity from the tracker.
|
||||||
|
*
|
||||||
|
* @param trackedEntity the {@link TrackedEntity} to remove.
|
||||||
|
*/
|
||||||
protected static void removeFromTracker(TrackedEntity trackedEntity) {
|
protected static void removeFromTracker(TrackedEntity trackedEntity) {
|
||||||
trackedEntities.remove(trackedEntity);
|
trackedEntities.remove(trackedEntity);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,14 +23,30 @@ public class ArcheryManager extends SkillManager {
|
|||||||
super(mcMMOPlayer, SkillType.ARCHERY);
|
super(mcMMOPlayer, SkillType.ARCHERY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if the target can be dazed. Checks if target is valid and if the player has sufficient permissions.
|
||||||
|
*
|
||||||
|
* @param target the {@link LivingEntity} object of the target to check
|
||||||
|
* @return true if the target can be dazed, false otherwise
|
||||||
|
*/
|
||||||
public boolean canDaze(LivingEntity target) {
|
public boolean canDaze(LivingEntity target) {
|
||||||
return target instanceof Player && Permissions.secondaryAbilityEnabled(getPlayer(), SecondaryAbility.DAZE);
|
return target instanceof Player && Permissions.secondaryAbilityEnabled(getPlayer(), SecondaryAbility.DAZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if the player can use SkillShot.
|
||||||
|
*
|
||||||
|
* @return true if the player can use SkillShot, false otherwise
|
||||||
|
*/
|
||||||
public boolean canSkillShot() {
|
public boolean canSkillShot() {
|
||||||
return getSkillLevel() >= Archery.skillShotIncreaseLevel && Permissions.secondaryAbilityEnabled(getPlayer(), SecondaryAbility.SKILL_SHOT);
|
return getSkillLevel() >= Archery.skillShotIncreaseLevel && Permissions.secondaryAbilityEnabled(getPlayer(), SecondaryAbility.SKILL_SHOT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if the player can use RetrieveArrows.
|
||||||
|
*
|
||||||
|
* @return true if the player can use RetrieveArrows, false otherwise
|
||||||
|
*/
|
||||||
public boolean canRetrieveArrows() {
|
public boolean canRetrieveArrows() {
|
||||||
return Permissions.secondaryAbilityEnabled(getPlayer(), SecondaryAbility.RETRIEVE);
|
return Permissions.secondaryAbilityEnabled(getPlayer(), SecondaryAbility.RETRIEVE);
|
||||||
}
|
}
|
||||||
@@ -67,6 +83,8 @@ public class ArcheryManager extends SkillManager {
|
|||||||
* Handle the effects of the Daze ability
|
* Handle the effects of the Daze ability
|
||||||
*
|
*
|
||||||
* @param defender The {@link Player} being affected by the ability
|
* @param defender The {@link Player} being affected by the ability
|
||||||
|
*
|
||||||
|
* @return amount of damage from Daze
|
||||||
*/
|
*/
|
||||||
public double daze(Player defender) {
|
public double daze(Player defender) {
|
||||||
if (!SkillUtils.activationSuccessful(SecondaryAbility.DAZE, getPlayer(), getSkillLevel(), activationChance)) {
|
if (!SkillUtils.activationSuccessful(SecondaryAbility.DAZE, getPlayer(), getSkillLevel(), activationChance)) {
|
||||||
@@ -94,6 +112,7 @@ public class ArcheryManager extends SkillManager {
|
|||||||
* Handle the effects of the Skill Shot ability
|
* Handle the effects of the Skill Shot ability
|
||||||
*
|
*
|
||||||
* @param damage The amount of damage initially dealt by the event
|
* @param damage The amount of damage initially dealt by the event
|
||||||
|
* @return amount of damage from Skill Shot
|
||||||
*/
|
*/
|
||||||
public double skillShot(double damage) {
|
public double skillShot(double damage) {
|
||||||
if (!SkillUtils.activationSuccessful(SecondaryAbility.SKILL_SHOT, getPlayer())) {
|
if (!SkillUtils.activationSuccessful(SecondaryAbility.SKILL_SHOT, getPlayer())) {
|
||||||
|
|||||||
@@ -23,6 +23,12 @@ public class Axes {
|
|||||||
|
|
||||||
public static double skullSplitterModifier = AdvancedConfig.getInstance().getSkullSplitterModifier();
|
public static double skullSplitterModifier = AdvancedConfig.getInstance().getSkullSplitterModifier();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if the target is wearing any armor.
|
||||||
|
*
|
||||||
|
* @param target the {@link LivingEntity} object of the target to check.
|
||||||
|
* @return true if the target is wearing at least one piece of armor, false otherwise
|
||||||
|
*/
|
||||||
protected static boolean hasArmor(LivingEntity target) {
|
protected static boolean hasArmor(LivingEntity target) {
|
||||||
for (ItemStack itemStack : target.getEquipment().getArmorContents()) {
|
for (ItemStack itemStack : target.getEquipment().getArmorContents()) {
|
||||||
if (ItemUtils.isArmor(itemStack)) {
|
if (ItemUtils.isArmor(itemStack)) {
|
||||||
|
|||||||
@@ -110,9 +110,6 @@ public final class Fishing {
|
|||||||
case PIG_ZOMBIE:
|
case PIG_ZOMBIE:
|
||||||
return TreasureConfig.getInstance().shakeFromPigZombie;
|
return TreasureConfig.getInstance().shakeFromPigZombie;
|
||||||
|
|
||||||
case PLAYER:
|
|
||||||
return TreasureConfig.getInstance().shakeFromPlayer;
|
|
||||||
|
|
||||||
case SHEEP:
|
case SHEEP:
|
||||||
return TreasureConfig.getInstance().shakeFromSheep;
|
return TreasureConfig.getInstance().shakeFromSheep;
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import org.bukkit.World;
|
|||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.block.BlockFace;
|
import org.bukkit.block.BlockFace;
|
||||||
import org.bukkit.enchantments.Enchantment;
|
import org.bukkit.enchantments.Enchantment;
|
||||||
|
import org.bukkit.entity.Creature;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.EntityType;
|
import org.bukkit.entity.EntityType;
|
||||||
import org.bukkit.entity.Fish;
|
import org.bukkit.entity.Fish;
|
||||||
@@ -28,8 +29,6 @@ import org.bukkit.entity.TNTPrimed;
|
|||||||
import org.bukkit.entity.ThrownPotion;
|
import org.bukkit.entity.ThrownPotion;
|
||||||
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
|
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.inventory.PlayerInventory;
|
|
||||||
import org.bukkit.inventory.meta.SkullMeta;
|
|
||||||
import org.bukkit.material.Wool;
|
import org.bukkit.material.Wool;
|
||||||
import org.bukkit.potion.Potion;
|
import org.bukkit.potion.Potion;
|
||||||
import org.bukkit.potion.PotionType;
|
import org.bukkit.potion.PotionType;
|
||||||
@@ -136,7 +135,7 @@ public class FishingManager extends SkillManager {
|
|||||||
player.setItemInHand(null);
|
player.setItemInHand(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
LivingEntity kraken = (LivingEntity) world.spawnEntity(player.getEyeLocation(), (Misc.getRandom().nextInt(100) == 0 ? EntityType.CHICKEN : EntityType.SQUID));
|
Creature kraken = (Creature) world.spawnEntity(player.getEyeLocation(), (Misc.getRandom().nextInt(100) == 0 ? EntityType.CHICKEN : EntityType.SQUID));
|
||||||
kraken.setCustomName(AdvancedConfig.getInstance().getKrakenName());
|
kraken.setCustomName(AdvancedConfig.getInstance().getKrakenName());
|
||||||
|
|
||||||
if (!kraken.isValid()) {
|
if (!kraken.isValid()) {
|
||||||
@@ -395,45 +394,6 @@ public class FishingManager extends SkillManager {
|
|||||||
|
|
||||||
// Extra processing depending on the mob and drop type
|
// Extra processing depending on the mob and drop type
|
||||||
switch (target.getType()) {
|
switch (target.getType()) {
|
||||||
case PLAYER:
|
|
||||||
Player targetPlayer = (Player) target;
|
|
||||||
|
|
||||||
switch (drop.getType()) {
|
|
||||||
case SKULL_ITEM:
|
|
||||||
drop.setDurability((short) 3);
|
|
||||||
SkullMeta skullMeta = (SkullMeta) drop.getItemMeta();
|
|
||||||
skullMeta.setOwner(targetPlayer.getName());
|
|
||||||
drop.setItemMeta(skullMeta);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case BED_BLOCK:
|
|
||||||
if (TreasureConfig.getInstance().getInventoryStealEnabled()) {
|
|
||||||
PlayerInventory inventory = targetPlayer.getInventory();
|
|
||||||
int length = inventory.getContents().length;
|
|
||||||
int slot = Misc.getRandom().nextInt(length);
|
|
||||||
drop = inventory.getItem(slot);
|
|
||||||
|
|
||||||
if (drop == null) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (TreasureConfig.getInstance().getInventoryStealStacks()) {
|
|
||||||
inventory.setItem(slot, null);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
inventory.setItem(slot, (drop.getAmount() > 1) ? new ItemStack(drop.getType(), drop.getAmount() - 1) : null);
|
|
||||||
drop.setAmount(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
targetPlayer.updateInventory();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case SHEEP:
|
case SHEEP:
|
||||||
Sheep sheep = (Sheep) target;
|
Sheep sheep = (Sheep) target;
|
||||||
|
|
||||||
@@ -477,7 +437,7 @@ public class FishingManager extends SkillManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Misc.dropItem(target.getLocation(), drop);
|
Misc.dropItem(target.getLocation(), drop);
|
||||||
CombatUtils.dealDamage(target, Math.max(target.getMaxHealth() / 4, 1), getPlayer()); // Make it so you can shake a mob no more than 4 times.
|
CombatUtils.dealDamage(target, Math.max(target.getMaxHealth() / 4, 1)); // Make it so you can shake a mob no more than 4 times.
|
||||||
applyXpGain(ExperienceConfig.getInstance().getFishingShakeXP(), XPGainReason.PVE);
|
applyXpGain(ExperienceConfig.getInstance().getFishingShakeXP(), XPGainReason.PVE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ public class Mining {
|
|||||||
*
|
*
|
||||||
* @param blockState The {@link BlockState} to check ability activation for
|
* @param blockState The {@link BlockState} to check ability activation for
|
||||||
*/
|
*/
|
||||||
public static int getBlockXp(BlockState blockState) {
|
protected static int getBlockXp(BlockState blockState) {
|
||||||
Material blockType = blockState.getType();
|
Material blockType = blockState.getType();
|
||||||
int xp = ExperienceConfig.getInstance().getXp(SkillType.MINING, blockType != Material.GLOWING_REDSTONE_ORE ? blockType : Material.REDSTONE_ORE);
|
int xp = ExperienceConfig.getInstance().getXp(SkillType.MINING, blockType != Material.GLOWING_REDSTONE_ORE ? blockType : Material.REDSTONE_ORE);
|
||||||
|
|
||||||
|
|||||||
@@ -159,6 +159,9 @@ public class RepairManager extends SkillManager {
|
|||||||
/**
|
/**
|
||||||
* Check if the player has tried to use an Anvil before.
|
* Check if the player has tried to use an Anvil before.
|
||||||
*
|
*
|
||||||
|
* @param anvilType The {@link Material} of the anvil block
|
||||||
|
* @param actualize determines if last anvil use should be actualized
|
||||||
|
*
|
||||||
* @return true if the player has confirmed using an Anvil
|
* @return true if the player has confirmed using an Anvil
|
||||||
*/
|
*/
|
||||||
public boolean checkConfirmation(boolean actualize) {
|
public boolean checkConfirmation(boolean actualize) {
|
||||||
@@ -273,7 +276,7 @@ public class RepairManager extends SkillManager {
|
|||||||
/**
|
/**
|
||||||
* Handles removing & downgrading enchants.
|
* Handles removing & downgrading enchants.
|
||||||
*
|
*
|
||||||
* @param item Item being repaired
|
* @param item {@link ItemStack} being repaired
|
||||||
*/
|
*/
|
||||||
private void addEnchants(ItemStack item) {
|
private void addEnchants(ItemStack item) {
|
||||||
Player player = getPlayer();
|
Player player = getPlayer();
|
||||||
|
|||||||
@@ -1,20 +1,12 @@
|
|||||||
package com.gmail.nossr50.skills.smelting;
|
package com.gmail.nossr50.skills.smelting;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.bukkit.ChatColor;
|
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.Sound;
|
|
||||||
import org.bukkit.block.BlockState;
|
import org.bukkit.block.BlockState;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.inventory.FurnaceBurnEvent;
|
import org.bukkit.event.inventory.FurnaceBurnEvent;
|
||||||
import org.bukkit.inventory.FurnaceRecipe;
|
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.inventory.meta.ItemMeta;
|
|
||||||
|
|
||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.mcMMO;
|
||||||
import com.gmail.nossr50.config.Config;
|
|
||||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||||
import com.gmail.nossr50.datatypes.skills.SecondaryAbility;
|
import com.gmail.nossr50.datatypes.skills.SecondaryAbility;
|
||||||
import com.gmail.nossr50.datatypes.skills.SkillType;
|
import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||||
@@ -22,12 +14,10 @@ import com.gmail.nossr50.datatypes.skills.XPGainReason;
|
|||||||
import com.gmail.nossr50.events.skills.secondaryabilities.SecondaryAbilityWeightedActivationCheckEvent;
|
import com.gmail.nossr50.events.skills.secondaryabilities.SecondaryAbilityWeightedActivationCheckEvent;
|
||||||
import com.gmail.nossr50.locale.LocaleLoader;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
import com.gmail.nossr50.skills.SkillManager;
|
import com.gmail.nossr50.skills.SkillManager;
|
||||||
import com.gmail.nossr50.skills.mining.Mining;
|
|
||||||
import com.gmail.nossr50.skills.smelting.Smelting.Tier;
|
import com.gmail.nossr50.skills.smelting.Smelting.Tier;
|
||||||
import com.gmail.nossr50.util.BlockUtils;
|
import com.gmail.nossr50.util.BlockUtils;
|
||||||
import com.gmail.nossr50.util.Misc;
|
import com.gmail.nossr50.util.Misc;
|
||||||
import com.gmail.nossr50.util.Permissions;
|
import com.gmail.nossr50.util.Permissions;
|
||||||
import com.gmail.nossr50.util.skills.ParticleEffectUtils;
|
|
||||||
import com.gmail.nossr50.util.skills.SkillUtils;
|
import com.gmail.nossr50.util.skills.SkillUtils;
|
||||||
|
|
||||||
public class SmeltingManager extends SkillManager {
|
public class SmeltingManager extends SkillManager {
|
||||||
@@ -74,46 +64,16 @@ public class SmeltingManager extends SkillManager {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// We need to distribute Mining XP here, because the block break event gets cancelled
|
|
||||||
applyXpGain(Mining.getBlockXp(blockState), XPGainReason.PVE);
|
|
||||||
|
|
||||||
SkillUtils.handleDurabilityChange(getPlayer().getItemInHand(), Config.getInstance().getAbilityToolDamage());
|
|
||||||
|
|
||||||
Misc.dropItems(blockState.getLocation(), item, isSecondSmeltSuccessful() ? 2 : 1);
|
Misc.dropItems(blockState.getLocation(), item, isSecondSmeltSuccessful() ? 2 : 1);
|
||||||
|
|
||||||
blockState.setType(Material.AIR);
|
blockState.setType(Material.AIR);
|
||||||
|
player.sendMessage(LocaleLoader.getString("Smelting.FluxMining.Success"));
|
||||||
if (Config.getInstance().getFluxPickaxeSoundEnabled()) {
|
|
||||||
player.playSound(blockState.getLocation(), Sound.FIZZ, Misc.FIZZ_VOLUME, Misc.getFizzPitch());
|
|
||||||
}
|
|
||||||
|
|
||||||
ParticleEffectUtils.playFluxEffect(blockState.getLocation());
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ItemStack getFluxPickaxe(Material material, int amount) {
|
|
||||||
ItemStack itemStack = new ItemStack(material, amount);
|
|
||||||
|
|
||||||
ItemMeta itemMeta = itemStack.getItemMeta();
|
|
||||||
itemMeta.setDisplayName(ChatColor.GOLD + LocaleLoader.getString("Item.FluxPickaxe.Name"));
|
|
||||||
|
|
||||||
List<String> itemLore = new ArrayList<String>();
|
|
||||||
itemLore.add("mcMMO Item");
|
|
||||||
itemLore.add(LocaleLoader.getString("Item.FluxPickaxe.Lore.1"));
|
|
||||||
itemLore.add(LocaleLoader.getString("Item.FluxPickaxe.Lore.2", Smelting.fluxMiningUnlockLevel));
|
|
||||||
itemMeta.setLore(itemLore);
|
|
||||||
|
|
||||||
itemStack.setItemMeta(itemMeta);
|
|
||||||
return itemStack;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static FurnaceRecipe getFluxPickaxeRecipe(Material material) {
|
|
||||||
return new FurnaceRecipe(getFluxPickaxe(material, 1), material);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Increases burn time for furnace fuel.
|
* Increases burn time for furnace fuel.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ public class SwordsManager extends SkillManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (SkillUtils.activationSuccessful(SecondaryAbility.COUNTER, getPlayer(), getSkillLevel(), activationChance)) {
|
if (SkillUtils.activationSuccessful(SecondaryAbility.COUNTER, getPlayer(), getSkillLevel(), activationChance)) {
|
||||||
CombatUtils.dealDamage(attacker, damage / Swords.counterAttackModifier, getPlayer());
|
CombatUtils.dealDamage(attacker, damage / Swords.counterAttackModifier);
|
||||||
|
|
||||||
getPlayer().sendMessage(LocaleLoader.getString("Swords.Combat.Countered"));
|
getPlayer().sendMessage(LocaleLoader.getString("Swords.Combat.Countered"));
|
||||||
|
|
||||||
|
|||||||
@@ -30,8 +30,6 @@ public class Taming {
|
|||||||
public static int thickFurUnlockLevel = AdvancedConfig.getInstance().getThickFurUnlock();
|
public static int thickFurUnlockLevel = AdvancedConfig.getInstance().getThickFurUnlock();
|
||||||
public static double thickFurModifier = AdvancedConfig.getInstance().getThickFurModifier();
|
public static double thickFurModifier = AdvancedConfig.getInstance().getThickFurModifier();
|
||||||
|
|
||||||
public static double wolfCommandRange = 10.0;
|
|
||||||
|
|
||||||
public static int wolfXp = ExperienceConfig.getInstance().getTamingXPWolf();
|
public static int wolfXp = ExperienceConfig.getInstance().getTamingXPWolf();
|
||||||
public static int ocelotXp = ExperienceConfig.getInstance().getTamingXPOcelot();
|
public static int ocelotXp = ExperienceConfig.getInstance().getTamingXPOcelot();
|
||||||
public static int horseXp = ExperienceConfig.getInstance().getTamingXPHorse();
|
public static int horseXp = ExperienceConfig.getInstance().getTamingXPHorse();
|
||||||
|
|||||||
@@ -15,8 +15,6 @@ import org.bukkit.entity.Player;
|
|||||||
import org.bukkit.entity.Tameable;
|
import org.bukkit.entity.Tameable;
|
||||||
import org.bukkit.entity.Wolf;
|
import org.bukkit.entity.Wolf;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.potion.PotionEffect;
|
|
||||||
import org.bukkit.potion.PotionEffectType;
|
|
||||||
|
|
||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.mcMMO;
|
||||||
import com.gmail.nossr50.config.AdvancedConfig;
|
import com.gmail.nossr50.config.AdvancedConfig;
|
||||||
@@ -210,81 +208,6 @@ public class TamingManager extends SkillManager {
|
|||||||
owner.sendMessage(LocaleLoader.getString("Taming.Listener.Wolf"));
|
owner.sendMessage(LocaleLoader.getString("Taming.Listener.Wolf"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void handleCharge(LivingEntity livingEntity) {
|
|
||||||
attackTarget(livingEntity, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
public LivingEntity getTarget(double range) {
|
|
||||||
Player player = getPlayer();
|
|
||||||
LivingEntity target = null;
|
|
||||||
|
|
||||||
for (Entity entity : player.getNearbyEntities(range, range, range)) {
|
|
||||||
if (!(entity instanceof LivingEntity) || entity.getType() == EntityType.WOLF || entity.getType() == EntityType.CREEPER || entity.equals(player)) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!player.hasLineOfSight(entity)) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
target = (LivingEntity) entity;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return target;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Make nearby wolves owned by the player attack the target
|
|
||||||
*
|
|
||||||
* @param target The LivingEntity to attack
|
|
||||||
*
|
|
||||||
* @return true if the attack was successful, false otherwise
|
|
||||||
*/
|
|
||||||
public boolean attackTarget(LivingEntity target, boolean charge) {
|
|
||||||
boolean success = false;
|
|
||||||
|
|
||||||
for (Entity entity : getNearbyEntities(EntityType.WOLF, Taming.wolfCommandRange, true)) {
|
|
||||||
Wolf wolf = (Wolf) entity;
|
|
||||||
|
|
||||||
if (charge) {
|
|
||||||
charge(wolf);
|
|
||||||
}
|
|
||||||
|
|
||||||
wolf.setTarget(target);
|
|
||||||
success = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return success;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean attackTarget(LivingEntity target) {
|
|
||||||
return attackTarget(target, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void charge(Wolf wolf) {
|
|
||||||
int duration = 0;
|
|
||||||
int amplifier = 0;
|
|
||||||
|
|
||||||
if (wolf.hasPotionEffect(PotionEffectType.SPEED)) {
|
|
||||||
for (PotionEffect effect : wolf.getActivePotionEffects()) {
|
|
||||||
if (effect.getType() != PotionEffectType.SPEED) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
duration = effect.getDuration();
|
|
||||||
amplifier = effect.getAmplifier();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int ticks = 20 * 5;
|
|
||||||
|
|
||||||
PotionEffect abilityBuff = new PotionEffect(PotionEffectType.SPEED, duration + ticks, amplifier + 3);
|
|
||||||
wolf.addPotionEffect(abilityBuff, true);
|
|
||||||
ParticleEffectUtils.playSmokeEffect(wolf);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void pummel(LivingEntity target, Wolf wolf) {
|
public void pummel(LivingEntity target, Wolf wolf) {
|
||||||
double chance = 10 / activationChance;
|
double chance = 10 / activationChance;
|
||||||
SecondaryAbilityWeightedActivationCheckEvent event = new SecondaryAbilityWeightedActivationCheckEvent(getPlayer(), SecondaryAbility.PUMMEL, chance);
|
SecondaryAbilityWeightedActivationCheckEvent event = new SecondaryAbilityWeightedActivationCheckEvent(getPlayer(), SecondaryAbility.PUMMEL, chance);
|
||||||
@@ -305,6 +228,25 @@ public class TamingManager extends SkillManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void attackTarget(LivingEntity target) {
|
||||||
|
double range = 5;
|
||||||
|
Player player = getPlayer();
|
||||||
|
|
||||||
|
for (Entity entity : player.getNearbyEntities(range, range, range)) {
|
||||||
|
if (entity.getType() != EntityType.WOLF) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
Wolf wolf = (Wolf) entity;
|
||||||
|
|
||||||
|
if (!wolf.isTamed() || (wolf.getOwner() != player) || wolf.isSitting()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
wolf.setTarget(target);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handle the Call of the Wild ability.
|
* Handle the Call of the Wild ability.
|
||||||
*
|
*
|
||||||
@@ -323,8 +265,7 @@ public class TamingManager extends SkillManager {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isEntityTypeNearby(type)) {
|
if (!rangeCheck(type)) {
|
||||||
player.sendMessage(Taming.getCallOfTheWildFailureMessage(type));
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -336,7 +277,6 @@ public class TamingManager extends SkillManager {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
location = Misc.getLocationOffset(location, 1);
|
|
||||||
LivingEntity entity = (LivingEntity) player.getWorld().spawnEntity(location, type);
|
LivingEntity entity = (LivingEntity) player.getWorld().spawnEntity(location, type);
|
||||||
|
|
||||||
FakeEntityTameEvent event = new FakeEntityTameEvent(entity, player);
|
FakeEntityTameEvent event = new FakeEntityTameEvent(entity, player);
|
||||||
@@ -395,41 +335,22 @@ public class TamingManager extends SkillManager {
|
|||||||
player.playSound(location, Sound.FIREWORK_LARGE_BLAST2, 1F, 0.5F);
|
player.playSound(location, Sound.FIREWORK_LARGE_BLAST2, 1F, 0.5F);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Entity> getNearbyEntities(EntityType type, double range, boolean wolfReady) {
|
private boolean rangeCheck(EntityType type) {
|
||||||
List<Entity> nearbyEntities = new ArrayList<Entity>();
|
double range = Config.getInstance().getTamingCOTWRange();
|
||||||
Player player = getPlayer();
|
Player player = getPlayer();
|
||||||
|
|
||||||
if (range == 0) {
|
if (range == 0) {
|
||||||
return nearbyEntities;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (Entity entity : player.getNearbyEntities(range, range, range)) {
|
for (Entity entity : player.getNearbyEntities(range, range, range)) {
|
||||||
EntityType entityType = entity.getType();
|
if (entity.getType() == type) {
|
||||||
|
player.sendMessage(Taming.getCallOfTheWildFailureMessage(type));
|
||||||
if (entityType != type) {
|
return false;
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (entityType == EntityType.WOLF && wolfReady) {
|
|
||||||
Wolf wolf = (Wolf) entity;
|
|
||||||
|
|
||||||
if (!wolf.isTamed() || (wolf.getOwner() != player) || wolf.isSitting()) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
nearbyEntities.add(entity);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return nearbyEntities;
|
return true;
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isEntityTypeNearby(EntityType type) {
|
|
||||||
return isEntityTypeNearby(type, Config.getInstance().getTamingCOTWRange(), false);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isEntityTypeNearby(EntityType type, double range, boolean wolfReady) {
|
|
||||||
return !getNearbyEntities(type, range, wolfReady).isEmpty();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean summonAmountCheck(EntityType entityType) {
|
private boolean summonAmountCheck(EntityType entityType) {
|
||||||
|
|||||||
@@ -4,13 +4,18 @@ import java.util.UUID;
|
|||||||
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Sound;
|
import org.bukkit.Sound;
|
||||||
|
import org.bukkit.entity.AnimalTamer;
|
||||||
import org.bukkit.entity.LivingEntity;
|
import org.bukkit.entity.LivingEntity;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.entity.Tameable;
|
||||||
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
||||||
import org.bukkit.scheduler.BukkitRunnable;
|
import org.bukkit.scheduler.BukkitRunnable;
|
||||||
|
|
||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.mcMMO;
|
||||||
import com.gmail.nossr50.config.Config;
|
import com.gmail.nossr50.config.Config;
|
||||||
|
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||||
import com.gmail.nossr50.util.Misc;
|
import com.gmail.nossr50.util.Misc;
|
||||||
|
import com.gmail.nossr50.util.player.UserManager;
|
||||||
import com.gmail.nossr50.util.skills.CombatUtils;
|
import com.gmail.nossr50.util.skills.CombatUtils;
|
||||||
import com.gmail.nossr50.util.skills.ParticleEffectUtils;
|
import com.gmail.nossr50.util.skills.ParticleEffectUtils;
|
||||||
|
|
||||||
@@ -18,11 +23,18 @@ public class TrackedTamingEntity extends BukkitRunnable {
|
|||||||
private LivingEntity livingEntity;
|
private LivingEntity livingEntity;
|
||||||
private UUID id;
|
private UUID id;
|
||||||
private int length;
|
private int length;
|
||||||
|
private Player owner;
|
||||||
|
|
||||||
protected TrackedTamingEntity(LivingEntity livingEntity) {
|
protected TrackedTamingEntity(LivingEntity livingEntity) {
|
||||||
this.livingEntity = livingEntity;
|
this.livingEntity = livingEntity;
|
||||||
this.id = livingEntity.getUniqueId();
|
this.id = livingEntity.getUniqueId();
|
||||||
|
|
||||||
|
AnimalTamer tamer = ((Tameable)livingEntity).getOwner();
|
||||||
|
|
||||||
|
if (tamer != null && tamer instanceof Player) {
|
||||||
|
this.owner = (Player) tamer;
|
||||||
|
}
|
||||||
|
|
||||||
int tamingCOTWLength = Config.getInstance().getTamingCOTWLength(livingEntity.getType());
|
int tamingCOTWLength = Config.getInstance().getTamingCOTWLength(livingEntity.getType());
|
||||||
|
|
||||||
if (tamingCOTWLength > 0) {
|
if (tamingCOTWLength > 0) {
|
||||||
@@ -40,7 +52,10 @@ public class TrackedTamingEntity extends BukkitRunnable {
|
|||||||
CombatUtils.dealDamage(livingEntity, livingEntity.getMaxHealth(), DamageCause.SUICIDE, livingEntity);
|
CombatUtils.dealDamage(livingEntity, livingEntity.getMaxHealth(), DamageCause.SUICIDE, livingEntity);
|
||||||
}
|
}
|
||||||
|
|
||||||
TamingManager.removeFromTracker(this);
|
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(owner);
|
||||||
|
TamingManager tamingManager = mcMMOPlayer.getTamingManager();
|
||||||
|
|
||||||
|
tamingManager.removeFromTracker(this);
|
||||||
this.cancel();
|
this.cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ import org.bukkit.material.SmoothBrick;
|
|||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.mcMMO;
|
||||||
import com.gmail.nossr50.skills.repair.Repair;
|
import com.gmail.nossr50.skills.repair.Repair;
|
||||||
import com.gmail.nossr50.skills.salvage.Salvage;
|
import com.gmail.nossr50.skills.salvage.Salvage;
|
||||||
import com.gmail.nossr50.util.temp.DualSupport;
|
|
||||||
|
|
||||||
public final class BlockUtils {
|
public final class BlockUtils {
|
||||||
private BlockUtils() {}
|
private BlockUtils() {}
|
||||||
@@ -64,11 +63,10 @@ public final class BlockUtils {
|
|||||||
case DROPPER:
|
case DROPPER:
|
||||||
case HOPPER:
|
case HOPPER:
|
||||||
case TRAPPED_CHEST:
|
case TRAPPED_CHEST:
|
||||||
case IRON_DOOR:
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return DualSupport.canActivateAbilities(blockState) && !isMcMMOAnvil(blockState) && !mcMMO.getModManager().isCustomAbilityBlock(blockState);
|
return !isMcMMOAnvil(blockState) && !mcMMO.getModManager().isCustomAbilityBlock(blockState);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -166,7 +164,7 @@ public final class BlockUtils {
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return DualSupport.affectedBySuperBreaker(blockState) || isOre(blockState) || mcMMO.getModManager().isCustomMiningBlock(blockState);
|
return isOre(blockState) || mcMMO.getModManager().isCustomMiningBlock(blockState);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -117,7 +117,7 @@ public final class ChimaeraWing {
|
|||||||
public static void chimaeraExecuteTeleport() {
|
public static void chimaeraExecuteTeleport() {
|
||||||
Player player = mcMMOPlayer.getPlayer();
|
Player player = mcMMOPlayer.getPlayer();
|
||||||
|
|
||||||
if (Config.getInstance().getChimaeraUseBedSpawn() && player.getBedSpawnLocation() != null) {
|
if (player.getBedSpawnLocation() != null) {
|
||||||
player.teleport(player.getBedSpawnLocation());
|
player.teleport(player.getBedSpawnLocation());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
@@ -34,8 +34,6 @@ public final class HardcoreManager {
|
|||||||
int playerSkillXpLevel = playerProfile.getSkillXpLevel(skillType);
|
int playerSkillXpLevel = playerProfile.getSkillXpLevel(skillType);
|
||||||
|
|
||||||
if (playerSkillLevel <= 0 || playerSkillLevel <= levelThreshold) {
|
if (playerSkillLevel <= 0 || playerSkillLevel <= levelThreshold) {
|
||||||
levelChanged.put(skillType.toString(), 0);
|
|
||||||
experienceChanged.put(skillType.toString(), 0F);
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -77,8 +75,6 @@ public final class HardcoreManager {
|
|||||||
int victimSkillLevel = victimProfile.getSkillLevel(skillType);
|
int victimSkillLevel = victimProfile.getSkillLevel(skillType);
|
||||||
|
|
||||||
if (victimSkillLevel <= 0 || victimSkillLevel < killerSkillLevel / 2 || victimSkillLevel <= levelThreshold) {
|
if (victimSkillLevel <= 0 || victimSkillLevel < killerSkillLevel / 2 || victimSkillLevel <= levelThreshold) {
|
||||||
levelChanged.put(skillType.toString(), 0);
|
|
||||||
experienceChanged.put(skillType.toString(), 0F);
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -694,13 +694,4 @@ public final class ItemUtils {
|
|||||||
ItemMeta itemMeta = item.getItemMeta();
|
ItemMeta itemMeta = item.getItemMeta();
|
||||||
return itemMeta.hasDisplayName() && itemMeta.getDisplayName().equals(ChatColor.GOLD + LocaleLoader.getString("Item.ChimaeraWing.Name"));
|
return itemMeta.hasDisplayName() && itemMeta.getDisplayName().equals(ChatColor.GOLD + LocaleLoader.getString("Item.ChimaeraWing.Name"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isFluxPickaxe(ItemStack item) {
|
|
||||||
if (!isMcMMOItem(item)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
ItemMeta itemMeta = item.getItemMeta();
|
|
||||||
return itemMeta.hasDisplayName() && itemMeta.getDisplayName().equals(ChatColor.GOLD + LocaleLoader.getString("Item.FluxPickaxe.Name"));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ public final class MaterialUtils {
|
|||||||
case REDSTONE_ORE:
|
case REDSTONE_ORE:
|
||||||
case EMERALD_ORE:
|
case EMERALD_ORE:
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return mcMMO.getModManager().isCustomOre(data);
|
return mcMMO.getModManager().isCustomOre(data);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -144,23 +144,6 @@ public final class Misc {
|
|||||||
return "UnknownMods";
|
return "UnknownMods";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets a random location near the specified location
|
|
||||||
*/
|
|
||||||
public static Location getLocationOffset(Location location, double strength) {
|
|
||||||
double blockX = location.getBlockX();
|
|
||||||
double blockZ = location.getBlockZ();
|
|
||||||
|
|
||||||
double distance;
|
|
||||||
distance = strength * random.nextDouble();
|
|
||||||
blockX = (random.nextBoolean()) ? blockX + (distance) : blockX - (distance);
|
|
||||||
|
|
||||||
distance = strength * random.nextDouble();
|
|
||||||
blockZ = (random.nextBoolean()) ? blockZ + (distance) : blockZ - (distance);
|
|
||||||
|
|
||||||
return new Location(location.getWorld(), blockX, location.getY(), blockZ);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Random getRandom() {
|
public static Random getRandom() {
|
||||||
return random;
|
return random;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -182,7 +182,6 @@ public final class Permissions {
|
|||||||
public static boolean serratedStrikes(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.swords.serratedstrikes"); }
|
public static boolean serratedStrikes(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.swords.serratedstrikes"); }
|
||||||
|
|
||||||
/* TAMING */
|
/* TAMING */
|
||||||
public static boolean charge(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.taming.charge"); }
|
|
||||||
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()); }
|
||||||
public static boolean renamePets(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.taming.callofthewild.renamepets"); }
|
public static boolean renamePets(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.taming.callofthewild.renamepets"); }
|
||||||
|
|
||||||
|
|||||||
@@ -199,13 +199,6 @@ public class ScoreboardWrapper {
|
|||||||
|
|
||||||
// TODO is there any way to do the time that looks acceptable?
|
// 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()), ticks / 20F));
|
||||||
|
|
||||||
PlayerProfile profile = UserManager.getPlayer(player).getProfile();
|
|
||||||
|
|
||||||
if (profile.getScoreboardTipsShown() >= Config.getInstance().getTipsAmount()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!tippedKeep) {
|
if (!tippedKeep) {
|
||||||
tippedKeep = true;
|
tippedKeep = true;
|
||||||
player.sendMessage(LocaleLoader.getString("Commands.Scoreboard.Tip.Keep"));
|
player.sendMessage(LocaleLoader.getString("Commands.Scoreboard.Tip.Keep"));
|
||||||
@@ -213,7 +206,6 @@ public class ScoreboardWrapper {
|
|||||||
else if (!tippedClear) {
|
else if (!tippedClear) {
|
||||||
tippedClear = true;
|
tippedClear = true;
|
||||||
player.sendMessage(LocaleLoader.getString("Commands.Scoreboard.Tip.Clear"));
|
player.sendMessage(LocaleLoader.getString("Commands.Scoreboard.Tip.Clear"));
|
||||||
profile.increaseTipsShown();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import org.bukkit.entity.Animals;
|
|||||||
import org.bukkit.entity.Arrow;
|
import org.bukkit.entity.Arrow;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.EntityType;
|
import org.bukkit.entity.EntityType;
|
||||||
import org.bukkit.entity.Guardian;
|
|
||||||
import org.bukkit.entity.IronGolem;
|
import org.bukkit.entity.IronGolem;
|
||||||
import org.bukkit.entity.LivingEntity;
|
import org.bukkit.entity.LivingEntity;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@@ -48,7 +47,7 @@ import com.gmail.nossr50.util.Misc;
|
|||||||
import com.gmail.nossr50.util.MobHealthbarUtils;
|
import com.gmail.nossr50.util.MobHealthbarUtils;
|
||||||
import com.gmail.nossr50.util.Permissions;
|
import com.gmail.nossr50.util.Permissions;
|
||||||
import com.gmail.nossr50.util.player.UserManager;
|
import com.gmail.nossr50.util.player.UserManager;
|
||||||
import com.gmail.nossr50.util.temp.CompatableGuardianXP;
|
|
||||||
import com.google.common.collect.ImmutableMap;
|
import com.google.common.collect.ImmutableMap;
|
||||||
|
|
||||||
public final class CombatUtils {
|
public final class CombatUtils {
|
||||||
@@ -485,7 +484,6 @@ public final class CombatUtils {
|
|||||||
case WITCH:
|
case WITCH:
|
||||||
case WITHER:
|
case WITHER:
|
||||||
case ZOMBIE:
|
case ZOMBIE:
|
||||||
case ENDERMITE:
|
|
||||||
baseXP = ExperienceConfig.getInstance().getCombatXP(type);
|
baseXP = ExperienceConfig.getInstance().getCombatXP(type);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -507,18 +505,6 @@ public final class CombatUtils {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
if (type.name().equals("RABBIT")) {
|
|
||||||
baseXP = ExperienceConfig.getInstance().getAnimalsXP();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (type.name().equals("ENDERMITE")) {
|
|
||||||
baseXP = ExperienceConfig.getInstance().getCombatXP(type);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (type.name().equals("GUARDIAN")) {
|
|
||||||
baseXP = CompatableGuardianXP.get(target);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
baseXP = 1.0;
|
baseXP = 1.0;
|
||||||
mcMMO.getModManager().addCustomEntity(target);
|
mcMMO.getModManager().addCustomEntity(target);
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -37,14 +37,6 @@ public final class ParticleEffectUtils {
|
|||||||
playSmokeEffect(player);
|
playSmokeEffect(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void playFluxEffect(Location location) {
|
|
||||||
if (!Config.getInstance().getFluxEffectEnabled()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
location.getWorld().playEffect(location, Effect.MOBSPAWNER_FLAMES, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void playSmokeEffect(LivingEntity livingEntity) {
|
public static void playSmokeEffect(LivingEntity livingEntity) {
|
||||||
Location location = livingEntity.getEyeLocation();
|
Location location = livingEntity.getEyeLocation();
|
||||||
World world = livingEntity.getWorld();
|
World world = livingEntity.getWorld();
|
||||||
|
|||||||
@@ -1,17 +0,0 @@
|
|||||||
package com.gmail.nossr50.util.temp;
|
|
||||||
|
|
||||||
import org.bukkit.entity.Entity;
|
|
||||||
import org.bukkit.entity.EntityType;
|
|
||||||
import org.bukkit.entity.Guardian;
|
|
||||||
|
|
||||||
import com.gmail.nossr50.config.experience.ExperienceConfig;
|
|
||||||
|
|
||||||
public class CompatableGuardianXP {
|
|
||||||
public static double get(Entity target) {
|
|
||||||
if (((Guardian) target).isElder()) {
|
|
||||||
return ExperienceConfig.getInstance().getElderGuardianXP();
|
|
||||||
} else {
|
|
||||||
return ExperienceConfig.getInstance().getCombatXP(EntityType.GUARDIAN);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
package com.gmail.nossr50.util.temp;
|
|
||||||
|
|
||||||
import org.bukkit.block.BlockState;
|
|
||||||
|
|
||||||
public class DualSupport {
|
|
||||||
|
|
||||||
public static boolean canActivateAbilities(BlockState blockState) {
|
|
||||||
String mat = blockState.getType().name();
|
|
||||||
return !mat.equals("IRON_TRAPDOOR") && !mat.equals("ACACIA_DOOR") && !mat.equals("SPRUCE_DOOR") && !mat.equals("BIRCH_DOOR")
|
|
||||||
&& !mat.equals("JUNGLE_DOOR") && !mat.equals("DARK_OAK_DOOR") && !mat.equals("ACACIA_FENCE") && !mat.equals("DARK_OAK_FENCE")
|
|
||||||
&& !mat.equals("BIRCH_FENCE") && !mat.equals("JUNGLE_FENCE") && !mat.equals("ARMOR_STAND");
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean affectedBySuperBreaker(BlockState blockState) {
|
|
||||||
String mat = blockState.getType().name();
|
|
||||||
return mat.equals("PRISMARINE") || mat.equals("RED_SANDSTONE");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -18,7 +18,7 @@ import org.json.simple.JSONObject;
|
|||||||
import org.json.simple.parser.JSONParser;
|
import org.json.simple.parser.JSONParser;
|
||||||
|
|
||||||
public class UUIDFetcher implements Callable<Map<String, UUID>> {
|
public class UUIDFetcher implements Callable<Map<String, UUID>> {
|
||||||
private static final int PROFILES_PER_REQUEST = 50;
|
private static final int PROFILES_PER_REQUEST = 100;
|
||||||
private static final long RATE_LIMIT = 100L;
|
private static final long RATE_LIMIT = 100L;
|
||||||
private static final String PROFILE_URL = "https://api.mojang.com/profiles/minecraft";
|
private static final String PROFILE_URL = "https://api.mojang.com/profiles/minecraft";
|
||||||
private final JSONParser jsonParser = new JSONParser();
|
private final JSONParser jsonParser = new JSONParser();
|
||||||
|
|||||||
@@ -447,11 +447,6 @@ Skills:
|
|||||||
ChanceMax: 75.0
|
ChanceMax: 75.0
|
||||||
MaxBonusLevel: 750
|
MaxBonusLevel: 750
|
||||||
|
|
||||||
# DamagePlayer: Bleeding damage dealt to players
|
|
||||||
# DamageMobs: Bleeding damage dealt to mobs
|
|
||||||
DamagePlayer: 1.0
|
|
||||||
DamageMobs: 2.0
|
|
||||||
|
|
||||||
# These settings determine how long the Bleeding effect lasts
|
# These settings determine how long the Bleeding effect lasts
|
||||||
MaxTicks: 3
|
MaxTicks: 3
|
||||||
BaseTicks: 2
|
BaseTicks: 2
|
||||||
|
|||||||
@@ -45,10 +45,6 @@ Scoreboard:
|
|||||||
# Show the /mcstats scoreboard automatically after logging in
|
# Show the /mcstats scoreboard automatically after logging in
|
||||||
Show_Stats_After_Login: false
|
Show_Stats_After_Login: false
|
||||||
|
|
||||||
# Show scoreboard tips 5 times. Tips are only displayed once for every login session.
|
|
||||||
# Set to 0 to never show these tips.
|
|
||||||
Tips_Amount: 5
|
|
||||||
|
|
||||||
# Add some more color on the board :-)
|
# Add some more color on the board :-)
|
||||||
Rainbows: false
|
Rainbows: false
|
||||||
|
|
||||||
@@ -211,15 +207,10 @@ Items:
|
|||||||
Warmup: 5
|
Warmup: 5
|
||||||
RecentlyHurt_Cooldown: 60
|
RecentlyHurt_Cooldown: 60
|
||||||
Prevent_Use_Underground: true
|
Prevent_Use_Underground: true
|
||||||
# Attempt to use the bed spawn, if one is available
|
|
||||||
Use_Bed_Spawn: true
|
|
||||||
Use_Cost: 1
|
Use_Cost: 1
|
||||||
Recipe_Cost: 5
|
Recipe_Cost: 5
|
||||||
Item_Name: FEATHER
|
Item_Name: FEATHER
|
||||||
Sound_Enabled: true
|
Sound_Enabled: true
|
||||||
Flux_Pickaxe:
|
|
||||||
Enabled: true
|
|
||||||
Sound_Enabled: true
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Settings for Parties
|
# Settings for Parties
|
||||||
@@ -267,7 +258,6 @@ Abilities:
|
|||||||
Cooldowns:
|
Cooldowns:
|
||||||
Berserk: 240
|
Berserk: 240
|
||||||
Blast_Mining: 60
|
Blast_Mining: 60
|
||||||
Charge: 240
|
|
||||||
Giga_Drill_Breaker: 240
|
Giga_Drill_Breaker: 240
|
||||||
Green_Terra: 240
|
Green_Terra: 240
|
||||||
Serrated_Strikes: 240
|
Serrated_Strikes: 240
|
||||||
@@ -277,7 +267,6 @@ Abilities:
|
|||||||
Max_Seconds:
|
Max_Seconds:
|
||||||
Berserk: 0
|
Berserk: 0
|
||||||
Blast_Mining: 0
|
Blast_Mining: 0
|
||||||
Charge: 0
|
|
||||||
Giga_Drill_Breaker: 0
|
Giga_Drill_Breaker: 0
|
||||||
Green_Terra: 0
|
Green_Terra: 0
|
||||||
Serrated_Strikes: 0
|
Serrated_Strikes: 0
|
||||||
@@ -490,9 +479,8 @@ Particles:
|
|||||||
LargeFireworks: true
|
LargeFireworks: true
|
||||||
|
|
||||||
# Use particle effect when these abilities trigger
|
# Use particle effect when these abilities trigger
|
||||||
Bleed: true
|
|
||||||
Dodge: true
|
Dodge: true
|
||||||
Flux: true
|
Bleed: true
|
||||||
Greater_Impact: true
|
Greater_Impact: true
|
||||||
Call_of_the_Wild: true
|
Call_of_the_Wild: true
|
||||||
|
|
||||||
|
|||||||
@@ -196,8 +196,6 @@ Experience:
|
|||||||
Sandstone: 30
|
Sandstone: 30
|
||||||
Stained_Clay: 50
|
Stained_Clay: 50
|
||||||
Stone: 30
|
Stone: 30
|
||||||
Red_Sandstone: 100
|
|
||||||
Prismarine: 70
|
|
||||||
Repair:
|
Repair:
|
||||||
Base: 1000.0
|
Base: 1000.0
|
||||||
Wood: 0.6
|
Wood: 0.6
|
||||||
@@ -243,6 +241,3 @@ Experience:
|
|||||||
Witch: 0.0
|
Witch: 0.0
|
||||||
Iron_Golem: 2.0
|
Iron_Golem: 2.0
|
||||||
Wither_Skeleton: 4.0
|
Wither_Skeleton: 4.0
|
||||||
Endermite: 2.0
|
|
||||||
Guardian: 3.0
|
|
||||||
Elder_Guardian: 4.0
|
|
||||||
|
|||||||
@@ -14,6 +14,6 @@ Options:
|
|||||||
UUIDConvertAmount: 100
|
UUIDConvertAmount: 100
|
||||||
# Amount of users to be converted at a time before waiting MojangLimitPeriod milliseconds to begin again
|
# Amount of users to be converted at a time before waiting MojangLimitPeriod milliseconds to begin again
|
||||||
# This setting is for large servers to avoid being temp banned from mojang api
|
# This setting is for large servers to avoid being temp banned from mojang api
|
||||||
MojangRateLimit: 300
|
MojangRateLimit: 50000
|
||||||
# Amount of time to wait after hitting the MojangRateLimit in UUID conversion
|
# Amount of time to wait after hitting the MojangRateLimit in UUID conversion
|
||||||
MojangLimitPeriod: 6000
|
MojangLimitPeriod: 600000
|
||||||
|
|||||||
@@ -333,8 +333,6 @@ Taming.Ability.Locked.2=LOCKED UNTIL {0}+ SKILL (SHOCK PROOF)
|
|||||||
Taming.Ability.Locked.3=LOCKED UNTIL {0}+ SKILL (SHARPENED CLAWS)
|
Taming.Ability.Locked.3=LOCKED UNTIL {0}+ SKILL (SHARPENED CLAWS)
|
||||||
Taming.Ability.Locked.4=LOCKED UNTIL {0}+ SKILL (FAST FOOD SERVICE)
|
Taming.Ability.Locked.4=LOCKED UNTIL {0}+ SKILL (FAST FOOD SERVICE)
|
||||||
Taming.Ability.Locked.5=LOCKED UNTIL {0}+ SKILL (HOLY HOUND)
|
Taming.Ability.Locked.5=LOCKED UNTIL {0}+ SKILL (HOLY HOUND)
|
||||||
Taming.Ability.Lower=[[GRAY]]**YOUR WOLVES STAND DOWN**
|
|
||||||
Taming.Ability.Ready=[[GREEN]]**YOU READY YOUR WOLVES**
|
|
||||||
Taming.Combat.Chance.Gore=[[RED]]Gore Chance: [[YELLOW]]{0}
|
Taming.Combat.Chance.Gore=[[RED]]Gore Chance: [[YELLOW]]{0}
|
||||||
Taming.Effect.0=Beast Lore
|
Taming.Effect.0=Beast Lore
|
||||||
Taming.Effect.1=Bone-whacking inspects wolves & ocelots
|
Taming.Effect.1=Bone-whacking inspects wolves & ocelots
|
||||||
@@ -355,18 +353,9 @@ Taming.Effect.6=Environmentally Aware
|
|||||||
Taming.Effect.7=Cactus/Lava Phobia, Fall DMG Immune
|
Taming.Effect.7=Cactus/Lava Phobia, Fall DMG Immune
|
||||||
Taming.Effect.8=Thick Fur
|
Taming.Effect.8=Thick Fur
|
||||||
Taming.Effect.9=DMG Reduction, Fire Resistance
|
Taming.Effect.9=DMG Reduction, Fire Resistance
|
||||||
Taming.Effect.20=Charge (ABILITY)
|
|
||||||
Taming.Effect.21=Target Enemy, Wolf Speed++
|
|
||||||
Taming.Listener.Wolf=[[DARK_GRAY]]Your wolf scurries back to you...
|
Taming.Listener.Wolf=[[DARK_GRAY]]Your wolf scurries back to you...
|
||||||
Taming.Listener=Taming:
|
Taming.Listener=Taming:
|
||||||
Taming.SkillName=TAMING
|
Taming.SkillName=TAMING
|
||||||
Taming.Skills.Charge.Off=[[RED]]**Charge has worn off**
|
|
||||||
Taming.Skills.Charge.On=[[GREEN]]**CHARGE ACTIVATED**
|
|
||||||
Taming.Skills.Charge.Other.Off=[[RED]]Charge[[GREEN]] has worn off for [[YELLOW]]{0}
|
|
||||||
Taming.Skills.Charge.Other.On=[[GREEN]]{0}[[DARK_GREEN]] has used [[RED]]Charge!
|
|
||||||
Taming.Skills.Charge.Refresh=[[GREEN]]Your [[YELLOW]]Charge [[GREEN]]ability is refreshed!
|
|
||||||
Taming.Skills.Charge.NoneNearby=[[RED]]**NO AVAILABLE WOLVES NEARBY**
|
|
||||||
Taming.Skills.Charge.NoTarget=[[RED]]**NO TARGET FOUND**
|
|
||||||
Taming.Skillup=[[YELLOW]]Taming skill increased by {0}. Total ({1})
|
Taming.Skillup=[[YELLOW]]Taming skill increased by {0}. Total ({1})
|
||||||
Taming.Summon.Complete=[[GREEN]]Summoning complete
|
Taming.Summon.Complete=[[GREEN]]Summoning complete
|
||||||
Taming.Summon.Lifespan=[[YELLOW]] (Lifespan: {0}s)
|
Taming.Summon.Lifespan=[[YELLOW]] (Lifespan: {0}s)
|
||||||
@@ -846,9 +835,6 @@ Item.ChimaeraWing.Name=Chimaera Wing
|
|||||||
Item.ChimaeraWing.Lore=[[GRAY]]Teleports you to your bed.
|
Item.ChimaeraWing.Lore=[[GRAY]]Teleports you to your bed.
|
||||||
Item.Generic.Wait=[[RED]]You need to wait before you can use this again! [[YELLOW]]({0}s)
|
Item.Generic.Wait=[[RED]]You need to wait before you can use this again! [[YELLOW]]({0}s)
|
||||||
Item.Injured.Wait=You were injured recently and must wait to use this. [[YELLOW]]({0}s)
|
Item.Injured.Wait=You were injured recently and must wait to use this. [[YELLOW]]({0}s)
|
||||||
Item.FluxPickaxe.Name=Flux Pickaxe
|
|
||||||
Item.FluxPickaxe.Lore.1=[[GRAY]]Has a chance of instantly smelting ores.
|
|
||||||
Item.FluxPickaxe.Lore.2=[[GRAY]]Requires Smelting level {0}+
|
|
||||||
|
|
||||||
#TELEPORTATION
|
#TELEPORTATION
|
||||||
Teleport.Commencing=[[GRAY]]Commencing teleport in [[GOLD]]({0}) [[GRAY]]seconds, please stand still...
|
Teleport.Commencing=[[GRAY]]Commencing teleport in [[GOLD]]({0}) [[GRAY]]seconds, please stand still...
|
||||||
@@ -922,6 +908,7 @@ Smelting.Effect.4=Vanilla XP Boost
|
|||||||
Smelting.Effect.5=Increase vanilla XP gained while smelting
|
Smelting.Effect.5=Increase vanilla XP gained while smelting
|
||||||
Smelting.Effect.6=Flux Mining
|
Smelting.Effect.6=Flux Mining
|
||||||
Smelting.Effect.7=Chance for ores to be instantly smelted while mining
|
Smelting.Effect.7=Chance for ores to be instantly smelted while mining
|
||||||
|
Smelting.FluxMining.Success=[[GREEN]]That ore smelted itself!
|
||||||
Smelting.Listener=Smelting:
|
Smelting.Listener=Smelting:
|
||||||
Smelting.SkillName=SMELTING
|
Smelting.SkillName=SMELTING
|
||||||
|
|
||||||
|
|||||||
@@ -536,7 +536,6 @@ permissions:
|
|||||||
mcmmo.ability.taming.sharpenedclaws: true
|
mcmmo.ability.taming.sharpenedclaws: true
|
||||||
mcmmo.ability.taming.shockproof: true
|
mcmmo.ability.taming.shockproof: true
|
||||||
mcmmo.ability.taming.thickfur: true
|
mcmmo.ability.taming.thickfur: true
|
||||||
mcmmo.ability.taming.charge: true
|
|
||||||
mcmmo.ability.taming.pummel: true
|
mcmmo.ability.taming.pummel: true
|
||||||
mcmmo.ability.taming.beastlore:
|
mcmmo.ability.taming.beastlore:
|
||||||
description: Allows access to the Beast Lore ability
|
description: Allows access to the Beast Lore ability
|
||||||
@@ -579,8 +578,6 @@ permissions:
|
|||||||
description: Allows access to the Shock Proof ability
|
description: Allows access to the Shock Proof ability
|
||||||
mcmmo.ability.taming.thickfur:
|
mcmmo.ability.taming.thickfur:
|
||||||
description: Allows access to the Thick Fur ability
|
description: Allows access to the Thick Fur ability
|
||||||
mcmmo.ability.taming.charge:
|
|
||||||
description: Allows access to the Charge ability
|
|
||||||
mcmmo.ability.taming.pummel:
|
mcmmo.ability.taming.pummel:
|
||||||
description: Allows access to the Pummel ability
|
description: Allows access to the Pummel ability
|
||||||
mcmmo.ability.unarmed.*:
|
mcmmo.ability.unarmed.*:
|
||||||
|
|||||||
@@ -793,16 +793,6 @@ Shake:
|
|||||||
XP: 0
|
XP: 0
|
||||||
Drop_Chance: 50.0
|
Drop_Chance: 50.0
|
||||||
Drop_Level: 0
|
Drop_Level: 0
|
||||||
PLAYER:
|
|
||||||
SKULL_ITEM:
|
|
||||||
Amount: 1
|
|
||||||
XP: 0
|
|
||||||
Drop_Chance: 0.0
|
|
||||||
Drop_Level: 0
|
|
||||||
INVENTORY:
|
|
||||||
Whole_Stacks: false
|
|
||||||
Drop_Chance: 0.0
|
|
||||||
Drop_Level: 0
|
|
||||||
SHEEP:
|
SHEEP:
|
||||||
WOOL:
|
WOOL:
|
||||||
Amount: 3
|
Amount: 3
|
||||||
|
|||||||
Reference in New Issue
Block a user