use of uk.co.wehavecookies56.kk.common.network.packet.client.SpawnKeybladeParticles in project Kingdom-Keys-Re-Coded by Wehavecookies56.
the class SummonKeyblade method process.
@Override
public void process(EntityPlayer player, Side side) {
ItemStack keychain = player.getCapability(ModCapabilities.SUMMON_KEYBLADE, null).getInventoryKeychain().getStackInSlot(offHandSlot);
ItemStack keyblade = new ItemStack(((ItemKeychain) (keychain.getItem())).getKeyblade());
if (keychain.hasTagCompound()) {
keyblade.setTagCompound(keychain.getTagCompound());
}
if (hand == EnumHand.MAIN_HAND) {
player.inventory.setInventorySlotContents(player.inventory.currentItem, keyblade);
} else {
player.inventory.offHandInventory.set(0, keyblade);
}
player.world.playSound((EntityPlayer) null, player.getPosition(), ModSounds.summon, SoundCategory.MASTER, 1.0f, 1.0f);
player.getCapability(ModCapabilities.SUMMON_KEYBLADE, null).setIsKeybladeSummoned(hand, true);
player.sendMessage(new TextComponentTranslation(TextFormatting.DARK_GREEN + "Summoned " + player.getHeldItem(hand).getDisplayName()));
PacketDispatcher.sendToAllAround(new SpawnKeybladeParticles(player), player, 64.0D);
PacketDispatcher.sendTo(new SyncKeybladeData(player.getCapability(ModCapabilities.SUMMON_KEYBLADE, null)), (EntityPlayerMP) player);
}
Aggregations