mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-29 16:46:46 +01:00
Read summon item from config in /taming command
This commit is contained in:
parent
8e5340ebc3
commit
63b332216e
@ -12,6 +12,7 @@ import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.skills.taming.Taming;
|
||||
import com.gmail.nossr50.util.Permissions;
|
||||
import com.gmail.nossr50.util.StringUtils;
|
||||
|
||||
public class TamingCommand extends SkillCommand {
|
||||
private String goreChance;
|
||||
@ -91,9 +92,13 @@ public class TamingCommand extends SkillCommand {
|
||||
|
||||
if (canCallWild) {
|
||||
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Taming.Effect.12"), LocaleLoader.getString("Taming.Effect.13")));
|
||||
messages.add(LocaleLoader.getString("Taming.Effect.14", Config.getInstance().getTamingCOTWCost(EntityType.OCELOT)));
|
||||
messages.add(LocaleLoader.getString("Taming.Effect.15", Config.getInstance().getTamingCOTWCost(EntityType.WOLF)));
|
||||
messages.add(LocaleLoader.getString("Taming.Effect.20", Config.getInstance().getTamingCOTWCost(EntityType.HORSE)));
|
||||
int costOcelot = Config.getInstance().getTamingCOTWCost(EntityType.OCELOT);
|
||||
String itemOcelot = StringUtils.getPrettyItemString(Config.getInstance().getTamingCOTWMaterial(EntityType.OCELOT));
|
||||
int costWolf = Config.getInstance().getTamingCOTWCost(EntityType.WOLF);
|
||||
String itemWolf = StringUtils.getPrettyItemString(Config.getInstance().getTamingCOTWMaterial(EntityType.WOLF));
|
||||
int costHorse = Config.getInstance().getTamingCOTWCost(EntityType.HORSE);
|
||||
String itemHorse = StringUtils.getPrettyItemString(Config.getInstance().getTamingCOTWMaterial(EntityType.HORSE));
|
||||
messages.add(LocaleLoader.getString("Taming.Effect.14", costOcelot, itemOcelot, costWolf, itemWolf, costHorse, itemHorse));
|
||||
}
|
||||
|
||||
return messages;
|
||||
|
@ -362,7 +362,8 @@ public class TamingManager extends SkillManager {
|
||||
return true;
|
||||
}
|
||||
|
||||
int summonAmount = summonedEntities.get(entityType).size();
|
||||
List<TrackedTamingEntity> trackedEntities = getTrackedEntities(entityType);
|
||||
int summonAmount = trackedEntities == null ? 0 : trackedEntities.size();
|
||||
|
||||
if (summonAmount >= maxAmountSummons) {
|
||||
player.sendMessage(LocaleLoader.getString("Taming.Summon.Fail.TooMany", maxAmountSummons));
|
||||
@ -382,6 +383,10 @@ public class TamingManager extends SkillManager {
|
||||
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);
|
||||
}
|
||||
|
@ -340,9 +340,7 @@ Taming.Effect.10=Shock Proof
|
||||
Taming.Effect.11=Explosive Damage Reduction
|
||||
Taming.Effect.12=Call of the Wild
|
||||
Taming.Effect.13=Summon an animal to your side
|
||||
Taming.Effect.14=[[GRAY]]COTW (Ocelot): Crouch and left-click with {0} Fish in hand
|
||||
Taming.Effect.15=[[GRAY]]COTW (Wolf): Crouch and left-click with {0} Bones in hand
|
||||
Taming.Effect.20=[[GRAY]]COTW (Horse): Crouch and left-click with {0} Apples in hand
|
||||
Taming.Effect.14=[[GRAY]]COTW: Crouch and left-click with\n {0} {1} (Ocelot), {2} {3} (Wolf), {4} {5} (Horse)
|
||||
Taming.Effect.16=Fast Food Service
|
||||
Taming.Effect.17=Chance for wolves to heal on attack
|
||||
Taming.Effect.18=Holy Hound
|
||||
|
Loading…
Reference in New Issue
Block a user