mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-12-27 11:07:38 +01:00
Depcrecate the regions plugins (add warnings, disable when replacement plugins are active). Remove example configuration.txt entries.
This commit is contained in:
parent
0a790b6014
commit
54589cd358
@ -9,17 +9,23 @@ import java.util.Map;
|
||||
import org.json.simple.JSONArray;
|
||||
import org.json.simple.JSONObject;
|
||||
public class ClientComponent extends Component {
|
||||
|
||||
private boolean disabled;
|
||||
|
||||
public ClientComponent(final DynmapPlugin plugin, final ConfigurationNode configuration) {
|
||||
super(plugin, configuration);
|
||||
plugin.events.addListener("buildclientconfiguration", new Event.Listener<JSONObject>() {
|
||||
@Override
|
||||
public void triggered(JSONObject root) {
|
||||
buildClientConfiguration(root);
|
||||
if(!disabled)
|
||||
buildClientConfiguration(root);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
protected void disableComponent() {
|
||||
disabled = true;
|
||||
}
|
||||
|
||||
protected void buildClientConfiguration(JSONObject root) {
|
||||
JSONObject o = createClientConfiguration();
|
||||
a(root, "components", o);
|
||||
|
@ -24,16 +24,32 @@ public class RegionsComponent extends ClientComponent {
|
||||
private TownyConfigHandler towny;
|
||||
private FactionsConfigHandler factions;
|
||||
private String regiontype;
|
||||
|
||||
private static String deprecated_ids[] = { "Residence", "Factions", "Towny", "WorldGuard" };
|
||||
private static String deprecated_new_plugins[] = { "dynmap-residence", "Dynmap-Factions", "Dynmap-Towny", "Dynmap-WorldGuard" };
|
||||
|
||||
public RegionsComponent(final DynmapPlugin plugin, final ConfigurationNode configuration) {
|
||||
super(plugin, configuration);
|
||||
|
||||
regiontype = configuration.getString("name", "WorldGuard");
|
||||
/* Check if a deprecated component */
|
||||
for(int i = 0; i < deprecated_ids.length; i++) {
|
||||
if(regiontype.equals(deprecated_ids[i])) { /* If match */
|
||||
/* See if new plugin is installed - disable if it is */
|
||||
if(plugin.getServer().getPluginManager().getPlugin(deprecated_new_plugins[i]) != null) {
|
||||
Log.info("Region component for '" + regiontype + "' disabled, replaced by '" + deprecated_new_plugins[i] + "' plugin, which is installed");
|
||||
disableComponent();
|
||||
return;
|
||||
}
|
||||
else {
|
||||
Log.info("Region component for '" + regiontype + "' has been DEPRECATED - migrate to '" + deprecated_new_plugins[i] + "' plugin");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// For internal webserver.
|
||||
String fname = configuration.getString("filename", "regions.yml");
|
||||
|
||||
regiontype = configuration.getString("name", "WorldGuard");
|
||||
|
||||
|
||||
/* Load special handler for Towny */
|
||||
if(regiontype.equals("Towny")) {
|
||||
towny = new TownyConfigHandler(configuration);
|
||||
|
@ -113,129 +113,6 @@ components:
|
||||
# timeout: 1800 # in seconds (1800 seconds = 30 minutes)
|
||||
# redirecturl: inactive.html
|
||||
# #showmessage: 'You were inactive for too long.'
|
||||
|
||||
#- class: org.dynmap.regions.RegionsComponent
|
||||
# type: regions
|
||||
# name: WorldGuard
|
||||
# useworldpath: true
|
||||
# filename: regions.yml
|
||||
# basenode: regions
|
||||
# use3dregions: true
|
||||
# regionstyle:
|
||||
# strokeColor: "#FF0000"
|
||||
# strokeOpacity: 0.8
|
||||
# strokeWeight: 3
|
||||
# fillColor: "#FF0000"
|
||||
# fillOpacity: 0.35
|
||||
# # Optional setting to limit which regions to show, by name - if commented out, all regions are shown
|
||||
# visibleregions:
|
||||
# - homebase
|
||||
# - miningsite
|
||||
# # Optional setting to hide specific regions, by name
|
||||
# hiddenregions:
|
||||
# - hiddenplace
|
||||
# - secretsite
|
||||
# # Optional per-region overrides for regionstyle (any defined replace those in regionstyle)
|
||||
# customstyle:
|
||||
# homebase:
|
||||
# strokeColor: "#00FF00"
|
||||
# # Optional - make layer hidden by default
|
||||
# hidebydefault: true
|
||||
# # Optional - ordering priority in layer menu (low goes before high - default is 0)
|
||||
# layerprio: 1
|
||||
|
||||
#- class: org.dynmap.regions.RegionsComponent
|
||||
# type: regions
|
||||
# name: Residence
|
||||
# useworldpath: false
|
||||
# filename: res.yml
|
||||
# basenode: Residences
|
||||
# use3dregions: false
|
||||
# infowindow: '<div class="infowindow"><span style="font-size:120%;">%regionname%</span><br /> Owner <span style="font-weight:bold;">%playerowners%</span><br />Flags<br /><span style="font-weight:bold;">%flags%</span></div>'
|
||||
# regionstyle:
|
||||
# strokeColor: "#FF0000"
|
||||
# strokeOpacity: 0.8
|
||||
# strokeWeight: 3
|
||||
# fillColor: "#FF0000"
|
||||
# fillOpacity: 0.35
|
||||
# # Optional setting to limit which regions to show, by name - if commented out, all regions are shown
|
||||
# visibleregions:
|
||||
# - homebase
|
||||
# - miningsite
|
||||
# - area.subzone1
|
||||
# # Optional setting to hide specific regions, by name
|
||||
# hiddenregions:
|
||||
# - hiddenplace
|
||||
# - secretsite
|
||||
# # Optional per-region overrides for regionstyle (any defined replace those in regionstyle)
|
||||
# customstyle:
|
||||
# homebase:
|
||||
# strokeColor: "#00FF00"
|
||||
# # Optional groups (subareas under a residence) overrides for regionstyle (any defined replace those in regionstyle)
|
||||
# groupstyle:
|
||||
# homebase:
|
||||
# strokeColor: "#007F00"
|
||||
# # Optional - make layer hidden by default
|
||||
# hidebydefault: true
|
||||
# # Optional - ordering priority in layer menu (low goes before high - default is 0)
|
||||
# layerprio: 1
|
||||
|
||||
#- class: org.dynmap.regions.RegionsComponent
|
||||
# type: regions
|
||||
# name: Towny
|
||||
# use3dregions: false
|
||||
# infowindow: '<div class="infowindow"><span style="font-size:120%;">%regionname% (%nation%)</span><br /> Mayor <span style="font-weight:bold;">%playerowners%</span><br /> Associates <span style="font-weight:bold;">%playermanagers%</span><br/>Flags<br /><span style="font-weight:bold;">%flags%</span></div>'
|
||||
# regionstyle:
|
||||
# strokeColor: "#FF0000"
|
||||
# strokeOpacity: 0.8
|
||||
# strokeWeight: 3
|
||||
# fillColor: "#FF0000"
|
||||
# fillOpacity: 0.35
|
||||
# # Optional setting to limit which regions to show, by name - if commented out, all regions are shown
|
||||
# visibleregions:
|
||||
# - homebase
|
||||
# - miningsite
|
||||
# # Optional setting to hide specific regions, by name
|
||||
# hiddenregions:
|
||||
# - hiddenplace
|
||||
# - secretsite
|
||||
# # Optional per-town overrides for regionstyle (any defined replace those in regionstyle)
|
||||
# customstyle:
|
||||
# homebase:
|
||||
# strokeColor: "#00FF00"
|
||||
# # Optional per-nation overrides for regionstyle (any defined replace those in regionstyle)
|
||||
# groupstyle:
|
||||
# MyNation:
|
||||
# strokeColor: "#007F00"
|
||||
# # Optional - make layer hidden by default
|
||||
# hidebydefault: true
|
||||
|
||||
#- class: org.dynmap.regions.RegionsComponent
|
||||
# type: regions
|
||||
# name: Factions
|
||||
# use3dregions: false
|
||||
# infowindow: '<div class="infowindow"><span style="font-size:120%;">%regionname%</span><br />Flags<br /><span style="font-weight:bold;">%flags%</span></div>'
|
||||
# regionstyle:
|
||||
# strokeColor: "#FF0000"
|
||||
# strokeOpacity: 0.8
|
||||
# strokeWeight: 3
|
||||
# fillColor: "#FF0000"
|
||||
# fillOpacity: 0.35
|
||||
# # Optional setting to limit which regions to show, by name - if commented out, all regions are shown
|
||||
# visibleregions:
|
||||
# - faction1
|
||||
# - faction2
|
||||
# # Optional setting to hide specific regions, by name
|
||||
# hiddenregions:
|
||||
# - hiddenfaction
|
||||
# # Optional per-faction overrides for regionstyle (any defined replace those in regionstyle)
|
||||
# customstyle:
|
||||
# faction1:
|
||||
# strokeColor: "#00FF00"
|
||||
# # Optional - make layer hidden by default
|
||||
# hidebydefault: true
|
||||
# # Optional - ordering priority in layer menu (low goes before high - default is 0)
|
||||
# layerprio: 1
|
||||
|
||||
#- class: org.dynmap.TestComponent
|
||||
# stuff: "This is some configuration-value"
|
||||
|
Loading…
Reference in New Issue
Block a user