Skip to content

Commit 3b3a777

Browse files
Revert "Revert "Added Release and made things look preatty""
This reverts commit 70d2329.
1 parent 70d2329 commit 3b3a777

12 files changed

+171
-118
lines changed
101 KB
Binary file not shown.

build.properties

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
dir.development=../../
2+
dir.release=Releases
3+
release.mod.majorVersion = 1
4+
release.mod.minorVersion = 0
5+
release.mod.revision = 0
6+
dir.mcp = mcp
7+
dir.modFloder = Void-Satchel
8+
dir.modPackege = jgdovin
9+
dir.src = common
10+
dir.res = resources
11+
basedir = C:\Minecraft Development\Main Files

build.xml

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<?xml version="1.0" ?>
2+
<project name="${dir.modFloder}">
3+
4+
<property file="build.properties" />
5+
6+
<target name="clean">
7+
<delete file="${dir.development}\${dir.mcp}\src\minecraft\mcmod.info" />
8+
<delete dir="${dir.development}\${dir.mcp}\src\minecraft\${dir.modPackege}" />
9+
<delete dir="${dir.development}\${dir.mcp}\reobf\minecraft" />
10+
</target>
11+
12+
<target name="build">
13+
<copy todir="${dir.development}\${dir.mcp}\src\minecraft">
14+
<fileset dir="${dir.development}\source\${dir.modFloder}\${dir.src}" />
15+
</copy>
16+
<replace dir="${dir.development}\${dir.mcp}\src\minecraft" token="@VERSION@" value="${release.mod.majorVersion}.${release.mod.minorVersion}.${release.mod.revision}" />
17+
</target>
18+
19+
<target name="recompile">
20+
<exec dir="${dir.development}\${dir.mcp}" executable="cmd" osfamily="windows">
21+
<arg line="/c recompile.bat" />
22+
</exec>
23+
<exec dir="${dir.development}\${dir.mcp}" executable="bash" osfamily="unix">
24+
<arg line="recompile.sh" />
25+
</exec>
26+
</target>
27+
28+
<target name="reobfuscate">
29+
<exec dir="${dir.development}\${dir.mcp}" executable="cmd" osfamily="windows">
30+
<arg line="/c reobfuscate_srg.bat" />
31+
</exec>
32+
<exec dir="${dir.development}\${dir.mcp}" executable="bash" osfamily="unix">
33+
<arg line="reobfuscate_srg.sh" />
34+
</exec>
35+
</target>
36+
37+
<target name="release">
38+
<!-- Prep for the release -->
39+
<antcall target="clean" />
40+
<antcall target="build" />
41+
<antcall target="recompile" />
42+
<antcall target="reobfuscate" />
43+
44+
<!-- Build the jar -->
45+
<mkdir dir="${dir.release}" />
46+
<jar destfile="${dir.release}\Void-Satchel-Universal-${release.mod.majorVersion}.${release.mod.minorVersion}.${release.mod.revision}.jar">
47+
<fileset dir="${dir.development}\${dir.mcp}\src\minecraft\" includes="mcmod.info" />
48+
<fileset dir="${dir.development}\${dir.mcp}\reobf\minecraft\" />
49+
<fileset dir="${dir.development}\source\${dir.modFloder}\resources"/>
50+
</jar>
51+
52+
<!-- Clean up the MCP source now that we are done -->
53+
<antcall target="clean" />
54+
</target>
55+
56+
</project>

common/jgdovin/voidsatchel/VoidSatchel.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@
1717
import cpw.mods.fml.common.network.NetworkMod;
1818

1919
@Mod(modid = Archive.id, name = Archive.name, version = Archive.ver)
20-
@NetworkMod(clientSideRequired = true, serverSideRequired = false, channels={"vSatchelPacket"}, packetHandler = PacketHandler.class)
20+
@NetworkMod(clientSideRequired = true, serverSideRequired = false, channels = { "vSatchelPacket" }, packetHandler = PacketHandler.class)
2121
public class VoidSatchel {
2222

2323
@Instance(Archive.id)
2424
public static VoidSatchel instance;
2525

2626
@SidedProxy(clientSide = Archive.clientProxy, serverSide = Archive.commonProxy)
2727
public static CommonProxy baseProxy;
28-
28+
2929
@PreInit
3030
public void preInit(FMLPreInitializationEvent evt) {
3131

common/jgdovin/voidsatchel/items/InventoryVoidSatchel.java

+41-33
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,22 @@
77
import net.minecraft.nbt.NBTTagList;
88

99
/**
10-
*
1110
* @author Michael DeRuscio<https://github.com/Michael-073>
1211
*/
13-
public class InventoryVoidSatchel implements IInventory{
12+
public class InventoryVoidSatchel implements IInventory {
1413

1514
private ItemStack[] inventory;
1615
private final int INVENTORY_SIZE = 13 * 3;
1716

18-
1917
public InventoryVoidSatchel(ItemStack stack) {
20-
if(stack.getItem() != ModItems.voidSatchel) return;
21-
22-
23-
18+
if (stack.getItem() != ModItems.voidSatchel){
19+
return;
20+
}
21+
2422
boolean success = readFromNBT(stack.getTagCompound());
25-
if(!success)
23+
if (!success){
2624
inventory = new ItemStack[INVENTORY_SIZE];
25+
}
2726
}
2827

2928
@Override
@@ -33,18 +32,21 @@ public int getSizeInventory() {
3332

3433
@Override
3534
public ItemStack getStackInSlot(int slot) {
36-
return inventory[slot];
35+
return inventory[slot];
3736
}
3837

3938
@Override
4039
public ItemStack decrStackSize(int slot, int num) {
4140
ItemStack stack = getStackInSlot(slot), s;
42-
if(stack == null) return null;
43-
if(stack.stackSize > num) {
41+
if (stack == null){
42+
return null;
43+
}
44+
if (stack.stackSize > num){
4445
s = stack.splitStack(num);
45-
if(stack.stackSize <= 0)
46+
if (stack.stackSize <= 0){
4647
setInventorySlotContents(slot, null);
47-
} else {
48+
}
49+
}else{
4850
s = stack;
4951
setInventorySlotContents(slot, null);
5052

@@ -53,16 +55,15 @@ public ItemStack decrStackSize(int slot, int num) {
5355
return s;
5456
}
5557

56-
57-
5858
@Override
59-
public ItemStack getStackInSlotOnClosing(int slot ){
60-
if (inventory[slot] != null) {
59+
public ItemStack getStackInSlotOnClosing(int slot) {
60+
if (inventory[slot] != null){
6161
ItemStack itemstack = inventory[slot];
6262
this.inventory[slot] = null;
6363
return itemstack;
64-
} else
64+
}else{
6565
return null;
66+
}
6667
}
6768

6869
@Override
@@ -109,55 +110,62 @@ public boolean isStackValidForSlot(int i, ItemStack itemstack) {
109110
private static final String NBT_VOID_SATCHEL_INVENTORY = "voidSatchelInventory";
110111

111112
private boolean readFromNBT(NBTTagCompound tag) {
112-
if(tag == null || !tag.hasKey(NBT_VOID_SATCHEL_INVENTORY)) return false;
113+
if ((tag == null) || !tag.hasKey(NBT_VOID_SATCHEL_INVENTORY)){
114+
return false;
115+
}
113116
NBTTagList tagList = tag.getTagList(NBT_VOID_SATCHEL_INVENTORY);
114117
inventory = new ItemStack[getSizeInventory()];
115118

116-
for(int i = 0; i < tagList.tagCount(); i++){
119+
for (int i = 0; i < tagList.tagCount(); i++){
117120
NBTTagCompound t = (NBTTagCompound) tagList.tagAt(i);
118121
int slot = t.getByte("Slot");
119-
if(slot >= 0 && slot < inventory.length)
122+
if ((slot >= 0) && (slot < inventory.length)){
120123
inventory[slot] = ItemStack.loadItemStackFromNBT(t);
124+
}
121125
}
122126
return true;
123127
}
124128

125129
public void writeBagContents(ItemStack item) {
126130
NBTTagCompound tag = item.getTagCompound();
127-
if(tag == null){
131+
if (tag == null){
128132
tag = new NBTTagCompound();
129133
item.setTagCompound(tag);
130134
}
131135
NBTTagList list = new NBTTagList();
132136
NBTTagCompound tagComp;
133137
ItemStack stack;
134-
for(int i = 0; i < inventory.length; i++) {
138+
for (int i = 0; i < inventory.length; i++){
135139
stack = inventory[i];
136-
if(stack == null) continue;
140+
if (stack == null){
141+
continue;
142+
}
137143
tagComp = new NBTTagCompound();
138-
tagComp.setByte("Slot", (byte)i);
144+
tagComp.setByte("Slot", (byte) i);
139145
stack.writeToNBT(tagComp);
140-
list.appendTag( tagComp );
146+
list.appendTag(tagComp);
141147
}
142148
tag.setTag(NBT_VOID_SATCHEL_INVENTORY, list);
143149
}
144-
145-
public void clearInventoryNBT(ItemStack item) {
150+
151+
public void clearInventoryNBT(ItemStack item) {
146152
NBTTagCompound tag = item.getTagCompound();
147-
if(tag == null){
153+
if (tag == null){
148154
tag = new NBTTagCompound();
149155
item.setTagCompound(tag);
150156
}
151157
NBTTagList list = new NBTTagList();
152158
NBTTagCompound tagComp;
153159
ItemStack stack;
154-
for(int i = 0; i < inventory.length; i++) {
160+
for (int i = 0; i < inventory.length; i++){
155161
stack = inventory[i];
156-
if(stack == null) continue;
162+
if (stack == null){
163+
continue;
164+
}
157165
tagComp = new NBTTagCompound();
158-
tagComp.setByte("Slot", (byte)i);
166+
tagComp.setByte("Slot", (byte) i);
159167
stack.writeToNBT(tagComp);
160-
list.appendTag( tagComp );
168+
list.appendTag(tagComp);
161169
}
162170
tag.setTag(NBT_VOID_SATCHEL_INVENTORY, list);
163171
}

common/jgdovin/voidsatchel/items/ItemVoidSatchel.java

+6-10
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,14 @@ public boolean getShareTag() {
2828
}
2929

3030
@Override
31-
public ItemStack onItemRightClick(ItemStack itemStack, World world,
32-
EntityPlayer entityPlayer) {
31+
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer entityPlayer) {
3332

34-
if (itemStack.hasDisplayName()) {
33+
if (itemStack.hasDisplayName()){
3534
this.setCustomName(itemStack.getDisplayName());
3635
}
37-
NBTHelper.setBoolean(itemStack, Archive.NBT_ITEM_VOID_SATCHEL_GUI_OPEN,
38-
true);
39-
entityPlayer.openGui(VoidSatchel.instance, Archive.voidSatchelGUID,
40-
entityPlayer.worldObj, (int) entityPlayer.posX,
41-
(int) entityPlayer.posY, (int) entityPlayer.posZ);
36+
NBTHelper.setBoolean(itemStack, Archive.NBT_ITEM_VOID_SATCHEL_GUI_OPEN, true);
37+
entityPlayer.openGui(VoidSatchel.instance, Archive.voidSatchelGUID, entityPlayer.worldObj,
38+
(int) entityPlayer.posX, (int) entityPlayer.posY, (int) entityPlayer.posZ);
4239

4340
return itemStack;
4441
}
@@ -59,7 +56,6 @@ public String getCustomName() {
5956
@SideOnly(Side.CLIENT)
6057
public void registerIcons(IconRegister iconRegister) {
6158
itemIcon = iconRegister.registerIcon(Archive.texture
62-
+ this.getUnlocalizedName().substring(
63-
this.getUnlocalizedName().indexOf(".") + 1));
59+
+ this.getUnlocalizedName().substring(this.getUnlocalizedName().indexOf(".") + 1));
6460
}
6561
}

0 commit comments

Comments
 (0)