Codota Logo
ViaVersionConfig
Code IndexAdd Codota to your IDE (free)

How to use
ViaVersionConfig
in
us.myles.ViaVersion.api

Best Java code snippets using us.myles.ViaVersion.api.ViaVersionConfig (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
DateTime d =
  • Codota Iconnew DateTime()
  • Codota IconDateTimeFormatter formatter;String text;formatter.parseDateTime(text)
  • Codota IconObject instant;new DateTime(instant)
  • Smart code suggestions by Codota
}
origin: MylesIsCool/ViaVersion

@Override
public SortedSet<Integer> getSupportedVersions() {
  SortedSet<Integer> outputSet = new TreeSet<>(ProtocolRegistry.getSupportedVersions());
  outputSet.removeAll(Via.getPlatform().getConf().getBlockedProtocols());
  return outputSet;
}
origin: MylesIsCool/ViaVersion

public static void init() {
  if (!Via.getConfig().isServersideBlockConnections()) return;
  Via.getPlatform().getLogger().info("Loading block connection mappings ...");
  JsonObject mapping1_13 = MappingData.loadData("mapping-1.13.json");
  if (!Via.getConfig().isReduceBlockStorageMemory()) {
    JsonObject mappingBlockConnections = MappingData.loadData("blockConnections.json");
    for (Entry<String, JsonElement> entry : mappingBlockConnections.entrySet()) {
  TripwireConnectionHandler.init();
  if (Via.getConfig().getBlockConnectionMethod().equalsIgnoreCase("packet")) {
    Via.getManager().getProviders().register(BlockConnectionProvider.class, new PacketBlockConnectionProvider());
origin: Matsv/ViaBackwards

public static EntityType getTypeFromId(int typeID, boolean isObject) {
  Optional<EntityType> type;
  if (isObject)
    type = ObjectType.getPCEntity(typeID);
  else
    type = EntityType.findById(typeID);
  if (!type.isPresent()) {
    if (!Via.getConfig().isSuppressMetadataErrors())
      ViaBackwards.getPlatform().getLogger().severe("[EntityType1_10] Could not find type id " + typeID + " isObject=" + isObject);
    return EntityType.ENTITY; // Fall back to the basic ENTITY
  }
  return type.get();
}
origin: MylesIsCool/ViaVersion

  @Override
  public boolean execute(ViaCommandSender sender, String[] args) {
    ConfigurationProvider provider = Via.getPlatform().getConfigurationProvider();
    boolean newValue = !Via.getConfig().isCheckForUpdates();

    provider.set("checkforupdates", newValue);
    provider.saveConfig();
    sendMessage(sender, "&6We will %snotify you about updates.", (newValue ? "&a" : "&cnot "));

    return true;
  }
}
origin: MylesIsCool/ViaVersion

    if (entityID != getProvidedEntityId() && Via.getConfig().isShieldBlocking()) {
      if ((data & 0x10) == 0x10) {
        if (validBlocking.contains(entityID)) {
if (type == Entity1_10Types.EntityType.ARMOR_STAND && Via.getConfig().isHologramPatch()) {
  if (metadata.getId() == 0 && getMetaByIndex(metadataList, 10) != null) {
    Metadata meta = getMetaByIndex(metadataList, 10); //Only happens if the armorstand is small
          wrapper.write(Type.VAR_INT, entityID);
          wrapper.write(Type.SHORT, (short) 0);
          wrapper.write(Type.SHORT, (short) (128D * (Via.getConfig().getHologramYOffset() * 32D)));
          wrapper.write(Type.SHORT, (short) 0);
          wrapper.write(Type.BOOLEAN, true);
if (Via.getConfig().isBossbarPatch()) {
  if (type == Entity1_10Types.EntityType.ENDER_DRAGON || type == Entity1_10Types.EntityType.WITHER) {
    if (metadata.getId() == 2) {
        bar.setTitle(title);
    } else if (metadata.getId() == 6 && !Via.getConfig().isBossbarAntiflicker()) { // If anti flicker is enabled, don't update health
      BossBar bar = bossBarMap.get(entityID);
origin: MylesIsCool/ViaVersion

if (type.is(EntityType.ARMOR_STAND) && Via.getConfig().isHologramPatch()) {
  Optional<Metadata> flags = getById(metadatas, 11);
  Optional<Metadata> customName = getById(metadatas, 2);
          wrapper.write(Type.VAR_INT, entityId);
          wrapper.write(Type.SHORT, (short) 0);
          wrapper.write(Type.SHORT, (short) (128D * (-Via.getConfig().getHologramYOffset() * 32D)));
          wrapper.write(Type.SHORT, (short) 0);
          wrapper.write(Type.BOOLEAN, true);
if (!Via.getConfig().isSuppressMetadataErrors() || Via.getManager().isDebug()) {
  Via.getPlatform().getLogger().warning("An error occurred with entity metadata handler");
  Via.getPlatform().getLogger().warning("Metadata: " + metadata);
origin: MylesIsCool/ViaVersion

  Via.getManager().getProviders().use(InventoryQuickMoveProvider.class, new BukkitInventoryQuickMoveProvider());
if (Via.getConfig().getBlockConnectionMethod().equalsIgnoreCase("world")) {
  Via.getManager().getProviders().use(BlockConnectionProvider.class, new BukkitBlockConnectionProvider());
origin: MylesIsCool/ViaVersion

@EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR)
public void onDeath(PlayerDeathEvent e) {
  Player p = e.getEntity();
  if (isOnPipe(p) && ViaVersion.getConfig().isShowNewDeathMessages() && checkGamerule(p.getWorld()) && e.getDeathMessage() != null)
    sendPacket(p, e.getDeathMessage());
}
origin: MylesIsCool/ViaVersion

public void init() {
  if (System.getProperty("ViaVersion") != null) {
    // Reload?
    platform.onReload();
  }
  // Check for updates
  if (platform.getConf().isCheckForUpdates())
    UpdateUtil.sendUpdateMessage();
  // Force class load
  ProtocolRegistry.getSupportedVersions();
  // Inject
  try {
    injector.inject();
  } catch (Exception e) {
    getPlatform().getLogger().severe("ViaVersion failed to inject:");
    e.printStackTrace();
    return;
  }
  // Mark as injected
  System.setProperty("ViaVersion", getPlatform().getPluginVersion());
  // If successful
  platform.runSync(new Runnable() {
    @Override
    public void run() {
      onServerLoaded();
    }
  });
}
origin: MylesIsCool/ViaVersion

if (Via.getConfig().getBlockConnectionMethod().equalsIgnoreCase("world")) {
  Via.getManager().getProviders().use(BlockConnectionProvider.class, new SpongeBlockConnectionProvider());
origin: MylesIsCool/ViaVersion

@Listener(order = Order.LAST)
public void onDeath(DestructEntityEvent.Death e) {
  if (!(e.getTargetEntity() instanceof Player))
    return;
  Player p = (Player) e.getTargetEntity();
  if (isOnPipe(p.getUniqueId()) && Via.getConfig().isShowNewDeathMessages() && checkGamerule(p.getWorld())) {
    sendPacket(p, e.getMessage().toPlain());
  }
}
origin: MylesIsCool/ViaVersion

  @EventHandler
  public void onJoin(PostLoginEvent e) {
    if (e.getPlayer().hasPermission("viaversion.update")
        && Via.getConfig().isCheckForUpdates()) {
      UpdateUtil.sendUpdateMessage(e.getPlayer().getUniqueId());
    }
  }
}
origin: MylesIsCool/ViaVersion

@Override
public SortedSet<Integer> getSupportedVersions() {
  SortedSet<Integer> outputSet = new TreeSet<>(ProtocolRegistry.getSupportedVersions());
  outputSet.removeAll(Via.getPlatform().getConf().getBlockedProtocols());
  return outputSet;
}
origin: Matsv/ViaBackwards

public static EntityType getTypeFromId(int typeID, boolean isObject) throws Exception {
  Optional<EntityType> type;
  if (isObject)
    type = ObjectType.getPCEntity(typeID);
  else
    type = EntityType.findById(typeID);
  if (!type.isPresent()) {
    if (!Via.getConfig().isSuppressMetadataErrors())
      ViaBackwards.getPlatform().getLogger().severe("[EntityType1_12] Could not find type id " + typeID + " isObject=" + isObject);
    return EntityType.ENTITY; // Fall back to the basic ENTITY
  }
  return type.get();
}
origin: MylesIsCool/ViaVersion

  @Listener
  public void onJoin(ClientConnectionEvent.Join join) {
    if (join.getTargetEntity().hasPermission("viaversion.update")
        && Via.getConfig().isCheckForUpdates()) {
      UpdateUtil.sendUpdateMessage(join.getTargetEntity().getUniqueId());
    }
  }
}
origin: MylesIsCool/ViaVersion

@Override
public SortedSet<Integer> getSupportedVersions() {
  SortedSet<Integer> outputSet = new TreeSet<>(ProtocolRegistry.getSupportedVersions());
  outputSet.removeAll(Via.getPlatform().getConf().getBlockedProtocols());
  return outputSet;
}
origin: Matsv/ViaBackwards

public static EntityType getTypeFromId(int typeID, boolean isObject) throws Exception {
  Optional<EntityType> type;
  if (isObject)
    type = ObjectType.getPCEntity(typeID);
  else
    type = EntityType.findById(typeID);
  if (!type.isPresent()) {
    if (!Via.getConfig().isSuppressMetadataErrors())
      ViaBackwards.getPlatform().getLogger().severe("[EntityType1_11] Could not find type id " + typeID + " isObject=" + isObject);
    return EntityType.ENTITY; // Fall back to the basic ENTITY
  }
  return type.get();
}
origin: MylesIsCool/ViaVersion

  @EventHandler
  public void onJoin(PlayerJoinEvent e) {
    if (e.getPlayer().hasPermission("viaversion.update")
        && Via.getConfig().isCheckForUpdates()) {
      UpdateUtil.sendUpdateMessage(e.getPlayer().getUniqueId());
    }
  }
}
origin: MylesIsCool/ViaVersion

@Override
public SortedSet<Integer> getSupportedVersions() {
  SortedSet<Integer> outputSet = new TreeSet<>(ProtocolRegistry.getSupportedVersions());
  outputSet.removeAll(Via.getPlatform().getConf().getBlockedProtocols());
  return outputSet;
}
origin: MylesIsCool/ViaVersion

  public static void handleMetadata(int entityId, Entity1_12Types.EntityType type, List<Metadata> metadatas, UserConnection connection) {
    for (Metadata metadata : new ArrayList<>(metadatas)) {
      try {
        if (metadata.getValue() instanceof Item) {
          // Apply rewrite
          BedRewriter.toClientItem((Item) metadata.getValue());
        }
        // Evocation Illager aggressive property became 13
        if (type.is(Entity1_12Types.EntityType.EVOCATION_ILLAGER)) {
          if (metadata.getId() == 12) {
            metadata.setId(13);
          }
        }
      } catch (Exception e) {
        metadatas.remove(metadata);
        if (!Via.getConfig().isSuppressMetadataErrors() || Via.getManager().isDebug()) {
          Via.getPlatform().getLogger().warning("An error occurred with entity metadata handler");
          Via.getPlatform().getLogger().warning("Metadata: " + metadata);
          e.printStackTrace();
        }
      }
    }

  }
}
us.myles.ViaVersion.apiViaVersionConfig

Most used methods

    Popular in Java

    • Start an intent from android
    • onRequestPermissionsResult (Fragment)
    • getSupportFragmentManager (FragmentActivity)
      Return the FragmentManager for interacting with fragments associated with this activity.
    • scheduleAtFixedRate (Timer)
      Schedules the specified task for repeated fixed-rate execution, beginning after the specified delay.
    • Table (com.google.common.collect)
      A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
    • ConnectException (java.net)
      A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
    • InetAddress (java.net)
      This class represents an Internet Protocol (IP) address. An IP address is either a 32-bit or 128-bit
    • Enumeration (java.util)
      A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
    • StringTokenizer (java.util)
      The string tokenizer class allows an application to break a string into tokens. The tokenization met
    • Filter (javax.servlet)
      A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
    Codota Logo
    • Products

      Search for Java codeSearch for JavaScript codeEnterprise
    • IDE Plugins

      IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
    • Company

      About UsContact UsCareers
    • Resources

      FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
    Get Codota for your IDE now