mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-07-31 11:35:28 +02:00
Update code style
This commit is contained in:
@@ -32,11 +32,29 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
public class TamingManager extends SkillManager {
|
||||
private static HashMap<EntityType, List<TrackedTamingEntity>> summonedEntities = new HashMap<>();
|
||||
|
||||
public TamingManager(McMMOPlayer mcMMOPlayer) {
|
||||
super(mcMMOPlayer, PrimarySkillType.TAMING);
|
||||
}
|
||||
|
||||
private static HashMap<EntityType, List<TrackedTamingEntity>> summonedEntities = new HashMap<>();
|
||||
protected static void addToTracker(LivingEntity livingEntity) {
|
||||
TrackedTamingEntity trackedEntity = new TrackedTamingEntity(livingEntity);
|
||||
|
||||
if (!summonedEntities.containsKey(livingEntity.getType())) {
|
||||
summonedEntities.put(livingEntity.getType(), new ArrayList<>());
|
||||
}
|
||||
|
||||
summonedEntities.get(livingEntity.getType()).add(trackedEntity);
|
||||
}
|
||||
|
||||
protected static List<TrackedTamingEntity> getTrackedEntities(EntityType entityType) {
|
||||
return summonedEntities.get(entityType);
|
||||
}
|
||||
|
||||
protected static void removeFromTracker(TrackedTamingEntity trackedEntity) {
|
||||
summonedEntities.get(trackedEntity.getLivingEntity().getType()).remove(trackedEntity);
|
||||
}
|
||||
|
||||
public boolean canUseThickFur() {
|
||||
return RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.TAMING_THICK_FUR)
|
||||
@@ -69,14 +87,14 @@ public class TamingManager extends SkillManager {
|
||||
}
|
||||
|
||||
public boolean canUseGore() {
|
||||
if(!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.TAMING_GORE))
|
||||
if (!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.TAMING_GORE))
|
||||
return false;
|
||||
|
||||
return Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.TAMING_GORE);
|
||||
}
|
||||
|
||||
public boolean canUseBeastLore() {
|
||||
if(!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.TAMING_BEAST_LORE))
|
||||
if (!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.TAMING_BEAST_LORE))
|
||||
return false;
|
||||
|
||||
return Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.TAMING_BEAST_LORE);
|
||||
@@ -94,7 +112,7 @@ public class TamingManager extends SkillManager {
|
||||
/**
|
||||
* Apply the Fast Food Service ability.
|
||||
*
|
||||
* @param wolf The wolf using the ability
|
||||
* @param wolf The wolf using the ability
|
||||
* @param damage The damage being absorbed by the wolf
|
||||
*/
|
||||
public void fastFoodService(Wolf wolf, double damage) {
|
||||
@@ -126,7 +144,7 @@ public class TamingManager extends SkillManager {
|
||||
BleedTimerTask.add(target, getPlayer(), Taming.getInstance().getGoreBleedTicks(), 1, 2);
|
||||
|
||||
if (target instanceof Player) {
|
||||
NotificationManager.sendPlayerInformation((Player)target, NotificationType.SUBSKILL_MESSAGE, "Combat.StruckByGore");
|
||||
NotificationManager.sendPlayerInformation((Player) target, NotificationType.SUBSKILL_MESSAGE, "Combat.StruckByGore");
|
||||
}
|
||||
|
||||
NotificationManager.sendPlayerInformation(getPlayer(), NotificationType.SUBSKILL_MESSAGE, "Combat.Gore");
|
||||
@@ -143,7 +161,7 @@ public class TamingManager extends SkillManager {
|
||||
* Summon an ocelot to your side.
|
||||
*/
|
||||
public void summonOcelot() {
|
||||
if(!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.TAMING_CALL_OF_THE_WILD))
|
||||
if (!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.TAMING_CALL_OF_THE_WILD))
|
||||
return;
|
||||
|
||||
if (!Permissions.callOfTheWild(getPlayer(), EntityType.OCELOT)) {
|
||||
@@ -157,7 +175,7 @@ public class TamingManager extends SkillManager {
|
||||
* Summon a wolf to your side.
|
||||
*/
|
||||
public void summonWolf() {
|
||||
if(!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.TAMING_CALL_OF_THE_WILD))
|
||||
if (!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.TAMING_CALL_OF_THE_WILD))
|
||||
return;
|
||||
|
||||
if (!Permissions.callOfTheWild(getPlayer(), EntityType.WOLF)) {
|
||||
@@ -171,7 +189,7 @@ public class TamingManager extends SkillManager {
|
||||
* Summon a horse to your side.
|
||||
*/
|
||||
public void summonHorse() {
|
||||
if(!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.TAMING_CALL_OF_THE_WILD))
|
||||
if (!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.TAMING_CALL_OF_THE_WILD))
|
||||
return;
|
||||
|
||||
if (!Permissions.callOfTheWild(getPlayer(), EntityType.HORSE)) {
|
||||
@@ -212,10 +230,10 @@ public class TamingManager extends SkillManager {
|
||||
}
|
||||
|
||||
public void pummel(LivingEntity target, Wolf wolf) {
|
||||
if(!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.TAMING_PUMMEL))
|
||||
if (!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.TAMING_PUMMEL))
|
||||
return;
|
||||
|
||||
if(!RandomChanceUtil.checkRandomChanceExecutionSuccess(new RandomChanceSkillStatic(AdvancedConfig.getInstance().getPummelChance(), getPlayer(), SubSkillType.TAMING_PUMMEL)))
|
||||
if (!RandomChanceUtil.checkRandomChanceExecutionSuccess(new RandomChanceSkillStatic(AdvancedConfig.getInstance().getPummelChance(), getPlayer(), SubSkillType.TAMING_PUMMEL)))
|
||||
return;
|
||||
|
||||
ParticleEffectUtils.playGreaterImpactEffect(target);
|
||||
@@ -252,7 +270,7 @@ public class TamingManager extends SkillManager {
|
||||
/**
|
||||
* Handle the Call of the Wild ability.
|
||||
*
|
||||
* @param type The type of entity to summon.
|
||||
* @param type The type of entity to summon.
|
||||
* @param summonAmount The amount of material needed to summon the entity
|
||||
*/
|
||||
private void callOfTheWild(EntityType type, int summonAmount) {
|
||||
@@ -378,22 +396,4 @@ public class TamingManager extends SkillManager {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
protected static void addToTracker(LivingEntity livingEntity) {
|
||||
TrackedTamingEntity trackedEntity = new TrackedTamingEntity(livingEntity);
|
||||
|
||||
if (!summonedEntities.containsKey(livingEntity.getType())) {
|
||||
summonedEntities.put(livingEntity.getType(), new ArrayList<>());
|
||||
}
|
||||
|
||||
summonedEntities.get(livingEntity.getType()).add(trackedEntity);
|
||||
}
|
||||
|
||||
protected static List<TrackedTamingEntity> getTrackedEntities(EntityType entityType) {
|
||||
return summonedEntities.get(entityType);
|
||||
}
|
||||
|
||||
protected static void removeFromTracker(TrackedTamingEntity trackedEntity) {
|
||||
summonedEntities.get(trackedEntity.getLivingEntity().getType()).remove(trackedEntity);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user