Examples of World


Examples of models.World

            public List<World> apply() throws Throwable {
                Random random = ThreadLocalRandom.current();
                List<World> worlds = new ArrayList<World>(n);
                for (int i = 0; i < n; ++i) {
                    long randomId = random.nextInt(TEST_DATABASE_ROWS) + 1;
                    World world = World.findById(randomId);
                    worlds.add(world);
                }
                return worlds;
            }
        }, dbEc);
View Full Code Here

Examples of models.World

    if (queries == 0)
      queries = 1;
    final List<World> worlds = new ArrayList<World>();
    for (int i = 0; i < queries; ++i) {
      Long id = Long.valueOf(random.nextInt(TEST_DATABASE_ROWS) + 1);
      World result = World.findById(id);
      worlds.add(result);
    }
    renderJSON(worlds);
  }
View Full Code Here

Examples of models.World

    World.deleteAll();
    System.out.println("DELETED");
    // in with the new
    for (long i = 0; i <= TEST_DATABASE_ROWS; i++) {
      int randomNumber = random.nextInt(TEST_DATABASE_ROWS) + 1;
      new World(i, randomNumber).save();
      if (i % 100 == 0) {

        World.em().flush();
        World.em().clear();
        System.out.println("FLUSHED : " + i + "/" + TEST_DATABASE_ROWS);
View Full Code Here

Examples of models.World

    for (int i = 0; i < queryCount; ++i) {
      final Long id = Long
          .valueOf(random.nextInt(TEST_DATABASE_ROWS) + 1);
      Job<World> job = new Job<World>() {
        public World doJobWithResult() throws Exception {
          World result = World.findById(id);
          return result;
        };
      };
      promises.add(job.now());
    }
View Full Code Here

Examples of models.World

    Job<List<World>> job = new Job<List<World>>() {
      public java.util.List<World> doJobWithResult() throws Exception {
        for (int i = 0; i < queryCount; ++i) {
          Long id = Long
              .valueOf(random.nextInt(TEST_DATABASE_ROWS) + 1);
          World result = World.findById(id);
          worlds.add(result);
        }
        return worlds;
      };
    };
View Full Code Here

Examples of net.canarymod.api.world.World

        return msgrec instanceof Player ? ((Player) msgrec).getWorld().getName() : Canary.getServer().getDefaultWorldName();
    }

    @MOTDKey(key = "{world.weather}")
    public final String worldWeather(MessageReceiver msgrec) {
        World world;
        if (msgrec instanceof Player) {
            world = ((Player) msgrec).getWorld();
        }
        else if (msgrec instanceof CommandBlock) {
            world = ((CommandBlock) msgrec).getWorld();
        }
        else {
            world = Canary.getServer().getDefaultWorld();
        }

        if (world.isThundering()) {
            return "thunderstorm";
        }
        else if (world.isRaining()) {
            return "raining";
        }
        else {
            return "sunny";
        }
View Full Code Here

Examples of net.lightstone.world.World

    if (args.length != 1) {
      player.sendMessage("§eUsage: /kick <username>");
      return;
    }

    World world = player.getWorld();
    String name = args[0];

    for (Player p : world.getPlayers()) {
      if (p.getName().equalsIgnoreCase(name)) {
        player.sendMessage("§eKicking " + p.getName());
        p.getSession().send(new KickMessage("Kicked by " + player.getName()));
        return;
      }
View Full Code Here

Examples of net.mdked.Jrachgame.world.World

        } else
          map[x][y] = snow2;
      }
    }

    new World();
    playerC = World.player;
    World.objecz.add(playerC);

    upRen = new ArrayList<Entity>();
    downRen = new ArrayList<Entity>();
View Full Code Here

Examples of net.minecraft.server.World

      return false;
    }
    // Preparations prior to teleportation
    final Entity entityHandle = CommonNMS.getNative(entity);
    final CommonEntity<?> passenger = get(getPassenger());
    final World newworld = CommonNMS.getNative(location.getWorld());
    final boolean isWorldChange = entityHandle.world != newworld;
    final EntityNetworkController<?> oldNetworkController = getNetworkController();
    final boolean hasNetworkController = !(oldNetworkController instanceof DefaultEntityNetworkController);
    WorldUtil.loadChunks(location, 3);
View Full Code Here

Examples of net.minecraft.server.v1_6_R3.World

        }
      }
    }
    // Overridden methods
    if (method.getName().equals("a") && Arrays.deepEquals(method.getParameterTypes(), new Class[] {IBlockAccess.class, int.class, int.class, int.class, int.class})) {
      World world = (World) args[0];
      int x = (Integer) args[1];
      int y = (Integer) args[2];
      int z = (Integer) args[3];
      int face = (Integer) args[4];

      org.getspout.spoutapi.material.CustomBlock block = getCustomBlock(world, x, y, z);
      if (block != null) {
        return block.isProvidingPowerTo(world.getWorld(), x, y, z, org.bukkit.craftbukkit.v1_6_R3.block.CraftBlock.notchToBlockFace(face));
      }
    } else if (method.getName().equals("c") && Arrays.deepEquals(method.getParameterTypes(), new Class[] {World.class, int.class, int.class, int.class, int.class})) {
      World world = (World) args[0];
      int x = (Integer) args[1];
      int y = (Integer) args[2];
      int z = (Integer) args[3];
      int face = (Integer) args[4];
      org.getspout.spoutapi.material.CustomBlock block = getCustomBlock(world, x, y, z);
      if (block != null) {
        return block.isProvidingPowerTo(world.getWorld(), x, y, z, org.bukkit.craftbukkit.v1_6_R3.block.CraftBlock.notchToBlockFace(face));
      }
    } else if (method.getName().equals("b") && Arrays.deepEquals(method.getParameterTypes(), new Class[] {World.class, int.class, int.class, int.class, Entity.class})) {
      World world = (World) args[0];
      int x = (Integer) args[1];
      int y = (Integer) args[2];
      int z = (Integer) args[3];
      Entity e = (Entity) args[4];
      org.getspout.spoutapi.material.CustomBlock block = getCustomBlock(world, x, y, z);
      if (block != null) {
        block.onEntityMoveAt(world.getWorld(), x, y, z, e.getBukkitEntity());
        return null;
      }
    } else if (method.getName().equals("interact")) {
      World world = (World) args[0];
      int x = (Integer) args[1];
      int y = (Integer) args[2];
      int z = (Integer) args[3];
      Entity human = (Entity) args[4];
      org.getspout.spoutapi.material.CustomBlock block = getCustomBlock(world, x, y, z);
      if (block != null && human instanceof EntityPlayer) {
        return block.onBlockInteract(world.getWorld(), x, y, z, ((SpoutPlayer) human.getBukkitEntity()));
      }
    } else if (method.getName().equals("getDamage")) {
      EntityHuman human = (EntityHuman) args[0];
      World world = (World) args[1];
      int x = (Integer) args[2];
      int y = (Integer) args[3];
      int z = (Integer) args[4];
      org.getspout.spoutapi.material.CustomBlock block = getCustomBlock(world, x, y, z);
      if (block != null) {
        if (block instanceof org.getspout.spoutapi.material.CustomBlock) {
          SpoutPlayer player = (SpoutPlayer) human.getBukkitEntity();
          float def;
          SpoutItemStack inHand = player.getItemInHand() == null ? null : new SpoutItemStack(player.getItemInHand());
          org.getspout.spoutapi.material.Material item = inHand.getMaterial();

          float hardness = block.getHardness();
          if (hardness <= 0F) {
            return m.invoke(wrapped, args);
          }

          def = (!human.a(wrapped) ? 1.0F / hardness / 100.0F : human.a(wrapped, false) / hardness / 30.0F); //TODO EntityHuman.a(Block, boolean) appears to not make any use of the flag variable...

          if (!(item instanceof CustomItem)) {
            return def;
          }

          if (!(item instanceof Tool)) {
            return def;
          }

          Tool tool = (Tool) item;

          float modifier = tool.getStrengthModifier(block);

          return modifier / hardness / (modifier > 1F ? 30F : 100F);
        }
      }
    } else if (method.getName().equals("remove")) {
      World world = (World) args[0];
      int x = (Integer) args[1];
      int y = (Integer) args[2];
      int z = (Integer) args[3];
      org.getspout.spoutapi.material.CustomBlock block = getCustomBlock(world, x, y, z);
      if (block != null) {
        block.onBlockDestroyed(world.getWorld(), x, y, z);
      }
    } else if (method.getName().equals("doPhysics")) {
      World world = (World) args[0];
      int x = (Integer) args[1];
      int y = (Integer) args[2];
      int z = (Integer) args[3];
      int face = (Integer) args[4];
      org.getspout.spoutapi.material.CustomBlock block = getCustomBlock(world, x, y, z);
      if (block != null) {
        block.onNeighborBlockChange(world.getWorld(), x, y, z, face);
      }
    }
      return m.invoke(wrapped, args);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.