예제 #1
0
  @SuppressWarnings("deprecation")
  @Override
  public boolean queueBlockBreakEffect(
      Platform server, Vector position, int blockId, double priority) {
    if (taskId == -1) {
      taskId =
          server.schedule(
              0,
              1,
              new Runnable() {
                @Override
                public void run() {
                  int max = Math.max(1, Math.min(30, effectQueue.size() / 3));
                  for (int i = 0; i < max; ++i) {
                    if (effectQueue.isEmpty()) return;

                    effectQueue.poll().play();
                  }
                }
              });
    }

    if (taskId == -1) {
      return false;
    }

    effectQueue.offer(new QueuedEffect(position, blockId, priority));

    return true;
  }
 @Override
 public LocalConfiguration getConfiguration() {
   return platform.getConfiguration();
 }
 @Override
 public void registerCommands(Dispatcher dispatcher) {
   platform.registerCommands(dispatcher);
 }
 @Nullable
 @Override
 public World matchWorld(World world) {
   return platform.matchWorld(world);
 }
 @Nullable
 @Override
 public Player matchPlayer(Player player) {
   return platform.matchPlayer(player);
 }
 @Override
 public List<? extends World> getWorlds() {
   return platform.getWorlds();
 }
 @Override
 public int schedule(long delay, long period, Runnable task) {
   return platform.schedule(delay, period, task);
 }
 @Override
 public void reload() {
   platform.reload();
 }
 @Override
 public boolean isValidMobType(String type) {
   return platform.isValidMobType(type);
 }
 @Override
 public int resolveItem(String name) {
   return platform.resolveItem(name);
 }
 @Override
 public Map<Capability, Preference> getCapabilities() {
   return platform.getCapabilities();
 }
 @Override
 public String getPlatformVersion() {
   return platform.getPlatformVersion();
 }
 @Override
 public String getPlatformName() {
   return platform.getPlatformName();
 }
예제 #14
0
 @Override
 public BiomeTypes getBiomes() {
   return platform.getBiomes();
 }