use of pokefenn.totemic.api.music.MusicInstrument in project Totemic by TeamTotemic.
the class PageCeremony method renderScreen.
@Override
public void renderScreen(IGuiLexiconEntry gui, int mx, int my) {
relativeMouseX = mx;
relativeMouseY = my;
Minecraft mc = Minecraft.getMinecraft();
TextureManager render = mc.renderEngine;
FontRenderer font = mc.fontRenderer;
List<MusicInstrument> instruments = ceremony.getSelectors();
int instrLeft = gui.getLeft() + gui.getWidth() / 2 - 10 * instruments.size();
for (int i = 0; i < instruments.size(); i++) {
ItemStack item = instruments.get(i).getItem();
if (!item.isEmpty())
renderItem(gui, instrLeft + 20 * i, gui.getTop() + 31, item, false);
}
if (!tooltipStack.isEmpty())
RenderHelper.renderTooltip(mx, my, tooltipStack.getTooltip(mc.player, TooltipFlags.NORMAL));
String text = I18n.format("totemicmisc.musicSelector");
font.drawString(text, gui.getLeft() + gui.getWidth() / 2 - font.getStringWidth(text) / 2, gui.getTop() + 14, 0x999999);
boolean unicode = font.getUnicodeFlag();
font.setUnicodeFlag(true);
text = I18n.format(TotemUtil.getMusicNeeded(ceremony.getMusicNeeded()));
font.drawString(text, gui.getLeft() + gui.getWidth() / 2 - font.getStringWidth(text) / 2, gui.getTop() + 90, 0x000000);
text = I18n.format(getUnlocalizedName());
font.drawString(text, gui.getLeft() + gui.getWidth() / 2 - font.getStringWidth(text) / 2, gui.getTop() + 150, 0x000000);
font.setUnicodeFlag(unicode);
render.bindTexture(ceremonyOverlay);
GlStateManager.enableBlend();
GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GlStateManager.color(1F, 1F, 1F, 1F);
((GuiScreen) gui).drawTexturedModalRect(gui.getLeft(), gui.getTop(), 0, 0, gui.getWidth(), gui.getHeight());
GlStateManager.disableBlend();
tooltipStack = tooltipContainerStack = ItemStack.EMPTY;
tooltipEntry = false;
mouseDownLastTick = Mouse.isButtonDown(0);
}
use of pokefenn.totemic.api.music.MusicInstrument in project Totemic by TeamTotemic.
the class ModContent method createRegistries.
@SubscribeEvent
public static void createRegistries(RegistryEvent.NewRegistry event) {
// RegistryEvents are fired in alphabetic order.
// Instruments have to be registered before Ceremonies.
new RegistryBuilder<MusicInstrument>().setName(new ResourceLocation(Totemic.MOD_ID, "a_music_instruments")).setType(MusicInstrument.class).setMaxID(Byte.MAX_VALUE).disableSaving().create();
new RegistryBuilder<TotemEffect>().setName(new ResourceLocation(Totemic.MOD_ID, "b_totem_effects")).setType(TotemEffect.class).setMaxID(Byte.MAX_VALUE).disableSaving().create();
new RegistryBuilder<Ceremony>().setName(new ResourceLocation(Totemic.MOD_ID, "c_ceremonies")).setType(Ceremony.class).setMaxID(Byte.MAX_VALUE).disableSaving().create();
}
use of pokefenn.totemic.api.music.MusicInstrument in project Totemic by TeamTotemic.
the class StateSelection method writeToNBT.
@Override
void writeToNBT(NBTTagCompound tag) {
NBTTagList selectorsTag = new NBTTagList();
for (MusicInstrument instr : selectors) selectorsTag.appendTag(new NBTTagString(instr.getRegistryName().toString()));
tag.setTag("selectors", selectorsTag);
}
use of pokefenn.totemic.api.music.MusicInstrument in project Totemic by TeamTotemic.
the class StateStartup method handleFullPacket.
public void handleFullPacket(PacketCeremonyStartupFull msg) {
time = msg.getStartupTime();
music.clear();
totalMusic = 0;
for (int i = 0; i < msg.getCount(); i++) {
MusicInstrument instr = msg.getInstrument(i);
int value = msg.getValue(i);
music.put(instr, value);
totalMusic += value;
}
}
Aggregations