use of uk.co.wehavecookies56.kk.common.network.packet.client.SyncMunnyData in project Kingdom-Keys-Re-Coded by Wehavecookies56.
the class OpenSynthesis method process.
@Override
public void process(EntityPlayer player, Side side) {
PacketDispatcher.sendTo(new SyncMunnyData(player.getCapability(ModCapabilities.MUNNY, null)), (EntityPlayerMP) player);
PacketDispatcher.sendTo(new SyncRecipeData(player.getCapability(ModCapabilities.SYNTHESIS_RECIPES, null)), (EntityPlayerMP) player);
PacketDispatcher.sendTo(new SyncFreeDevRecipeData(player.getCapability(ModCapabilities.SYNTHESIS_RECIPES, null)), (EntityPlayerMP) player);
PacketDispatcher.sendTo(new SyncMaterialData(player.getCapability(ModCapabilities.SYNTHESIS_MATERIALS, null)), (EntityPlayerMP) player);
}
use of uk.co.wehavecookies56.kk.common.network.packet.client.SyncMunnyData in project Kingdom-Keys-Re-Coded by Wehavecookies56.
the class OpenMenu method process.
@Override
public void process(EntityPlayer player, Side side) {
PacketDispatcher.sendTo(new SyncMunnyData(player.getCapability(ModCapabilities.MUNNY, null)), (EntityPlayerMP) player);
PacketDispatcher.sendTo(new SyncMagicData(player.getCapability(ModCapabilities.MAGIC_STATE, null), player.getCapability(ModCapabilities.PLAYER_STATS, null)), (EntityPlayerMP) player);
PacketDispatcher.sendTo(new SyncDriveData(player.getCapability(ModCapabilities.DRIVE_STATE, null)), (EntityPlayerMP) player);
PacketDispatcher.sendTo(new SyncLevelData(player.getCapability(ModCapabilities.PLAYER_STATS, null)), (EntityPlayerMP) player);
}
use of uk.co.wehavecookies56.kk.common.network.packet.client.SyncMunnyData in project Kingdom-Keys-Re-Coded by Wehavecookies56.
the class GiveBoughtItem method process.
@Override
public void process(EntityPlayer player, Side side) {
player.inventory.addItemStackToInventory(this.boughtItem);
player.getCapability(ModCapabilities.MUNNY, null).remMunny(spentMunny);
PacketDispatcher.sendTo(new SyncMunnyData(player.getCapability(ModCapabilities.MUNNY, null)), (EntityPlayerMP) player);
}
use of uk.co.wehavecookies56.kk.common.network.packet.client.SyncMunnyData in project Kingdom-Keys-Re-Coded by Wehavecookies56.
the class EntityMoogle method processInteract.
@Override
protected boolean processInteract(EntityPlayer player, EnumHand hand) {
if (!player.isSneaking()) {
this.world.playSound(player, this.posX, this.posY, this.posZ, ModSounds.kupo, SoundCategory.BLOCKS, 1.0F, 1.0F);
if (!this.world.isRemote) {
PacketDispatcher.sendTo(new SyncMunnyData(player.getCapability(ModCapabilities.MUNNY, null)), (EntityPlayerMP) player);
}
player.openGui(KingdomKeys.instance, GuiIDs.GUI_SHOP, this.world, (int) this.posX, (int) this.posY, (int) this.posZ);
return true;
}
return false;
}
use of uk.co.wehavecookies56.kk.common.network.packet.client.SyncMunnyData in project Kingdom-Keys-Re-Coded by Wehavecookies56.
the class TakeSoldItem method process.
@Override
public void process(EntityPlayer player, Side side) {
int quantityRemaining = quantity;
for (int i = 0; i < player.inventory.getSizeInventory(); i++) {
if (player.inventory.getStackInSlot(i).getItem() instanceof ItemSynthesisMaterial) {
ItemStack invItem = player.inventory.getStackInSlot(i);
if (invItem.getTagCompound().getString("material").equals(soldItem.getTagCompound().getString("material"))) {
// System.out.println(invItem.getTagCompound().getString("material")+">"+soldItem.getTagCompound().getString("material"));
if (quantityRemaining >= player.inventory.getStackInSlot(i).getCount()) {
// If the amount you want to sell is bigger or equals to the amount you have
// Remove the item
player.inventory.removeStackFromSlot(i);
quantityRemaining -= player.inventory.getStackInSlot(i).getCount();
} else if (quantityRemaining < player.inventory.getStackInSlot(i).getCount()) {
player.inventory.getStackInSlot(i).shrink(quantityRemaining);
quantityRemaining = 0;
}
}
}
}
player.getCapability(ModCapabilities.MUNNY, null).addMunny(munnyToGive);
PacketDispatcher.sendTo(new SyncMunnyData(player.getCapability(ModCapabilities.MUNNY, null)), (EntityPlayerMP) player);
}
Aggregations