Java 类net.minecraft.network.play.server.SPacketWorldBorder 实例源码

项目:Backmemed    文件:PlayerList.java   
/**
 * Updates the time and weather for the given player to those of the given world
 */
public void updateTimeAndWeatherForPlayer(EntityPlayerMP playerIn, WorldServer worldIn)
{
    WorldBorder worldborder = this.mcServer.worldServers[0].getWorldBorder();
    playerIn.connection.sendPacket(new SPacketWorldBorder(worldborder, SPacketWorldBorder.Action.INITIALIZE));
    playerIn.connection.sendPacket(new SPacketTimeUpdate(worldIn.getTotalWorldTime(), worldIn.getWorldTime(), worldIn.getGameRules().getBoolean("doDaylightCycle")));
    BlockPos blockpos = worldIn.getSpawnPoint();
    playerIn.connection.sendPacket(new SPacketSpawnPosition(blockpos));

    if (worldIn.isRaining())
    {
        playerIn.connection.sendPacket(new SPacketChangeGameState(1, 0.0F));
        playerIn.connection.sendPacket(new SPacketChangeGameState(7, worldIn.getRainStrength(1.0F)));
        playerIn.connection.sendPacket(new SPacketChangeGameState(8, worldIn.getThunderStrength(1.0F)));
    }
}
项目:CustomWorldGen    文件:PlayerList.java   
/**
 * Updates the time and weather for the given player to those of the given world
 */
public void updateTimeAndWeatherForPlayer(EntityPlayerMP playerIn, WorldServer worldIn)
{
    WorldBorder worldborder = this.mcServer.worldServers[0].getWorldBorder();
    playerIn.connection.sendPacket(new SPacketWorldBorder(worldborder, SPacketWorldBorder.Action.INITIALIZE));
    playerIn.connection.sendPacket(new SPacketTimeUpdate(worldIn.getTotalWorldTime(), worldIn.getWorldTime(), worldIn.getGameRules().getBoolean("doDaylightCycle")));

    if (worldIn.isRaining())
    {
        playerIn.connection.sendPacket(new SPacketChangeGameState(1, 0.0F));
        playerIn.connection.sendPacket(new SPacketChangeGameState(7, worldIn.getRainStrength(1.0F)));
        playerIn.connection.sendPacket(new SPacketChangeGameState(8, worldIn.getThunderStrength(1.0F)));
    }
}
项目:justenoughdimensions    文件:WorldBorderUtils.java   
public static void sendWorldBorder(EntityPlayer player)
{
    if (Configs.enableSeparateWorldBorders && player.getEntityWorld().isRemote == false && (player instanceof EntityPlayerMP))
    {
        JustEnoughDimensions.logInfo("WorldBorderUtils.sendWorldBorder(): Sending the border to player '{}'", player.getName());
        ((EntityPlayerMP) player).connection.sendPacket(
                new SPacketWorldBorder(player.getEntityWorld().getWorldBorder(), SPacketWorldBorder.Action.INITIALIZE));
    }
}
项目:justenoughdimensions    文件:JEDBorderListener.java   
private void sendPacketToPlayers(SPacketWorldBorder packet)
{
    World world = DimensionManager.getWorld(this.dimension);

    if (world != null && world.isRemote == false)
    {
        for (EntityPlayerMP player : world.getPlayers(EntityPlayerMP.class, Predicates.alwaysTrue()))
        {
            player.connection.sendPacket(packet);
        }
    }
}
项目:Zombe-Modpack    文件:NetHandlerPlayClient.java   
public void handleWorldBorder(SPacketWorldBorder packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    packetIn.apply(this.clientWorldController.getWorldBorder());
}
项目:Backmemed    文件:NetHandlerPlayClient.java   
public void handleWorldBorder(SPacketWorldBorder packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    packetIn.apply(this.clientWorldController.getWorldBorder());
}
项目:CustomWorldGen    文件:NetHandlerPlayClient.java   
public void handleWorldBorder(SPacketWorldBorder packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    packetIn.apply(this.clientWorldController.getWorldBorder());
}
项目:justenoughdimensions    文件:JEDBorderListener.java   
@Override
public void onSizeChanged(WorldBorder border, double newSize)
{
    this.sendPacketToPlayers(new SPacketWorldBorder(border, SPacketWorldBorder.Action.SET_SIZE));
}
项目:justenoughdimensions    文件:JEDBorderListener.java   
@Override
public void onTransitionStarted(WorldBorder border, double oldSize, double newSize, long time)
{
    this.sendPacketToPlayers(new SPacketWorldBorder(border, SPacketWorldBorder.Action.LERP_SIZE));
}
项目:justenoughdimensions    文件:JEDBorderListener.java   
@Override
public void onCenterChanged(WorldBorder border, double x, double z)
{
    this.sendPacketToPlayers(new SPacketWorldBorder(border, SPacketWorldBorder.Action.SET_CENTER));
}
项目:justenoughdimensions    文件:JEDBorderListener.java   
@Override
public void onWarningTimeChanged(WorldBorder border, int newTime)
{
    this.sendPacketToPlayers(new SPacketWorldBorder(border, SPacketWorldBorder.Action.SET_WARNING_TIME));
}
项目:justenoughdimensions    文件:JEDBorderListener.java   
@Override
public void onWarningDistanceChanged(WorldBorder border, int newDistance)
{
    this.sendPacketToPlayers(new SPacketWorldBorder(border, SPacketWorldBorder.Action.SET_WARNING_BLOCKS));
}
项目:ExpandedRailsMod    文件:NetHandlerPlayClient.java   
public void handleWorldBorder(SPacketWorldBorder packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    packetIn.apply(this.clientWorldController.getWorldBorder());
}
项目:Backmemed    文件:INetHandlerPlayClient.java   
void handleWorldBorder(SPacketWorldBorder packetIn);
项目:CustomWorldGen    文件:INetHandlerPlayClient.java   
void handleWorldBorder(SPacketWorldBorder packetIn);