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

项目:nailed    文件:NailedWorld.java   
@Override
public void onPlayerJoined(Player player) {
    logger.info("Player " + player.toString() + " joined world " + this.toString());
    players.add(player);
    ((NailedPlayer) player).sendPacket(new S41PacketServerDifficulty(wrapped.getDifficulty(), false));
    if(this.getConfig().resourcePackUrl() != null){
        player.loadResourcePack(this.getConfig().resourcePackUrl(), ""); //TODO: fix hash
    }
}
项目:nailed    文件:NailedWorld.java   
@Override
public void setDifficulty(Difficulty difficulty) {
    EnumDifficulty diff = EnumDifficulty.getDifficultyEnum(difficulty.getId());
    this.wrapped.getWorldInfo().setDifficulty(diff);
    for (Player player : this.players) {
        ((NailedPlayer) player).sendPacket(new S41PacketServerDifficulty(diff, false));
    }
    if(difficulty == Difficulty.PEACEFUL){
        wrapped.setAllowedSpawnTypes(false, true);
    }else{
        wrapped.setAllowedSpawnTypes(true, true);
    }
}
项目:DecompiledMinecraft    文件:NetHandlerPlayClient.java   
public void handleServerDifficulty(S41PacketServerDifficulty packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    this.gameController.theWorld.getWorldInfo().setDifficulty(packetIn.getDifficulty());
    this.gameController.theWorld.getWorldInfo().setDifficultyLocked(packetIn.isDifficultyLocked());
}
项目:BaseClient    文件:NetHandlerPlayClient.java   
public void handleServerDifficulty(S41PacketServerDifficulty packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    this.gameController.theWorld.getWorldInfo().setDifficulty(packetIn.getDifficulty());
    this.gameController.theWorld.getWorldInfo().setDifficultyLocked(packetIn.isDifficultyLocked());
}
项目:BaseClient    文件:NetHandlerPlayClient.java   
public void handleServerDifficulty(S41PacketServerDifficulty packetIn) {
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    this.gameController.theWorld.getWorldInfo().setDifficulty(packetIn.getDifficulty());
    this.gameController.theWorld.getWorldInfo().setDifficultyLocked(packetIn.isDifficultyLocked());
}
项目:DecompiledMinecraft    文件:INetHandlerPlayClient.java   
void handleServerDifficulty(S41PacketServerDifficulty packetIn);
项目:DecompiledMinecraft    文件:INetHandlerPlayClient.java   
void handleServerDifficulty(S41PacketServerDifficulty packetIn);
项目:BaseClient    文件:INetHandlerPlayClient.java   
void handleServerDifficulty(S41PacketServerDifficulty packetIn);
项目:BaseClient    文件:INetHandlerPlayClient.java   
void handleServerDifficulty(S41PacketServerDifficulty packetIn);