use of crazypants.enderio.api.upgrades.IHasPlayerRenderer in project EnderIO by SleepyTrousers.
the class UpgradeRenderDispatcher method doRenderLayer.
@Override
public void doRenderLayer(@Nonnull AbstractClientPlayer player, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
NNList.of(EntityEquipmentSlot.class).apply(new Callback<EntityEquipmentSlot>() {
@Override
public void apply(@Nonnull EntityEquipmentSlot slot) {
ItemStack item = player.getItemStackFromSlot(slot);
if (item.getItem() instanceof IDarkSteelItem) {
for (IDarkSteelUpgrade upgrade : UpgradeRegistry.getUpgrades()) {
if (upgrade instanceof IHasPlayerRenderer && upgrade.hasUpgrade(item)) {
((IHasPlayerRenderer) upgrade).getRender().doRenderLayer(renderPlayer, slot, item, player, limbSwing, limbSwingAmount, partialTicks, ageInTicks, netHeadYaw, headPitch, scale);
}
}
}
if (item.getItem() instanceof IHasPlayerRenderer) {
((IHasPlayerRenderer) item.getItem()).getRender().doRenderLayer(renderPlayer, slot, item, player, limbSwing, limbSwingAmount, partialTicks, ageInTicks, netHeadYaw, headPitch, scale);
}
}
});
IInventory baubles = BaublesUtil.instance().getBaubles(player);
if (baubles != null) {
for (int i = 0; i < baubles.getSizeInventory(); i++) {
ItemStack piece = baubles.getStackInSlot(i);
if (piece.getItem() instanceof IHasPlayerRenderer) {
((IHasPlayerRenderer) piece.getItem()).getRender().doRenderLayer(renderPlayer, null, piece, player, limbSwing, limbSwingAmount, partialTicks, ageInTicks, netHeadYaw, headPitch, scale);
}
}
}
}
Aggregations