Skip to content

Commit

Permalink
This isn't needed actually...
Browse files Browse the repository at this point in the history
Velocity 1.x plugins wouldn't load in Velocity 2 and vice-versa.
  • Loading branch information
Andre601 committed May 17, 2021
1 parent b413a9f commit 4273259
Showing 1 changed file with 0 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

import com.andre601.oneversionremake.core.commands.CommandHandler;
import com.andre601.oneversionremake.core.enums.ProtocolVersion;
import com.andre601.oneversionremake.core.enums.ProxyPlatform;
import com.andre601.oneversionremake.core.files.ConfigHandler;
import com.andre601.oneversionremake.core.interfaces.PluginCore;
import com.andre601.oneversionremake.core.interfaces.ProxyLogger;
Expand Down Expand Up @@ -119,14 +118,6 @@ public <T> List<T> getPlayers(Class<T> clazz, List<String> lines, List<Integer>

private void start(){
loadVersion();

if((pluginCore.getProxyPlatform() != ProxyPlatform.BUNGEECORD) && (pluginCore.getProxyPlatform() != ProxyPlatform.WATERFALL)){
if((isNewVelocity() && isLegacyPlugin()) || (!isNewVelocity() && !isLegacyPlugin())){
printIncompatabilityWarning();
return;
}
}

printBanner();

if(configHandler.loadConfig()){
Expand Down Expand Up @@ -195,15 +186,6 @@ private void printWarning(){
getProxyLogger().warn("================================================================================");
}

private void printIncompatabilityWarning(){
getProxyLogger().warn("================================================================================");
getProxyLogger().warn("WARNING!");
getProxyLogger().warn("You're using Velocity 2 while the plugin itself is for Velocity 1.1.0!");
getProxyLogger().warn("");
getProxyLogger().warn("The Legacy-plugin is incompatible with Velocity 2 and will be disabled...");
getProxyLogger().warn("================================================================================");
}

private void loadVersion(){
try(InputStream is = getClass().getResourceAsStream("/core.properties")){
Properties properties = new Properties();
Expand All @@ -215,18 +197,4 @@ private void loadVersion(){
version = "UNKNOWN";
}
}

private boolean isNewVelocity(){
try{
int maj = Integer.parseInt(pluginCore.getProxyVersion().split("\\.")[0]);

return maj >= 2;
}catch(NumberFormatException ex){
return false;
}
}

private boolean isLegacyPlugin(){
return pluginCore.getProxyPlatform() == ProxyPlatform.VELOCITY_LEGACY;
}
}

0 comments on commit 4273259

Please sign in to comment.