Skip to content

Commit

Permalink
Attempt to fix the invisible menu bug
Browse files Browse the repository at this point in the history
New building/releasing system
  • Loading branch information
sirolf2009 committed Jun 15, 2013
1 parent bec8ea5 commit 62fae2e
Show file tree
Hide file tree
Showing 11 changed files with 131 additions and 54 deletions.
4 changes: 4 additions & 0 deletions build.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@ECHO OFF
set ANT_HOME=C:\Program Files (x86)\Java\apache-ant-1.9.1
ant release >> build_log.txt
pause
2 changes: 2 additions & 0 deletions build.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dir.development=../../
dir.release=C:\Users\Floris\Dropbox\Public\necromancy\releases
92 changes: 92 additions & 0 deletions build.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
<?xml version="1.0" ?>
<project name="Necromancy" default="build">

<property file="build.properties" prefix="build"/>
<property file="build_number.properties" prefix="build_number"/>

<target name="clean">
<delete file="${build.dir.development}\forge\mcp\src\minecraft\mcmod.info" />
<delete dir="${build.dir.development}\forge\mcp\src\minecraft\com\sirolf2009" />
<delete dir="${build.dir.development}\forge\mcp\reobf\minecraft" />
</target>

<target name="prep">
<copy todir="${build.dir.development}\forge\mcp\src\minecraft">
<fileset dir="${build.dir.development}\source\Necromancy\common\" />
</copy>
<copy todir="${build.dir.development}\forge\mcp\src\minecraft">
<fileset dir="${build.dir.development}\source\NecroAPI\common\" />
</copy>
</target>

<target name="replace_tokens">
<replace dir="${build.dir.development}\forge\mcp\src\minecraft" token="@VERSION@" value="${release.mod.version}" />
<replace dir="${build.dir.development}\forge\mcp\src\minecraft" token="@FINGERPRINT@" value="${release.mod.fingerprint}" />
</target>

<target name="recompile">
<exec dir="${build.dir.development}\forge\mcp" executable="cmd" osfamily="windows">
<arg line="/c recompile.bat" />
</exec>
<exec dir="${build.dir.development}\forge\mcp" executable="bash" osfamily="unix">
<arg line="recompile.sh" />
</exec>
</target>

<target name="reobfuscate">
<exec dir="${build.dir.development}\forge\mcp" executable="cmd" osfamily="windows">
<arg line="/c reobfuscate_srg.bat" />
</exec>
<exec dir="${build.dir.development}\forge\mcp" executable="bash" osfamily="unix">
<arg line="reobfuscate_srg.sh" />
</exec>
</target>

<target name="sign_jar">
<signjar jar="${build.dir.release}\Necromancy-${release.mod.version}-${release.minecraft.version}.jar" keystore="${build.keystore.location}" alias="${build.keystore.alias}" storepass="${build.keystore.password}" />
</target>

<target name="build">
<!-- Prep for the build -->
<antcall target="clean" />
<antcall target="prep" />
<antcall target="recompile" />
<antcall target="reobfuscate" />

<!-- Build the jar -->
<mkdir dir="${build.dir.release}" />
<jar destfile="${build.dir.release}\Necromancy-universal-${release.mod.version}.jar">
<fileset dir="${build.dir.development}\forge\mcp\src\minecraft\" includes="mcmod.info" />
<fileset dir="${build.dir.development}\forge\mcp\reobf\minecraft" />
<fileset dir="${build.dir.development}\source\Necromancy\resources" excludes="**/xcf/**" />
</jar>

<!-- Clean up the MCP source now that we are done -->
<antcall target="clean" />
</target>

<target name="release">
<!-- Prep for the build -->
<input message="Mod version:" addproperty="release.mod.version" />
<input message="Minecraft version:" addproperty="release.minecraft.version" />
<antcall target="clean" />
<antcall target="prep" />
<antcall target="replace_tokens" />
<antcall target="recompile" />
<antcall target="reobfuscate" />

<!-- Build the jar -->
<mkdir dir="${build.dir.release}" />
<jar destfile="${build.dir.release}\Necromancy-${release.mod.version}-${release.minecraft.version}.jar">
<fileset dir="${build.dir.development}\forge\mcp\src\minecraft\" includes="mcmod.info" />
<fileset dir="${build.dir.development}\forge\mcp\reobf\minecraft" />
<fileset dir="${build.dir.development}\source\Necromancy\resources" excludes="**/xcf/**" />
</jar>

<!-- Sign the finished jar -->
<antcall target="sign_jar" />

<!-- Clean up the MCP source now that we are done -->
<antcall target="clean" />
</target>
</project>
9 changes: 5 additions & 4 deletions common/com/sirolf2009/necromancy/Necromancy.java
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,10 @@ public class Necromancy {
public static boolean Christmas = false;
public static boolean renderSpecialScythe = false;

public static Item necroArmorHead;
public static Item necroArmorTorso;
public static Item necroArmorLeggings;
public static Item necroArmorBoots;
public static Item apprenticeArmorHead;
public static Item apprenticeArmorTorso;
public static Item apprenticeArmorLeggings;
public static Item apprenticeArmorBoots;
public static Item necromanticItems;
public static Item necronomicon;
public static Item scythe;
Expand All @@ -150,6 +150,7 @@ public class Necromancy {
// public static Block skullWall;

public static EnumArmorMaterial isaac = EnumHelper.addArmorMaterial("Isaac", Integer.MAX_VALUE, new int[] { 0, 0, 0, 0 }, 0);
public static EnumArmorMaterial apprenticeRobes = EnumHelper.addArmorMaterial("apprenticeRobesNecromancy", Integer.MAX_VALUE, new int[] { 0, 0, 0, 0 }, 100);

public static Logger logger;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,28 @@

import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.renderer.InventoryEffectRenderer;
import net.minecraft.client.model.ModelBook;
import net.minecraft.item.ItemStack;
import net.minecraftforge.client.IItemRenderer;

import org.lwjgl.opengl.GL11;

import com.sirolf2009.necromancy.client.model.ModelNecronomicon;
import com.sirolf2009.necromancy.core.proxy.ClientProxy;
import com.sirolf2009.necromancy.item.ItemNecronomicon;
import com.sirolf2009.necromancy.lib.Reference;

import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;


@SideOnly(Side.CLIENT)
public class ItemNecronomiconRenderer implements IItemRenderer {

public ModelNecronomicon modelInteractive = new ModelNecronomicon();
public ModelNecronomicon modelStatic = new ModelNecronomicon();
public ModelBook modelBook = new ModelBook();
public boolean isFancyBookSupported = true;

public String[] leftPageContent = {}, rightPageContent = {};

Expand All @@ -43,22 +45,25 @@ public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRe

@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
switch (type) {
case ENTITY:
if(!isFancyBookSupported) {
if(type.equals(ItemRenderType.ENTITY)) {
renderNecronomiconStatic(0F, 0.2F, 0F, 180F, 1F, 1F, 0.004F);
break;
case EQUIPPED:
if (ClientProxy.mc.gameSettings.thirdPersonView == 0 && !(ClientProxy.mc.currentScreen instanceof InventoryEffectRenderer)) {
renderNecronomiconInteractive(0.8F, 1F, -1F, 20F, 100F, 160F, 0.01F, (ItemNecronomicon) item.getItem());
} else {
renderNecronomiconInteractive(0.8F, 1.3F, 0.6F, 180F, 180F, 0F, 0.009F, (ItemNecronomicon) item.getItem());
}
break;
case INVENTORY:
} else if(type.equals(ItemRenderType.EQUIPPED)) {
renderNecronomiconInteractive(0.8F, 1.3F, 0.6F, 180F, 180F, 0F, 0.009F, (ItemNecronomicon) item.getItem());
} else if(type.equals(ItemRenderType.EQUIPPED_FIRST_PERSON)) {
renderNecronomiconInteractive(0.8F, 1F, -1F, 20F, 100F, 160F, 0.01F, (ItemNecronomicon) item.getItem());
} else if(type.equals(ItemRenderType.INVENTORY)) {
renderNecronomiconStatic(-0.2F, 0.2F, 0.2F, 100F, -20F, -20F, 0.007F);
break;
default:
break;
}
} else {
GL11.glPushMatrix();
GL11.glScalef(2F, 2F, 2F);
FMLClientHandler.instance().getClient().renderEngine.bindTexture(Reference.LOC_RESOURCES_TEXTURES_MODELS + "/necronomicon.png");
modelBook.render(null, 111.29507F, 0.10000038F, 0.9000004F, 0F, 0, 0.0625F);
GL11.glPopMatrix();
}
if(isFancyBookSupported && GL11.glGetError() != GL11.GL_NO_ERROR) {
isFancyBookSupported = false;
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package com.sirolf2009.necromancy.entity.necroapi;

import org.lwjgl.opengl.GL11;

import net.minecraft.client.model.ModelBase;
import net.minecraft.entity.Entity;
import net.minecraft.item.Item;
Expand Down Expand Up @@ -76,7 +74,6 @@ public BodyPart[] initArmRight(ModelBase model) {

@Override
public void preRender(Entity entity, BodyPart[] parts, String location, ModelBase model) {
GL11.glTranslatef(0, 0, 0);
}

@Override
Expand Down
10 changes: 4 additions & 6 deletions common/com/sirolf2009/necromancy/item/ItemIsaacsHead.java
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
package com.sirolf2009.necromancy.item;

import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.item.EnumArmorMaterial;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.IArmorTextureProvider;

import com.sirolf2009.necromancy.Necromancy;

public class ItemIsaacsHead extends ItemArmor implements IArmorTextureProvider {
public class ItemIsaacsHead extends ItemArmor {

public ItemIsaacsHead(int par1, EnumArmorMaterial material, int par3, int par4) {
super(par1, material, par3, par4);
setUnlocalizedName("IsaacsHead");
setCreativeTab(Necromancy.tabNecromancy);
}

@Override
public String getArmorTextureFile(ItemStack stack) {

public String getArmorTexture(ItemStack stack, Entity entity, int slot, int layer) {
return "/armor/Isaac_1.png";
}

Expand Down
3 changes: 2 additions & 1 deletion common/com/sirolf2009/necromancy/lib/Reference.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
public class Reference {
public static final String MOD_ID = "necromancy";
public static final String MOD_NAME = "Necromancy";
public static final String MOD_VERSION = "1.1";
public static final String MOD_VERSION = "@VERSION@";
public static final String MOD_FINGERPRINT = "@FINGERPRINT@";

public static final String LOC_RESOURCES = "/mods/necromancy";
public static final String LOC_RESOURCES_SOUNDS = LOC_RESOURCES + "/sounds";
Expand Down
2 changes: 1 addition & 1 deletion common/mcmod.info
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"modid": "necromancy",
"name": "Necromancy",
"description": "This mod is all about necromancy. Also known as the art of reanimation. using this mod, you can reanimate slain foes and use your minions to rule the world! (of minecraftia).",
"version": "1.0",
"version": "1.2",
"url": "https://github.com/sirolf2009/Necromancy",
"updateUrl": "https://github.com/sirolf2009/Necromancy",
"authorList": [
Expand Down
23 changes: 0 additions & 23 deletions resources/mcmod.info

This file was deleted.

Binary file modified resources/mods/necromancy/textures/models/necronomicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 62fae2e

Please sign in to comment.