Added AutoUpdater

This commit is contained in:
BuildTools 2018-05-03 14:46:10 +02:00
parent 4934e1b68b
commit bd080c4ee4
22 changed files with 957 additions and 532 deletions

6
WorldSystem/.gitignore vendored Normal file
View File

@ -0,0 +1,6 @@
.idea/
.settings/
bin/
WorldSystem.iml
.project
.classpath

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/WorldSystem.iml" filepath="$PROJECT_DIR$/WorldSystem.iml" />
</modules>
</component>
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/WorldSystem.iml" filepath="$PROJECT_DIR$/WorldSystem.iml" />
</modules>
</component>
</project>

View File

@ -1,277 +1,277 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="97a3c063-d1d2-4944-b5c0-38257b243326" name="Default" comment="" />
<ignored path="$PROJECT_DIR$/bin/" />
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="TRACKING_ENABLED" value="true" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="FileEditorManager">
<leaf>
<file leaf-file-name="WorldSystem.java" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/src/de/butzlabben/world/WorldSystem.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="272">
<caret line="57" column="39" lean-forward="true" selection-start-line="57" selection-start-column="39" selection-end-line="57" selection-end-column="39" />
</state>
</provider>
</entry>
</file>
</leaf>
</component>
<component name="ProjectFrameBounds">
<option name="x" value="260" />
<option name="y" value="20" />
<option name="width" value="1400" />
<option name="height" value="1000" />
</component>
<component name="ProjectView">
<navigator proportions="" version="1">
<foldersAlwaysOnTop value="true" />
</navigator>
<panes>
<pane id="ProjectPane">
<subPane>
<expand>
<path>
<item name="WorldSystem" type="b2602c69:ProjectViewProjectNode" />
<item name="WorldSystem" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="WorldSystem" type="b2602c69:ProjectViewProjectNode" />
<item name="WorldSystem" type="462c0819:PsiDirectoryNode" />
<item name="src" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="WorldSystem" type="b2602c69:ProjectViewProjectNode" />
<item name="WorldSystem" type="462c0819:PsiDirectoryNode" />
<item name="src" type="462c0819:PsiDirectoryNode" />
<item name="butzlabben" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="WorldSystem" type="b2602c69:ProjectViewProjectNode" />
<item name="WorldSystem" type="462c0819:PsiDirectoryNode" />
<item name="src" type="462c0819:PsiDirectoryNode" />
<item name="butzlabben" type="462c0819:PsiDirectoryNode" />
<item name="world" type="462c0819:PsiDirectoryNode" />
</path>
</expand>
<select />
</subPane>
</pane>
<pane id="AndroidView">
<subPane>
<expand>
<path>
<item name="WorldSystem" type="1abcf292:AndroidViewProjectNode" />
<item name="WorldSystem" type="e9137016:NonAndroidModuleNode" />
</path>
<path>
<item name="WorldSystem" type="1abcf292:AndroidViewProjectNode" />
<item name="WorldSystem" type="e9137016:NonAndroidModuleNode" />
<item name="java" type="f7eae187:NonAndroidSourceTypeNode" />
</path>
</expand>
<select />
</subPane>
</pane>
<pane id="Scope" />
<pane id="PackagesPane" />
</panes>
</component>
<component name="PropertiesComponent">
<property name="project.structure.last.edited" value="Modules" />
<property name="project.structure.proportion" value="0.0" />
<property name="project.structure.side.proportion" value="0.0" />
<property name="settings.editor.selected.configurable" value="preferences.general" />
</component>
<component name="RunDashboard">
<option name="ruleStates">
<list>
<RuleState>
<option name="name" value="ConfigurationTypeDashboardGroupingRule" />
</RuleState>
<RuleState>
<option name="name" value="StatusDashboardGroupingRule" />
</RuleState>
</list>
</option>
</component>
<component name="RunManager">
<configuration default="true" type="Application" factoryName="Application">
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
</configuration>
<configuration default="true" type="JUnit" factoryName="JUnit">
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PACKAGE_NAME" />
<option name="MAIN_CLASS_NAME" />
<option name="METHOD_NAME" />
<option name="TEST_OBJECT" value="class" />
<option name="VM_PARAMETERS" value="-ea" />
<option name="PARAMETERS" />
<option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="singleModule" />
</option>
<patterns />
</configuration>
<configuration default="true" type="TestNG" factoryName="TestNG">
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="SUITE_NAME" />
<option name="PACKAGE_NAME" />
<option name="MAIN_CLASS_NAME" />
<option name="METHOD_NAME" />
<option name="GROUP_NAME" />
<option name="TEST_OBJECT" value="CLASS" />
<option name="VM_PARAMETERS" value="-ea" />
<option name="PARAMETERS" />
<option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
<option name="OUTPUT_DIRECTORY" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="singleModule" />
</option>
<option name="USE_DEFAULT_REPORTERS" value="false" />
<option name="PROPERTIES_FILE" />
<properties />
<listeners />
</configuration>
</component>
<component name="SvnConfiguration">
<configuration />
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="97a3c063-d1d2-4944-b5c0-38257b243326" name="Default" comment="" />
<created>1524410861721</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1524410861721</updated>
</task>
<servers />
</component>
<component name="ToolWindowManager">
<frame x="260" y="20" width="1400" height="1000" extended-state="0" />
<layout>
<window_info anchor="right" id="Palette" />
<window_info anchor="bottom" id="TODO" order="6" />
<window_info anchor="right" id="Palette&#9;" />
<window_info id="Image Layers" />
<window_info anchor="right" id="Capture Analysis" />
<window_info anchor="bottom" id="Event Log" side_tool="true" />
<window_info anchor="right" id="Maven Projects" />
<window_info anchor="bottom" id="Run" order="2" />
<window_info anchor="bottom" id="Version Control" show_stripe_button="false" />
<window_info anchor="bottom" id="Terminal" />
<window_info id="Capture Tool" />
<window_info id="Designer" />
<window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.25" />
<window_info id="Structure" order="1" side_tool="true" weight="0.25" />
<window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
<window_info id="UI Designer" />
<window_info anchor="right" id="Theme Preview" />
<window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
<window_info id="Favorites" side_tool="true" />
<window_info anchor="bottom" id="Find" order="1" />
<window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
<window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
<window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
<window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
<window_info anchor="bottom" id="Message" order="0" />
</layout>
</component>
<component name="VcsContentAnnotationSettings">
<option name="myLimit" value="2678400000" />
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/src/de/butzlabben/world/WorldSystem.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="272">
<caret line="57" column="39" lean-forward="true" selection-start-line="57" selection-start-column="39" selection-end-line="57" selection-end-column="39" />
</state>
</provider>
</entry>
</component>
<component name="masterDetails">
<states>
<state key="ArtifactsStructureConfigurable.UI">
<settings>
<artifact-editor />
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="FacetStructureConfigurable.UI">
<settings>
<last-edited>No facets are configured</last-edited>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="GlobalLibrariesConfigurable.UI">
<settings>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="JdkListConfigurable.UI">
<settings>
<last-edited>1.8</last-edited>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="ModuleStructureConfigurable.UI">
<settings>
<last-edited>WorldSystem</last-edited>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
<option value="0.6" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="ProjectLibrariesConfigurable.UI">
<settings>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
</states>
</component>
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="97a3c063-d1d2-4944-b5c0-38257b243326" name="Default" comment="" />
<ignored path="$PROJECT_DIR$/bin/" />
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="TRACKING_ENABLED" value="true" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="FileEditorManager">
<leaf>
<file leaf-file-name="WorldSystem.java" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/src/de/butzlabben/world/WorldSystem.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="272">
<caret line="57" column="39" lean-forward="true" selection-start-line="57" selection-start-column="39" selection-end-line="57" selection-end-column="39" />
</state>
</provider>
</entry>
</file>
</leaf>
</component>
<component name="ProjectFrameBounds">
<option name="x" value="260" />
<option name="y" value="20" />
<option name="width" value="1400" />
<option name="height" value="1000" />
</component>
<component name="ProjectView">
<navigator proportions="" version="1">
<foldersAlwaysOnTop value="true" />
</navigator>
<panes>
<pane id="ProjectPane">
<subPane>
<expand>
<path>
<item name="WorldSystem" type="b2602c69:ProjectViewProjectNode" />
<item name="WorldSystem" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="WorldSystem" type="b2602c69:ProjectViewProjectNode" />
<item name="WorldSystem" type="462c0819:PsiDirectoryNode" />
<item name="src" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="WorldSystem" type="b2602c69:ProjectViewProjectNode" />
<item name="WorldSystem" type="462c0819:PsiDirectoryNode" />
<item name="src" type="462c0819:PsiDirectoryNode" />
<item name="butzlabben" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="WorldSystem" type="b2602c69:ProjectViewProjectNode" />
<item name="WorldSystem" type="462c0819:PsiDirectoryNode" />
<item name="src" type="462c0819:PsiDirectoryNode" />
<item name="butzlabben" type="462c0819:PsiDirectoryNode" />
<item name="world" type="462c0819:PsiDirectoryNode" />
</path>
</expand>
<select />
</subPane>
</pane>
<pane id="AndroidView">
<subPane>
<expand>
<path>
<item name="WorldSystem" type="1abcf292:AndroidViewProjectNode" />
<item name="WorldSystem" type="e9137016:NonAndroidModuleNode" />
</path>
<path>
<item name="WorldSystem" type="1abcf292:AndroidViewProjectNode" />
<item name="WorldSystem" type="e9137016:NonAndroidModuleNode" />
<item name="java" type="f7eae187:NonAndroidSourceTypeNode" />
</path>
</expand>
<select />
</subPane>
</pane>
<pane id="Scope" />
<pane id="PackagesPane" />
</panes>
</component>
<component name="PropertiesComponent">
<property name="project.structure.last.edited" value="Modules" />
<property name="project.structure.proportion" value="0.0" />
<property name="project.structure.side.proportion" value="0.0" />
<property name="settings.editor.selected.configurable" value="preferences.general" />
</component>
<component name="RunDashboard">
<option name="ruleStates">
<list>
<RuleState>
<option name="name" value="ConfigurationTypeDashboardGroupingRule" />
</RuleState>
<RuleState>
<option name="name" value="StatusDashboardGroupingRule" />
</RuleState>
</list>
</option>
</component>
<component name="RunManager">
<configuration default="true" type="Application" factoryName="Application">
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
</configuration>
<configuration default="true" type="JUnit" factoryName="JUnit">
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PACKAGE_NAME" />
<option name="MAIN_CLASS_NAME" />
<option name="METHOD_NAME" />
<option name="TEST_OBJECT" value="class" />
<option name="VM_PARAMETERS" value="-ea" />
<option name="PARAMETERS" />
<option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="singleModule" />
</option>
<patterns />
</configuration>
<configuration default="true" type="TestNG" factoryName="TestNG">
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="SUITE_NAME" />
<option name="PACKAGE_NAME" />
<option name="MAIN_CLASS_NAME" />
<option name="METHOD_NAME" />
<option name="GROUP_NAME" />
<option name="TEST_OBJECT" value="CLASS" />
<option name="VM_PARAMETERS" value="-ea" />
<option name="PARAMETERS" />
<option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
<option name="OUTPUT_DIRECTORY" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="singleModule" />
</option>
<option name="USE_DEFAULT_REPORTERS" value="false" />
<option name="PROPERTIES_FILE" />
<properties />
<listeners />
</configuration>
</component>
<component name="SvnConfiguration">
<configuration />
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="97a3c063-d1d2-4944-b5c0-38257b243326" name="Default" comment="" />
<created>1524410861721</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1524410861721</updated>
</task>
<servers />
</component>
<component name="ToolWindowManager">
<frame x="260" y="20" width="1400" height="1000" extended-state="0" />
<layout>
<window_info anchor="right" id="Palette" />
<window_info anchor="bottom" id="TODO" order="6" />
<window_info anchor="right" id="Palette&#9;" />
<window_info id="Image Layers" />
<window_info anchor="right" id="Capture Analysis" />
<window_info anchor="bottom" id="Event Log" side_tool="true" />
<window_info anchor="right" id="Maven Projects" />
<window_info anchor="bottom" id="Run" order="2" />
<window_info anchor="bottom" id="Version Control" show_stripe_button="false" />
<window_info anchor="bottom" id="Terminal" />
<window_info id="Capture Tool" />
<window_info id="Designer" />
<window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.25" />
<window_info id="Structure" order="1" side_tool="true" weight="0.25" />
<window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
<window_info id="UI Designer" />
<window_info anchor="right" id="Theme Preview" />
<window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
<window_info id="Favorites" side_tool="true" />
<window_info anchor="bottom" id="Find" order="1" />
<window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
<window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
<window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
<window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
<window_info anchor="bottom" id="Message" order="0" />
</layout>
</component>
<component name="VcsContentAnnotationSettings">
<option name="myLimit" value="2678400000" />
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/src/de/butzlabben/world/WorldSystem.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="272">
<caret line="57" column="39" lean-forward="true" selection-start-line="57" selection-start-column="39" selection-end-line="57" selection-end-column="39" />
</state>
</provider>
</entry>
</component>
<component name="masterDetails">
<states>
<state key="ArtifactsStructureConfigurable.UI">
<settings>
<artifact-editor />
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="FacetStructureConfigurable.UI">
<settings>
<last-edited>No facets are configured</last-edited>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="GlobalLibrariesConfigurable.UI">
<settings>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="JdkListConfigurable.UI">
<settings>
<last-edited>1.8</last-edited>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="ModuleStructureConfigurable.UI">
<settings>
<last-edited>WorldSystem</last-edited>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
<option value="0.6" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="ProjectLibrariesConfigurable.UI">
<settings>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
</states>
</component>
</project>

View File

@ -1,29 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="EclipseModuleManager">
<libelement value="jar://$MODULE_DIR$/../../../spigot-1.12.jar!/" />
<src_description expected_position="2">
<src_folder value="file://$MODULE_DIR$/src" expected_position="2" />
</src_description>
</component>
<component name="NewModuleRootManager">
<output url="file://$MODULE_DIR$/bin" />
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="jdk" jdkName="JavaSE-1.8" jdkType="JavaSDK" />
<orderEntry type="module-library">
<library name="spigot-1.12.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../spigot-1.12.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://C:/Program Files/Java/jdk1.8.0_131/src.zip!/" />
</SOURCES>
</library>
</orderEntry>
<orderEntry type="sourceFolder" forTests="false" />
</component>
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="EclipseModuleManager">
<libelement value="jar://$MODULE_DIR$/../../../spigot-1.12.jar!/" />
<src_description expected_position="2">
<src_folder value="file://$MODULE_DIR$/src" expected_position="2" />
</src_description>
</component>
<component name="NewModuleRootManager">
<output url="file://$MODULE_DIR$/bin" />
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="jdk" jdkName="JavaSE-1.8" jdkType="JavaSDK" />
<orderEntry type="module-library">
<library name="spigot-1.12.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../spigot-1.12.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://C:/Program Files/Java/jdk1.8.0_131/src.zip!/" />
</SOURCES>
</library>
</orderEntry>
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

View File

@ -1,3 +0,0 @@
/de/
/org/
/ru.yml

View File

@ -1,76 +1,79 @@
##########################################################################
### __ __ __ _______ __ ###
### \ \ / / / / / / ___/ / / ###
### \ \ __ / /___ ___/ /___/ / /____ ______/ /______________ ###
### \ \ / \ / / __ \/ _/ / __ /__ / / / / __/ __/ ___/ _ _ / ###
### \ \/ /\ \/ / /_/ / // / /_/ /__/ / /_/ /_ / /_/ ___/ // // / ###
### \__/ \__/\____/_//_/\__,_/____/\__, /___/\__/\___/_//_//_/ ###
### ___/ / ###
### \___/ ###
##########################################################################
# Path where the worlds will be saved
worldfolder: 'plugins/WorldSystem/Worlds'
# Name of the template world
worldsource: ''
# When nobody is on a world time until it get unloaded
unloadingtime: 20
# If true nobody can teleport or change their gamemode a WorldSystem world
# Except for players with the permissions: ws.gamemode | ws.tp.*
survival: false
# Time in seconds until a request expires
request_expires: 20
# Name of the languagefile in plugins/WorldSystem/messages/
language: en
# Prefix which will be shown before each message
prefix: '&8[&3WorldSystem&8] &6'
# Options for the LagSystem:
# period_in_seconds - how often will be checked for entities in seconds
# entities_per_world - maximal allowed entities per world
# garbagecollector - how often will be unused ram be cleared
lagsystem:
period_in_seconds: 10
entities_per_world: 350
garbagecollector:
use: false
period_in_minutes: 5
# Options for random world generation
worldgeneration:
# A seed for worldgeneration
# Set it to 0 for no seed-useage
seed: 0
# Environment for the world
# Valid inputs are 'NORMAL', 'NETHER' and 'THE_END'
environment: NORMAL
# Type of the world eg. flat, amplified, ...
# Valid types are 'NORMAL', 'VERSION_1_1', 'FLAT', 'AMPLIFIED', 'CUSTOMIZED' or 'LARGE_BIOMES'
type: NORMAL
# Location where you will be teleported when you leave you world
spawn:
gamemode: 2
spawnpoint:
world: world
x: 0
y: 20
z: 0
yaw: 0
pitch: 0
# Location where you spawn when you join a world
worldspawn:
use: true
spawnpoint:
x: 0
y: 20
z: 0
yaw: 0
pitch: 0
##########################################################################
### __ __ __ _______ __ ###
### \ \ / / / / / / ___/ / / ###
### \ \ __ / /___ ___/ /___/ / /____ ______/ /______________ ###
### \ \ / \ / / __ \/ _/ / __ /__ / / / / __/ __/ ___/ _ _ / ###
### \ \/ /\ \/ / /_/ / // / /_/ /__/ / /_/ /_ / /_/ ___/ // // / ###
### \__/ \__/\____/_//_/\__,_/____/\__, /___/\__/\___/_//_//_/ ###
### ___/ / ###
### \___/ ###
##########################################################################
# Path where the worlds will be saved
worldfolder: 'plugins/WorldSystem/Worlds'
# Name of the template world
worldsource: ''
# If a confirm is needed before auto-update
need_confirm: true
# When nobody is on a world time until it get unloaded
unloadingtime: 20
# If true nobody can teleport or change their gamemode a WorldSystem world
# Except for players with the permissions: ws.gamemode | ws.tp.*
survival: false
# Time in seconds until a request expires
request_expires: 20
# Name of the languagefile in plugins/WorldSystem/messages/
language: en
# Prefix which will be shown before each message
prefix: '&8[&3WorldSystem&8] &6'
# Options for the LagSystem:
# period_in_seconds - how often will be checked for entities in seconds
# entities_per_world - maximal allowed entities per world
# garbagecollector - how often will be unused ram be cleared
lagsystem:
period_in_seconds: 10
entities_per_world: 350
garbagecollector:
use: false
period_in_minutes: 5
# Options for random world generation
worldgeneration:
# A seed for worldgeneration
# Set it to 0 for no seed-useage
seed: 0
# Environment for the world
# Valid inputs are 'NORMAL', 'NETHER' and 'THE_END'
environment: NORMAL
# Type of the world eg. flat, amplified, ...
# Valid types are 'NORMAL', 'VERSION_1_1', 'FLAT', 'AMPLIFIED', 'CUSTOMIZED' or 'LARGE_BIOMES'
type: NORMAL
# Location where you will be teleported when you leave you world
spawn:
gamemode: 2
spawnpoint:
world: world
x: 0
y: 20
z: 0
yaw: 0
pitch: 0
# Location where you spawn when you join a world
worldspawn:
use: true
spawnpoint:
x: 0
y: 20
z: 0
yaw: 0
pitch: 0

View File

@ -1,62 +1,48 @@
name: WorldSystem
version: 2.0.2
version: 2.0.3
author: Butzlabben
main: de.butzlabben.world.WorldSystem
commands:
ws:
description: Commands for WorldSystem
aliases: [worldsystem, world, worlds]
usage: /ws
ws get:
aliases: [worldsystem get, world get, worlds get]
usage: /ws get
ws help:
aliases: [worldsystem help, world help, worlds help]
usage: /ws help
ws home:
aliases: [worldsystem home, world home, worlds home]
usage: /ws home
ws addmember:
aliases: [worldsystem addmember, world addmember, worlds addmember]
usage: /ws addmember <player>
ws delmember:
aliases: [worldsystem delmember, world delmember, worlds delmember]
usage: /ws delmember <player>
ws leave:
aliases: [worldsystem leave, world leave, worlds leave]
usage: /ws leave
ws tp:
aliases: [worldsystem tp, world tp, worlds tp]
usage: /ws tp <target>
ws tnt:
aliases: [worldsystem tnt, world tnt, worlds tnt]
usage: /ws tnt
ws fire:
aliases: [worldsystem, world fire, worlds fire]
usage: /ws fire
ws info:
aliases: [worldsystem info, world info, worlds info]
usage: /ws info
ws togglebuild:
aliases: [worldsystem togglebuild, world togglebuild, worlds togglebuild]
usage: /ws togglebuild <player>
ws togglegm:
aliases: [worldsystem togglegm, world togglegm, worlds togglegm]
usage: /ws togglegm <player>
ws toggletp:
aliases: [worldsystem toggletp, world toggletp, worlds toggletp]
usage: /ws toggletp <player>
ws reset:
aliases: [worldsystem reset, world reset, worlds reset]
usage: /ws reset
ws gui:
aliases: [worldsystem gui, world gui, worlds gui]
usage: /ws gui
ws delete:
aliases: [worldsystem delete, world delete, worlds delete]
usage: /ws delete <player>
permission: ws.delete
ws confirm:
usage: /ws confirm
permission: ws.confirm
permissions:
ws.*:
@ -73,6 +59,7 @@ permissions:
ws.lag: true
ws.big: true
ws.large: true
ws.confirm: true
ws.tp.*:
default: op
description: You can teleport everything
@ -109,5 +96,8 @@ permissions:
children:
ws.big: true
description: Gives you a even bigger world (if set)
ws.confirm:
default: op
description: You can confirm (if needed) an auto-update
default-permission: admin

View File

@ -1,76 +1,79 @@
##########################################################################
### __ __ __ _______ __ ###
### \ \ / / / / / / ___/ / / ###
### \ \ __ / /___ ___/ /___/ / /____ ______/ /______________ ###
### \ \ / \ / / __ \/ _/ / __ /__ / / / / __/ __/ ___/ _ _ / ###
### \ \/ /\ \/ / /_/ / // / /_/ /__/ / /_/ /_ / /_/ ___/ // // / ###
### \__/ \__/\____/_//_/\__,_/____/\__, /___/\__/\___/_//_//_/ ###
### ___/ / ###
### \___/ ###
##########################################################################
# Path where the worlds will be saved
worldfolder: 'plugins/WorldSystem/Worlds'
# Name of the template world
worldsource: ''
# When nobody is on a world time until it get unloaded
unloadingtime: 20
# If true nobody can teleport or change their gamemode a WorldSystem world
# Except for players with the permissions: ws.gamemode | ws.tp.*
survival: false
# Time in seconds until a request expires
request_expires: 20
# Name of the languagefile in plugins/WorldSystem/messages/
language: en
# Prefix which will be shown before each message
prefix: '&8[&3WorldSystem&8] &6'
# Options for the LagSystem:
# period_in_seconds - how often will be checked for entities in seconds
# entities_per_world - maximal allowed entities per world
# garbagecollector - how often will be unused ram be cleared
lagsystem:
period_in_seconds: 10
entities_per_world: 350
garbagecollector:
use: false
period_in_minutes: 5
# Options for random world generation
worldgeneration:
# A seed for worldgeneration
# Set it to 0 for no seed-useage
seed: 0
# Environment for the world
# Valid inputs are 'NORMAL', 'NETHER' and 'THE_END'
environment: NORMAL
# Type of the world eg. flat, amplified, ...
# Valid types are 'NORMAL', 'VERSION_1_1', 'FLAT', 'AMPLIFIED', 'CUSTOMIZED' or 'LARGE_BIOMES'
type: NORMAL
# Location where you will be teleported when you leave you world
spawn:
gamemode: 2
spawnpoint:
world: world
x: 0
y: 20
z: 0
yaw: 0
pitch: 0
# Location where you spawn when you join a world
worldspawn:
use: true
spawnpoint:
x: 0
y: 20
z: 0
yaw: 0
pitch: 0
##########################################################################
### __ __ __ _______ __ ###
### \ \ / / / / / / ___/ / / ###
### \ \ __ / /___ ___/ /___/ / /____ ______/ /______________ ###
### \ \ / \ / / __ \/ _/ / __ /__ / / / / __/ __/ ___/ _ _ / ###
### \ \/ /\ \/ / /_/ / // / /_/ /__/ / /_/ /_ / /_/ ___/ // // / ###
### \__/ \__/\____/_//_/\__,_/____/\__, /___/\__/\___/_//_//_/ ###
### ___/ / ###
### \___/ ###
##########################################################################
# Path where the worlds will be saved
worldfolder: 'plugins/WorldSystem/Worlds'
# Name of the template world
worldsource: ''
# If a confirm is needed before auto-update
need_confirm: true
# When nobody is on a world time until it get unloaded
unloadingtime: 20
# If true nobody can teleport or change their gamemode a WorldSystem world
# Except for players with the permissions: ws.gamemode | ws.tp.*
survival: false
# Time in seconds until a request expires
request_expires: 20
# Name of the languagefile in plugins/WorldSystem/messages/
language: en
# Prefix which will be shown before each message
prefix: '&8[&3WorldSystem&8] &6'
# Options for the LagSystem:
# period_in_seconds - how often will be checked for entities in seconds
# entities_per_world - maximal allowed entities per world
# garbagecollector - how often will be unused ram be cleared
lagsystem:
period_in_seconds: 10
entities_per_world: 350
garbagecollector:
use: false
period_in_minutes: 5
# Options for random world generation
worldgeneration:
# A seed for worldgeneration
# Set it to 0 for no seed-useage
seed: 0
# Environment for the world
# Valid inputs are 'NORMAL', 'NETHER' and 'THE_END'
environment: NORMAL
# Type of the world eg. flat, amplified, ...
# Valid types are 'NORMAL', 'VERSION_1_1', 'FLAT', 'AMPLIFIED', 'CUSTOMIZED' or 'LARGE_BIOMES'
type: NORMAL
# Location where you will be teleported when you leave you world
spawn:
gamemode: 2
spawnpoint:
world: world
x: 0
y: 20
z: 0
yaw: 0
pitch: 0
# Location where you spawn when you join a world
worldspawn:
use: true
spawnpoint:
x: 0
y: 20
z: 0
yaw: 0
pitch: 0

View File

@ -0,0 +1,53 @@
package de.butzlabben.autoupdater;
import java.io.FileOutputStream;
import java.io.IOException;
import java.net.URL;
import java.nio.channels.Channels;
import java.nio.channels.FileChannel;
import java.nio.channels.ReadableByteChannel;
/**
* @author Butzlabben
* @since 02.05.2018
*/
public class AutoUpdate implements Runnable {
private UpdateInformations ui;
private String jar;
public AutoUpdate(UpdateInformations ui, String jar) {
this.ui = ui;
this.jar = jar;
}
@Override
public void run() {
FileChannel out = null;
FileOutputStream outStream = null;
try {
ReadableByteChannel in = Channels
.newChannel(new URL(ui.getURL()).openStream());
outStream = new FileOutputStream(jar);
out = outStream.getChannel();
out.transferFrom(in, 0, Long.MAX_VALUE);
} catch (Exception e) {
e.printStackTrace();
} finally {
if (out != null)
try {
out.close();
} catch (IOException e) {
e.printStackTrace();
}
if (outStream != null) {
try {
outStream.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
}

View File

@ -0,0 +1,108 @@
package de.butzlabben.autoupdater;
import java.io.File;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.HandlerList;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.plugin.java.JavaPlugin;
import de.butzlabben.world.WorldSystem;
import de.butzlabben.world.config.PluginConfig;
/**
* @author Butzlabben
* @since 01.05.2018
*/
public class AutoUpdater implements Listener {
private boolean confirmed;
private boolean confirmNeed;
private static AutoUpdater instance;
private AutoUpdate au;
public static void startAsync() {
Thread t = new Thread(() -> {
getInstance();
});
t.setName("update-thread-worldsystem");
t.start();
}
public static synchronized AutoUpdater getInstance() {
if (instance == null)
instance = new AutoUpdater(WorldSystem.getInstance());
return instance;
}
private AutoUpdater(JavaPlugin plugin) {
confirmNeed = PluginConfig.confirmNeed();
UpdateInformations ui = UpdateInformations.getInformations();
String v = plugin.getDescription().getVersion();
if (!ui.getVersion().equals(plugin.getDescription().getVersion())) {
Bukkit.getConsoleSender().sendMessage(
PluginConfig.getPrefix() + "Found new version. Current: " + v + ", Available: " + ui.getVersion());
// Get jar file
Method getFileMethod = null;
try {
getFileMethod = JavaPlugin.class.getDeclaredMethod("getFile");
} catch (NoSuchMethodException | SecurityException e1) {
e1.printStackTrace();
return;
}
getFileMethod.setAccessible(true);
File file = null;
try {
file = (File) getFileMethod.invoke(plugin);
} catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
e.printStackTrace();
return;
}
getFileMethod.setAccessible(false);
String jar = file.getAbsolutePath();
au = new AutoUpdate(ui, jar);
if (!confirmNeed) {
Runtime.getRuntime().addShutdownHook(new Thread(au));
Bukkit.getConsoleSender().sendMessage(PluginConfig.getPrefix() + "§aAutoupdate confirmed, §crestart §ato apply changes");
confirmed = true;
} else {
Bukkit.getPluginManager().registerEvents(this, plugin);
for(Player p : Bukkit.getOnlinePlayers()) {
p.sendMessage(PluginConfig.getPrefix() + "§aFound new update. Confirm autoupdate with §c/ws confirm");
}
Bukkit.getConsoleSender().sendMessage(PluginConfig.getPrefix() + "§aFound new update. Confirm autoupdate with §c/ws confirm");
}
}
}
@EventHandler
public void on(PlayerJoinEvent e) {
if (e.getPlayer().hasPermission("ws.confirm")) {
e.getPlayer().sendMessage(PluginConfig.getPrefix() + "§aFound new update. Confirm autoupdate with §c/ws confirm");
}
}
public boolean confirm() {
if (confirmNeed && !confirmed) {
Runtime.getRuntime().addShutdownHook(new Thread(au));
confirmed = true;
HandlerList.unregisterAll(this);
return true;
}
return false;
}
public boolean confirmed() {
return confirmed;
}
}

View File

@ -0,0 +1,71 @@
package de.butzlabben.autoupdater;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;
import java.nio.charset.Charset;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
/**
* @author Butzlabben
* @since 02.05.2018
*/
public class UpdateInformations {
private final String version, url;
public static synchronized UpdateInformations getInformations() {
String json = callURL("https://seagiants.eu/worldsystem/info.php");
Gson gson = new GsonBuilder().create();
UpdateInformations ui = gson.fromJson(json, UpdateInformations.class);
return ui;
}
private static String callURL(String URL) {
StringBuilder sb = new StringBuilder();
URLConnection urlConn = null;
InputStreamReader in = null;
try {
URL url = new URL(URL);
urlConn = url.openConnection();
if (urlConn != null)
urlConn.setReadTimeout(60 * 1000);
if (urlConn != null && urlConn.getInputStream() != null) {
in = new InputStreamReader(urlConn.getInputStream(), Charset.defaultCharset());
BufferedReader bufferedReader = new BufferedReader(in);
if (bufferedReader != null) {
int cp;
while ((cp = bufferedReader.read()) != -1) {
sb.append((char) cp);
}
bufferedReader.close();
}
}
in.close();
} catch (Exception e) {
e.printStackTrace();
}
return sb.toString();
}
public String getVersion() {
return version;
}
public String getURL() {
return url;
}
public UpdateInformations(String version, String url) {
this.version = version;
this.url = url;
}
}

View File

@ -1,7 +1,5 @@
package de.butzlabben.world;
import java.io.BufferedReader;
import java.io.IOException;
import java.net.URL;
import java.util.Scanner;
@ -9,17 +7,12 @@ public class ConnectionHolder {
@SuppressWarnings("resource")
public static int getMaxPlayers() throws Exception{
BufferedReader reader = null;
String inputLine = "";
try {
inputLine = new Scanner(new URL("http://seagiants.eu/validation/limit.php").openStream(), "UTF-8").nextLine();
} finally {
if (reader != null)
try {
reader.close();
} catch (IOException e) {
}
inputLine = new Scanner(new URL("https://seagiants.eu/worldsystem/limit.php").openStream(), "UTF-8").nextLine();
} catch (Exception ex) {
ex.printStackTrace();
}
if (inputLine.equals(""))
return 0;
@ -28,18 +21,12 @@ public class ConnectionHolder {
@SuppressWarnings("resource")
public static int getMaxPlayersWithLicense(String license) throws Exception{
BufferedReader reader = null;
String inputLine = "";
String url = "http://seagiants.eu/validation/limit.php?license=" + license;
String url = "https://seagiants.eu/worldsystem/limit.php?license=" + license;
try {
inputLine = new Scanner(new URL(url).openStream(), "UTF-8").nextLine();
} finally {
if (reader != null)
try {
reader.close();
} catch (IOException e) {
}
} catch (Exception ex) {
ex.printStackTrace();
}
if (inputLine.equals(""))
return 0;

View File

@ -12,9 +12,11 @@ import org.bukkit.entity.Player;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.java.JavaPlugin;
import de.butzlabben.autoupdater.AutoUpdater;
import de.butzlabben.inventory.OrcInventory;
import de.butzlabben.world.command.WSAddmemberCommand;
import de.butzlabben.world.command.WSCommand;
import de.butzlabben.world.command.WSConfirmCommand;
import de.butzlabben.world.command.WSDeleteCommand;
import de.butzlabben.world.command.WSDelmemberCommand;
import de.butzlabben.world.command.WSFireCommand;
@ -124,6 +126,8 @@ public class WorldSystem extends JavaPlugin {
getCommand("ws togglegm").setExecutor(new WSToggleGMCommand());
getCommand("ws togglebuild").setExecutor(new WSToggleBuildCommand());
getCommand("ws delete").setExecutor(new WSDeleteCommand());
getCommand("ws confirm").setExecutor(new WSConfirmCommand());
getCommand("ws gui").setExecutor(new GuiCommand());
@ -132,8 +136,9 @@ public class WorldSystem extends JavaPlugin {
System.setProperty("bstats.relocatecheck", "false");
Metrics m = new Metrics(this);
m.addCustomChart(new Metrics.SingleLineChart("worlds", Entry::entrys));
m.getPluginData();
AutoUpdater.startAsync();
Bukkit.getConsoleSender().sendMessage(PluginConfig.getPrefix() + "Succesfully enabled WorldSystem v" + version);
}

View File

@ -21,7 +21,7 @@ public class WSCommand implements CommandExecutor, TabCompleter {
public List<String> onTabComplete(CommandSender cs, Command cmd, String label, String[] args) {
List<String> list = new LinkedList<>();
if (args.length == 1) {
list.add("addmember");
list.add("addmember");
list.add("delete");
list.add("delmember");
list.add("fire");
@ -114,8 +114,10 @@ public class WSCommand implements CommandExecutor, TabCompleter {
WorldSystem.getInstance().getCommand("ws togglebuild").execute(cs, label, args);
} else if (subcommand.equals("delete")) {
WorldSystem.getInstance().getCommand("ws delete").execute(cs, label, args);
} else if (subcommand.equals("gui")) {
} else if (subcommand.equals("gui")) {
WorldSystem.getInstance().getCommand("ws gui").execute(cs, label, args);
} else if (subcommand.equals("confirm")) {
WorldSystem.getInstance().getCommand("ws confirm").execute(cs, label, args);
} else {
if (cs instanceof Player) {
Player p = (Player) cs;

View File

@ -0,0 +1,26 @@
package de.butzlabben.world.command;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import de.butzlabben.autoupdater.AutoUpdater;
import de.butzlabben.world.config.PluginConfig;
/**
* @author Butzlabben
* @since 02.05.2018
*/
public class WSConfirmCommand implements CommandExecutor {
@Override
public boolean onCommand(CommandSender cs, Command cmd, String label, String[] args) {
if (AutoUpdater.getInstance().confirmed()) {
cs.sendMessage(PluginConfig.getPrefix() + "§cAlready confirmed or no confirm needed");
return true;
}
AutoUpdater.getInstance().confirm();
cs.sendMessage(PluginConfig.getPrefix() + "§aAutoupdate confirmed, §crestart §ato apply changes");
return true;
}
}

View File

@ -33,7 +33,7 @@ public class PluginConfig {
YamlConfiguration cfg = getConfig();
if (false == (cfg.isString("worldfolder") && cfg.isString("worldsource") && cfg.isInt("unloadingtime")
&& cfg.isBoolean("survival") && cfg.isString("language") && cfg.isString("prefix")
&& cfg.isInt("request_expires") &&
&& cfg.isInt("request_expires") && cfg.isBoolean("need_confirm") &&
cfg.isInt("lagsystem.period_in_seconds") && cfg.isInt("lagsystem.entities_per_world")
&& cfg.isBoolean("lagsystem.garbagecollector.use")
@ -183,4 +183,8 @@ public class PluginConfig {
cfg.getDouble(path + ".z", 0), (float) cfg.getDouble(path + ".yaw", 0),
(float) cfg.getDouble(path + ".pitch", 0));
}
public static boolean confirmNeed() {
return getConfig().getBoolean("need_confirm", true);
}
}

View File

@ -0,0 +1,49 @@
package de.jubeki.generator;
import org.bukkit.Material;
import org.bukkit.block.Biome;
import org.bukkit.generator.ChunkGenerator;
abstract class AbstractGenerator extends ChunkGenerator {
void checkHeight(byte[][] result, int y) {
if (result[y >> 4] == null) {
result[y >> 4] = new byte[4096];
}
}
@SuppressWarnings("deprecation")
void setBlock(byte[][] result, int x, int y, int z, Material mat) {
result[y >> 4][((y & 0xF) << 8) | (z << 4) | x] = (byte) mat.getId();
}
byte[][] createDefaultResult() {
byte[][] result = new byte[16][];
checkHeight(result, 0);
for (int x = 0; x < 16; x++) {
for (int z = 0; z < 16; z++) {
setBlock(result, x, 0, z, Material.BEDROCK);
}
}
return result;
}
void setMaterial(byte[][] result, int min, int max, Material mat) {
for (int y = min; y <= max; y++) {
checkHeight(result, y);
for (int x = 0; x < 16; x++) {
for (int z = 0; z < 16; z++) {
setBlock(result, x, 0, z, mat);
}
}
}
}
void setBiome(BiomeGrid biomes, Biome biome) {
for (int x = 0; x < 16; x++) {
for (int z = 0; z < 16; z++) {
biomes.setBiome(x, z, biome);
}
}
}
}

View File

@ -0,0 +1,53 @@
package de.jubeki.generator;
import java.util.Random;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.block.Biome;
public class FlatGenerator extends AbstractGenerator {
private final byte[][] result = createDefaultResult();
public FlatGenerator() {
this(3);
}
public FlatGenerator(int height) {
if(height < 1) {
height = 1;
}
setDirt(height);
setGrass(height);
}
@Override
public byte[][] generateBlockSections(World world, Random random, int x, int z, BiomeGrid biomes) {
setBiome(biomes, Biome.PLAINS);
return result;
}
private void setGrass(int height) {
checkHeight(result, height);
for(int x = 0; x < 16; x++) {
for(int z = 0; z < 16; z++) {
setBlock(result, x, height, z, Material.GRASS);
}
}
}
private void setDirt(int height) {
for(int y = 1; y < height; y++) {
checkHeight(result, y);
for(int x = 0; x < 16; x++) {
for(int z = 0; z < 16; z++) {
setBlock(result, x, y, z, Material.DIRT);
}
}
}
}
}

View File

@ -0,0 +1,60 @@
package de.jubeki.generator;
import java.util.Random;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.block.Biome;
public class GridGenerator extends AbstractGenerator {
public GridGenerator() {
this(3, 15);
}
public GridGenerator(int grid) {
this(3, grid);
}
private final int height, grid;
private final byte[][] result = createDefaultResult();
public GridGenerator(int height, int grid) {
this.height = height < 1 ? 1 : height;
this.grid = (grid < 1 ? 2 : grid+1);
setMaterial(result, 1, height-1, Material.DIRT);
if(grid == 16) {
for(int i = 0; i < 16; i++) {
for(int k = 0; k < 16; k++) {
if(i == 0 || k == 0) {
setBlock(result, i, height, k, Material.BEDROCK);
} else {
setBlock(result, i, height, k, Material.GRASS);
}
}
}
}
}
@Override
public byte[][] generateBlockSections(World world, Random random, int x, int z, BiomeGrid biomes) {
setBiome(biomes, Biome.PLAINS);
if(grid == 16) {
return result;
}
int diffx = 16*x;
int diffz = 16*z;
for(int i = 0; i < 16; i++) {
boolean set = (diffx + i) % grid == 0;
for(int k = 0; k < 16; k++) {
if(set || (diffz + k) % grid == 0) {
setBlock(result, i, height, k, Material.BEDROCK);
} else {
setBlock(result, i, height, k, Material.GRASS);
}
}
}
return result;
}
}

View File

@ -0,0 +1,18 @@
package de.jubeki.generator;
import java.util.Random;
import org.bukkit.World;
import org.bukkit.block.Biome;
public class VoidGenerator extends AbstractGenerator {
private final byte[][] result = new byte[16][];
@Override
public byte[][] generateBlockSections(World world, Random random, int x, int z, BiomeGrid biomes) {
setBiome(biomes, Biome.VOID);
return result;
}
}

View File

@ -1,62 +1,48 @@
name: WorldSystem
version: 2.0.2
version: 2.0.3
author: Butzlabben
main: de.butzlabben.world.WorldSystem
commands:
ws:
description: Commands for WorldSystem
aliases: [worldsystem, world, worlds]
usage: /ws
ws get:
aliases: [worldsystem get, world get, worlds get]
usage: /ws get
ws help:
aliases: [worldsystem help, world help, worlds help]
usage: /ws help
ws home:
aliases: [worldsystem home, world home, worlds home]
usage: /ws home
ws addmember:
aliases: [worldsystem addmember, world addmember, worlds addmember]
usage: /ws addmember <player>
ws delmember:
aliases: [worldsystem delmember, world delmember, worlds delmember]
usage: /ws delmember <player>
ws leave:
aliases: [worldsystem leave, world leave, worlds leave]
usage: /ws leave
ws tp:
aliases: [worldsystem tp, world tp, worlds tp]
usage: /ws tp <target>
ws tnt:
aliases: [worldsystem tnt, world tnt, worlds tnt]
usage: /ws tnt
ws fire:
aliases: [worldsystem, world fire, worlds fire]
usage: /ws fire
ws info:
aliases: [worldsystem info, world info, worlds info]
usage: /ws info
ws togglebuild:
aliases: [worldsystem togglebuild, world togglebuild, worlds togglebuild]
usage: /ws togglebuild <player>
ws togglegm:
aliases: [worldsystem togglegm, world togglegm, worlds togglegm]
usage: /ws togglegm <player>
ws toggletp:
aliases: [worldsystem toggletp, world toggletp, worlds toggletp]
usage: /ws toggletp <player>
ws reset:
aliases: [worldsystem reset, world reset, worlds reset]
usage: /ws reset
ws gui:
aliases: [worldsystem gui, world gui, worlds gui]
usage: /ws gui
ws delete:
aliases: [worldsystem delete, world delete, worlds delete]
usage: /ws delete <player>
permission: ws.delete
ws confirm:
usage: /ws confirm
permission: ws.confirm
permissions:
ws.*:
@ -73,6 +59,7 @@ permissions:
ws.lag: true
ws.big: true
ws.large: true
ws.confirm: true
ws.tp.*:
default: op
description: You can teleport everything
@ -109,5 +96,8 @@ permissions:
children:
ws.big: true
description: Gives you a even bigger world (if set)
ws.confirm:
default: op
description: You can confirm (if needed) an auto-update
default-permission: admin