Search in sources :

Example 1 with ClaymanTeam

use of de.sanandrew.mods.claysoldiers.util.soldier.ClaymanTeam in project ClaySoldiersMod by SanAndreasP.

the class EntityClayMan method setupTexture.

public void setupTexture(boolean isRare, boolean isUnique) {
    ClaymanTeam team = ClaymanTeam.getTeam(this.getClayTeam());
    if (isUnique && team.getUniqueTextures().length > 0) {
        this.dataWatcher.updateObject(DW_IS_TEXTURE_RARE_OR_UNIQUE, (byte) 2);
        this.dataWatcher.updateObject(DW_TEXTURE_INDEX, this.rand.nextInt(team.getUniqueTextures().length));
    } else if (isRare && team.getRareTextures().length > 0) {
        this.dataWatcher.updateObject(DW_IS_TEXTURE_RARE_OR_UNIQUE, (byte) 1);
        this.dataWatcher.updateObject(DW_TEXTURE_INDEX, this.rand.nextInt(team.getRareTextures().length));
    } else {
        this.dataWatcher.updateObject(DW_IS_TEXTURE_RARE_OR_UNIQUE, (byte) 0);
        this.dataWatcher.updateObject(DW_TEXTURE_INDEX, this.rand.nextInt(team.getDefaultTextures().length));
    }
}
Also used : ClaymanTeam(de.sanandrew.mods.claysoldiers.util.soldier.ClaymanTeam)

Example 2 with ClaymanTeam

use of de.sanandrew.mods.claysoldiers.util.soldier.ClaymanTeam in project ClaySoldiersMod by SanAndreasP.

the class RenderStatDisplayOverlay method renderSoldiers.

private void renderSoldiers(Minecraft mc) {
    @SuppressWarnings("unchecked") List<EntityClayMan> soldiers = mc.theWorld.getEntitiesWithinAABB(EntityClayMan.class, getRangeAabbFromPlayer(mc.thePlayer));
    // team background color, team name, team count
    List<Quartet<Integer, String, Integer, ItemStack>> teams = new ArrayList<>();
    Map<String, Integer> teamCounts = Maps.newHashMap();
    for (EntityClayMan dex : soldiers) {
        String team = dex.getClayTeam();
        if (teamCounts.containsKey(team)) {
            teamCounts.put(team, teamCounts.get(team) + 1);
        } else {
            teamCounts.put(team, 1);
        }
    }
    for (Entry<String, Integer> team : teamCounts.entrySet()) {
        ClaymanTeam teamInst = ClaymanTeam.getTeam(team.getKey());
        ItemStack renderedItem = new ItemStack(RegistryItems.dollSoldier);
        ItemClayManDoll.setTeamForItem(team.getKey(), renderedItem);
        teams.add(Quartet.with(teamInst.getTeamColor(), renderedItem.getUnlocalizedName() + ".color", team.getValue(), renderedItem));
    }
    this.renderStats(mc, SAPUtils.translate(RegistryItems.statDisplay.getUnlocalizedName() + ".title.soldiers"), teams, 5, 5);
}
Also used : Quartet(de.sanandrew.core.manpack.util.javatuples.Quartet) ClaymanTeam(de.sanandrew.mods.claysoldiers.util.soldier.ClaymanTeam) EntityClayMan(de.sanandrew.mods.claysoldiers.entity.EntityClayMan) ArrayList(java.util.ArrayList) ItemStack(net.minecraft.item.ItemStack)

Example 3 with ClaymanTeam

use of de.sanandrew.mods.claysoldiers.util.soldier.ClaymanTeam in project ClaySoldiersMod by SanAndreasP.

the class ParticleHelper method spawnSoldierDeathFx.

public static void spawnSoldierDeathFx(Quartet<Double, Double, Double, String> data, Minecraft mc) {
    ClaymanTeam team = ClaymanTeam.getTeam(data.getValue3());
    for (int i = 0; i < 10; i++) {
        ParticleSoldierDeath fx = new ParticleSoldierDeath(mc.theWorld, data.getValue0(), data.getValue1(), data.getValue2(), team);
        mc.effectRenderer.addEffect(fx);
    }
}
Also used : ClaymanTeam(de.sanandrew.mods.claysoldiers.util.soldier.ClaymanTeam)

Aggregations

ClaymanTeam (de.sanandrew.mods.claysoldiers.util.soldier.ClaymanTeam)3 Quartet (de.sanandrew.core.manpack.util.javatuples.Quartet)1 EntityClayMan (de.sanandrew.mods.claysoldiers.entity.EntityClayMan)1 ArrayList (java.util.ArrayList)1 ItemStack (net.minecraft.item.ItemStack)1