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));
}
}
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);
}
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);
}
}
Aggregations