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);
}
}
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;
}
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;
}
}
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()));
}
}
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);
}
Aggregations