当前位置: 首页>>代码示例>>Java>>正文


Java WeatherType.DOWNFALL属性代码示例

本文整理汇总了Java中org.bukkit.WeatherType.DOWNFALL属性的典型用法代码示例。如果您正苦于以下问题:Java WeatherType.DOWNFALL属性的具体用法?Java WeatherType.DOWNFALL怎么用?Java WeatherType.DOWNFALL使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.bukkit.WeatherType的用法示例。


在下文中一共展示了WeatherType.DOWNFALL属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setPlayerWeather

public void setPlayerWeather(WeatherType type, boolean plugin) {
    if (!plugin && this.weather != null) {
        return;
    }

    if (plugin) {
        this.weather = type;
    }

    if (type == WeatherType.DOWNFALL) {
        this.playerConnection.sendPacket(new PacketPlayOutGameStateChange(2, 0));
        // this.playerConnection.sendPacket(new PacketPlayOutGameStateChange(7, this.world.j(1.0F)));
        // this.playerConnection.sendPacket(new PacketPlayOutGameStateChange(8, this.world.h(1.0F)));
    } else {
        this.playerConnection.sendPacket(new PacketPlayOutGameStateChange(1, 0));
    }
}
 
开发者ID:OvercastNetwork,项目名称:CraftBukkit,代码行数:17,代码来源:EntityPlayer.java

示例2: setPlayerWeather

public void setPlayerWeather(WeatherType type, boolean plugin)
{
    if (!plugin && this.weather != null)
    {
        return;
    }

    if (plugin)
    {
        this.weather = type;
    }

    if (type == WeatherType.DOWNFALL)
    {
        this.playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(2, 0));
        // this.playerConnection.sendPacket(new PacketPlayOutGameStateChange(7, this.world.j(1.0F)));
        // this.playerConnection.sendPacket(new PacketPlayOutGameStateChange(8, this.world.h(1.0F)));
    }
    else
    {
        this.playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(1, 0));
    }
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:23,代码来源:EntityPlayerMP.java

示例3: updateWeather

public void updateWeather(float oldRain, float newRain, float oldThunder, float newThunder) {
    if (this.weather == null) {
        // Vanilla
        if (oldRain != newRain) {
            this.playerConnection.sendPacket(new PacketPlayOutGameStateChange(7, newRain));
        }
    } else {
        // Plugin
        if (pluginRainPositionPrevious != pluginRainPosition) {
            this.playerConnection.sendPacket(new PacketPlayOutGameStateChange(7, pluginRainPosition));
        }
    }

    if (oldThunder != newThunder) {
        if (weather == WeatherType.DOWNFALL || weather == null) {
            this.playerConnection.sendPacket(new PacketPlayOutGameStateChange(8, newThunder));
        } else {
            this.playerConnection.sendPacket(new PacketPlayOutGameStateChange(8, 0));
        }
    }
}
 
开发者ID:bergerkiller,项目名称:SpigotSource,代码行数:21,代码来源:EntityPlayer.java

示例4: setPlayerWeather

public void setPlayerWeather(WeatherType type, boolean plugin) {
    if (!plugin && this.weather != null) {
        return;
    }

    if (plugin) {
        this.weather = type;
    }

    if (type == WeatherType.DOWNFALL) {
        this.playerConnection.sendPacket(new PacketPlayOutGameStateChange(2, 0));
    } else {
        this.playerConnection.sendPacket(new PacketPlayOutGameStateChange(1, 0));
    }
}
 
开发者ID:bergerkiller,项目名称:SpigotSource,代码行数:15,代码来源:EntityPlayer.java

示例5: tickWeather

public void tickWeather() {
    if (this.weather == null) return;

    pluginRainPositionPrevious = pluginRainPosition;
    if (weather == WeatherType.DOWNFALL) {
        pluginRainPosition += 0.01;
    } else {
        pluginRainPosition -= 0.01;
    }

    pluginRainPosition = MathHelper.a(pluginRainPosition, 0.0F, 1.0F);
}
 
开发者ID:bergerkiller,项目名称:SpigotSource,代码行数:12,代码来源:EntityPlayer.java


注:本文中的org.bukkit.WeatherType.DOWNFALL属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。