Gui updated to send the packet properly

and not pause the game in SSP
This commit is contained in:
MachineMuse 2012-12-22 23:29:00 -07:00
parent fe1ff6d838
commit eaba708c88
3 changed files with 16 additions and 6 deletions

View file

@ -1,6 +1,7 @@
package machinemuse.powersuits.common;
import machinemuse.powersuits.gui.GuiTinkerTable;
import net.minecraft.client.entity.EntityClientPlayerMP;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
import cpw.mods.fml.common.network.IGuiHandler;
@ -25,7 +26,7 @@ public class GuiHandler implements IGuiHandler {
int x, int y, int z) {
switch (ID) {
case 0:
return new GuiTinkerTable(player);
return new GuiTinkerTable((EntityClientPlayerMP) player);
default:
return null;
}

View file

@ -12,9 +12,8 @@ import machinemuse.powersuits.augmentation.Augmentation;
import machinemuse.powersuits.augmentation.AugmentationList;
import machinemuse.powersuits.item.ItemUtils;
import machinemuse.powersuits.network.MusePacketUpgradeRequest;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.client.entity.EntityClientPlayerMP;
import net.minecraft.item.ItemStack;
import cpw.mods.fml.common.network.PacketDispatcher;
import cpw.mods.fml.common.network.Player;
/**
@ -24,7 +23,7 @@ import cpw.mods.fml.common.network.Player;
*
*/
public class GuiTinkerTable extends MuseGui {
protected EntityPlayer player;
protected EntityClientPlayerMP player;
protected List<ClickableItem> itemButtons;
protected ClickableItem selectedItemStack;
protected List<ClickableAugmentation> augButtons;
@ -41,7 +40,7 @@ public class GuiTinkerTable extends MuseGui {
*
* @param player
*/
public GuiTinkerTable(EntityPlayer player) {
public GuiTinkerTable(EntityClientPlayerMP player) {
this.player = player;
this.itemButtons = new ArrayList<ClickableItem>();
@ -248,8 +247,9 @@ public class GuiTinkerTable extends MuseGui {
// ItemUtils.deleteFromInventory(workingUpgradeCost,
// player.inventory);
// workingAugmentation.upgrade();
PacketDispatcher.sendPacketToServer(new MusePacketUpgradeRequest(
player.sendQueue.addToSendQueue(new MusePacketUpgradeRequest(
(Player) player, 0, 1).getPacket());
// player.sendQueue.sendPacket();
}
}

View file

@ -122,6 +122,15 @@ public class MuseGui extends GuiScreen {
return points;
}
/**
* Whether or not this gui pauses the game in single player.
*/
@Override
public boolean doesGuiPauseGame()
{
return false;
}
/**
* Singleton pattern for the RenderItem
*