本文整理汇总了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));
}
}
示例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));
}
}
示例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));
}
}
}
示例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));
}
}
示例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);
}