use of me.desht.pneumaticcraft.common.recipes.AmadronOfferCustom in project pnc-repressurized by TeamPneumatic.
the class PacketSyncAmadronOffers method toBytes.
@Override
public void toBytes(ByteBuf buf) {
buf.writeInt(offers.size());
for (AmadronOffer offer : offers) {
buf.writeBoolean(offer instanceof AmadronOfferCustom);
writeFluidOrItemStack(offer.getInput(), buf);
writeFluidOrItemStack(offer.getOutput(), buf);
if (offer instanceof AmadronOfferCustom) {
((AmadronOfferCustom) offer).writeToBuf(buf);
}
}
}
use of me.desht.pneumaticcraft.common.recipes.AmadronOfferCustom in project pnc-repressurized by TeamPneumatic.
the class WidgetAmadronOffer method render.
@Override
public void render(int mouseX, int mouseY, float partialTick) {
if (renderBackground) {
Minecraft.getMinecraft().getTextureManager().bindTexture(Textures.WIDGET_AMADRON_OFFER);
GlStateManager.color(1f, canBuy ? 1f : 0.4f, canBuy ? 1f : 0.4f, 1f);
Gui.drawModalRectWithCustomSizedTexture(x, y, 0, 0, getBounds().width, getBounds().height, 256, 256);
}
for (IGuiWidget widget : widgets) {
widget.render(mouseX, mouseY, partialTick);
}
Minecraft.getMinecraft().fontRenderer.drawString(offer.getVendor(), x + 2, y + 2, 0xFF000000);
boolean customOffer = offer instanceof AmadronOfferCustom;
if (shoppingAmount > 0) {
Minecraft.getMinecraft().fontRenderer.drawString(TextFormatting.BLACK.toString() + shoppingAmount, x + 36 - Minecraft.getMinecraft().fontRenderer.getStringWidth("" + shoppingAmount) / 2, y + (customOffer ? 15 : 20), 0xFF000000);
}
if (customOffer) {
AmadronOfferCustom custom = (AmadronOfferCustom) offer;
Minecraft.getMinecraft().fontRenderer.drawString(TextFormatting.DARK_BLUE.toString() + custom.getStock(), x + 36 - Minecraft.getMinecraft().fontRenderer.getStringWidth("" + custom.getStock()) / 2, y + 25, 0xFF000000);
}
}
Aggregations