mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-28 12:25:59 +00:00
Proper Reformating
This commit is contained in:
1 parent
ce75880aba
commit
180d257024
1179 files changed
+59847
-61583
No files matched your search
@@ -5,49 +5,49 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
public class MoneyBagContents {
|
||||
private EntityPlayer player;
|
||||
private int[] coinData = new int[]{0,0,0,0,0,0,0};
|
||||
private EntityPlayer player;
|
||||
private int[] coinData = new int[]{0, 0, 0, 0, 0, 0, 0};
|
||||
|
||||
public MoneyBagContents(EntityPlayer player) {
|
||||
this.player = player;
|
||||
}
|
||||
|
||||
public void readNBT(NBTTagCompound compound){
|
||||
coinData = compound.getIntArray("coins");
|
||||
}
|
||||
|
||||
public NBTTagCompound writeNBT(){
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
compound.setIntArray("coins", coinData);
|
||||
return compound;
|
||||
}
|
||||
|
||||
|
||||
public enum CoinType {
|
||||
WOOD,STONE,IRON,GOLD,DIAMOND,BRONZE,EMERALD;
|
||||
}
|
||||
|
||||
|
||||
//Adds stackSize to coinType
|
||||
public void AddCurrency(CoinType coinType, byte stackSize, ItemStack theBag){
|
||||
coinData[coinType.ordinal()] = coinData[coinType.ordinal()] + stackSize;
|
||||
theBag.stackTagCompound.setTag("contents", writeNBT());
|
||||
}
|
||||
|
||||
//Creates amount number of coinType in playerInventory and subtracts from the moneyBag.
|
||||
public void WithdrawCurrencyByVal(CoinType coinType, short amount, ItemStack theBag) {
|
||||
int amtAdded = 0;
|
||||
|
||||
coinData[coinType.ordinal()] = coinData[coinType.ordinal()]- amtAdded;
|
||||
theBag.stackTagCompound.setTag("contents", writeNBT());
|
||||
}
|
||||
|
||||
//Creates numStacks of coinType in recievingInventory and subtracts from the moneyBag.
|
||||
public void WithdrawCurrencyByStack(CoinType coinType, byte numStacks, ItemStack theBag) {
|
||||
int amtAdded = 0;
|
||||
//check inventory space
|
||||
|
||||
coinData[coinType.ordinal()] = coinData[coinType.ordinal()]- amtAdded;
|
||||
theBag.stackTagCompound.setTag("contents", writeNBT());
|
||||
}
|
||||
public MoneyBagContents(EntityPlayer player) {
|
||||
this.player = player;
|
||||
}
|
||||
|
||||
public void readNBT(NBTTagCompound compound) {
|
||||
coinData = compound.getIntArray("coins");
|
||||
}
|
||||
|
||||
public NBTTagCompound writeNBT() {
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
compound.setIntArray("coins", coinData);
|
||||
return compound;
|
||||
}
|
||||
|
||||
|
||||
public enum CoinType {
|
||||
WOOD, STONE, IRON, GOLD, DIAMOND, BRONZE, EMERALD;
|
||||
}
|
||||
|
||||
|
||||
//Adds stackSize to coinType
|
||||
public void AddCurrency(CoinType coinType, byte stackSize, ItemStack theBag) {
|
||||
coinData[coinType.ordinal()] = coinData[coinType.ordinal()] + stackSize;
|
||||
theBag.stackTagCompound.setTag("contents", writeNBT());
|
||||
}
|
||||
|
||||
//Creates amount number of coinType in playerInventory and subtracts from the moneyBag.
|
||||
public void WithdrawCurrencyByVal(CoinType coinType, short amount, ItemStack theBag) {
|
||||
int amtAdded = 0;
|
||||
|
||||
coinData[coinType.ordinal()] = coinData[coinType.ordinal()] - amtAdded;
|
||||
theBag.stackTagCompound.setTag("contents", writeNBT());
|
||||
}
|
||||
|
||||
//Creates numStacks of coinType in recievingInventory and subtracts from the moneyBag.
|
||||
public void WithdrawCurrencyByStack(CoinType coinType, byte numStacks, ItemStack theBag) {
|
||||
int amtAdded = 0;
|
||||
//check inventory space
|
||||
|
||||
coinData[coinType.ordinal()] = coinData[coinType.ordinal()] - amtAdded;
|
||||
theBag.stackTagCompound.setTag("contents", writeNBT());
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user