else
{
//Send packet when firing a semi or starting to fire a full
if(leftMouseHeld && !lastLeftMouseHeld)
{
FlansMod.getPacketHandler().sendToServer(new PacketGunFire(true, true));
if(clientSideShoot(player, offHandGunStack, offHandGunType, true))
player.inventory.setInventorySlotContents(data.offHandGunSlot - 1, null);
}
if((offHandGunType.mode == EnumFireMode.FULLAUTO || offHandGunType.mode == EnumFireMode.MINIGUN) && !leftMouseHeld && lastLeftMouseHeld) //Full auto. Send released mouse packet
{
FlansMod.getPacketHandler().sendToServer(new PacketGunFire(true, false));
}
if((offHandGunType.mode == EnumFireMode.FULLAUTO || offHandGunType.mode == EnumFireMode.MINIGUN) && leftMouseHeld)
{
if(clientSideShoot(player, offHandGunStack, offHandGunType, true))
player.inventory.setInventorySlotContents(data.offHandGunSlot - 1, null);
}
}
}
}
else data.offHandGunSlot = 0;
}
}
//--------------------------------- Main hand item ---------------------------------------------
//If we are using a burst mode gun, and there is burst left to be done, try to do it
if(type.usableByPlayers)
{
if(type.mode == EnumFireMode.BURST && data.burstRoundsRemainingRight > 0)
{
if(clientSideShoot(player, itemstack, type, false))
player.inventory.setInventorySlotContents(player.inventory.currentItem, null);
}
else
{
//Send packet when firing a semi or starting to fire a full
if(rightMouseHeld && !lastRightMouseHeld)
{
FlansMod.getPacketHandler().sendToServer(new PacketGunFire(false, true));
if(clientSideShoot(player, itemstack, type, false))
player.inventory.setInventorySlotContents(player.inventory.currentItem, null);
}
if((type.mode == EnumFireMode.FULLAUTO || type.mode == EnumFireMode.MINIGUN) && !rightMouseHeld && lastRightMouseHeld) //Full auto. Send released mouse packet
{
FlansMod.getPacketHandler().sendToServer(new PacketGunFire(false, false));
}
if((type.mode == EnumFireMode.FULLAUTO || type.mode == EnumFireMode.MINIGUN) && rightMouseHeld)
{
if(clientSideShoot(player, itemstack, type, false))
player.inventory.setInventorySlotContents(player.inventory.currentItem, null);