Search in sources :

Example 6 with PacketSimpleMars

use of micdoodle8.mods.galacticraft.planets.mars.network.PacketSimpleMars in project Galacticraft by micdoodle8.

the class GuiLaunchControllerAdvanced method onSelectionChanged.

@Override
public void onSelectionChanged(GuiElementCheckbox checkbox, boolean newSelected) {
    if (checkbox.equals(this.enablePadRemovalButton)) {
        this.launchController.launchPadRemovalDisabled = !newSelected;
        GalacticraftCore.packetPipeline.sendToServer(new PacketSimpleMars(EnumSimplePacketMars.S_UPDATE_ADVANCED_GUI, GCCoreUtil.getDimensionID(mc.theWorld), new Object[] { 3, this.launchController.getPos(), this.launchController.launchPadRemovalDisabled ? 1 : 0 }));
    } else if (checkbox.equals(this.launchWhenCheckbox)) {
        this.launchController.launchSchedulingEnabled = newSelected;
        GalacticraftCore.packetPipeline.sendToServer(new PacketSimpleMars(EnumSimplePacketMars.S_UPDATE_ADVANCED_GUI, GCCoreUtil.getDimensionID(mc.theWorld), new Object[] { 4, this.launchController.getPos(), this.launchController.launchSchedulingEnabled ? 1 : 0 }));
    }
}
Also used : PacketSimpleMars(micdoodle8.mods.galacticraft.planets.mars.network.PacketSimpleMars)

Example 7 with PacketSimpleMars

use of micdoodle8.mods.galacticraft.planets.mars.network.PacketSimpleMars in project Galacticraft by micdoodle8.

the class GuiSlimeling method keyTyped.

@Override
protected void keyTyped(char typedChar, int keyCode) throws IOException {
    if (this.slimeling.isOwner(this.mc.thePlayer)) {
        if (this.nameField.textboxKeyTyped(typedChar, keyCode)) {
            this.slimeling.setName(this.nameField.getText());
            GalacticraftCore.packetPipeline.sendToServer(new PacketSimpleMars(EnumSimplePacketMars.S_UPDATE_SLIMELING_DATA, GCCoreUtil.getDimensionID(this.slimeling.worldObj), new Object[] { this.slimeling.getEntityId(), 1, this.slimeling.getName() }));
        }
    }
    super.keyTyped(typedChar, keyCode);
}
Also used : PacketSimpleMars(micdoodle8.mods.galacticraft.planets.mars.network.PacketSimpleMars)

Example 8 with PacketSimpleMars

use of micdoodle8.mods.galacticraft.planets.mars.network.PacketSimpleMars in project Galacticraft by micdoodle8.

the class GuiSlimeling method mouseClicked.

@Override
protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException {
    if (this.slimeling.isOwner(this.mc.thePlayer)) {
        this.nameField.mouseClicked(mouseX, mouseY, mouseButton);
    }
    if (mouseX >= this.invX && mouseX < this.invX + this.invWidth && mouseY >= this.invY && mouseY < this.invY + this.invHeight) {
        this.mc.getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0F));
        GalacticraftCore.packetPipeline.sendToServer(new PacketSimpleMars(EnumSimplePacketMars.S_UPDATE_SLIMELING_DATA, GCCoreUtil.getDimensionID(this.slimeling.worldObj), new Object[] { this.slimeling.getEntityId(), 6, "" }));
    }
    super.mouseClicked(mouseX, mouseY, mouseButton);
}
Also used : ResourceLocation(net.minecraft.util.ResourceLocation) PacketSimpleMars(micdoodle8.mods.galacticraft.planets.mars.network.PacketSimpleMars)

Example 9 with PacketSimpleMars

use of micdoodle8.mods.galacticraft.planets.mars.network.PacketSimpleMars in project Galacticraft by micdoodle8.

the class EventHandlerGC method onLeaveBedButtonClicked.

// @SideOnly(Side.CLIENT)
// @SubscribeEvent
// public void onMinecraftLoaded(MinecraftLoadedEvent event)
// {
// ;
// }
// @SideOnly(Side.CLIENT)
// @SubscribeEvent
// public void onSoundLoad(SoundLoadEvent event)
// {
// event.manager.addSound(Constants.TEXTURE_PREFIX + "ambience/scaryscape.ogg");
// event.manager.addSound(Constants.TEXTURE_PREFIX + "ambience/singledrip1.ogg");
// event.manager.addSound(Constants.TEXTURE_PREFIX + "ambience/singledrip2.ogg");
// event.manager.addSound(Constants.TEXTURE_PREFIX + "ambience/singledrip3.ogg");
// event.manager.addSound(Constants.TEXTURE_PREFIX + "ambience/singledrip4.ogg");
// event.manager.addSound(Constants.TEXTURE_PREFIX + "ambience/singledrip5.ogg");
// event.manager.addSound(Constants.TEXTURE_PREFIX + "ambience/singledrip6.ogg");
// event.manager.addSound(Constants.TEXTURE_PREFIX + "ambience/singledrip7.ogg");
// event.manager.addSound(Constants.TEXTURE_PREFIX + "ambience/singledrip8.ogg");
// event.manager.addSound(Constants.TEXTURE_PREFIX + "entity/bossdeath.ogg");
// event.manager.addSound(Constants.TEXTURE_PREFIX + "entity/bosslaugh.ogg");
// event.manager.addSound(Constants.TEXTURE_PREFIX + "entity/bossliving.ogg");
// event.manager.addSound(Constants.TEXTURE_PREFIX + "entity/slime_death.ogg");
// ClientProxyCore.newMusic.add(this.func_110654_c(event.manager.soundPoolMusic, Constants.TEXTURE_PREFIX + "music/mars_JC.ogg"));
// ClientProxyCore.newMusic.add(this.func_110654_c(event.manager.soundPoolMusic, Constants.TEXTURE_PREFIX + "music/mimas_JC.ogg"));
// ClientProxyCore.newMusic.add(this.func_110654_c(event.manager.soundPoolMusic, Constants.TEXTURE_PREFIX + "music/orbit_JC.ogg"));
// ClientProxyCore.newMusic.add(this.func_110654_c(event.manager.soundPoolMusic, Constants.TEXTURE_PREFIX + "music/scary_ambience.ogg"));
// ClientProxyCore.newMusic.add(this.func_110654_c(event.manager.soundPoolMusic, Constants.TEXTURE_PREFIX + "music/spacerace_JC.ogg"));
// event.manager.addSound(Constants.TEXTURE_PREFIX + "player/closeairlock.ogg");
// event.manager.addSound(Constants.TEXTURE_PREFIX + "player/openairlock.ogg");
// event.manager.addSound(Constants.TEXTURE_PREFIX + "player/parachute.ogg");
// event.manager.addSound(Constants.TEXTURE_PREFIX + "player/unlockchest.ogg");
// event.manager.addSound(Constants.TEXTURE_PREFIX + "shuttle/shuttle.ogg");
// }
// 
// @SideOnly(Side.CLIENT)
// private SoundPoolEntry func_110654_c(SoundPool pool, String par1Str)
// {
// try
// {
// ResourceLocation resourcelocation = new ResourceLocation(par1Str);
// String s1 = String.format("%s:%s:%s/%s", new Object[] { "mcsounddomain", resourcelocation.getResourceDomain(), "sound", resourcelocation.getResourcePath() });
// SoundPoolProtocolHandler soundpoolprotocolhandler = new SoundPoolProtocolHandler(pool);
// return new SoundPoolEntry(par1Str, new URL((URL) null, s1, soundpoolprotocolhandler));
// }
// catch (MalformedURLException e)
// {
// e.printStackTrace();
// }
// 
// return null;
// } TODO Fix sounds
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void onLeaveBedButtonClicked(SleepCancelledEvent event) {
    EntityPlayer player = FMLClientHandler.instance().getClient().thePlayer;
    BlockPos c = player.playerLocation;
    if (c != null) {
        EventWakePlayer event0 = new EventWakePlayer(player, c, true, true, false, true);
        MinecraftForge.EVENT_BUS.post(event0);
        player.wakeUpPlayer(true, true, false);
        if (player.worldObj.isRemote && GalacticraftCore.isPlanetsLoaded) {
            GalacticraftCore.packetPipeline.sendToServer(new PacketSimpleMars(PacketSimpleMars.EnumSimplePacketMars.S_WAKE_PLAYER, GCCoreUtil.getDimensionID(player.worldObj), new Object[] {}));
        }
    }
}
Also used : EntityPlayer(net.minecraft.entity.player.EntityPlayer) PacketSimpleMars(micdoodle8.mods.galacticraft.planets.mars.network.PacketSimpleMars) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 10 with PacketSimpleMars

use of micdoodle8.mods.galacticraft.planets.mars.network.PacketSimpleMars in project Galacticraft by micdoodle8.

the class MarsUtil method openAdvancedLaunchController.

public static void openAdvancedLaunchController(EntityPlayerMP player, TileEntityLaunchController launchController) {
    player.getNextWindowId();
    player.closeContainer();
    int windowId = player.currentWindowId;
    GalacticraftCore.packetPipeline.sendTo(new PacketSimpleMars(EnumSimplePacketMars.C_OPEN_CUSTOM_GUI_TILE, GCCoreUtil.getDimensionID(player.worldObj), new Object[] { windowId, 0, launchController.getPos() }), player);
    player.openContainer = new ContainerLaunchControllerAdvanced(player.inventory, launchController, player);
    player.openContainer.windowId = windowId;
    player.openContainer.onCraftGuiOpened(player);
}
Also used : ContainerLaunchControllerAdvanced(micdoodle8.mods.galacticraft.planets.mars.inventory.ContainerLaunchControllerAdvanced) PacketSimpleMars(micdoodle8.mods.galacticraft.planets.mars.network.PacketSimpleMars)

Aggregations

PacketSimpleMars (micdoodle8.mods.galacticraft.planets.mars.network.PacketSimpleMars)11 GCPlayerStats (micdoodle8.mods.galacticraft.core.entities.player.GCPlayerStats)1 ContainerRocketInventory (micdoodle8.mods.galacticraft.core.inventory.ContainerRocketInventory)1 ContainerLaunchControllerAdvanced (micdoodle8.mods.galacticraft.planets.mars.inventory.ContainerLaunchControllerAdvanced)1 ContainerSlimeling (micdoodle8.mods.galacticraft.planets.mars.inventory.ContainerSlimeling)1 Block (net.minecraft.block.Block)1 EntityPlayer (net.minecraft.entity.player.EntityPlayer)1 EnumStatus (net.minecraft.entity.player.EntityPlayer.EnumStatus)1 BlockPos (net.minecraft.util.BlockPos)1 ChatComponentText (net.minecraft.util.ChatComponentText)1 ResourceLocation (net.minecraft.util.ResourceLocation)1 ChunkCoordIntPair (net.minecraft.world.ChunkCoordIntPair)1 SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)1 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)1