use of blusunrize.immersiveengineering.common.items.ItemRevolver.SpecialRevolver in project ImmersiveEngineering by BluSunrize.
the class BotaniaHelper method onPotatoRender.
@SubscribeEvent()
@SideOnly(Side.CLIENT)
public void onPotatoRender(TinyPotatoRenderEvent event) {
if (event.tile.getWorld() == null)
return;
if (revolverEntity == null) {
revolverEntity = new EntityItem(event.tile.getWorld(), 0.0D, 0.0D, 0.0D, new ItemStack(IEContent.itemRevolver));
revolverEntity.hoverStart = 0;
}
try {
String formattedName = event.name.replace("_", " ");
ItemRevolver.SpecialRevolver special = null;
if (formattedName.equalsIgnoreCase("Mr Damien Hazard") || formattedName.equalsIgnoreCase("Mr Hazard"))
special = ItemRevolver.specialRevolversByTag.get("dev");
else if (event.name.equalsIgnoreCase("BluSunrize"))
special = ItemRevolver.specialRevolversByTag.get("fenrir");
else {
if (nameToSpecial.containsKey(event.name.toLowerCase(Locale.ENGLISH))) {
List<SpecialRevolver> list = nameToSpecial.get(event.name.toLowerCase(Locale.ENGLISH));
if (list != null && list.size() > 0) {
long ticks = event.tile.getWorld() != null ? event.tile.getWorld().getTotalWorldTime() / 100 : 0;
special = list.get((int) (ticks % list.size()));
}
}
}
if (special != null) {
GlStateManager.pushMatrix();
((ItemRevolver) IEContent.itemRevolver).applySpecialCrafting(revolverEntity.getEntityItem(), special);
GlStateManager.translate(-.16, 1.45, -.2);
GlStateManager.rotate(-90, 0, 1, 0);
GlStateManager.rotate(15, 0, 0, 1);
GlStateManager.rotate(180, 1, 0, 0);
GlStateManager.scale(.625f, .625f, .625f);
ClientUtils.mc().getRenderManager().doRenderEntity(revolverEntity, 0, 0, 0, 0, 0, false);
GlStateManager.popMatrix();
}
} catch (Exception e) {
}
}
Aggregations