use of de.sanandrew.mods.claysoldiers.util.mount.EnumHorseType in project ClaySoldiersMod by SanAndreasP.
the class RenderStatDisplayOverlay method renderMounts.
private void renderMounts(Minecraft mc) {
@SuppressWarnings("unchecked") List<EntityHorseMount> horses = mc.theWorld.getEntitiesWithinAABB(EntityHorseMount.class, getRangeAabbFromPlayer(mc.thePlayer));
List<Quartet<Integer, String, Integer, ItemStack>> teams = new ArrayList<>();
Map<String, Integer> teamCounts = Maps.newHashMap();
for (EntityHorseMount dex : horses) {
String team = EnumHorseType.VALUES[dex.getType()].toString();
if (teamCounts.containsKey(team)) {
teamCounts.put(team, teamCounts.get(team) + 1);
} else {
teamCounts.put(team, 1);
}
}
for (Entry<String, Integer> team : teamCounts.entrySet()) {
EnumHorseType teamInst = EnumHorseType.valueOf(team.getKey());
teams.add(Quartet.with(teamInst.typeColor, team.getKey(), team.getValue(), (ItemStack) null));
}
this.renderStats(mc, SAPUtils.translate(RegistryItems.statDisplay.getUnlocalizedName() + ".title.mounts"), teams, 110, 5);
}
use of de.sanandrew.mods.claysoldiers.util.mount.EnumHorseType in project ClaySoldiersMod by SanAndreasP.
the class ItemHorseDoll method registerIcons.
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister) {
Map<String, IIcon> names = Maps.newHashMap();
this.p_icons = Maps.newEnumMap(EnumHorseType.class);
for (EnumHorseType type : EnumHorseType.VALUES) {
if (type.itemData == null) {
continue;
}
if (!names.containsKey(type.itemData.getValue0())) {
names.put(type.itemData.getValue0(), iconRegister.registerIcon(type.itemData.getValue0()));
}
this.p_icons.put(type, names.get(type.itemData.getValue0()));
}
this.p_pegasusWings = iconRegister.registerIcon(ClaySoldiersMod.MOD_ID + ":doll_pegasus_wing");
}
use of de.sanandrew.mods.claysoldiers.util.mount.EnumHorseType in project ClaySoldiersMod by SanAndreasP.
the class ItemHorseDoll method getSubItems.
@Override
@SuppressWarnings("unchecked")
public void getSubItems(Item item, CreativeTabs creativeTab, List stacks) {
for (EnumHorseType type : EnumHorseType.VALUES) {
if (type.itemData == null) {
continue;
}
ItemStack stack = new ItemStack(this, 1);
setType(stack, type, false);
stacks.add(stack.copy());
setType(stack, type, true);
stacks.add(stack);
}
}
use of de.sanandrew.mods.claysoldiers.util.mount.EnumHorseType in project ClaySoldiersMod by SanAndreasP.
the class RecipeHorses method getCraftingResult.
@Override
public ItemStack getCraftingResult(InventoryCrafting invCrafting) {
boolean isPegasus = false;
if (ItemUtils.areStacksEqual(invCrafting.getStackInSlot(1), this.p_feather, true)) {
isPegasus = true;
}
for (EnumHorseType horseType : EnumHorseType.VALUES) {
if (ItemUtils.areStacksEqual(horseType.item, invCrafting.getStackInSlot(3), true)) {
ItemStack stack = new ItemStack(RegistryItems.dollHorseMount, 2);
ItemHorseDoll.setType(stack, horseType, isPegasus);
return stack;
}
}
return null;
}
use of de.sanandrew.mods.claysoldiers.util.mount.EnumHorseType in project ClaySoldiersMod by SanAndreasP.
the class EntityHorseMount method setHorseSpecs.
public void setHorseSpecs() {
EnumHorseType type = EnumHorseType.VALUES[this.getType()];
this.updateHealth(type.health);
this.moveSpeed = type.moveSpeed;
}
Aggregations