Some fixes :p

This commit is contained in:
Sauilitired 2014-10-19 10:45:41 +02:00
parent 83ca1a55f0
commit e8d657eb5d
2 changed files with 108 additions and 128 deletions

View File

@ -10,15 +10,7 @@
</component>
<component name="ChangeListManager">
<list default="true" id="f6aaf715-4424-4f9e-96dc-b47edea10520" name="Default" comment="">
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/database/DBFunc.java" afterPath="$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/database/DBFunc.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/FlagManager.java" afterPath="$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/FlagManager.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/commands/Info.java" afterPath="$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/commands/Info.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/PlayerFunctions.java" afterPath="$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/PlayerFunctions.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/Plot.java" afterPath="$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/Plot.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$/PlotSquared/src/com/intellectualcrafters/plot/PlotSettings.java" afterPath="$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/PlotSettings.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/commands/Set.java" afterPath="$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/commands/Set.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
</list>
<ignored path="plot_news.iws" />
@ -42,28 +34,6 @@
</component>
<component name="FileEditorManager">
<leaf>
<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">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0" vertical-offset="19934" max-vertical-offset="20689">
<caret line="1255" column="18" selection-start-line="1255" selection-start-column="18" selection-end-line="1255" selection-end-column="18" />
<folding>
<element signature="e#0#37053#0" expanded="true" />
<element signature="e#3711#3804#0" expanded="true" />
<element signature="e#3799#3800#0" expanded="true" />
<element signature="e#5178#5179#0" expanded="true" />
<element signature="e#5211#5212#0" expanded="true" />
<element signature="e#5257#5258#0" expanded="true" />
<element signature="e#5289#5290#0" expanded="true" />
<element signature="e#7640#7641#0" expanded="true" />
<element signature="e#7694#7695#0" expanded="true" />
<element signature="e#7765#7766#0" expanded="true" />
<element signature="e#7816#7817#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="Plot.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/Plot.java">
<provider selected="true" editor-type-id="text-editor">
@ -74,38 +44,27 @@
</provider>
</entry>
</file>
<file leaf-file-name="FlagManager.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/FlagManager.java">
<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">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0" vertical-offset="290" max-vertical-offset="2244">
<caret line="47" column="25" selection-start-line="47" selection-start-column="25" selection-end-line="47" selection-end-column="25" />
<state vertical-scroll-proportion="0.88245314" vertical-offset="2049" max-vertical-offset="15300">
<caret line="167" column="38" selection-start-line="167" selection-start-column="38" selection-end-line="167" selection-end-column="38" />
<folding>
<element signature="e#1372#1373#0" expanded="true" />
<element signature="e#1391#1392#0" expanded="true" />
<element signature="imports" expanded="true" />
<element signature="e#1804#1805#0" expanded="true" />
<element signature="e#1859#1860#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="PlotSettings.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/PlotSettings.java">
<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">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0" vertical-offset="1629" max-vertical-offset="2244">
<caret line="101" column="0" selection-start-line="101" selection-start-column="0" selection-end-line="101" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="PlayerEvents.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/listeners/PlayerEvents.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="-7.607143" vertical-offset="1895" max-vertical-offset="15266">
<caret line="140" column="33" selection-start-line="140" selection-start-column="33" selection-end-line="140" selection-end-column="33" />
<state vertical-scroll-proportion="0.0" vertical-offset="19815" max-vertical-offset="20604">
<caret line="1251" column="67" selection-start-line="1251" selection-start-column="67" selection-end-line="1251" selection-end-column="67" />
<folding>
<element signature="imports" expanded="true" />
<element signature="e#1751#1752#0" expanded="true" />
<element signature="e#1806#1807#0" expanded="true" />
<element signature="e#0#37228#0" expanded="true" />
</folding>
</state>
</provider>
@ -114,8 +73,8 @@
<file leaf-file-name="PlotHelper.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/PlotHelper.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0" vertical-offset="12410" max-vertical-offset="15147">
<caret line="758" column="0" selection-start-line="758" selection-start-column="0" selection-end-line="758" selection-end-column="0" />
<state vertical-scroll-proportion="0.0" vertical-offset="12801" max-vertical-offset="15538">
<caret line="761" column="0" selection-start-line="761" selection-start-column="0" selection-end-line="761" selection-end-column="0" />
<folding />
</state>
</provider>
@ -199,11 +158,31 @@
</provider>
</entry>
</file>
<file leaf-file-name="Set.java" pinned="false" current="true" current-in-tab="true">
<file leaf-file-name="Set.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/commands/Set.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.42358804" vertical-offset="0" max-vertical-offset="6426">
<caret line="36" column="83" selection-start-line="36" selection-start-column="83" selection-end-line="36" selection-end-column="83" />
<state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="6426">
<caret line="37" column="0" selection-start-line="37" selection-start-column="0" selection-end-line="37" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="PlotMeConverter.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/database/PlotMeConverter.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0" vertical-offset="2044" max-vertical-offset="3043">
<caret line="156" column="66" selection-start-line="156" selection-start-column="66" selection-end-line="156" selection-end-column="66" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="PlotWorld.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/PlotWorld.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0" vertical-offset="1377" max-vertical-offset="2941">
<caret line="93" column="0" selection-start-line="93" selection-start-column="0" selection-end-line="93" selection-end-column="0" />
<folding />
</state>
</provider>
@ -228,7 +207,6 @@
<option value="$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/WorldGenerator.java" />
<option value="$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/api/PlotAPI.java" />
<option value="$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/commands/Debug.java" />
<option value="$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/database/PlotMeConverter.java" />
<option value="$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/commands/SubCommand.java" />
<option value="$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/commands/Rate.java" />
<option value="$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/ConfigurationNode.java" />
@ -267,12 +245,13 @@
<option value="$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/FlagManager.java" />
<option value="$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/PlotMain.java" />
<option value="$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/PlotSettings.java" />
<option value="$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/listeners/PlayerEvents.java" />
<option value="$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/PlayerFunctions.java" />
<option value="$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/commands/Info.java" />
<option value="$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/Plot.java" />
<option value="$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/database/DBFunc.java" />
<option value="$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/commands/Set.java" />
<option value="$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/database/PlotMeConverter.java" />
<option value="$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/listeners/PlayerEvents.java" />
</list>
</option>
</component>
@ -847,7 +826,7 @@
<workItem from="1413065609242" duration="214000" />
<workItem from="1413065904473" duration="9265000" />
<workItem from="1413125251335" duration="4054000" />
<workItem from="1413221404445" duration="21082000" />
<workItem from="1413221404445" duration="22666000" />
</task>
<task id="LOCAL-00001" summary="First Commit">
<created>1411382351159</created>
@ -1025,11 +1004,19 @@
<created>1413634257996</created>
<updated>1413634257996</updated>
</task>
<option name="localTasksCounter" value="45" />
<task id="LOCAL-00045" summary="I'm sure I broke something :_:">
<created>1413706779041</created>
<updated>1413706779041</updated>
</task>
<task id="LOCAL-00046" summary="Well, I knew it...">
<created>1413706970695</created>
<updated>1413706970695</updated>
</task>
<option name="localTasksCounter" value="47" />
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="99653000" />
<option name="totallyTimeSpent" value="101237000" />
</component>
<component name="TodoView" selected-index="0">
<todo-panel id="selected-file">
@ -1127,8 +1114,6 @@
<option name="myTodoPanelSettings">
<TodoPanelSettings />
</option>
<MESSAGE value="Fixed some items on the to-do list." />
<MESSAGE value="Started working on rate system :D" />
<MESSAGE value="I seriously doubt this is working xD" />
<MESSAGE value="Economy + schematics for /p auto :P" />
<MESSAGE value="Updated plugin info: New link, total downloads + newest version" />
@ -1152,7 +1137,9 @@
<MESSAGE value="Flags :D" />
<MESSAGE value="Gamemode" />
<MESSAGE value="Gamemode :D" />
<option name="LAST_COMMIT_MESSAGE" value="Gamemode :D" />
<MESSAGE value="I'm sure I broke something :_:" />
<MESSAGE value="Well, I knew it..." />
<option name="LAST_COMMIT_MESSAGE" value="Well, I knew it..." />
</component>
<component name="XDebuggerManager">
<breakpoint-manager>
@ -1223,13 +1210,6 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/database/PlotMeConverter.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0" vertical-offset="1298" max-vertical-offset="3468">
<caret line="101" column="40" selection-start-line="101" selection-start-column="40" selection-end-line="101" selection-end-column="40" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/ConsoleColors.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0" vertical-offset="1003" max-vertical-offset="1717">
@ -1475,14 +1455,6 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/PlotWorld.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0" vertical-offset="2052" max-vertical-offset="2975">
<caret line="151" column="0" selection-start-line="151" selection-start-column="0" selection-end-line="151" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/Settings.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0" vertical-offset="769" max-vertical-offset="1598">
@ -1510,26 +1482,6 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/PlotMain.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0" vertical-offset="19934" max-vertical-offset="20689">
<caret line="1255" column="18" selection-start-line="1255" selection-start-column="18" selection-end-line="1255" selection-end-column="18" />
<folding>
<element signature="e#0#37053#0" expanded="true" />
<element signature="e#3711#3804#0" expanded="true" />
<element signature="e#3799#3800#0" expanded="true" />
<element signature="e#5178#5179#0" expanded="true" />
<element signature="e#5211#5212#0" expanded="true" />
<element signature="e#5257#5258#0" expanded="true" />
<element signature="e#5289#5290#0" expanded="true" />
<element signature="e#7640#7641#0" expanded="true" />
<element signature="e#7694#7695#0" expanded="true" />
<element signature="e#7765#7766#0" expanded="true" />
<element signature="e#7816#7817#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/PlotSettings.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0" vertical-offset="1629" max-vertical-offset="2244">
@ -1538,22 +1490,10 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/listeners/PlayerEvents.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="-7.607143" vertical-offset="1895" max-vertical-offset="15266">
<caret line="140" column="33" selection-start-line="140" selection-start-column="33" selection-end-line="140" selection-end-column="33" />
<folding>
<element signature="imports" expanded="true" />
<element signature="e#1751#1752#0" expanded="true" />
<element signature="e#1806#1807#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/PlotHelper.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0" vertical-offset="12410" max-vertical-offset="15147">
<caret line="758" column="0" selection-start-line="758" selection-start-column="0" selection-end-line="758" selection-end-column="0" />
<state vertical-scroll-proportion="0.0" vertical-offset="12801" max-vertical-offset="15538">
<caret line="761" column="0" selection-start-line="761" selection-start-column="0" selection-end-line="761" selection-end-column="0" />
<folding />
</state>
</provider>
@ -1640,12 +1580,50 @@
</entry>
<entry file="file://$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/commands/Set.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.42358804" vertical-offset="0" max-vertical-offset="6426">
<caret line="36" column="83" selection-start-line="36" selection-start-column="83" selection-end-line="36" selection-end-column="83" />
<state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="6426">
<caret line="37" column="0" selection-start-line="37" selection-start-column="0" selection-end-line="37" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/database/PlotMeConverter.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0" vertical-offset="2044" max-vertical-offset="3043">
<caret line="156" column="66" selection-start-line="156" selection-start-column="66" selection-end-line="156" selection-end-column="66" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/PlotWorld.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0" vertical-offset="1377" max-vertical-offset="2941">
<caret line="93" column="0" selection-start-line="93" selection-start-column="0" selection-end-line="93" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/PlotMain.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0" vertical-offset="19815" max-vertical-offset="20604">
<caret line="1251" column="67" selection-start-line="1251" selection-start-column="67" selection-end-line="1251" selection-end-column="67" />
<folding>
<element signature="e#0#37228#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/listeners/PlayerEvents.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.88245314" vertical-offset="2049" max-vertical-offset="15300">
<caret line="167" column="38" selection-start-line="167" selection-start-column="38" selection-end-line="167" selection-end-column="38" />
<folding>
<element signature="imports" expanded="true" />
<element signature="e#1804#1805#0" expanded="true" />
<element signature="e#1859#1860#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</component>
<component name="masterDetails">
<states>

View File

@ -9,6 +9,7 @@
package com.intellectualcrafters.plot.listeners;
import com.intellectualcrafters.plot.*;
import com.intellectualcrafters.plot.commands.Setup;
import com.intellectualcrafters.plot.events.PlayerEnterPlotEvent;
import com.intellectualcrafters.plot.events.PlayerLeavePlotEvent;
import org.bukkit.*;
@ -157,19 +158,13 @@ public class PlayerEvents implements Listener {
} else if (adventure.contains(str)) {
return GameMode.ADVENTURE;
} else {
return GameMode.SURVIVAL;
return Bukkit.getDefaultGameMode();
}
}
private HashMap<String, GameMode> previousGamemode = new HashMap<>();
public void plotEntry(Player player, Plot plot) {
if (plot.hasOwner()) {
if(plot.settings.getFlag("gamemode") != null) {
if(previousGamemode.containsKey(player.getName())) {
previousGamemode.remove(player.getName());
}
previousGamemode.put(player.getName(), player.getGameMode());
player.setGameMode(getGameMode(plot.settings.getFlag("gamemode").getValue()));
}
if(plot.settings.getFlag("time") != null) {
@ -206,10 +201,7 @@ public class PlayerEvents implements Listener {
PlayerLeavePlotEvent callEvent = new PlayerLeavePlotEvent(player, plot);
Bukkit.getPluginManager().callEvent(callEvent);
}
if(previousGamemode.containsKey(player.getName())) {
player.setGameMode(previousGamemode.get(player.getName()));
previousGamemode.remove(player.getName());
}
player.setGameMode(Bukkit.getDefaultGameMode());
player.resetPlayerTime();
player.resetPlayerWeather();
PlayerFunctions.sendMessage(player, plot.settings.getLeaveMessage());
@ -711,6 +703,16 @@ public class PlayerEvents implements Listener {
}
}
@EventHandler
public void onLeave(PlayerQuitEvent event) {
if(PlotSelection.currentSelection.containsKey(event.getPlayer().getName())) {
PlotSelection.currentSelection.remove(event.getPlayer().getName());
}
if(Setup.setupMap.containsKey(event.getPlayer().getName())) {
Setup.setupMap.remove(event.getPlayer().getName());
}
}
@EventHandler(
priority = EventPriority.HIGH, ignoreCancelled = true)
public void onBucketFill(PlayerBucketFillEvent e) {