mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-24 06:06:45 +01:00
Gamemode
This commit is contained in:
parent
e4cd1bdc56
commit
15252ea94b
@ -10,7 +10,8 @@
|
|||||||
</component>
|
</component>
|
||||||
<component name="ChangeListManager">
|
<component name="ChangeListManager">
|
||||||
<list default="true" id="f6aaf715-4424-4f9e-96dc-b47edea10520" name="Default" comment="">
|
<list default="true" id="f6aaf715-4424-4f9e-96dc-b47edea10520" name="Default" comment="">
|
||||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/AbstractFlag.java" afterPath="$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/AbstractFlag.java" />
|
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/listeners/PlayerEvents.java" afterPath="$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/listeners/PlayerEvents.java" />
|
||||||
|
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/PlotMain.java" afterPath="$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/PlotMain.java" />
|
||||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
|
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
|
||||||
</list>
|
</list>
|
||||||
<ignored path="plot_news.iws" />
|
<ignored path="plot_news.iws" />
|
||||||
@ -37,10 +38,10 @@
|
|||||||
<file leaf-file-name="PlotMain.java" pinned="false" current="false" current-in-tab="false">
|
<file leaf-file-name="PlotMain.java" pinned="false" current="false" current-in-tab="false">
|
||||||
<entry file="file://$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/PlotMain.java">
|
<entry file="file://$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/PlotMain.java">
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
<state vertical-scroll-proportion="0.0" vertical-offset="20017" max-vertical-offset="20553">
|
<state vertical-scroll-proportion="0.0" vertical-offset="19934" max-vertical-offset="20655">
|
||||||
<caret line="1258" column="55" selection-start-line="1258" selection-start-column="55" selection-end-line="1258" selection-end-column="55" />
|
<caret line="1256" column="55" selection-start-line="1256" selection-start-column="55" selection-end-line="1256" selection-end-column="55" />
|
||||||
<folding>
|
<folding>
|
||||||
<element signature="e#0#36822#0" expanded="true" />
|
<element signature="e#0#37010#0" expanded="true" />
|
||||||
<element signature="e#3711#3804#0" expanded="true" />
|
<element signature="e#3711#3804#0" expanded="true" />
|
||||||
<element signature="e#3799#3800#0" expanded="true" />
|
<element signature="e#3799#3800#0" expanded="true" />
|
||||||
<element signature="e#5178#5179#0" expanded="true" />
|
<element signature="e#5178#5179#0" expanded="true" />
|
||||||
@ -66,10 +67,10 @@
|
|||||||
</provider>
|
</provider>
|
||||||
</entry>
|
</entry>
|
||||||
</file>
|
</file>
|
||||||
<file leaf-file-name="AbstractFlag.java" pinned="false" current="true" current-in-tab="true">
|
<file leaf-file-name="AbstractFlag.java" pinned="false" current="false" current-in-tab="false">
|
||||||
<entry file="file://$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/AbstractFlag.java">
|
<entry file="file://$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/AbstractFlag.java">
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
<state vertical-scroll-proportion="0.5707071" vertical-offset="97" max-vertical-offset="765">
|
<state vertical-scroll-proportion="0.0" vertical-offset="97" max-vertical-offset="765">
|
||||||
<caret line="19" column="76" selection-start-line="19" selection-start-column="76" selection-end-line="19" selection-end-column="76" />
|
<caret line="19" column="76" selection-start-line="19" selection-start-column="76" selection-end-line="19" selection-end-column="76" />
|
||||||
<folding />
|
<folding />
|
||||||
</state>
|
</state>
|
||||||
@ -116,11 +117,11 @@
|
|||||||
</provider>
|
</provider>
|
||||||
</entry>
|
</entry>
|
||||||
</file>
|
</file>
|
||||||
<file leaf-file-name="PlayerEvents.java" pinned="false" current="false" current-in-tab="false">
|
<file leaf-file-name="PlayerEvents.java" pinned="false" current="true" current-in-tab="true">
|
||||||
<entry file="file://$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/listeners/PlayerEvents.java">
|
<entry file="file://$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/listeners/PlayerEvents.java">
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
<state vertical-scroll-proportion="0.0" vertical-offset="8442" max-vertical-offset="14535">
|
<state vertical-scroll-proportion="0.3089431" vertical-offset="2020" max-vertical-offset="14858">
|
||||||
<caret line="517" column="0" selection-start-line="517" selection-start-column="0" selection-end-line="521" selection-end-column="51" />
|
<caret line="146" column="34" selection-start-line="146" selection-start-column="34" selection-end-line="146" selection-end-column="34" />
|
||||||
<folding>
|
<folding>
|
||||||
<element signature="imports" expanded="true" />
|
<element signature="imports" expanded="true" />
|
||||||
<element signature="e#1751#1752#0" expanded="true" />
|
<element signature="e#1751#1752#0" expanded="true" />
|
||||||
@ -217,9 +218,9 @@
|
|||||||
<option value="$PROJECT_DIR$/PlotSquared/src/plugin.yml" />
|
<option value="$PROJECT_DIR$/PlotSquared/src/plugin.yml" />
|
||||||
<option value="$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/Settings.java" />
|
<option value="$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/Settings.java" />
|
||||||
<option value="$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/PlotWorld.java" />
|
<option value="$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/PlotWorld.java" />
|
||||||
<option value="$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/listeners/PlayerEvents.java" />
|
|
||||||
<option value="$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/PlotMain.java" />
|
|
||||||
<option value="$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/AbstractFlag.java" />
|
<option value="$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/AbstractFlag.java" />
|
||||||
|
<option value="$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/PlotMain.java" />
|
||||||
|
<option value="$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/listeners/PlayerEvents.java" />
|
||||||
</list>
|
</list>
|
||||||
</option>
|
</option>
|
||||||
</component>
|
</component>
|
||||||
@ -764,7 +765,7 @@
|
|||||||
<workItem from="1413065609242" duration="214000" />
|
<workItem from="1413065609242" duration="214000" />
|
||||||
<workItem from="1413065904473" duration="9265000" />
|
<workItem from="1413065904473" duration="9265000" />
|
||||||
<workItem from="1413125251335" duration="4054000" />
|
<workItem from="1413125251335" duration="4054000" />
|
||||||
<workItem from="1413221404445" duration="13605000" />
|
<workItem from="1413221404445" duration="17302000" />
|
||||||
</task>
|
</task>
|
||||||
<task id="LOCAL-00001" summary="First Commit">
|
<task id="LOCAL-00001" summary="First Commit">
|
||||||
<created>1411382351159</created>
|
<created>1411382351159</created>
|
||||||
@ -930,11 +931,15 @@
|
|||||||
<created>1413622665156</created>
|
<created>1413622665156</created>
|
||||||
<updated>1413622665156</updated>
|
<updated>1413622665156</updated>
|
||||||
</task>
|
</task>
|
||||||
<option name="localTasksCounter" value="42" />
|
<task id="LOCAL-00042" summary="Flags :D">
|
||||||
|
<created>1413627152131</created>
|
||||||
|
<updated>1413627152131</updated>
|
||||||
|
</task>
|
||||||
|
<option name="localTasksCounter" value="43" />
|
||||||
<servers />
|
<servers />
|
||||||
</component>
|
</component>
|
||||||
<component name="TimeTrackingManager">
|
<component name="TimeTrackingManager">
|
||||||
<option name="totallyTimeSpent" value="92176000" />
|
<option name="totallyTimeSpent" value="95873000" />
|
||||||
</component>
|
</component>
|
||||||
<component name="TodoView" selected-index="0">
|
<component name="TodoView" selected-index="0">
|
||||||
<todo-panel id="selected-file">
|
<todo-panel id="selected-file">
|
||||||
@ -971,7 +976,7 @@
|
|||||||
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.2072072" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
|
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.2072072" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
|
||||||
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
|
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
|
||||||
<window_info id="IDEtalk" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
|
<window_info id="IDEtalk" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
|
||||||
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.32882884" sideWeight="0.5" order="9" side_tool="false" content_ui="tabs" />
|
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32882884" sideWeight="0.5" order="9" side_tool="false" content_ui="tabs" />
|
||||||
<window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32732734" sideWeight="0.5" order="13" side_tool="false" content_ui="tabs" />
|
<window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32732734" sideWeight="0.5" order="13" side_tool="false" content_ui="tabs" />
|
||||||
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.2072072" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
|
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.2072072" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
|
||||||
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
|
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
|
||||||
@ -1447,24 +1452,28 @@
|
|||||||
</state>
|
</state>
|
||||||
</provider>
|
</provider>
|
||||||
</entry>
|
</entry>
|
||||||
<entry file="file://$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/listeners/PlayerEvents.java">
|
<entry file="file://$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/FlagManager.java">
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
<state vertical-scroll-proportion="0.0" vertical-offset="8442" max-vertical-offset="14535">
|
<state vertical-scroll-proportion="0.0" vertical-offset="290" max-vertical-offset="1870">
|
||||||
<caret line="517" column="0" selection-start-line="517" selection-start-column="0" selection-end-line="521" selection-end-column="51" />
|
<caret line="27" column="31" selection-start-line="27" selection-start-column="31" selection-end-line="27" selection-end-column="31" />
|
||||||
<folding>
|
<folding />
|
||||||
<element signature="imports" expanded="true" />
|
</state>
|
||||||
<element signature="e#1751#1752#0" expanded="true" />
|
</provider>
|
||||||
<element signature="e#1806#1807#0" expanded="true" />
|
</entry>
|
||||||
</folding>
|
<entry file="file://$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/AbstractFlag.java">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state vertical-scroll-proportion="0.0" vertical-offset="97" max-vertical-offset="765">
|
||||||
|
<caret line="19" column="76" selection-start-line="19" selection-start-column="76" selection-end-line="19" selection-end-column="76" />
|
||||||
|
<folding />
|
||||||
</state>
|
</state>
|
||||||
</provider>
|
</provider>
|
||||||
</entry>
|
</entry>
|
||||||
<entry file="file://$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/PlotMain.java">
|
<entry file="file://$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/PlotMain.java">
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
<state vertical-scroll-proportion="0.0" vertical-offset="20017" max-vertical-offset="20553">
|
<state vertical-scroll-proportion="0.0" vertical-offset="19934" max-vertical-offset="20655">
|
||||||
<caret line="1258" column="55" selection-start-line="1258" selection-start-column="55" selection-end-line="1258" selection-end-column="55" />
|
<caret line="1256" column="55" selection-start-line="1256" selection-start-column="55" selection-end-line="1256" selection-end-column="55" />
|
||||||
<folding>
|
<folding>
|
||||||
<element signature="e#0#36822#0" expanded="true" />
|
<element signature="e#0#37010#0" expanded="true" />
|
||||||
<element signature="e#3711#3804#0" expanded="true" />
|
<element signature="e#3711#3804#0" expanded="true" />
|
||||||
<element signature="e#3799#3800#0" expanded="true" />
|
<element signature="e#3799#3800#0" expanded="true" />
|
||||||
<element signature="e#5178#5179#0" expanded="true" />
|
<element signature="e#5178#5179#0" expanded="true" />
|
||||||
@ -1479,19 +1488,15 @@
|
|||||||
</state>
|
</state>
|
||||||
</provider>
|
</provider>
|
||||||
</entry>
|
</entry>
|
||||||
<entry file="file://$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/FlagManager.java">
|
<entry file="file://$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/listeners/PlayerEvents.java">
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
<state vertical-scroll-proportion="0.0" vertical-offset="290" max-vertical-offset="1870">
|
<state vertical-scroll-proportion="0.3089431" vertical-offset="2020" max-vertical-offset="14858">
|
||||||
<caret line="27" column="31" selection-start-line="27" selection-start-column="31" selection-end-line="27" selection-end-column="31" />
|
<caret line="146" column="34" selection-start-line="146" selection-start-column="34" selection-end-line="146" selection-end-column="34" />
|
||||||
<folding />
|
<folding>
|
||||||
</state>
|
<element signature="imports" expanded="true" />
|
||||||
</provider>
|
<element signature="e#1751#1752#0" expanded="true" />
|
||||||
</entry>
|
<element signature="e#1806#1807#0" expanded="true" />
|
||||||
<entry file="file://$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/AbstractFlag.java">
|
</folding>
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
|
||||||
<state vertical-scroll-proportion="0.5707071" vertical-offset="97" max-vertical-offset="765">
|
|
||||||
<caret line="19" column="76" selection-start-line="19" selection-start-column="76" selection-end-line="19" selection-end-column="76" />
|
|
||||||
<folding />
|
|
||||||
</state>
|
</state>
|
||||||
</provider>
|
</provider>
|
||||||
</entry>
|
</entry>
|
||||||
|
@ -1250,6 +1250,12 @@ public class PlotMain extends JavaPlugin {
|
|||||||
for(String str : materialFlags.values()) {
|
for(String str : materialFlags.values()) {
|
||||||
FlagManager.addFlag(new AbstractFlag(str));
|
FlagManager.addFlag(new AbstractFlag(str));
|
||||||
}
|
}
|
||||||
|
List<String> otherFlags = Arrays.asList(
|
||||||
|
"gamemode"
|
||||||
|
);
|
||||||
|
for(String str : otherFlags) {
|
||||||
|
FlagManager.addFlag(new AbstractFlag(str));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void addPlotWorld(String world, PlotWorld plotworld, PlotManager manager) {
|
public static void addPlotWorld(String world, PlotWorld plotworld, PlotManager manager) {
|
||||||
|
@ -135,8 +135,27 @@ public class PlayerEvents implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private GameMode getGameMode(String str) {
|
||||||
|
str = str.toLowerCase();
|
||||||
|
List<String> creative = Arrays.asList("creative" , "cr", "1");
|
||||||
|
List<String> survival = Arrays.asList("survival" , "su", "0");
|
||||||
|
List<String> adventure = Arrays.asList("adventure", "ad", "2");
|
||||||
|
if (creative.equals(str)) {
|
||||||
|
return GameMode.CREATIVE;
|
||||||
|
} else if (survival.equals(str)) {
|
||||||
|
return GameMode.SURVIVAL;
|
||||||
|
} else if (adventure.equals(str)) {
|
||||||
|
return GameMode.ADVENTURE;
|
||||||
|
} else {
|
||||||
|
return GameMode.SURVIVAL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void plotEntry(Player player, Plot plot) {
|
public void plotEntry(Player player, Plot plot) {
|
||||||
if (plot.hasOwner()) {
|
if (plot.hasOwner()) {
|
||||||
|
if(plot.settings.getFlag("gamemode") != null) {
|
||||||
|
player.setGameMode(getGameMode(plot.settings.getFlag("gamemode").getValue()));
|
||||||
|
}
|
||||||
if (C.TITLE_ENTERED_PLOT.s().length() > 2) {
|
if (C.TITLE_ENTERED_PLOT.s().length() > 2) {
|
||||||
String sTitleMain = C.TITLE_ENTERED_PLOT.s().replaceFirst("%s", plot.getDisplayName());
|
String sTitleMain = C.TITLE_ENTERED_PLOT.s().replaceFirst("%s", plot.getDisplayName());
|
||||||
String sTitleSub = C.TITLE_ENTERED_PLOT_SUB.s().replaceFirst("%s", getName(plot.owner));
|
String sTitleSub = C.TITLE_ENTERED_PLOT_SUB.s().replaceFirst("%s", getName(plot.owner));
|
||||||
|
Loading…
Reference in New Issue
Block a user