13
0

Refactor version dependant calls to new System #79

Manuell gemergt
Lixfel hat 4 Commits von RefactoringVersionDependant nach master 2021-01-04 22:20:12 +01:00 zusammengeführt
Nur Änderungen aus Commit d5cf3aa545 werden angezeigt - Alle Commits anzeigen

Datei anzeigen

@ -20,6 +20,7 @@
package de.steamwar.schematicsystem; package de.steamwar.schematicsystem;
import de.steamwar.core.Core; import de.steamwar.core.Core;
import de.steamwar.core.VersionedCallable;
import de.steamwar.sql.Schematic; import de.steamwar.sql.Schematic;
import de.steamwar.sql.SchematicType; import de.steamwar.sql.SchematicType;
import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.ConfigurationSection;
@ -67,14 +68,9 @@ public class CheckSchemType implements ICheckSchemType {
} }
public AutoCheckResult autoCheck(Schematic schematic) { public AutoCheckResult autoCheck(Schematic schematic) {
switch(Core.getVersion()){ return VersionedCallable.call(new VersionedCallable<>(() -> new AutoCheckResult(), 8),
case 15: new VersionedCallable<>(() -> CheckSchemType_12.autoCheck(schematic, null), 12),
return CheckSchemType_15.autoCheck(schematic, this); new VersionedCallable<>(() -> CheckSchemType_15.autoCheck(schematic, null), 15));
case 12:
return CheckSchemType_12.autoCheck(schematic, this);
default:
return new AutoCheckResult();
}
} }
@Override @Override