Search in sources :

Example 11 with PacketSimpleMP

use of stevekung.mods.moreplanets.network.PacketSimpleMP in project MorePlanets by SteveKunG.

the class GuiGameOverMP method confirmClicked.

@Override
public void confirmClicked(boolean result, int id) {
    if (result) {
        this.mc.world.sendQuittingDisconnectingPacket();
        this.mc.loadWorld((WorldClient) null);
        this.mc.displayGuiScreen(new GuiMainMenu());
    } else {
        GalacticraftCore.packetPipeline.sendToServer(new PacketSimpleMP(EnumSimplePacketMP.S_RESPAWN_PLAYER_NETHER, GCCoreUtil.getDimensionID(this.mc.world)));
        this.mc.displayGuiScreen((GuiScreen) null);
    }
}
Also used : PacketSimpleMP(stevekung.mods.moreplanets.network.PacketSimpleMP)

Example 12 with PacketSimpleMP

use of stevekung.mods.moreplanets.network.PacketSimpleMP in project MorePlanets by SteveKunG.

the class BlockSpacePortal method onBlockActivated.

@Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) {
    if (ConfigManagerMP.enableStartedPlanet && !(ConfigManagerMP.startedPlanet.equals("planet.") || ConfigManagerMP.startedPlanet.equals("moon.") || ConfigManagerMP.startedPlanet.equals("satellite."))) {
        if (!player.isRiding() && !player.isBeingRidden() && player.isNonBoss() && player instanceof EntityPlayerMP) {
            EntityPlayerMP playerMP = (EntityPlayerMP) player;
            if (playerMP.dimension != -1) {
                playerMP.mcServer.getPlayerList().transferPlayerToDimension(playerMP, -1, new TeleporterMP(playerMP.mcServer.getWorld(-1)));
                GalacticraftCore.packetPipeline.sendTo(new PacketSimpleMP(EnumSimplePacketMP.C_RELOAD_RENDERER, playerMP.dimension), playerMP);
            } else {
                int dimID = WorldUtil.getProviderForNameServer(WorldTickEventHandler.startedDimensionData.planetToBack).getDimension();
                playerMP.mcServer.getPlayerList().transferPlayerToDimension(playerMP, dimID, new TeleporterMP(playerMP.mcServer.getWorld(dimID)));
                GalacticraftCore.packetPipeline.sendTo(new PacketSimpleMP(EnumSimplePacketMP.C_RELOAD_RENDERER, playerMP.dimension), playerMP);
            }
        }
    }
    return true;
}
Also used : TeleporterMP(stevekung.mods.moreplanets.util.TeleporterMP) EntityPlayerMP(net.minecraft.entity.player.EntityPlayerMP) PacketSimpleMP(stevekung.mods.moreplanets.network.PacketSimpleMP)

Example 13 with PacketSimpleMP

use of stevekung.mods.moreplanets.network.PacketSimpleMP in project MorePlanets by SteveKunG.

the class GuiShieldGeneratorConfig method actionPerformed.

@Override
protected void actionPerformed(GuiButton button) {
    switch(button.id) {
        case 0:
            GalacticraftCore.packetPipeline.sendToServer(new PacketSimpleMP(EnumSimplePacketMP.S_SWITCH_SHIELD_GENERATOR_GUI, GCCoreUtil.getDimensionID(this.tile.getWorld()), new Object[] { this.tile.getPos(), false }));
            break;
        case 1:
            GalacticraftCore.packetPipeline.sendToServer(new PacketSimpleMP(EnumSimplePacketMP.S_SHIELD_GENERATOR_OPTION, GCCoreUtil.getDimensionID(this.tile.getWorld()), this.tile.getPos(), this.tempDamage, "damage"));
            GalacticraftCore.packetPipeline.sendToServer(new PacketSimpleMP(EnumSimplePacketMP.S_SHIELD_GENERATOR_OPTION, GCCoreUtil.getDimensionID(this.tile.getWorld()), this.tile.getPos(), this.tempSize, "size"));
            this.messageTicks = 60;
            break;
    }
}
Also used : PacketSimpleMP(stevekung.mods.moreplanets.network.PacketSimpleMP)

Example 14 with PacketSimpleMP

use of stevekung.mods.moreplanets.network.PacketSimpleMP in project MorePlanets by SteveKunG.

the class GuiShieldGeneratorConfig method onSelectionChanged.

@Override
public void onSelectionChanged(GuiElementCheckbox checkbox, boolean newSelected) {
    if (checkbox.equals(this.checkboxRenderShield)) {
        this.tile.setBubbleVisible(newSelected);
        GalacticraftCore.packetPipeline.sendToServer(new PacketSimpleMP(EnumSimplePacketMP.S_SHIELD_VISIBLE, GCCoreUtil.getDimensionID(this.tile.getWorld()), this.tile.getPos(), this.tile.shouldRender));
    } else if (checkbox.equals(this.checkboxEnableShield)) {
        GalacticraftCore.packetPipeline.sendToServer(new PacketSimpleMP(EnumSimplePacketMP.S_ENABLE_SHIELD, GCCoreUtil.getDimensionID(this.tile.getWorld()), this.tile.getPos()));
    } else if (checkbox.equals(this.checkboxEnableDamage)) {
        GalacticraftCore.packetPipeline.sendToServer(new PacketSimpleMP(EnumSimplePacketMP.S_ENABLE_SHIELD_DAMAGE, GCCoreUtil.getDimensionID(this.tile.getWorld()), this.tile.getPos()));
    }
}
Also used : PacketSimpleMP(stevekung.mods.moreplanets.network.PacketSimpleMP)

Example 15 with PacketSimpleMP

use of stevekung.mods.moreplanets.network.PacketSimpleMP in project MorePlanets by SteveKunG.

the class InfectedCrystallizeEffect method removeAttributesModifiersFromEntity.

@Override
public void removeAttributesModifiersFromEntity(EntityLivingBase living, AbstractAttributeMap attributeMap, int amplifier) {
    int id = GCCoreUtil.getDimensionID(living.world);
    PacketSimpleMP.sendToAllAround(new PacketSimpleMP(EnumSimplePacketMP.C_REMOVE_ENTITY_ID, id, String.valueOf(living.getEntityId())), living.world, id, living.getPosition(), 64);
    super.removeAttributesModifiersFromEntity(living, attributeMap, amplifier);
}
Also used : PacketSimpleMP(stevekung.mods.moreplanets.network.PacketSimpleMP)

Aggregations

PacketSimpleMP (stevekung.mods.moreplanets.network.PacketSimpleMP)15 SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)3 EntityLivingBase (net.minecraft.entity.EntityLivingBase)2 EntityPlayerMP (net.minecraft.entity.player.EntityPlayerMP)2 TileEntity (net.minecraft.tileentity.TileEntity)2 ArrayList (java.util.ArrayList)1 GuiElementCheckbox (micdoodle8.mods.galacticraft.core.client.gui.element.GuiElementCheckbox)1 EntityJuicer (micdoodle8.mods.galacticraft.planets.venus.entities.EntityJuicer)1 GuiButton (net.minecraft.client.gui.GuiButton)1 EntityPlayer (net.minecraft.entity.player.EntityPlayer)1 PotionEffect (net.minecraft.potion.PotionEffect)1 BlockPos (net.minecraft.util.math.BlockPos)1 World (net.minecraft.world.World)1 WorldProviderNibiru (stevekung.mods.moreplanets.module.planets.nibiru.dimension.WorldProviderNibiru)1 TileEntityNuclearWasteGenerator (stevekung.mods.moreplanets.module.planets.nibiru.tileentity.TileEntityNuclearWasteGenerator)1 TileEntityDarkEnergyReceiver (stevekung.mods.moreplanets.tileentity.TileEntityDarkEnergyReceiver)1 TeleporterMP (stevekung.mods.moreplanets.util.TeleporterMP)1 IFireBlock (stevekung.mods.moreplanets.util.blocks.IFireBlock)1 GuiElementInfoRegionMP (stevekung.mods.moreplanets.util.client.gui.GuiElementInfoRegionMP)1 GuiNumberField (stevekung.mods.moreplanets.util.client.gui.GuiNumberField)1