Updated to 1.4.0 BentoBox API
This commit is contained in:
parent
1563abf1a7
commit
30b4598ef5
|
@ -44,7 +44,7 @@ public class BSkyBlock extends GameModeAddon {
|
||||||
setState(State.DISABLED);
|
setState(State.DISABLED);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
new Config<>(this, Settings.class).saveConfigObject(settings);
|
this.saveWorldSettings();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -122,4 +122,12 @@ public class BSkyBlock extends GameModeAddon {
|
||||||
public @NonNull ChunkGenerator getDefaultWorldGenerator(String worldName, String id) {
|
public @NonNull ChunkGenerator getDefaultWorldGenerator(String worldName, String id) {
|
||||||
return chunkGenerator;
|
return chunkGenerator;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void saveWorldSettings() {
|
||||||
|
if (settings != null) {
|
||||||
|
new Config<>(this, Settings.class).saveConfigObject(settings);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -185,9 +185,10 @@ public class Settings implements DataObject, WorldSettings {
|
||||||
@Adapter(FlagSerializer2.class)
|
@Adapter(FlagSerializer2.class)
|
||||||
private Map<Flag, Integer> defaultIslandSettings = new HashMap<>();
|
private Map<Flag, Integer> defaultIslandSettings = new HashMap<>();
|
||||||
|
|
||||||
@ConfigComment("These are the settings visible to users. (Not implemented yet)")
|
@ConfigComment("These settings/flags are hidden from users")
|
||||||
@ConfigEntry(path = "world.visible-settings", experimental = true)
|
@ConfigComment("Ops can toggle hiding in-game using SHIFT-LEFT-CLICK on flags in settings")
|
||||||
private List<String> visibleSettings = new ArrayList<>();
|
@ConfigEntry(path = "world.hidden-flags")
|
||||||
|
private List<String> hiddenFlags = new ArrayList<>();
|
||||||
|
|
||||||
@ConfigComment("Visitor banned commands - Visitors to islands cannot use these commands in this world")
|
@ConfigComment("Visitor banned commands - Visitors to islands cannot use these commands in this world")
|
||||||
@ConfigEntry(path = "world.visitor-banned-commands")
|
@ConfigEntry(path = "world.visitor-banned-commands")
|
||||||
|
@ -519,11 +520,11 @@ public class Settings implements DataObject, WorldSettings {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the visibleSettings
|
* @return the hidden flags
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<String> getVisibleSettings() {
|
public List<String> getHiddenFlags() {
|
||||||
return visibleSettings;
|
return hiddenFlags;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -899,10 +900,10 @@ public class Settings implements DataObject, WorldSettings {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param visibleSettings the visibleSettings to set
|
* @param set the hidden flags
|
||||||
*/
|
*/
|
||||||
public void setVisibleSettings(List<String> visibleSettings) {
|
public void setHiddenFlags(List<String> hiddenFlags) {
|
||||||
this.visibleSettings = visibleSettings;
|
this.hiddenFlags = hiddenFlags;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -254,13 +254,13 @@ public class SettingsTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test method for {@link world.bentobox.bskyblock.Settings#setVisibleSettings(java.util.List)}.
|
* Test method for {@link world.bentobox.bskyblock.Settings#setHiddenFlags(java.util.List)}.
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testSetVisibleSettings() {
|
public void testSetVisibleSettings() {
|
||||||
List<String> visibleSettings = Collections.emptyList();
|
List<String> visibleSettings = Collections.emptyList();
|
||||||
s.setVisibleSettings(visibleSettings);
|
s.setHiddenFlags(visibleSettings);
|
||||||
assertEquals(visibleSettings, s.getVisibleSettings());
|
assertEquals(visibleSettings, s.getHiddenFlags());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue