Dieser Commit ist enthalten in:
Ursprung
fc5c4922db
Commit
58fb831950
@ -64,7 +64,7 @@ public class ModCommand extends SWCommand {
|
||||
}
|
||||
|
||||
public void updateAndCloseGui(Mod.ModType modType,String modName,Mod.Platform modPlatform,SWInventory toClose,ProxiedPlayer p) {
|
||||
Mod.setMod(modType, modName, modPlatform);
|
||||
Mod.get(modName,modPlatform).setModType(modType,modName,modPlatform);
|
||||
toClose.close();
|
||||
openGui(p);
|
||||
}
|
||||
@ -123,7 +123,7 @@ public class ModCommand extends SWCommand {
|
||||
return;
|
||||
}
|
||||
|
||||
Mod.setMod(newModType,modName,platform);
|
||||
Mod.get(modName,platform).setModType(newModType,modName,platform);
|
||||
|
||||
Message.send("MOD_CHANGED_TYPE",p,modName,platform.name(),newModType.name());
|
||||
}
|
||||
@ -135,10 +135,9 @@ public class ModCommand extends SWCommand {
|
||||
|
||||
@Register(value = {"next"})
|
||||
public void next(ProxiedPlayer p) {
|
||||
Pair<String ,Integer> foundMod = Mod.findFirstMod();
|
||||
Mod mod = Mod.get(foundMod.getKey(),foundMod.getValue());
|
||||
Mod mod = Mod.findFirstMod();
|
||||
|
||||
if(foundMod == null) {
|
||||
if(mod == null) {
|
||||
Message.send("MOD_NO_MORE_UNCLASSIFIED_MODS",p);
|
||||
return;
|
||||
}
|
||||
|
@ -70,25 +70,13 @@ public class Mod {
|
||||
return get(modName,platform).modType;
|
||||
}
|
||||
|
||||
public static void setMod(Mod.ModType newModType,String modName,Mod.Platform platform) {
|
||||
public void setModType(Mod.ModType newModType,String modName,Mod.Platform platform) {
|
||||
set.update(newModType.value ,modName,platform.value);
|
||||
}
|
||||
|
||||
public static boolean doesModExist(String modName,Mod.Platform modPlatform) {
|
||||
return get.select(ResultSet::next,modName,modPlatform.value);
|
||||
}
|
||||
|
||||
public static List<Mod> getAll(int page, int elementsPerPage) {
|
||||
return Mod.getAll.select(rs -> {
|
||||
List<Mod> f = new ArrayList<>();
|
||||
while(rs.next()){
|
||||
Mod entry = new Mod(rs.getString("ModName"), Mod.Platform.valueOf(rs.getInt("Platform")),Mod.ModType.valueOf(rs.getInt("ModType")));
|
||||
f.add(entry);
|
||||
}
|
||||
return f;
|
||||
},page * elementsPerPage, elementsPerPage);
|
||||
}
|
||||
|
||||
public static List<Mod> getAllModsFiltered(int page,int elementsPerPage, Mod.ModType filter) {
|
||||
return Mod.getAllFiltered.select(rs -> {
|
||||
List<Mod> f = new ArrayList<>();
|
||||
@ -100,11 +88,11 @@ public class Mod {
|
||||
},filter.value, page * elementsPerPage, elementsPerPage);
|
||||
}
|
||||
|
||||
public static Pair<String,Integer> findFirstMod() {
|
||||
public static Mod findFirstMod() {
|
||||
findFirst.select(rs -> {
|
||||
String name = rs.getString("ModName");
|
||||
int platform = rs.getInt("Platform");
|
||||
return new ImmutablePair<>(name,platform);
|
||||
return get(name,Platform.valueOf(platform));
|
||||
});
|
||||
return null;
|
||||
}
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren