use of cpw.mods.fml.relauncher.SideOnly in project ArsMagica2 by Mithion.
the class ItemLostJournal method getSubItems.
@Override
@SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List par3List) {
super.getSubItems(item, par2CreativeTabs, par3List);
int sCount = 0;
for (Story s : StoryManager.INSTANCE.allStories()) {
int meta = sCount << 16;
for (short i = 0; i < s.getNumParts(); ++i) {
meta = sCount + i;
ItemStack stack = new ItemStack(item, 1, meta);
stack.stackTagCompound = new NBTTagCompound();
s.WritePartToNBT(stack.stackTagCompound, i);
stack.stackTagCompound.setString("title", s.getTitle());
par3List.add(stack);
}
}
}
use of cpw.mods.fml.relauncher.SideOnly in project ArsMagica2 by Mithion.
the class CompendiumEntryRitual method getCompendiumGui.
@Override
@SideOnly(Side.CLIENT)
protected GuiArcaneCompendium getCompendiumGui(String searchID, int meta) {
if (this.ritualShape != null) {
try {
Field f = RitualShapeHelper.class.getField(ritualShape);
MultiblockStructureDefinition def = (MultiblockStructureDefinition) f.get(RitualShapeHelper.instance);
ISkillTreeEntry entry = SkillManager.instance.getSkill(ritualController);
if (entry instanceof IRitualInteraction) {
IRitualInteraction controller = (IRitualInteraction) entry;
return new GuiArcaneCompendium(searchID, def, controller);
}
} catch (Throwable e) {
e.printStackTrace();
}
}
return new GuiArcaneCompendium(searchID);
}
use of cpw.mods.fml.relauncher.SideOnly in project ArsMagica2 by Mithion.
the class AMClientEventHandler method onPlayerRender.
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void onPlayerRender(RenderPlayerEvent.Pre event) {
ItemStack chestPlate = event.entityPlayer.inventory.armorInventory[2];
ModelBiped mainModel = ReflectionHelper.getPrivateValue(RenderPlayer.class, event.renderer, "field_77109_a", "modelBipedMain");
boolean holdingItem = false;
if (event.entityPlayer.getCurrentEquippedItem() != null)
holdingItem = true;
if (!AMCore.proxy.playerTracker.hasCLS(event.entityPlayer.getUniqueID().toString())) {
if (chestPlate != null && chestPlate.getItem() == ItemsCommonProxy.earthGuardianArmor) {
if (mainModel != null) {
mainModel.bipedLeftArm.isHidden = true;
mainModel.bipedRightArm.isHidden = !holdingItem;
}
} else {
if (mainModel != null) {
mainModel.bipedLeftArm.isHidden = false;
mainModel.bipedRightArm.isHidden = false;
}
}
}
double dX = AMCore.proxy.getLocalPlayer().posX - event.entityPlayer.posX;
double dY = AMCore.proxy.getLocalPlayer().posY - event.entityPlayer.posY;
double dZ = AMCore.proxy.getLocalPlayer().posZ - event.entityPlayer.posZ;
double dpX = AMCore.proxy.getLocalPlayer().prevPosX - event.entityPlayer.prevPosX;
double dpY = AMCore.proxy.getLocalPlayer().prevPosY - event.entityPlayer.prevPosY;
double dpZ = AMCore.proxy.getLocalPlayer().prevPosZ - event.entityPlayer.prevPosZ;
double transX = dpX + (dX - dpX) * event.partialRenderTick;
double transY = dpY + (dY - dpY) * event.partialRenderTick;
double transZ = dpZ + (dZ - dpZ) * event.partialRenderTick;
if (ExtendedProperties.For(event.entityPlayer).getFlipRotation() > 0) {
GL11.glPushMatrix();
GL11.glTranslated(-transX, -transY, -transZ);
GL11.glRotatef(ExtendedProperties.For(event.entityPlayer).getFlipRotation(), 0, 0, 1.0f);
GL11.glTranslated(transX, transY, transZ);
float offset = event.entityPlayer.height * (ExtendedProperties.For(event.entityPlayer).getFlipRotation() / 180.0f);
GL11.glTranslatef(0, -offset, 0);
}
float shrink = ExtendedProperties.For(event.entityPlayer).getShrinkPct();
if (shrink > 0) {
GL11.glPushMatrix();
GL11.glTranslatef(0, 0 - 0.5f * shrink, 0);
GL11.glScalef(1 - 0.5f * shrink, 1 - 0.5f * shrink, 1 - 0.5f * shrink);
}
}
use of cpw.mods.fml.relauncher.SideOnly in project ArsMagica2 by Mithion.
the class AMClientEventHandler method onPlayerRender.
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void onPlayerRender(RenderPlayerEvent.Post event) {
ModelBiped mainModel = ReflectionHelper.getPrivateValue(RenderPlayer.class, event.renderer, "field_77109_a", "modelBipedMain");
if (mainModel != null) {
mainModel.bipedLeftArm.isHidden = false;
mainModel.bipedRightArm.isHidden = false;
}
if (ExtendedProperties.For(event.entityPlayer).getFlipRotation() > 0) {
GL11.glPopMatrix();
}
if (ExtendedProperties.For(event.entityPlayer).getShrinkPct() > 0) {
GL11.glPopMatrix();
}
CloakUtils.renderCloakModel(event.entityPlayer, mainModel, event.partialRenderTick);
if (event.entityPlayer == AMCore.proxy.getLocalPlayer()) {
if (AMCore.proxy.getLocalPlayer().isPotionActive(BuffList.trueSight.id)) {
if (AMGuiHelper.instance.playerRunesAlpha < 1)
AMGuiHelper.instance.playerRunesAlpha += 0.01f;
} else {
if (AMGuiHelper.instance.playerRunesAlpha > 0)
AMGuiHelper.instance.playerRunesAlpha -= 0.01f;
}
if (AMGuiHelper.instance.playerRunesAlpha > 0) {
int runeCombo = EntityUtilities.getRuneCombo(event.entityPlayer);
int numRunes = 0;
for (int i = 0; i <= 16; ++i) {
int bit = 1 << i;
if ((runeCombo & bit) == bit) {
numRunes++;
}
}
double step = 0.25f;
double xOffset = -(numRunes / 2.0f) * step + ((numRunes % 2 == 0) ? step / 2f : 0);
for (int i = 0; i <= 16; ++i) {
int bit = 1 << i;
if ((runeCombo & bit) == bit) {
RenderUtilities.DrawIconInWorldAtOffset(ItemsCommonProxy.rune.getIconFromDamage(i), xOffset, 0.5f, 0, 0.25f, 0.25f);
xOffset += step;
}
}
}
}
}
use of cpw.mods.fml.relauncher.SideOnly in project ArsMagica2 by Mithion.
the class AMNetHandler method requestAuras.
@SideOnly(Side.CLIENT)
public void requestAuras(EntityPlayer player) {
AMDataWriter writer = new AMDataWriter();
EntityPlayer localPlayer = Minecraft.getMinecraft().thePlayer;
if (localPlayer == null)
return;
writer.add(localPlayer.getEntityId());
writer.add(player.getEntityId());
sendPacketToServer(AMPacketIDs.REQUEST_BETA_PARTICLES, writer.generate());
}
Aggregations