mirror of
https://github.com/BentoBoxWorld/CaveBlock.git
synced 2025-01-24 21:21:20 +01:00
Updated to BentoBox 1.4.0 API
This commit is contained in:
parent
f42c15e225
commit
7753565a8c
4
pom.xml
4
pom.xml
@ -6,7 +6,7 @@
|
||||
|
||||
<groupId>world.bentobox</groupId>
|
||||
<artifactId>caveblock</artifactId>
|
||||
<version>0.1.0</version>
|
||||
<version>0.1.1</version>
|
||||
|
||||
<name>CaveBlock</name>
|
||||
<description>CaveBlock is an add-on for BentoBox, an expandable Minecraft Bukkit plugin for island-type games like SkyBlock or AcidIsland.</description>
|
||||
@ -86,7 +86,7 @@
|
||||
<dependency>
|
||||
<groupId>world.bentobox</groupId>
|
||||
<artifactId>bentobox</artifactId>
|
||||
<version>1.2.0</version>
|
||||
<version>1.4.0-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
@ -30,6 +30,7 @@ public class CaveBlock extends GameModeAddon
|
||||
|
||||
this.saveDefaultConfig();
|
||||
this.loadSettings();
|
||||
this.saveWorldSettings();
|
||||
}
|
||||
|
||||
|
||||
@ -62,10 +63,7 @@ public class CaveBlock extends GameModeAddon
|
||||
@Override
|
||||
public void onDisable()
|
||||
{
|
||||
if (this.settings != null)
|
||||
{
|
||||
new Config<>(this, Settings.class).saveConfigObject(this.settings);
|
||||
}
|
||||
// Do nothing
|
||||
}
|
||||
|
||||
|
||||
@ -206,6 +204,13 @@ public class CaveBlock extends GameModeAddon
|
||||
return this.settings;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveWorldSettings() {
|
||||
if (settings != null) {
|
||||
new Config<>(this, Settings.class).saveConfigObject(settings);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------
|
||||
// Section: Variables
|
||||
@ -237,4 +242,5 @@ public class CaveBlock extends GameModeAddon
|
||||
* String for the end world.
|
||||
*/
|
||||
private static final String THE_END = "_the_end";
|
||||
|
||||
}
|
||||
|
@ -358,13 +358,13 @@ public class Settings implements DataObject, WorldSettings
|
||||
|
||||
|
||||
/**
|
||||
* This method returns the visibleSettings object.
|
||||
* @return the visibleSettings object.
|
||||
* This method returns the hiddenFlags object.
|
||||
* @return the hiddenFlags object.
|
||||
*/
|
||||
@Override
|
||||
public List<String> getVisibleSettings()
|
||||
public List<String> getHiddenFlags()
|
||||
{
|
||||
return visibleSettings;
|
||||
return hiddenFlags;
|
||||
}
|
||||
|
||||
|
||||
@ -1111,13 +1111,13 @@ public class Settings implements DataObject, WorldSettings
|
||||
|
||||
|
||||
/**
|
||||
* This method sets the visibleSettings object value.
|
||||
* @param visibleSettings the visibleSettings object new value.
|
||||
* This method sets the hiddenFlags object value.
|
||||
* @param hiddenFlags the hiddenFlags object new value.
|
||||
*
|
||||
*/
|
||||
public void setVisibleSettings(List<String> visibleSettings)
|
||||
public void setHiddenFlags(List<String> hiddenFlags)
|
||||
{
|
||||
this.visibleSettings = visibleSettings;
|
||||
this.hiddenFlags = hiddenFlags;
|
||||
}
|
||||
|
||||
|
||||
@ -1803,9 +1803,10 @@ public class Settings implements DataObject, WorldSettings
|
||||
@Adapter(FlagSerializer2.class)
|
||||
private Map<Flag, Integer> defaultIslandSettings = new HashMap<>();
|
||||
|
||||
@ConfigComment("These are the settings visible to users. (Not implemented yet)")
|
||||
@ConfigEntry(path = "world.visible-settings", experimental = true)
|
||||
private List<String> visibleSettings = new ArrayList<>();
|
||||
@ConfigComment("These settings/flags are hidden from users")
|
||||
@ConfigComment("Ops can toggle hiding in-game using SHIFT-LEFT-CLICK on flags in settings")
|
||||
@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")
|
||||
@ConfigEntry(path = "world.visitor-banned-commands")
|
||||
|
@ -258,9 +258,9 @@ world:
|
||||
MONSTER_SPAWN: true
|
||||
FIRE_SPREAD: true
|
||||
PVP_OVERWORLD: false
|
||||
# These are the settings visible to users. (Not implemented yet)
|
||||
# /!\ This feature is experimental and might not work as expected or might not work at all.
|
||||
visible-settings: []
|
||||
# These settings/flags are hidden from users
|
||||
# Ops can toggle hiding in-game using SHIFT-LEFT-CLICK on flags in settings
|
||||
hidden-flags: []
|
||||
# Visitor banned commands - Visitors to islands cannot use these commands in this world
|
||||
visitor-banned-commands:
|
||||
- spawner
|
||||
|
Loading…
Reference in New Issue
Block a user