Implement per-player Weather API. Adds BUKKIT-812

This commit is contained in:
T00thpick1
2012-12-20 16:51:27 -05:00
committed by Travis Watkins
parent a7a5f273e3
commit 1bde25bb33
4 changed files with 38 additions and 2 deletions

View File

@@ -10,6 +10,7 @@ import java.util.Set;
import java.util.TreeSet;
// CraftBukkit start
import org.bukkit.WeatherType;
import org.bukkit.block.BlockState;
import org.bukkit.craftbukkit.util.LongHash;
@@ -896,7 +897,7 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate
// CraftBukkit start - only sending weather packets to those affected
for (int i = 0; i < this.players.size(); ++i) {
if (((EntityPlayer) this.players.get(i)).world == this) {
((EntityPlayer) this.players.get(i)).playerConnection.sendPacket(new Packet70Bed(flag ? 2 : 1, 0));
((EntityPlayer) this.players.get(i)).setPlayerWeather((!flag ? WeatherType.DOWNFALL : WeatherType.CLEAR), false);
}
}
// CraftBukkit end