mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-25 06:36:45 +01:00
What a pain in the ass
This commit is contained in:
parent
1a3832f117
commit
4e2d68908e
@ -14,6 +14,7 @@ Version 2.2.0
|
|||||||
Repair config has been rewritten and expanded to support much more complex settings
|
Repair config has been rewritten and expanded to support much more complex settings
|
||||||
Fixed a bug where salvage anvil noises wouldn't play for a player that lacked repair permissions nodes
|
Fixed a bug where salvage anvil noises wouldn't play for a player that lacked repair permissions nodes
|
||||||
Sharpened Claws now has settings to change its damage for PVE or PVP instead of a flat setting that applied to both
|
Sharpened Claws now has settings to change its damage for PVE or PVP instead of a flat setting that applied to both
|
||||||
|
Gore tick length is now customizable
|
||||||
Removed the following Repair/Salvage permissions
|
Removed the following Repair/Salvage permissions
|
||||||
mcmmo.ability.repair.stonerepair
|
mcmmo.ability.repair.stonerepair
|
||||||
mcmmo.ability.repair.stringrepair
|
mcmmo.ability.repair.stringrepair
|
||||||
|
@ -35,8 +35,8 @@ public class AcrobaticsCommand extends SkillCommand {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void permissionsCheck(Player player) {
|
protected void permissionsCheck(Player player) {
|
||||||
canDodge = canUseSubskill(player, SubSkillType.ACROBATICS_DODGE);
|
canDodge = canUseSubSkill(player, SubSkillType.ACROBATICS_DODGE);
|
||||||
canRoll = canUseSubskill(player, SubSkillType.ACROBATICS_ROLL);
|
canRoll = canUseSubSkill(player, SubSkillType.ACROBATICS_ROLL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -49,9 +49,9 @@ public class ArcheryCommand extends SkillCommand {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void permissionsCheck(Player player) {
|
protected void permissionsCheck(Player player) {
|
||||||
canSkillShot = canUseSubskill(player, SubSkillType.ARCHERY_SKILL_SHOT);
|
canSkillShot = canUseSubSkill(player, SubSkillType.ARCHERY_SKILL_SHOT);
|
||||||
canDaze = canUseSubskill(player, SubSkillType.ARCHERY_DAZE);
|
canDaze = canUseSubSkill(player, SubSkillType.ARCHERY_DAZE);
|
||||||
canRetrieve = canUseSubskill(player, SubSkillType.ARCHERY_ARROW_RETRIEVAL);
|
canRetrieve = canUseSubSkill(player, SubSkillType.ARCHERY_ARROW_RETRIEVAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -72,7 +72,7 @@ public class ArcheryCommand extends SkillCommand {
|
|||||||
messages.add(getStatMessage(SubSkillType.ARCHERY_SKILL_SHOT, skillShotBonus));
|
messages.add(getStatMessage(SubSkillType.ARCHERY_SKILL_SHOT, skillShotBonus));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (canUseSubskill(player, SubSkillType.ARCHERY_ARCHERY_LIMIT_BREAK)) {
|
if (canUseSubSkill(player, SubSkillType.ARCHERY_ARCHERY_LIMIT_BREAK)) {
|
||||||
messages.add(getStatMessage(SubSkillType.ARCHERY_ARCHERY_LIMIT_BREAK,
|
messages.add(getStatMessage(SubSkillType.ARCHERY_ARCHERY_LIMIT_BREAK,
|
||||||
<<<<<<< HEAD
|
<<<<<<< HEAD
|
||||||
String.valueOf(pluginRef.getCombatTools().getLimitBreakDamage(player, SubSkillType.ARCHERY_ARCHERY_LIMIT_BREAK))));
|
String.valueOf(pluginRef.getCombatTools().getLimitBreakDamage(player, SubSkillType.ARCHERY_ARCHERY_LIMIT_BREAK))));
|
||||||
|
@ -58,10 +58,10 @@ public class AxesCommand extends SkillCommand {
|
|||||||
@Override
|
@Override
|
||||||
protected void permissionsCheck(Player player) {
|
protected void permissionsCheck(Player player) {
|
||||||
canSkullSplitter = pluginRef.getPermissionTools().skullSplitter(player) && pluginRef.getRankTools().hasUnlockedSubskill(player, SubSkillType.AXES_SKULL_SPLITTER);
|
canSkullSplitter = pluginRef.getPermissionTools().skullSplitter(player) && pluginRef.getRankTools().hasUnlockedSubskill(player, SubSkillType.AXES_SKULL_SPLITTER);
|
||||||
canCritical = canUseSubskill(player, SubSkillType.AXES_CRITICAL_STRIKES);
|
canCritical = canUseSubSkill(player, SubSkillType.AXES_CRITICAL_STRIKES);
|
||||||
canAxeMastery = canUseSubskill(player, SubSkillType.AXES_AXE_MASTERY);
|
canAxeMastery = canUseSubSkill(player, SubSkillType.AXES_AXE_MASTERY);
|
||||||
canImpact = canUseSubskill(player, SubSkillType.AXES_ARMOR_IMPACT);
|
canImpact = canUseSubSkill(player, SubSkillType.AXES_ARMOR_IMPACT);
|
||||||
canGreaterImpact = canUseSubskill(player, SubSkillType.AXES_GREATER_IMPACT);
|
canGreaterImpact = canUseSubSkill(player, SubSkillType.AXES_GREATER_IMPACT);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -90,7 +90,7 @@ public class AxesCommand extends SkillCommand {
|
|||||||
+ (hasEndurance ? pluginRef.getLocaleManager().getString("Perks.ActivationTime.Bonus", skullSplitterLengthEndurance) : ""));
|
+ (hasEndurance ? pluginRef.getLocaleManager().getString("Perks.ActivationTime.Bonus", skullSplitterLengthEndurance) : ""));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (canUseSubskill(player, SubSkillType.AXES_AXES_LIMIT_BREAK)) {
|
if (canUseSubSkill(player, SubSkillType.AXES_AXES_LIMIT_BREAK)) {
|
||||||
messages.add(getStatMessage(SubSkillType.AXES_AXES_LIMIT_BREAK,
|
messages.add(getStatMessage(SubSkillType.AXES_AXES_LIMIT_BREAK,
|
||||||
<<<<<<< HEAD
|
<<<<<<< HEAD
|
||||||
String.valueOf(pluginRef.getCombatTools().getLimitBreakDamage(player, SubSkillType.AXES_AXES_LIMIT_BREAK))));
|
String.valueOf(pluginRef.getCombatTools().getLimitBreakDamage(player, SubSkillType.AXES_AXES_LIMIT_BREAK))));
|
||||||
|
@ -34,7 +34,7 @@ public class ExcavationCommand extends SkillCommand {
|
|||||||
@Override
|
@Override
|
||||||
protected void permissionsCheck(Player player) {
|
protected void permissionsCheck(Player player) {
|
||||||
canGigaDrill = pluginRef.getPermissionTools().gigaDrillBreaker(player) && pluginRef.getRankTools().hasUnlockedSubskill(player, SubSkillType.EXCAVATION_GIGA_DRILL_BREAKER);
|
canGigaDrill = pluginRef.getPermissionTools().gigaDrillBreaker(player) && pluginRef.getRankTools().hasUnlockedSubskill(player, SubSkillType.EXCAVATION_GIGA_DRILL_BREAKER);
|
||||||
canTreasureHunt = canUseSubskill(player, SubSkillType.EXCAVATION_ARCHAEOLOGY);
|
canTreasureHunt = canUseSubSkill(player, SubSkillType.EXCAVATION_ARCHAEOLOGY);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -50,7 +50,7 @@ public class ExcavationCommand extends SkillCommand {
|
|||||||
//messages.add(pluginRef.getLocaleManager().getString("Excavation.Effect.Length", gigaDrillBreakerLength) + (hasEndurance ? pluginRef.getLocaleManager().getString("Perks.ActivationTime.Bonus", gigaDrillBreakerLengthEndurance) : ""));
|
//messages.add(pluginRef.getLocaleManager().getString("Excavation.Effect.Length", gigaDrillBreakerLength) + (hasEndurance ? pluginRef.getLocaleManager().getString("Perks.ActivationTime.Bonus", gigaDrillBreakerLengthEndurance) : ""));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(canUseSubskill(player, SubSkillType.EXCAVATION_ARCHAEOLOGY)) {
|
if(canUseSubSkill(player, SubSkillType.EXCAVATION_ARCHAEOLOGY)) {
|
||||||
messages.add(getStatMessage(false, false, SubSkillType.EXCAVATION_ARCHAEOLOGY,
|
messages.add(getStatMessage(false, false, SubSkillType.EXCAVATION_ARCHAEOLOGY,
|
||||||
percent.format(excavationManager.getArchaelogyExperienceOrbChance() / 100.0D)));
|
percent.format(excavationManager.getArchaelogyExperienceOrbChance() / 100.0D)));
|
||||||
messages.add(getStatMessage(true, false, SubSkillType.EXCAVATION_ARCHAEOLOGY,
|
messages.add(getStatMessage(true, false, SubSkillType.EXCAVATION_ARCHAEOLOGY,
|
||||||
|
@ -118,13 +118,13 @@ public class FishingCommand extends SkillCommand {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void permissionsCheck(Player player) {
|
protected void permissionsCheck(Player player) {
|
||||||
canTreasureHunt = canUseSubskill(player, SubSkillType.FISHING_TREASURE_HUNTER);
|
canTreasureHunt = canUseSubSkill(player, SubSkillType.FISHING_TREASURE_HUNTER);
|
||||||
canMagicHunt = canUseSubskill(player, SubSkillType.FISHING_MAGIC_HUNTER) && canUseSubskill(player, SubSkillType.FISHING_TREASURE_HUNTER);
|
canMagicHunt = canUseSubSkill(player, SubSkillType.FISHING_MAGIC_HUNTER) && canUseSubSkill(player, SubSkillType.FISHING_TREASURE_HUNTER);
|
||||||
canShake = canUseSubskill(player, SubSkillType.FISHING_SHAKE);
|
canShake = canUseSubSkill(player, SubSkillType.FISHING_SHAKE);
|
||||||
canFishermansDiet = canUseSubskill(player, SubSkillType.FISHING_FISHERMANS_DIET);
|
canFishermansDiet = canUseSubSkill(player, SubSkillType.FISHING_FISHERMANS_DIET);
|
||||||
canMasterAngler = canUseSubskill(player, SubSkillType.FISHING_MASTER_ANGLER);
|
canMasterAngler = canUseSubSkill(player, SubSkillType.FISHING_MASTER_ANGLER);
|
||||||
canIceFish = canUseSubskill(player, SubSkillType.FISHING_ICE_FISHING);
|
canIceFish = canUseSubSkill(player, SubSkillType.FISHING_ICE_FISHING);
|
||||||
canInnerPeace = canUseSubskill(player, SubSkillType.FISHING_INNER_PEACE);
|
canInnerPeace = canUseSubSkill(player, SubSkillType.FISHING_INNER_PEACE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -84,13 +84,13 @@ public class HerbalismCommand extends SkillCommand {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void permissionsCheck(Player player) {
|
protected void permissionsCheck(Player player) {
|
||||||
hasHylianLuck = canUseSubskill(player, SubSkillType.HERBALISM_HYLIAN_LUCK);
|
hasHylianLuck = canUseSubSkill(player, SubSkillType.HERBALISM_HYLIAN_LUCK);
|
||||||
canGreenTerra = pluginRef.getPermissionTools().greenTerra(player);
|
canGreenTerra = pluginRef.getPermissionTools().greenTerra(player);
|
||||||
canGreenThumbPlants = pluginRef.getRankTools().hasUnlockedSubskill(player, SubSkillType.HERBALISM_GREEN_THUMB) && (pluginRef.getPermissionTools().greenThumbPlant(player, Material.WHEAT) || pluginRef.getPermissionTools().greenThumbPlant(player, Material.CARROT) || pluginRef.getPermissionTools().greenThumbPlant(player, Material.POTATO) || pluginRef.getPermissionTools().greenThumbPlant(player, Material.BEETROOT) || pluginRef.getPermissionTools().greenThumbPlant(player, Material.NETHER_WART) || pluginRef.getPermissionTools().greenThumbPlant(player, Material.COCOA));
|
canGreenThumbPlants = pluginRef.getRankTools().hasUnlockedSubskill(player, SubSkillType.HERBALISM_GREEN_THUMB) && (pluginRef.getPermissionTools().greenThumbPlant(player, Material.WHEAT) || pluginRef.getPermissionTools().greenThumbPlant(player, Material.CARROT) || pluginRef.getPermissionTools().greenThumbPlant(player, Material.POTATO) || pluginRef.getPermissionTools().greenThumbPlant(player, Material.BEETROOT) || pluginRef.getPermissionTools().greenThumbPlant(player, Material.NETHER_WART) || pluginRef.getPermissionTools().greenThumbPlant(player, Material.COCOA));
|
||||||
canGreenThumbBlocks = pluginRef.getRankTools().hasUnlockedSubskill(player, SubSkillType.HERBALISM_GREEN_THUMB) && (pluginRef.getPermissionTools().greenThumbBlock(player, Material.DIRT) || pluginRef.getPermissionTools().greenThumbBlock(player, Material.COBBLESTONE) || pluginRef.getPermissionTools().greenThumbBlock(player, Material.COBBLESTONE_WALL) || pluginRef.getPermissionTools().greenThumbBlock(player, Material.STONE_BRICKS));
|
canGreenThumbBlocks = pluginRef.getRankTools().hasUnlockedSubskill(player, SubSkillType.HERBALISM_GREEN_THUMB) && (pluginRef.getPermissionTools().greenThumbBlock(player, Material.DIRT) || pluginRef.getPermissionTools().greenThumbBlock(player, Material.COBBLESTONE) || pluginRef.getPermissionTools().greenThumbBlock(player, Material.COBBLESTONE_WALL) || pluginRef.getPermissionTools().greenThumbBlock(player, Material.STONE_BRICKS));
|
||||||
canFarmersDiet = canUseSubskill(player, SubSkillType.HERBALISM_FARMERS_DIET);
|
canFarmersDiet = canUseSubSkill(player, SubSkillType.HERBALISM_FARMERS_DIET);
|
||||||
canDoubleDrop = canUseSubskill(player, SubSkillType.HERBALISM_DOUBLE_DROPS);
|
canDoubleDrop = canUseSubSkill(player, SubSkillType.HERBALISM_DOUBLE_DROPS);
|
||||||
canShroomThumb = canUseSubskill(player, SubSkillType.HERBALISM_SHROOM_THUMB);
|
canShroomThumb = canUseSubSkill(player, SubSkillType.HERBALISM_SHROOM_THUMB);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -67,7 +67,7 @@ public class MiningCommand extends SkillCommand {
|
|||||||
canBiggerBombs = pluginRef.getRankTools().hasUnlockedSubskill(player, SubSkillType.MINING_BIGGER_BOMBS) && pluginRef.getPermissionTools().biggerBombs(player);
|
canBiggerBombs = pluginRef.getRankTools().hasUnlockedSubskill(player, SubSkillType.MINING_BIGGER_BOMBS) && pluginRef.getPermissionTools().biggerBombs(player);
|
||||||
canBlast = pluginRef.getRankTools().hasUnlockedSubskill(player, SubSkillType.MINING_BLAST_MINING) && pluginRef.getPermissionTools().remoteDetonation(player);
|
canBlast = pluginRef.getRankTools().hasUnlockedSubskill(player, SubSkillType.MINING_BLAST_MINING) && pluginRef.getPermissionTools().remoteDetonation(player);
|
||||||
canDemoExpert = pluginRef.getRankTools().hasUnlockedSubskill(player, SubSkillType.MINING_DEMOLITIONS_EXPERTISE) && pluginRef.getPermissionTools().demolitionsExpertise(player);
|
canDemoExpert = pluginRef.getRankTools().hasUnlockedSubskill(player, SubSkillType.MINING_DEMOLITIONS_EXPERTISE) && pluginRef.getPermissionTools().demolitionsExpertise(player);
|
||||||
canDoubleDrop = canUseSubskill(player, SubSkillType.MINING_DOUBLE_DROPS);
|
canDoubleDrop = canUseSubSkill(player, SubSkillType.MINING_DOUBLE_DROPS);
|
||||||
canSuperBreaker = pluginRef.getRankTools().hasUnlockedSubskill(player, SubSkillType.MINING_SUPER_BREAKER) && pluginRef.getPermissionTools().superBreaker(player);
|
canSuperBreaker = pluginRef.getRankTools().hasUnlockedSubskill(player, SubSkillType.MINING_SUPER_BREAKER) && pluginRef.getPermissionTools().superBreaker(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,9 +70,9 @@ public class RepairCommand extends SkillCommand {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void permissionsCheck(Player player) {
|
protected void permissionsCheck(Player player) {
|
||||||
canSuperRepair = canUseSubskill(player, SubSkillType.REPAIR_SUPER_REPAIR);
|
canSuperRepair = canUseSubSkill(player, SubSkillType.REPAIR_SUPER_REPAIR);
|
||||||
canMasterRepair = canUseSubskill(player, SubSkillType.REPAIR_REPAIR_MASTERY);
|
canMasterRepair = canUseSubSkill(player, SubSkillType.REPAIR_REPAIR_MASTERY);
|
||||||
canArcaneForge = canUseSubskill(player, SubSkillType.REPAIR_ARCANE_FORGING);
|
canArcaneForge = canUseSubSkill(player, SubSkillType.REPAIR_ARCANE_FORGING);
|
||||||
// canRepairDiamond = Permissions.repairMaterialType(player, ItemMaterialCategory.DIAMOND);
|
// canRepairDiamond = Permissions.repairMaterialType(player, ItemMaterialCategory.DIAMOND);
|
||||||
// canRepairGold = Permissions.repairMaterialType(player, ItemMaterialCategory.GOLD);
|
// canRepairGold = Permissions.repairMaterialType(player, ItemMaterialCategory.GOLD);
|
||||||
// canRepairIron = Permissions.repairMaterialType(player, ItemMaterialCategory.IRON);
|
// canRepairIron = Permissions.repairMaterialType(player, ItemMaterialCategory.IRON);
|
||||||
|
@ -27,8 +27,8 @@ public class SalvageCommand extends SkillCommand {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void permissionsCheck(Player player) {
|
protected void permissionsCheck(Player player) {
|
||||||
canScrapCollector = canUseSubskill(player, SubSkillType.SALVAGE_SCRAP_COLLECTOR);
|
canScrapCollector = canUseSubSkill(player, SubSkillType.SALVAGE_SCRAP_COLLECTOR);
|
||||||
canArcaneSalvage = canUseSubskill(player, SubSkillType.SALVAGE_ARCANE_SALVAGE);
|
canArcaneSalvage = canUseSubSkill(player, SubSkillType.SALVAGE_ARCANE_SALVAGE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -230,9 +230,8 @@ public abstract class SkillCommand implements TabExecutor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
protected abstract void dataCalculations(Player player, double skillValue);
|
protected abstract void dataCalculations(Player player, double skillValue);
|
||||||
=======
|
|
||||||
protected String getLimitBreakDescriptionParameter() {
|
protected String getLimitBreakDescriptionParameter() {
|
||||||
if(AdvancedConfig.getInstance().canApplyLimitBreakPVE()) {
|
if(AdvancedConfig.getInstance().canApplyLimitBreakPVE()) {
|
||||||
return "(PVP/PVE)";
|
return "(PVP/PVE)";
|
||||||
@ -241,8 +240,6 @@ public abstract class SkillCommand implements TabExecutor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected abstract void dataCalculations(Player player, float skillValue);
|
|
||||||
>>>>>>> 308e3a4b1f46e9e3de28d6d540dd055a540ed4d5
|
|
||||||
|
|
||||||
protected abstract void permissionsCheck(Player player);
|
protected abstract void permissionsCheck(Player player);
|
||||||
|
|
||||||
@ -259,7 +256,7 @@ public abstract class SkillCommand implements TabExecutor {
|
|||||||
* @param subSkillType target subskill
|
* @param subSkillType target subskill
|
||||||
* @return true if the player has permission and has the skill unlocked
|
* @return true if the player has permission and has the skill unlocked
|
||||||
*/
|
*/
|
||||||
protected boolean canUseSubskill(Player player, SubSkillType subSkillType) {
|
protected boolean canUseSubSkill(Player player, SubSkillType subSkillType) {
|
||||||
return pluginRef.getPermissionTools().isSubSkillEnabled(player, subSkillType) && pluginRef.getRankTools().hasUnlockedSubskill(player, subSkillType);
|
return pluginRef.getPermissionTools().isSubSkillEnabled(player, subSkillType) && pluginRef.getRankTools().hasUnlockedSubskill(player, subSkillType);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -49,8 +49,8 @@ public class SmeltingCommand extends SkillCommand {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void permissionsCheck(Player player) {
|
protected void permissionsCheck(Player player) {
|
||||||
canFuelEfficiency = canUseSubskill(player, SubSkillType.SMELTING_FUEL_EFFICIENCY);
|
canFuelEfficiency = canUseSubSkill(player, SubSkillType.SMELTING_FUEL_EFFICIENCY);
|
||||||
canSecondSmelt = canUseSubskill(player, SubSkillType.SMELTING_SECOND_SMELT);
|
canSecondSmelt = canUseSubSkill(player, SubSkillType.SMELTING_SECOND_SMELT);
|
||||||
//canFluxMine = canUseSubskill(player, SubSkillType.SMELTING_FLUX_MINING);
|
//canFluxMine = canUseSubskill(player, SubSkillType.SMELTING_FLUX_MINING);
|
||||||
canUnderstandTheArt = pluginRef.getPermissionTools().vanillaXpBoost(player, skill) && pluginRef.getRankTools().hasUnlockedSubskill(player, SubSkillType.SMELTING_UNDERSTANDING_THE_ART);
|
canUnderstandTheArt = pluginRef.getPermissionTools().vanillaXpBoost(player, skill) && pluginRef.getRankTools().hasUnlockedSubskill(player, SubSkillType.SMELTING_UNDERSTANDING_THE_ART);
|
||||||
}
|
}
|
||||||
|
@ -54,8 +54,8 @@ public class SwordsCommand extends SkillCommand {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void permissionsCheck(Player player) {
|
protected void permissionsCheck(Player player) {
|
||||||
canBleed = canUseSubskill(player, SubSkillType.SWORDS_RUPTURE);
|
canBleed = canUseSubSkill(player, SubSkillType.SWORDS_RUPTURE);
|
||||||
canCounter = canUseSubskill(player, SubSkillType.SWORDS_COUNTER_ATTACK);
|
canCounter = canUseSubSkill(player, SubSkillType.SWORDS_COUNTER_ATTACK);
|
||||||
canSerratedStrike = pluginRef.getRankTools().hasUnlockedSubskill(player, SubSkillType.SWORDS_SERRATED_STRIKES) && pluginRef.getPermissionTools().serratedStrikes(player);
|
canSerratedStrike = pluginRef.getRankTools().hasUnlockedSubskill(player, SubSkillType.SWORDS_SERRATED_STRIKES) && pluginRef.getPermissionTools().serratedStrikes(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -91,12 +91,12 @@ public class SwordsCommand extends SkillCommand {
|
|||||||
+ (hasEndurance ? pluginRef.getLocaleManager().getString("Perks.ActivationTime.Bonus", serratedStrikesLengthEndurance) : ""));
|
+ (hasEndurance ? pluginRef.getLocaleManager().getString("Perks.ActivationTime.Bonus", serratedStrikesLengthEndurance) : ""));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (canUseSubskill(player, SubSkillType.SWORDS_STAB)) {
|
if (canUseSubSkill(player, SubSkillType.SWORDS_STAB)) {
|
||||||
messages.add(getStatMessage(SubSkillType.SWORDS_STAB,
|
messages.add(getStatMessage(SubSkillType.SWORDS_STAB,
|
||||||
String.valueOf(pluginRef.getUserManager().getPlayer(player).getSwordsManager().getStabDamage())));
|
String.valueOf(pluginRef.getUserManager().getPlayer(player).getSwordsManager().getStabDamage())));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (canUseSubskill(player, SubSkillType.SWORDS_SWORDS_LIMIT_BREAK)) {
|
if (canUseSubSkill(player, SubSkillType.SWORDS_SWORDS_LIMIT_BREAK)) {
|
||||||
messages.add(getStatMessage(SubSkillType.SWORDS_SWORDS_LIMIT_BREAK,
|
messages.add(getStatMessage(SubSkillType.SWORDS_SWORDS_LIMIT_BREAK,
|
||||||
<<<<<<< HEAD
|
<<<<<<< HEAD
|
||||||
String.valueOf(pluginRef.getCombatTools().getLimitBreakDamage(player, SubSkillType.SWORDS_SWORDS_LIMIT_BREAK))));
|
String.valueOf(pluginRef.getCombatTools().getLimitBreakDamage(player, SubSkillType.SWORDS_SWORDS_LIMIT_BREAK))));
|
||||||
|
@ -3,7 +3,6 @@ package com.gmail.nossr50.commands.skills;
|
|||||||
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
|
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
|
||||||
import com.gmail.nossr50.datatypes.skills.SubSkillType;
|
import com.gmail.nossr50.datatypes.skills.SubSkillType;
|
||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.mcMMO;
|
||||||
import com.gmail.nossr50.skills.taming.Taming;
|
|
||||||
import net.md_5.bungee.api.chat.TextComponent;
|
import net.md_5.bungee.api.chat.TextComponent;
|
||||||
import org.bukkit.entity.EntityType;
|
import org.bukkit.entity.EntityType;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@ -40,15 +39,15 @@ public class TamingCommand extends SkillCommand {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void permissionsCheck(Player player) {
|
protected void permissionsCheck(Player player) {
|
||||||
canBeastLore = canUseSubskill(player, SubSkillType.TAMING_BEAST_LORE);
|
canBeastLore = canUseSubSkill(player, SubSkillType.TAMING_BEAST_LORE);
|
||||||
canCallWild = pluginRef.getPermissionTools().callOfTheWild(player, EntityType.HORSE) || pluginRef.getPermissionTools().callOfTheWild(player, EntityType.WOLF) || pluginRef.getPermissionTools().callOfTheWild(player, EntityType.OCELOT);
|
canCallWild = pluginRef.getPermissionTools().callOfTheWild(player, EntityType.HORSE) || pluginRef.getPermissionTools().callOfTheWild(player, EntityType.WOLF) || pluginRef.getPermissionTools().callOfTheWild(player, EntityType.OCELOT);
|
||||||
canEnvironmentallyAware = canUseSubskill(player, SubSkillType.TAMING_ENVIRONMENTALLY_AWARE);
|
canEnvironmentallyAware = canUseSubSkill(player, SubSkillType.TAMING_ENVIRONMENTALLY_AWARE);
|
||||||
canFastFood = canUseSubskill(player, SubSkillType.TAMING_FAST_FOOD_SERVICE);
|
canFastFood = canUseSubSkill(player, SubSkillType.TAMING_FAST_FOOD_SERVICE);
|
||||||
canGore = canUseSubskill(player, SubSkillType.TAMING_GORE);
|
canGore = canUseSubSkill(player, SubSkillType.TAMING_GORE);
|
||||||
canSharpenedClaws = canUseSubskill(player, SubSkillType.TAMING_SHARPENED_CLAWS);
|
canSharpenedClaws = canUseSubSkill(player, SubSkillType.TAMING_SHARPENED_CLAWS);
|
||||||
canShockProof = canUseSubskill(player, SubSkillType.TAMING_SHOCK_PROOF);
|
canShockProof = canUseSubSkill(player, SubSkillType.TAMING_SHOCK_PROOF);
|
||||||
canThickFur = canUseSubskill(player, SubSkillType.TAMING_THICK_FUR);
|
canThickFur = canUseSubSkill(player, SubSkillType.TAMING_THICK_FUR);
|
||||||
canHolyHound = canUseSubskill(player, SubSkillType.TAMING_HOLY_HOUND);
|
canHolyHound = canUseSubSkill(player, SubSkillType.TAMING_HOLY_HOUND);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -63,7 +62,7 @@ public class TamingCommand extends SkillCommand {
|
|||||||
messages.add(pluginRef.getLocaleManager().getString("Ability.Generic.Template",
|
messages.add(pluginRef.getLocaleManager().getString("Ability.Generic.Template",
|
||||||
pluginRef.getLocaleManager().getString("Taming.Ability.Bonus.8"),
|
pluginRef.getLocaleManager().getString("Taming.Ability.Bonus.8"),
|
||||||
pluginRef.getLocaleManager().getString("Taming.Ability.Bonus.9",
|
pluginRef.getLocaleManager().getString("Taming.Ability.Bonus.9",
|
||||||
percent.format(Taming.getInstance().getFastFoodServiceActivationChance() / 100D))));
|
percent.format(pluginRef.getDynamicSettingsManager().getSkillStaticChance(SubSkillType.TAMING_FAST_FOOD_SERVICE) / 100D))));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (canGore) {
|
if (canGore) {
|
||||||
@ -82,21 +81,21 @@ public class TamingCommand extends SkillCommand {
|
|||||||
messages.add(pluginRef.getLocaleManager().getString("Ability.Generic.Template",
|
messages.add(pluginRef.getLocaleManager().getString("Ability.Generic.Template",
|
||||||
pluginRef.getLocaleManager().getString("Taming.Ability.Bonus.6"),
|
pluginRef.getLocaleManager().getString("Taming.Ability.Bonus.6"),
|
||||||
pluginRef.getLocaleManager().getString("Taming.Ability.Bonus.7",
|
pluginRef.getLocaleManager().getString("Taming.Ability.Bonus.7",
|
||||||
Taming.getInstance().getSharpenedClawsBonusDamage())));
|
pluginRef.getDynamicSettingsManager().getSkillBehaviourManager().getTamingBehaviour().getSharpenedClawsBonusDamage(true))));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (canShockProof) {
|
if (canShockProof) {
|
||||||
messages.add(pluginRef.getLocaleManager().getString("Ability.Generic.Template",
|
messages.add(pluginRef.getLocaleManager().getString("Ability.Generic.Template",
|
||||||
pluginRef.getLocaleManager().getString("Taming.Ability.Bonus.4"),
|
pluginRef.getLocaleManager().getString("Taming.Ability.Bonus.4"),
|
||||||
pluginRef.getLocaleManager().getString("Taming.Ability.Bonus.5",
|
pluginRef.getLocaleManager().getString("Taming.Ability.Bonus.5",
|
||||||
Taming.getInstance().getShockProofModifier())));
|
pluginRef.getDynamicSettingsManager().getSkillBehaviourManager().getTamingBehaviour().getShockProofModifier())));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (canThickFur) {
|
if (canThickFur) {
|
||||||
messages.add(pluginRef.getLocaleManager().getString("Ability.Generic.Template",
|
messages.add(pluginRef.getLocaleManager().getString("Ability.Generic.Template",
|
||||||
pluginRef.getLocaleManager().getString("Taming.Ability.Bonus.2"),
|
pluginRef.getLocaleManager().getString("Taming.Ability.Bonus.2"),
|
||||||
pluginRef.getLocaleManager().getString("Taming.Ability.Bonus.3",
|
pluginRef.getLocaleManager().getString("Taming.Ability.Bonus.3",
|
||||||
Taming.getInstance().getThickFurModifier())));
|
pluginRef.getDynamicSettingsManager().getSkillBehaviourManager().getTamingBehaviour().getThickFurModifier())));
|
||||||
}
|
}
|
||||||
|
|
||||||
return messages;
|
return messages;
|
||||||
|
@ -69,10 +69,10 @@ public class UnarmedCommand extends SkillCommand {
|
|||||||
@Override
|
@Override
|
||||||
protected void permissionsCheck(Player player) {
|
protected void permissionsCheck(Player player) {
|
||||||
canBerserk = pluginRef.getRankTools().hasUnlockedSubskill(player, SubSkillType.UNARMED_BERSERK) && pluginRef.getPermissionTools().berserk(player);
|
canBerserk = pluginRef.getRankTools().hasUnlockedSubskill(player, SubSkillType.UNARMED_BERSERK) && pluginRef.getPermissionTools().berserk(player);
|
||||||
canIronArm = canUseSubskill(player, SubSkillType.UNARMED_IRON_ARM_STYLE);
|
canIronArm = canUseSubSkill(player, SubSkillType.UNARMED_IRON_ARM_STYLE);
|
||||||
canDeflect = canUseSubskill(player, SubSkillType.UNARMED_ARROW_DEFLECT);
|
canDeflect = canUseSubSkill(player, SubSkillType.UNARMED_ARROW_DEFLECT);
|
||||||
canDisarm = canUseSubskill(player, SubSkillType.UNARMED_DISARM);
|
canDisarm = canUseSubSkill(player, SubSkillType.UNARMED_DISARM);
|
||||||
canIronGrip = canUseSubskill(player, SubSkillType.UNARMED_IRON_GRIP);
|
canIronGrip = canUseSubSkill(player, SubSkillType.UNARMED_IRON_GRIP);
|
||||||
// TODO: Apparently we forgot about block cracker?
|
// TODO: Apparently we forgot about block cracker?
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -108,7 +108,7 @@ public class UnarmedCommand extends SkillCommand {
|
|||||||
//messages.add(pluginRef.getLocaleManager().getString("Unarmed.Ability.Chance.IronGrip", ironGripChance) + (isLucky ? pluginRef.getLocaleManager().getString("Perks.Lucky.Bonus", ironGripChanceLucky) : ""));
|
//messages.add(pluginRef.getLocaleManager().getString("Unarmed.Ability.Chance.IronGrip", ironGripChance) + (isLucky ? pluginRef.getLocaleManager().getString("Perks.Lucky.Bonus", ironGripChanceLucky) : ""));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (canUseSubskill(player, SubSkillType.UNARMED_UNARMED_LIMIT_BREAK)) {
|
if (canUseSubSkill(player, SubSkillType.UNARMED_UNARMED_LIMIT_BREAK)) {
|
||||||
messages.add(getStatMessage(SubSkillType.UNARMED_UNARMED_LIMIT_BREAK,
|
messages.add(getStatMessage(SubSkillType.UNARMED_UNARMED_LIMIT_BREAK,
|
||||||
<<<<<<< HEAD
|
<<<<<<< HEAD
|
||||||
String.valueOf(pluginRef.getCombatTools().getLimitBreakDamage(player, SubSkillType.UNARMED_UNARMED_LIMIT_BREAK))));
|
String.valueOf(pluginRef.getCombatTools().getLimitBreakDamage(player, SubSkillType.UNARMED_UNARMED_LIMIT_BREAK))));
|
||||||
|
@ -50,8 +50,8 @@ public class WoodcuttingCommand extends SkillCommand {
|
|||||||
@Override
|
@Override
|
||||||
protected void permissionsCheck(Player player) {
|
protected void permissionsCheck(Player player) {
|
||||||
canTreeFell = pluginRef.getRankTools().hasUnlockedSubskill(player, SubSkillType.WOODCUTTING_TREE_FELLER) && pluginRef.getPermissionTools().treeFeller(player);
|
canTreeFell = pluginRef.getRankTools().hasUnlockedSubskill(player, SubSkillType.WOODCUTTING_TREE_FELLER) && pluginRef.getPermissionTools().treeFeller(player);
|
||||||
canDoubleDrop = canUseSubskill(player, SubSkillType.WOODCUTTING_HARVEST_LUMBER) && pluginRef.getRankTools().getRank(player, SubSkillType.WOODCUTTING_HARVEST_LUMBER) >= 1;
|
canDoubleDrop = canUseSubSkill(player, SubSkillType.WOODCUTTING_HARVEST_LUMBER) && pluginRef.getRankTools().getRank(player, SubSkillType.WOODCUTTING_HARVEST_LUMBER) >= 1;
|
||||||
canLeafBlow = canUseSubskill(player, SubSkillType.WOODCUTTING_LEAF_BLOWER);
|
canLeafBlow = canUseSubSkill(player, SubSkillType.WOODCUTTING_LEAF_BLOWER);
|
||||||
/*canSplinter = canUseSubskill(player, SubSkillType.WOODCUTTING_SPLINTER);
|
/*canSplinter = canUseSubskill(player, SubSkillType.WOODCUTTING_SPLINTER);
|
||||||
canBarkSurgeon = canUseSubskill(player, SubSkillType.WOODCUTTING_BARK_SURGEON);
|
canBarkSurgeon = canUseSubskill(player, SubSkillType.WOODCUTTING_BARK_SURGEON);
|
||||||
canNaturesBounty = canUseSubskill(player, SubSkillType.WOODCUTTING_NATURES_BOUNTY);*/
|
canNaturesBounty = canUseSubskill(player, SubSkillType.WOODCUTTING_NATURES_BOUNTY);*/
|
||||||
|
@ -1,7 +1,17 @@
|
|||||||
package com.gmail.nossr50.config.hocon.skills.taming;
|
package com.gmail.nossr50.config.hocon.skills.taming;
|
||||||
|
|
||||||
|
import ninja.leaping.configurate.objectmapping.Setting;
|
||||||
import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
|
import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
|
||||||
|
|
||||||
@ConfigSerializable
|
@ConfigSerializable
|
||||||
public class ConfigTamingShockProof {
|
public class ConfigTamingShockProof {
|
||||||
|
public static final double DEFAULT_SHOCKPROOF_MOD = 6.0D;
|
||||||
|
|
||||||
|
@Setting(value = "Damage-Reduction-Modifier", comment = "Damage modified by activation of shock proof will be divided by this value" +
|
||||||
|
"\nDefault value: "+DEFAULT_SHOCKPROOF_MOD)
|
||||||
|
private double shockProofModifier = DEFAULT_SHOCKPROOF_MOD;
|
||||||
|
|
||||||
|
public double getShockProofModifier() {
|
||||||
|
return shockProofModifier;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,17 @@
|
|||||||
package com.gmail.nossr50.config.hocon.skills.taming;
|
package com.gmail.nossr50.config.hocon.skills.taming;
|
||||||
|
|
||||||
|
import ninja.leaping.configurate.objectmapping.Setting;
|
||||||
import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
|
import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
|
||||||
|
|
||||||
@ConfigSerializable
|
@ConfigSerializable
|
||||||
public class ConfigTamingThickFur {
|
public class ConfigTamingThickFur {
|
||||||
|
public static final double DEFAULT_THICKFUR_MOD = 6.0D;
|
||||||
|
|
||||||
|
@Setting(value = "Damage-Reduction-Modifier", comment = "Damage modified by activation of thick fur will be divided by this value" +
|
||||||
|
"\nDefault value: "+ DEFAULT_THICKFUR_MOD)
|
||||||
|
private double thickFurDamageModifier = DEFAULT_THICKFUR_MOD;
|
||||||
|
|
||||||
|
public double getThickFurDamageModifier() {
|
||||||
|
return thickFurDamageModifier;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -188,6 +188,11 @@ public class DynamicSettingsManager {
|
|||||||
return skillPropertiesManager.getMaxChance(subSkillType);
|
return skillPropertiesManager.getMaxChance(subSkillType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//TODO: Doesn't allow for per rank changes in static chance
|
||||||
|
public double getSkillStaticChance(SubSkillType subSkillType) {
|
||||||
|
return skillPropertiesManager.getStaticChance(subSkillType);
|
||||||
|
}
|
||||||
|
|
||||||
public SkillPropertiesManager getSkillPropertiesManager() {
|
public SkillPropertiesManager getSkillPropertiesManager() {
|
||||||
return skillPropertiesManager;
|
return skillPropertiesManager;
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ public class SkillPropertiesManager {
|
|||||||
private final mcMMO pluginRef;
|
private final mcMMO pluginRef;
|
||||||
|
|
||||||
private HashMap<SubSkillType, Double> maxChanceMap;
|
private HashMap<SubSkillType, Double> maxChanceMap;
|
||||||
private HashMap<SubSkillType, Double> staticActivationChanceMap;
|
private HashMap<SubSkillType, Double> staticActivationChanceMap; //TODO: Doesn't allow for per rank changes
|
||||||
private HashMap<SubSkillType, Integer> maxBonusLevelMap;
|
private HashMap<SubSkillType, Integer> maxBonusLevelMap;
|
||||||
private HashMap<SubSkillType, Double> maxBonusMap;
|
private HashMap<SubSkillType, Double> maxBonusMap;
|
||||||
|
|
||||||
|
@ -1,8 +1,11 @@
|
|||||||
package com.gmail.nossr50.datatypes.skills.behaviours;
|
package com.gmail.nossr50.datatypes.skills.behaviours;
|
||||||
|
|
||||||
|
import com.gmail.nossr50.datatypes.skills.SubSkillType;
|
||||||
import com.gmail.nossr50.datatypes.skills.subskills.taming.CallOfTheWildType;
|
import com.gmail.nossr50.datatypes.skills.subskills.taming.CallOfTheWildType;
|
||||||
import com.gmail.nossr50.datatypes.skills.subskills.taming.TamingSummon;
|
import com.gmail.nossr50.datatypes.skills.subskills.taming.TamingSummon;
|
||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.mcMMO;
|
||||||
|
import org.bukkit.EntityEffect;
|
||||||
|
import org.bukkit.entity.*;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
@ -26,4 +29,76 @@ public class TamingBehaviour {
|
|||||||
return pluginRef.getConfigManager().getConfigTaming().getCallOfTheWild().getCOTWSummon(callOfTheWildType);
|
return pluginRef.getConfigManager().getConfigTaming().getCallOfTheWild().getCOTWSummon(callOfTheWildType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public double getFastFoodServiceActivationChance() {
|
||||||
|
return pluginRef.getDynamicSettingsManager().getSkillStaticChance(SubSkillType.TAMING_FAST_FOOD_SERVICE);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getGoreBleedTicks() {
|
||||||
|
return pluginRef.getConfigManager().getConfigTaming().getGore().getGoreBleedTicks();
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getGoreModifier() {
|
||||||
|
return pluginRef.getConfigManager().getConfigTaming().getGore().getGoreMofifier();
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getSharpenedClawsBonusDamage(boolean PVE) {
|
||||||
|
if(PVE) {
|
||||||
|
return pluginRef.getConfigManager().getConfigTaming().getSharpenedClaws().getBonusDamage().getPVEModifier();
|
||||||
|
} else {
|
||||||
|
return pluginRef.getConfigManager().getConfigTaming().getSharpenedClaws().getBonusDamage().getPVEModifier();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getShockProofModifier() {
|
||||||
|
return pluginRef.getConfigManager().getConfigTaming().getShockProof().getShockProofModifier();
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getThickFurModifier() {
|
||||||
|
return pluginRef.getConfigManager().getConfigTaming().getThickFur().getThickFurDamageModifier();
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean canPreventDamage(Tameable pet, AnimalTamer owner) {
|
||||||
|
return pet.isTamed() && owner instanceof Player && pet instanceof Wolf;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double processThickFur(Wolf wolf, double damage) {
|
||||||
|
wolf.playEffect(EntityEffect.WOLF_SHAKE);
|
||||||
|
return damage / getThickFurModifier();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void processThickFurFire(Wolf wolf) {
|
||||||
|
wolf.playEffect(EntityEffect.WOLF_SMOKE);
|
||||||
|
wolf.setFireTicks(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public double processShockProof(Wolf wolf, double damage) {
|
||||||
|
wolf.playEffect(EntityEffect.WOLF_SHAKE);
|
||||||
|
return damage / getShockProofModifier();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void processHolyHound(Wolf wolf, double damage) {
|
||||||
|
double modifiedHealth = Math.min(wolf.getHealth() + damage, wolf.getMaxHealth());
|
||||||
|
|
||||||
|
wolf.setHealth(modifiedHealth);
|
||||||
|
wolf.playEffect(EntityEffect.WOLF_HEARTS);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCallOfTheWildFailureMessage(EntityType type) {
|
||||||
|
switch (type) {
|
||||||
|
case OCELOT:
|
||||||
|
return "Taming.Summon.Fail.Ocelot";
|
||||||
|
|
||||||
|
case WOLF:
|
||||||
|
return "Taming.Summon.Fail.Wolf";
|
||||||
|
|
||||||
|
case HORSE:
|
||||||
|
return "Taming.Summon.Fail.Horse";
|
||||||
|
|
||||||
|
default:
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,6 @@ import com.gmail.nossr50.events.fake.FakeEntityDamageEvent;
|
|||||||
import com.gmail.nossr50.events.fake.FakeEntityTameEvent;
|
import com.gmail.nossr50.events.fake.FakeEntityTameEvent;
|
||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.mcMMO;
|
||||||
import com.gmail.nossr50.skills.mining.MiningManager;
|
import com.gmail.nossr50.skills.mining.MiningManager;
|
||||||
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.util.Misc;
|
import com.gmail.nossr50.util.Misc;
|
||||||
@ -533,7 +532,7 @@ public class EntityListener implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Taming.getInstance().canPreventDamage(pet, owner)) {
|
if (pluginRef.getDynamicSettingsManager().getSkillBehaviourManager().getTamingBehaviour().canPreventDamage(pet, owner)) {
|
||||||
Player player = (Player) owner;
|
Player player = (Player) owner;
|
||||||
Wolf wolf = (Wolf) pet;
|
Wolf wolf = (Wolf) pet;
|
||||||
|
|
||||||
@ -562,7 +561,7 @@ public class EntityListener implements Listener {
|
|||||||
case ENTITY_ATTACK:
|
case ENTITY_ATTACK:
|
||||||
case PROJECTILE:
|
case PROJECTILE:
|
||||||
if (tamingManager.canUseThickFur()) {
|
if (tamingManager.canUseThickFur()) {
|
||||||
event.setDamage(Taming.getInstance().processThickFur(wolf, event.getDamage()));
|
event.setDamage(pluginRef.getDynamicSettingsManager().getSkillBehaviourManager().getTamingBehaviour().processThickFur(wolf, event.getDamage()));
|
||||||
|
|
||||||
if (event.getFinalDamage() == 0) {
|
if (event.getFinalDamage() == 0) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
@ -572,7 +571,7 @@ public class EntityListener implements Listener {
|
|||||||
|
|
||||||
case FIRE_TICK:
|
case FIRE_TICK:
|
||||||
if (tamingManager.canUseThickFur()) {
|
if (tamingManager.canUseThickFur()) {
|
||||||
Taming.getInstance().processThickFurFire(wolf);
|
pluginRef.getDynamicSettingsManager().getSkillBehaviourManager().getTamingBehaviour().processThickFurFire(wolf);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -580,7 +579,7 @@ public class EntityListener implements Listener {
|
|||||||
case POISON:
|
case POISON:
|
||||||
case WITHER:
|
case WITHER:
|
||||||
if (tamingManager.canUseHolyHound()) {
|
if (tamingManager.canUseHolyHound()) {
|
||||||
Taming.getInstance().processHolyHound(wolf, event.getDamage());
|
pluginRef.getDynamicSettingsManager().getSkillBehaviourManager().getTamingBehaviour().processHolyHound(wolf, event.getDamage());
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -588,7 +587,7 @@ public class EntityListener implements Listener {
|
|||||||
case ENTITY_EXPLOSION:
|
case ENTITY_EXPLOSION:
|
||||||
case LIGHTNING:
|
case LIGHTNING:
|
||||||
if (tamingManager.canUseShockProof()) {
|
if (tamingManager.canUseShockProof()) {
|
||||||
event.setDamage(Taming.getInstance().processShockProof(wolf, event.getDamage()));
|
event.setDamage(pluginRef.getDynamicSettingsManager().getSkillBehaviourManager().getTamingBehaviour().processShockProof(wolf, event.getDamage()));
|
||||||
|
|
||||||
if (event.getFinalDamage() == 0) {
|
if (event.getFinalDamage() == 0) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
|
@ -1,103 +0,0 @@
|
|||||||
package com.gmail.nossr50.skills.taming;
|
|
||||||
|
|
||||||
import com.gmail.nossr50.config.AdvancedConfig;
|
|
||||||
import org.bukkit.EntityEffect;
|
|
||||||
import org.bukkit.entity.*;
|
|
||||||
|
|
||||||
public class Taming {
|
|
||||||
|
|
||||||
private static Taming instance;
|
|
||||||
private double fastFoodServiceActivationChance;
|
|
||||||
private int goreBleedTicks;
|
|
||||||
private double goreModifier;
|
|
||||||
private double sharpenedClawsBonusDamage;
|
|
||||||
private double shockProofModifier;
|
|
||||||
private double thickFurModifier;
|
|
||||||
|
|
||||||
public Taming() {
|
|
||||||
fastFoodServiceActivationChance = AdvancedConfig.getInstance().getFastFoodChance();
|
|
||||||
|
|
||||||
//Equivalent to rank 1 in Rupture
|
|
||||||
goreBleedTicks = 2;
|
|
||||||
goreModifier = AdvancedConfig.getInstance().getGoreModifier();
|
|
||||||
|
|
||||||
sharpenedClawsBonusDamage = AdvancedConfig.getInstance().getSharpenedClawsBonus();
|
|
||||||
|
|
||||||
shockProofModifier = AdvancedConfig.getInstance().getShockProofModifier();
|
|
||||||
|
|
||||||
thickFurModifier = AdvancedConfig.getInstance().getThickFurModifier();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Taming getInstance() {
|
|
||||||
if (instance == null)
|
|
||||||
instance = new Taming();
|
|
||||||
|
|
||||||
return instance;
|
|
||||||
}
|
|
||||||
|
|
||||||
public double getFastFoodServiceActivationChance() {
|
|
||||||
return fastFoodServiceActivationChance;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getGoreBleedTicks() {
|
|
||||||
return goreBleedTicks;
|
|
||||||
}
|
|
||||||
|
|
||||||
public double getGoreModifier() {
|
|
||||||
return goreModifier;
|
|
||||||
}
|
|
||||||
|
|
||||||
public double getSharpenedClawsBonusDamage() {
|
|
||||||
return sharpenedClawsBonusDamage;
|
|
||||||
}
|
|
||||||
|
|
||||||
public double getShockProofModifier() {
|
|
||||||
return shockProofModifier;
|
|
||||||
}
|
|
||||||
|
|
||||||
public double getThickFurModifier() {
|
|
||||||
return thickFurModifier;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean canPreventDamage(Tameable pet, AnimalTamer owner) {
|
|
||||||
return pet.isTamed() && owner instanceof Player && pet instanceof Wolf;
|
|
||||||
}
|
|
||||||
|
|
||||||
public double processThickFur(Wolf wolf, double damage) {
|
|
||||||
wolf.playEffect(EntityEffect.WOLF_SHAKE);
|
|
||||||
return damage / thickFurModifier;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void processThickFurFire(Wolf wolf) {
|
|
||||||
wolf.playEffect(EntityEffect.WOLF_SMOKE);
|
|
||||||
wolf.setFireTicks(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
public double processShockProof(Wolf wolf, double damage) {
|
|
||||||
wolf.playEffect(EntityEffect.WOLF_SHAKE);
|
|
||||||
return damage / shockProofModifier;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void processHolyHound(Wolf wolf, double damage) {
|
|
||||||
double modifiedHealth = Math.min(wolf.getHealth() + damage, wolf.getMaxHealth());
|
|
||||||
|
|
||||||
wolf.setHealth(modifiedHealth);
|
|
||||||
wolf.playEffect(EntityEffect.WOLF_HEARTS);
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCallOfTheWildFailureMessage(EntityType type) {
|
|
||||||
switch (type) {
|
|
||||||
case OCELOT:
|
|
||||||
return "Taming.Summon.Fail.Ocelot";
|
|
||||||
|
|
||||||
case WOLF:
|
|
||||||
return "Taming.Summon.Fail.Wolf";
|
|
||||||
|
|
||||||
case HORSE:
|
|
||||||
return "Taming.Summon.Fail.Horse";
|
|
||||||
|
|
||||||
default:
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user