congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
ViaVersionConfig
Code IndexAdd Tabnine 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)

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
    • setScale (BigDecimal)
    • addToBackStack (FragmentTransaction)
    • startActivity (Activity)
    • BorderLayout (java.awt)
      A border layout lays out a container, arranging and resizing its components to fit in five regions:
    • ResultSet (java.sql)
      An interface for an object which represents a database table entry, returned as the result of the qu
    • Hashtable (java.util)
      A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
    • TimerTask (java.util)
      The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
    • DataSource (javax.sql)
      An interface for the creation of Connection objects which represent a connection to a database. This
    • BoxLayout (javax.swing)
    • Top plugins for WebStorm
    Tabnine Logo
    • Products

      Search for Java codeSearch for JavaScript code
    • IDE Plugins

      IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
    • Company

      About UsContact UsCareers
    • Resources

      FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
    Get Tabnine for your IDE now