Search in sources :

Example 1 with EnumHorseType

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);
}
Also used : EntityHorseMount(de.sanandrew.mods.claysoldiers.entity.mount.EntityHorseMount) Quartet(de.sanandrew.core.manpack.util.javatuples.Quartet) ArrayList(java.util.ArrayList) EnumHorseType(de.sanandrew.mods.claysoldiers.util.mount.EnumHorseType) ItemStack(net.minecraft.item.ItemStack)

Example 2 with EnumHorseType

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");
}
Also used : IIcon(net.minecraft.util.IIcon) EnumHorseType(de.sanandrew.mods.claysoldiers.util.mount.EnumHorseType) SideOnly(cpw.mods.fml.relauncher.SideOnly)

Example 3 with EnumHorseType

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);
    }
}
Also used : EnumHorseType(de.sanandrew.mods.claysoldiers.util.mount.EnumHorseType) ItemStack(net.minecraft.item.ItemStack)

Example 4 with EnumHorseType

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;
}
Also used : EnumHorseType(de.sanandrew.mods.claysoldiers.util.mount.EnumHorseType) ItemStack(net.minecraft.item.ItemStack)

Example 5 with EnumHorseType

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;
}
Also used : EnumHorseType(de.sanandrew.mods.claysoldiers.util.mount.EnumHorseType)

Aggregations

EnumHorseType (de.sanandrew.mods.claysoldiers.util.mount.EnumHorseType)6 ItemStack (net.minecraft.item.ItemStack)3 SideOnly (cpw.mods.fml.relauncher.SideOnly)1 Quartet (de.sanandrew.core.manpack.util.javatuples.Quartet)1 EntityHorseMount (de.sanandrew.mods.claysoldiers.entity.mount.EntityHorseMount)1 ArrayList (java.util.ArrayList)1 IIcon (net.minecraft.util.IIcon)1