Browse Source

v1.9.2 : Optimized code, attempts to fix SQL & H2 bugs

- Optimized all SQL & H2 queries
- Now SQL does not save all block placings out of context
- Some code cleaning, still need to clean even more in the future
master
Jaryl Chng 5 years ago
committed by Jaryl Chng
parent
commit
d62ec48afd
9 changed files with 238 additions and 199 deletions
  1. +163
    -135
      .idea/workspace.xml
  2. +2
    -2
      FoundBoxx.iml
  3. +1
    -1
      plugin.yml
  4. +46
    -35
      src/me/Jaryl/FoundBoxx/FoundBoxx.java
  5. +1
    -1
      src/me/Jaryl/FoundBoxx/Listeners/fBlockListener.java
  6. +2
    -3
      src/me/Jaryl/FoundBoxx/Listeners/fBreakListener.java
  7. +5
    -4
      src/me/Jaryl/FoundBoxx/SQLwrapper/Threads/SQLLoad.java
  8. +7
    -7
      src/me/Jaryl/FoundBoxx/Threads/Farmrate.java
  9. +11
    -11
      src/me/Jaryl/FoundBoxx/Threads/Notify.java

+ 163
- 135
.idea/workspace.xml View File

@ -8,9 +8,12 @@
<component name="ChangeListManager">
<list default="true" id="fe81a065-a2a2-45be-9404-14338ecb420d" name="Default" comment="">
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/FoundBoxx.iml" afterPath="$PROJECT_DIR$/FoundBoxx.iml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/plugin.yml" afterPath="$PROJECT_DIR$/plugin.yml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/me/Jaryl/FoundBoxx/FoundBoxx.java" afterPath="$PROJECT_DIR$/src/me/Jaryl/FoundBoxx/FoundBoxx.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/me/Jaryl/FoundBoxx/Listeners/fBlockListener.java" afterPath="$PROJECT_DIR$/src/me/Jaryl/FoundBoxx/Listeners/fBlockListener.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/me/Jaryl/FoundBoxx/Listeners/fBreakListener.java" afterPath="$PROJECT_DIR$/src/me/Jaryl/FoundBoxx/Listeners/fBreakListener.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/me/Jaryl/FoundBoxx/SQLwrapper/Threads/SQLLoad.java" afterPath="$PROJECT_DIR$/src/me/Jaryl/FoundBoxx/SQLwrapper/Threads/SQLLoad.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/me/Jaryl/FoundBoxx/Threads/Farmrate.java" afterPath="$PROJECT_DIR$/src/me/Jaryl/FoundBoxx/Threads/Farmrate.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/me/Jaryl/FoundBoxx/Threads/Notify.java" afterPath="$PROJECT_DIR$/src/me/Jaryl/FoundBoxx/Threads/Notify.java" />
</list>
@ -38,9 +41,11 @@
<file leaf-file-name="FoundBoxx.java" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/me/Jaryl/FoundBoxx/FoundBoxx.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="25.035715">
<caret line="100" column="17" selection-start-line="100" selection-start-column="17" selection-end-line="100" selection-end-column="17" />
<folding />
<state vertical-scroll-proportion="-5.107143">
<caret line="197" column="8" selection-start-line="197" selection-start-column="8" selection-end-line="197" selection-end-column="8" />
<folding>
<element signature="e#3232#3262#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
@ -48,9 +53,11 @@
<file leaf-file-name="Notify.java" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/me/Jaryl/FoundBoxx/Threads/Notify.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="-10.206897">
<caret line="128" column="88" selection-start-line="128" selection-start-column="23" selection-end-line="128" selection-end-column="88" />
<folding />
<state vertical-scroll-proportion="-26.142857">
<caret line="129" column="20" selection-start-line="129" selection-start-column="20" selection-end-line="129" selection-end-column="20" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
@ -59,37 +66,37 @@
<entry file="file://$PROJECT_DIR$/plugin.yml">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="10" column="11" selection-start-line="10" selection-start-column="11" selection-end-line="10" selection-end-column="11" />
<caret line="2" column="14" selection-start-line="2" selection-start-column="14" selection-end-line="2" selection-end-column="14" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="Farmrate.java" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/src/me/Jaryl/FoundBoxx/Threads/Farmrate.java">
<file leaf-file-name="Updater.java" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/net/gravitydevelopment/updater/Updater.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.4665493">
<caret line="39" column="50" selection-start-line="39" selection-start-column="50" selection-end-line="39" selection-end-column="50" />
<state vertical-scroll-proportion="-6.5172415">
<caret line="35" column="11" selection-start-line="35" selection-start-column="10" selection-end-line="35" selection-end-column="11" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="SQLwrapper.java" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/me/Jaryl/FoundBoxx/SQLwrapper/SQLwrapper.java">
<file leaf-file-name="Farmrate.java" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/me/Jaryl/FoundBoxx/Threads/Farmrate.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="-6.5172415">
<caret line="94" column="20" selection-start-line="94" selection-start-column="17" selection-end-line="94" selection-end-column="20" />
<state vertical-scroll-proportion="0.0">
<caret line="72" column="21" selection-start-line="72" selection-start-column="21" selection-end-line="72" selection-end-column="21" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="SQLLoad.java" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/me/Jaryl/FoundBoxx/SQLwrapper/Threads/SQLLoad.java">
<file leaf-file-name="SQLwrapper.java" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/me/Jaryl/FoundBoxx/SQLwrapper/SQLwrapper.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="-17.758621">
<caret line="91" column="35" selection-start-line="91" selection-start-column="35" selection-end-line="91" selection-end-column="35" />
<state vertical-scroll-proportion="-55.103447">
<caret line="105" column="20" selection-start-line="105" selection-start-column="16" selection-end-line="105" selection-end-column="20" />
<folding />
</state>
</provider>
@ -98,28 +105,28 @@
<file leaf-file-name="fPlayerListener.java" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/me/Jaryl/FoundBoxx/Listeners/fPlayerListener.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="29" column="5" selection-start-line="29" selection-start-column="5" selection-end-line="29" selection-end-column="5" />
<state vertical-scroll-proportion="-12.310345">
<caret line="30" column="24" selection-start-line="30" selection-start-column="23" selection-end-line="30" selection-end-column="24" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="fBreakListener.java" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/me/Jaryl/FoundBoxx/Listeners/fBreakListener.java">
<file leaf-file-name="SQLLoad.java" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/src/me/Jaryl/FoundBoxx/SQLwrapper/Threads/SQLLoad.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="32" column="39" selection-start-line="32" selection-start-column="16" selection-end-line="32" selection-end-column="39" />
<state vertical-scroll-proportion="-1.1179674">
<caret line="36" column="30" selection-start-line="36" selection-start-column="30" selection-end-line="36" selection-end-column="30" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="fBlockListener.java" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/me/Jaryl/FoundBoxx/Listeners/fBlockListener.java">
<file leaf-file-name="fBreakListener.java" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/me/Jaryl/FoundBoxx/Listeners/fBreakListener.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="-7.375">
<caret line="38" column="32" selection-start-line="38" selection-start-column="32" selection-end-line="38" selection-end-column="32" />
<state vertical-scroll-proportion="-13.137931">
<caret line="27" column="23" selection-start-line="27" selection-start-column="23" selection-end-line="27" selection-end-column="23" />
<folding>
<element signature="imports" expanded="true" />
</folding>
@ -127,12 +134,14 @@
</provider>
</entry>
</file>
<file leaf-file-name="PermissionsHandler.java" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/me/Jaryl/FoundBoxx/PermissionsHandler.java">
<file leaf-file-name="fBlockListener.java" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/me/Jaryl/FoundBoxx/Listeners/fBlockListener.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="23" column="40" selection-start-line="23" selection-start-column="40" selection-end-line="23" selection-end-column="40" />
<folding />
<state vertical-scroll-proportion="-11.965517">
<caret line="38" column="41" selection-start-line="38" selection-start-column="41" selection-end-line="38" selection-end-column="41" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
@ -154,16 +163,16 @@
<option value="$PROJECT_DIR$/src/META-INF/MANIFEST.MF" />
<option value="$PROJECT_DIR$/README.md" />
<option value="$PROJECT_DIR$/src/me/Jaryl/FoundBoxx/PermissionsHandler.java" />
<option value="$PROJECT_DIR$/src/me/Jaryl/FoundBoxx/SQLwrapper/Threads/SQLLoad.java" />
<option value="$PROJECT_DIR$/src/net/gravitydevelopment/updater/Updater.java" />
<option value="$PROJECT_DIR$/src/org/mcstats/MetricsLite.java" />
<option value="$PROJECT_DIR$/src/me/Jaryl/FoundBoxx/Listeners/fBreakListener.java" />
<option value="$PROJECT_DIR$/src/me/Jaryl/FoundBoxx/Listeners/fPlayerListener.java" />
<option value="$PROJECT_DIR$/plugin.yml" />
<option value="$PROJECT_DIR$/src/me/Jaryl/FoundBoxx/Listeners/fBlockListener.java" />
<option value="$PROJECT_DIR$/src/me/Jaryl/FoundBoxx/SQLwrapper/Threads/SQLLoad.java" />
<option value="$PROJECT_DIR$/src/me/Jaryl/FoundBoxx/Threads/Notify.java" />
<option value="$PROJECT_DIR$/src/me/Jaryl/FoundBoxx/FoundBoxx.java" />
<option value="$PROJECT_DIR$/src/me/Jaryl/FoundBoxx/Listeners/fBreakListener.java" />
<option value="$PROJECT_DIR$/src/me/Jaryl/FoundBoxx/Listeners/fBlockListener.java" />
<option value="$PROJECT_DIR$/plugin.yml" />
<option value="$PROJECT_DIR$/src/me/Jaryl/FoundBoxx/Threads/Farmrate.java" />
<option value="$PROJECT_DIR$/src/me/Jaryl/FoundBoxx/FoundBoxx.java" />
</list>
</option>
</component>
@ -226,8 +235,6 @@
<foldersAlwaysOnTop value="true" />
</navigator>
<panes>
<pane id="PackagesPane" />
<pane id="Scratches" />
<pane id="ProjectPane">
<subPane>
<PATH>
@ -264,6 +271,24 @@
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="FoundBoxx" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="FoundBoxx" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="src" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="updater" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="FoundBoxx" />
@ -377,16 +402,18 @@
</subPane>
</pane>
<pane id="Scope" />
<pane id="Scratches" />
<pane id="PackagesPane" />
</panes>
</component>
<component name="PropertiesComponent">
<property name="WebServerToolWindowFactoryState" value="false" />
<property name="settings.editor.selected.configurable" value="preferences.lookFeel" />
<property name="settings.editor.splitter.proportion" value="0.2" />
<property name="project.structure.last.edited" value="Modules" />
<property name="project.structure.last.edited" value="Artifacts" />
<property name="project.structure.proportion" value="0.15" />
<property name="project.structure.side.proportion" value="0.2" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/../Dependencies/PermissionsEx-1.23.3.jar!/" />
<property name="last_opened_file_path" value="$USER_HOME$/Desktop/Desktop/MC/;Server/plugins/LaggRemover-0.1.9.jar!/" />
</component>
<component name="RunManager">
<configuration default="true" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" factoryName="Plugin">
@ -676,22 +703,23 @@
<workItem from="1451129225342" duration="26000" />
<workItem from="1451185954209" duration="2179000" />
<workItem from="1451199594465" duration="1458000" />
<workItem from="1451305917616" duration="2830000" />
<workItem from="1451305917616" duration="3197000" />
<workItem from="1451478984499" duration="2984000" />
</task>
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="10794000" />
<option name="totallyTimeSpent" value="14145000" />
</component>
<component name="ToolWindowManager">
<frame x="-8" y="-8" width="1936" height="1056" extended-state="7" />
<editor active="true" />
<frame x="-8" y="-8" width="1936" height="1056" extended-state="6" />
<editor active="false" />
<layout>
<window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
<window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32769555" sideWeight="0.41875" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32769555" sideWeight="0.4171875" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Palette&#9;" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.33932346" sideWeight="0.58125" 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="true" show_stripe_button="true" weight="0.32769555" sideWeight="0.5828125" order="7" side_tool="true" content_ui="tabs" />
<window_info id="Maven Projects" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" 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" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
@ -741,31 +769,11 @@
<option name="FILTER_TARGETS" value="false" />
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/src/me/Jaryl/FoundBoxx/Listeners/fBreakListener.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="32" column="39" selection-start-line="32" selection-start-column="16" selection-end-line="32" selection-end-column="39" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/me/Jaryl/FoundBoxx/Listeners/fBlockListener.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/me/Jaryl/FoundBoxx/PermissionsHandler.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="23" column="40" selection-start-line="23" selection-start-column="40" selection-end-line="23" selection-end-column="40" />
<folding>
<element signature="imports" expanded="false" />
</folding>
<folding />
</state>
</provider>
</entry>
@ -773,7 +781,9 @@
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="128" column="88" selection-start-line="128" selection-start-column="20" selection-end-line="128" selection-end-column="88" />
<folding />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
@ -805,7 +815,9 @@
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="33" column="13" selection-start-line="33" selection-start-column="13" selection-end-line="33" selection-end-column="13" />
<folding />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
@ -829,7 +841,9 @@
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
<folding>
<element signature="e#3232#3262#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
@ -861,9 +875,7 @@
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="23" column="40" selection-start-line="23" selection-start-column="40" selection-end-line="23" selection-end-column="40" />
<folding>
<element signature="imports" expanded="false" />
</folding>
<folding />
</state>
</provider>
</entry>
@ -879,7 +891,9 @@
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="97" column="39" selection-start-line="97" selection-start-column="39" selection-end-line="97" selection-end-column="39" />
<folding />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
@ -895,7 +909,9 @@
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="213" column="53" selection-start-line="213" selection-start-column="53" selection-end-line="213" selection-end-column="53" />
<folding />
<folding>
<element signature="e#3232#3262#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
@ -935,9 +951,7 @@
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding>
<element signature="imports" expanded="false" />
</folding>
<folding />
</state>
</provider>
</entry>
@ -953,7 +967,9 @@
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="97" column="39" selection-start-line="97" selection-start-column="39" selection-end-line="97" selection-end-column="39" />
<folding />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
@ -969,7 +985,9 @@
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="213" column="53" selection-start-line="213" selection-start-column="53" selection-end-line="213" selection-end-column="53" />
<folding />
<folding>
<element signature="e#3232#3262#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
@ -1002,9 +1020,7 @@
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding>
<element signature="imports" expanded="false" />
</folding>
<folding />
</state>
</provider>
</entry>
@ -1019,9 +1035,7 @@
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding>
<element signature="imports" expanded="false" />
</folding>
<folding />
</state>
</provider>
</entry>
@ -1054,22 +1068,6 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/net/gravitydevelopment/updater/Updater.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="-46.931034">
<caret line="744" column="1" selection-start-line="744" selection-start-column="1" selection-end-line="744" selection-end-column="1" />
<folding>
<element signature="imports" expanded="false" />
<element signature="e#28638#28639#0" expanded="false" />
<element signature="e#28674#28675#0" expanded="false" />
<element signature="e#29435#29586#0" expanded="false" />
<element signature="e#29585#29586#0" expanded="false" />
<element signature="e#29657#29658#0" expanded="false" />
<element signature="e#29701#29702#0" expanded="false" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/FoundBoxx.iml">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
@ -1088,84 +1086,114 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/me/Jaryl/FoundBoxx/Listeners/fPlayerListener.java">
<entry file="file://$PROJECT_DIR$/src/me/Jaryl/FoundBoxx/PermissionsHandler.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="29" column="5" selection-start-line="29" selection-start-column="5" selection-end-line="29" selection-end-column="5" />
<caret line="23" column="40" selection-start-line="23" selection-start-column="40" selection-end-line="23" selection-end-column="40" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/plugin.yml">
<entry file="jar://$USER_HOME$/Desktop/Desktop/MC/;Server/plugins/LaggRemover-0.1.9.jar!/plugin.yml">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="10" column="11" selection-start-line="10" selection-start-column="11" selection-end-line="10" selection-end-column="11" />
<state vertical-scroll-proportion="0.19932999">
<caret line="7" column="34" selection-start-line="7" selection-start-column="34" selection-end-line="7" selection-end-column="34" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/me/Jaryl/FoundBoxx/PermissionsHandler.java">
<entry file="jar://$USER_HOME$/Desktop/Desktop/MC/;Server/plugins/LaggRemover-0.1.9.jar!/drew6017/lr/main/Updater.class">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="23" column="40" selection-start-line="23" selection-start-column="40" selection-end-line="23" selection-end-column="40" />
<state vertical-scroll-proportion="3.757856">
<caret line="398" column="69" selection-start-line="398" selection-start-column="69" selection-end-line="398" selection-end-column="69" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/me/Jaryl/FoundBoxx/Listeners/fBreakListener.java">
<entry file="file://$PROJECT_DIR$/src/net/gravitydevelopment/updater/Updater.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="32" column="39" selection-start-line="32" selection-start-column="16" selection-end-line="32" selection-end-column="39" />
<state vertical-scroll-proportion="-6.5172415">
<caret line="35" column="11" selection-start-line="35" selection-start-column="10" selection-end-line="35" selection-end-column="11" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/me/Jaryl/FoundBoxx/SQLwrapper/SQLwrapper.java">
<entry file="file://$PROJECT_DIR$/src/me/Jaryl/FoundBoxx/Listeners/fPlayerListener.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="-6.5172415">
<caret line="94" column="20" selection-start-line="94" selection-start-column="17" selection-end-line="94" selection-end-column="20" />
<state vertical-scroll-proportion="-12.310345">
<caret line="30" column="24" selection-start-line="30" selection-start-column="23" selection-end-line="30" selection-end-column="24" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/me/Jaryl/FoundBoxx/Threads/Notify.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="-10.206897">
<caret line="128" column="88" selection-start-line="128" selection-start-column="23" selection-end-line="128" selection-end-column="88" />
<folding />
<state vertical-scroll-proportion="-26.142857">
<caret line="129" column="20" selection-start-line="129" selection-start-column="20" selection-end-line="129" selection-end-column="20" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/me/Jaryl/FoundBoxx/FoundBoxx.java">
<entry file="file://$PROJECT_DIR$/src/me/Jaryl/FoundBoxx/Listeners/fBlockListener.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="-11.965517">
<caret line="38" column="41" selection-start-line="38" selection-start-column="41" selection-end-line="38" selection-end-column="41" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/me/Jaryl/FoundBoxx/Listeners/fBreakListener.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="25.035715">
<caret line="100" column="17" selection-start-line="100" selection-start-column="17" selection-end-line="100" selection-end-column="17" />
<state vertical-scroll-proportion="-13.137931">
<caret line="27" column="23" selection-start-line="27" selection-start-column="23" selection-end-line="27" selection-end-column="23" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/plugin.yml">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="2" column="14" selection-start-line="2" selection-start-column="14" selection-end-line="2" selection-end-column="14" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/me/Jaryl/FoundBoxx/SQLwrapper/Threads/SQLLoad.java">
<entry file="file://$PROJECT_DIR$/src/me/Jaryl/FoundBoxx/Threads/Farmrate.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="-17.758621">
<caret line="91" column="35" selection-start-line="91" selection-start-column="35" selection-end-line="91" selection-end-column="35" />
<state vertical-scroll-proportion="0.0">
<caret line="72" column="21" selection-start-line="72" selection-start-column="21" selection-end-line="72" selection-end-column="21" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/me/Jaryl/FoundBoxx/Listeners/fBlockListener.java">
<entry file="file://$PROJECT_DIR$/src/me/Jaryl/FoundBoxx/FoundBoxx.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="-7.375">
<caret line="38" column="32" selection-start-line="38" selection-start-column="32" selection-end-line="38" selection-end-column="32" />
<state vertical-scroll-proportion="-5.107143">
<caret line="197" column="8" selection-start-line="197" selection-start-column="8" selection-end-line="197" selection-end-column="8" />
<folding>
<element signature="imports" expanded="true" />
<element signature="e#3232#3262#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/me/Jaryl/FoundBoxx/Threads/Farmrate.java">
<entry file="file://$PROJECT_DIR$/src/me/Jaryl/FoundBoxx/SQLwrapper/SQLwrapper.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="-55.103447">
<caret line="105" column="20" selection-start-line="105" selection-start-column="16" selection-end-line="105" selection-end-column="20" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/me/Jaryl/FoundBoxx/SQLwrapper/Threads/SQLLoad.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.4665493">
<caret line="39" column="50" selection-start-line="39" selection-start-column="50" selection-end-line="39" selection-end-column="50" />
<state vertical-scroll-proportion="-1.1179674">
<caret line="36" column="30" selection-start-line="36" selection-start-column="30" selection-end-line="36" selection-end-column="30" />
<folding />
</state>
</provider>

+ 2
- 2
FoundBoxx.iml View File

@ -15,7 +15,7 @@
</content>
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="inheritedJdk" />
<orderEntry type="module-library" exported="" scope="PROVIDED">
<orderEntry type="module-library" scope="PROVIDED">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/../Dependencies/spigot.jar!/" />
@ -26,7 +26,7 @@
</SOURCES>
</library>
</orderEntry>
<orderEntry type="module-library" exported="" scope="PROVIDED">
<orderEntry type="module-library" scope="PROVIDED">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/../Dependencies/PermissionsEx-1.23.3.jar!/" />

+ 1
- 1
plugin.yml View File

@ -1,6 +1,6 @@
name: FoundBoxx
main: me.Jaryl.FoundBoxx.FoundBoxx
version: 1.9.1
version: 1.9.2
author: Jaryl
website: http://about.me/jarylc
softdepend: [PermissionsEx]

+ 46
- 35
src/me/Jaryl/FoundBoxx/FoundBoxx.java View File

@ -15,6 +15,7 @@ import net.gravitydevelopment.updater.Updater;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
@ -46,14 +47,8 @@ public class FoundBoxx extends JavaPlugin {
//public int Delay;
public boolean diagonal;
public boolean Emeralds;
public boolean Diamonds;
public boolean Gold;
public boolean Iron;
public boolean Coal;
public boolean Lapis;
public boolean Red;
public List<Material> Blks;
public List<String> ExtraBlks;
public int Chance;
@ -80,38 +75,45 @@ public class FoundBoxx extends JavaPlugin {
public String sqlUser;
public String sqlPass;
public boolean canAnnounce(Block block)
public Material canAnnounce(Block block)
{
Location loc = block.getLocation();
if (sql.Connected() && !block.hasMetadata("Found"))
Material blockType = block.getType();
if (!Blks.contains(blockType))
return null;
if (block.hasMetadata("Found"))
return null;
if (sql.Connected())
{
try {
// Check if the block is placed by a player before
ResultSet rs = sql.Query("SELECT * FROM `" + sqlPrefix + "-placed` WHERE `x` = " + loc.getX() + " AND `y` = " + loc.getY() + " AND `z` = " + loc.getZ() + " LIMIT 1;");
ResultSet rs = sql.Query("SELECT * FROM " + sqlPrefix + "_placed WHERE x = " + loc.getX() + " AND y = " + loc.getY() + " AND z = " + loc.getZ() + " LIMIT 1;");
if (rs.next())
{
rs.close();
return false;
return null;
}
// Check if the block is found before
ResultSet rs2 = sql.Query("SELECT * FROM `" + sqlPrefix + "-log` WHERE `x` = " + loc.getX() + " AND `y` = " + loc.getY() + " AND `z` = " + loc.getZ() + " LIMIT 1;");
ResultSet rs2 = sql.Query("SELECT * FROM " + sqlPrefix + "_log WHERE x = " + loc.getX() + " AND y = " + loc.getY() + " AND z = " + loc.getZ() + " LIMIT 1;");
if (rs2.next())
{
block.setMetadata("Found", new FixedMetadataValue(this, true));
rs2.close();
return false;
return null;
}
rs.close();
return true;
rs2.close();
} catch (SQLException e) {
e.printStackTrace();
System.out.println("[FoundBoxx] Unable to load the values above for checking.");
}
}
return !block.hasMetadata("Found");
return blockType;
}
@SuppressWarnings("unchecked")
@ -129,21 +131,30 @@ public class FoundBoxx extends JavaPlugin {
Stats = parseConfig("Allow_Usage_Stats_Collection", true);
Creative = parseConfig("Survival_Only", true);
Nick = parseConfig("Use_Nickname", false);
//Delay = parseConfig("Delay_In_Seconds", 10);
Perms = parseConfig("Use_Permissions", false);
OreMsg = parseConfig("Messages.Found_Notification", "%ply found %amt %blk(s) (Visibility: %vis%)");
DarkMsg = parseConfig("Messages.Must_Have_Light_To_Mine", "Interacting in the dark is dangerous! Put some torches!");
diagonal = parseConfig("Count_Diagonal_Ores", false);
Emeralds = parseConfig("EMERALDS", true);
Diamonds = parseConfig("DIAMONDS", true);
Gold = parseConfig("GOLD", true);
Iron = parseConfig("IRON", true);
Coal = parseConfig("COAL", false);
Lapis = parseConfig("LAPIS", true);
Red = parseConfig("REDSTONE", false);
Blks = new ArrayList<Material>();
if (parseConfig("EMERALDS", true))
Blks.add(Material.EMERALD_ORE);
if (parseConfig("DIAMONDS", true))
Blks.add(Material.DIAMOND_ORE);
if (parseConfig("GOLD", true))
Blks.add(Material.GOLD_ORE);
if (parseConfig("IRON", true))
Blks.add(Material.IRON_ORE);
if (parseConfig("COAL", true))
Blks.add(Material.COAL_ORE);
if (parseConfig("LAPIS", true))
Blks.add(Material.LAPIS_ORE);
if (parseConfig("REDSTONE", true)) {
Blks.add(Material.GLOWING_REDSTONE_ORE);
Blks.add(Material.REDSTONE_ORE);
}
ExtraBlks = parseConfig("Extra_Blocks", new ArrayList<String>());
Chance = parseConfig("Percentage_Chance_To_Give_Randoms_Item", 0);
@ -192,7 +203,7 @@ public class FoundBoxx extends JavaPlugin {
sqlload.start();
System.out.println("[FoundBoxx] " + (useSQL.equalsIgnoreCase("h2") ? "H2" : "SQL") + " loaded.");
sql.queueData("DELETE FROM `" + sqlPrefix + "-log` WHERE `date` <= CURDATE() -" + sqlDays + " LIMIT " + sqlLimit + ";");
sql.queueData("DELETE FROM " + sqlPrefix + "_log WHERE date <= CURDATE() -" + sqlDays + " LIMIT " + sqlLimit + ";");
}
else
{
@ -212,13 +223,13 @@ public class FoundBoxx extends JavaPlugin {
p.sendMessage(" Permissions: " + Perms);
p.sendMessage(" Count diagonal ores: " + diagonal);
p.sendMessage(" Blocks:");
p.sendMessage(" EMERALDS: " + Emeralds);
p.sendMessage(" DIAMONDS: " + Diamonds);
p.sendMessage(" GOLD: " + Gold);
p.sendMessage(" IRON: " + Iron);
p.sendMessage(" LAPIS: " + Lapis);
p.sendMessage(" REDSTONE: " + Red);
p.sendMessage(" COAL: " + Coal);
p.sendMessage(" EMERALDS: " + Blks.contains(Material.EMERALD_ORE));
p.sendMessage(" DIAMONDS: " + Blks.contains(Material.DIAMOND_ORE));
p.sendMessage(" GOLD: " + Blks.contains(Material.GOLD_ORE));
p.sendMessage(" IRON: " + Blks.contains(Material.IRON_ORE));
p.sendMessage(" LAPIS: " + Blks.contains(Material.LAPIS_ORE));
p.sendMessage(" REDSTONE: " + Blks.contains(Material.REDSTONE_ORE));
p.sendMessage(" COAL: " + Blks.contains(Material.COAL_ORE));
p.sendMessage(" EXTRA BLOCKS: " + ExtraBlks.toString());
p.sendMessage(" Random Item:");
p.sendMessage(" Chance random item: " + Chance + "%");
@ -314,7 +325,7 @@ public class FoundBoxx extends JavaPlugin {
if (sql.Connected())
{
try {
ResultSet rs = sql.Query("SELECT * FROM `" + sqlPrefix + "-log` WHERE `player` = '" + name + "' AND `date` >= CURRENT_DATE() - " + days + " LIMIT " + sqlLimit + ";");
ResultSet rs = sql.Query("SELECT * FROM " + sqlPrefix + "_log WHERE player = '" + name + "' AND date >= CURRENT_DATE() - " + days + " LIMIT " + sqlLimit + ";");
Thread farmrate = new Farmrate(this, rs, name, days, asker);
farmrate.start();

+ 1
- 1
src/me/Jaryl/FoundBoxx/Listeners/fBlockListener.java View File

@ -42,7 +42,7 @@ public class fBlockListener implements Listener {
player.sendMessage(ChatColor.RED + "[FB] " + plugin.DarkMsg);
}
if (plugin.canAnnounce(block) && (plugin.Creative && player.getGameMode() != GameMode.CREATIVE))
if ((plugin.canAnnounce(block) != null) && (plugin.Creative && player.getGameMode() != GameMode.CREATIVE))
{
Thread notify = new Notify(plugin, player, block, loc, light);
notify.start();

+ 2
- 3
src/me/Jaryl/FoundBoxx/Listeners/fBreakListener.java View File

@ -30,11 +30,10 @@ public class fBreakListener implements Listener{
if (!event.isCancelled() && event.getPlayer().getGameMode() != GameMode.CREATIVE)
{
Block blk = event.getBlock();
if (plugin.canAnnounce(blk))
if (plugin.canAnnounce(blk) != null)
{
blk.setMetadata("Found", new FixedMetadataValue(this.plugin, true));
plugin.sql.queueData("INSERT INTO `" + plugin.sqlPrefix + "-placed` (`x`, `y`, `z`) VALUES ('" + blk.getX() + "', '" + blk.getY() + "', '" + + blk.getZ() + "');");
plugin.sql.queueData("INSERT INTO " + plugin.sqlPrefix + "_placed (x, y, z) VALUES (" + blk.getX() + ", " + blk.getY() + ", " + + blk.getZ() + ");");
}
}
}

+ 5
- 4
src/me/Jaryl/FoundBoxx/SQLwrapper/Threads/SQLLoad.java View File

@ -70,10 +70,11 @@ public class SQLLoad extends Thread {
plugin.sql.conn.setAutoCommit(true);
if (plugin.sql.conn != null)
{
plugin.sql.dataQuery("CREATE TABLE IF NOT EXISTS `" + prefix + "-log` (`date` datetime NOT NULL, `player` longtext NOT NULL, `block` varchar(32) NOT NULL, `x` int NOT NULL, `y` int NOT NULL, `z` int NOT NULL)");
plugin.sql.dataQuery("CREATE TABLE IF NOT EXISTS `" + prefix + "-placed` (`x` int NOT NULL, `y` int NOT NULL, `z` int NOT NULL)");
try {
plugin.sql.dataQuery("CREATE TABLE IF NOT EXISTS " + prefix + "_log (date datetime NOT NULL, player longtext NOT NULL, block varchar(32) NOT NULL, x int NOT NULL, y int NOT NULL, z int NOT NULL)");
plugin.sql.dataQuery("CREATE TABLE IF NOT EXISTS " + prefix + "_placed (x int NOT NULL, y int NOT NULL, z int NOT NULL)");
} catch (Exception ex) {
System.out.println("[FoundBoxx] There was a problem creating the SQL tables, please double check or try reloading the server.");
}
} catch (SQLException e) {
e.printStackTrace();

+ 7
- 7
src/me/Jaryl/FoundBoxx/Threads/Farmrate.java View File

@ -38,31 +38,31 @@ public class Farmrate extends Thread {
while (rs.next())
{
String id = rs.getString("block");
if (plugin.Emeralds && id.equals("EMERALD_ORE"))
if (id.equals("EMERALD_ORE"))
{
emer++;
}
if (plugin.Diamonds && id.equals("DIAMOND_ORE"))
if (id.equals("DIAMOND_ORE"))
{
dias++;
}
if (plugin.Gold && id.equals("GOLD_ORE"))
if (id.equals("GOLD_ORE"))
{
gold++;
}
if (plugin.Iron && id.equals("IRON_ORE"))
if (id.equals("IRON_ORE"))
{
iron++;
}
if (plugin.Lapis && id.equals("LAPIS_ORE"))
if (id.equals("LAPIS_ORE"))
{
lapis++;
}
if (plugin.Red && (id.equals("REDSTONE_ORE") || id.equals("GLOWING_REDSTONE_ORE")))
if (id.equals("REDSTONE_ORE") || id.equals("GLOWING_REDSTONE_ORE"))
{
red++;
}
if (plugin.Coal && id.equals("COAL_ORE"))
if (id.equals("COAL_ORE"))
{
coal++;
}

+ 11
- 11
src/me/Jaryl/FoundBoxx/Threads/Notify.java View File

@ -26,45 +26,45 @@ public class Notify extends Thread {
}
public void run() {
Material blocktype = block.getType();
Material blocktype = plugin.canAnnounce(block);
ChatColor prefix = ChatColor.WHITE;
String item = null;
Boolean toGive = false;
if (plugin.Emeralds && blocktype == Material.EMERALD_ORE && !plugin.PermHandler.hasPermission(player, "foundboxx.ignore.emerald", false, true))
if (blocktype == Material.EMERALD_ORE && !plugin.PermHandler.hasPermission(player, "foundboxx.ignore.emerald", false, true))
{
prefix = ChatColor.GREEN;
item = "emerald";
toGive = (plugin.Chance > 0);
}
if (plugin.Diamonds && blocktype == Material.DIAMOND_ORE && !plugin.PermHandler.hasPermission(player, "foundboxx.ignore.diamond", false, true))
if (blocktype == Material.DIAMOND_ORE && !plugin.PermHandler.hasPermission(player, "foundboxx.ignore.diamond", false, true))
{
prefix = ChatColor.AQUA;
item = "diamond";
toGive = (plugin.Chance > 0);
}
if (plugin.Gold && blocktype == Material.GOLD_ORE && !plugin.PermHandler.hasPermission(player, "foundboxx.ignore.gold", false, true))
if (blocktype == Material.GOLD_ORE && !plugin.PermHandler.hasPermission(player, "foundboxx.ignore.gold", false, true))
{
prefix = ChatColor.GOLD;
item = "gold";
}
if (plugin.Iron && blocktype == Material.IRON_ORE && !plugin.PermHandler.hasPermission(player, "foundboxx.ignore.iron", false, true))
if (blocktype == Material.IRON_ORE && !plugin.PermHandler.hasPermission(player, "foundboxx.ignore.iron", false, true))
{
prefix = ChatColor.GRAY;
item = "iron";
}
if (plugin.Lapis && blocktype == Material.LAPIS_ORE && !plugin.PermHandler.hasPermission(player, "foundboxx.ignore.lapis", false, true))
if (blocktype == Material.LAPIS_ORE && !plugin.PermHandler.hasPermission(player, "foundboxx.ignore.lapis", false, true))
{
prefix = ChatColor.BLUE;
item = "lapis lazuli";
}
if (plugin.Red && blocktype == Material.REDSTONE_ORE && !plugin.PermHandler.hasPermission(player, "foundboxx.ignore.redstone", false, true))
if ((blocktype == Material.REDSTONE_ORE || blocktype == Material.GLOWING_REDSTONE_ORE) && !plugin.PermHandler.hasPermission(player, "foundboxx.ignore.redstone", false, true))
{
prefix = ChatColor.RED;
item = "redstone";
}
if (plugin.Coal && block.getType() == Material.COAL_ORE && !plugin.PermHandler.hasPermission(player, "foundboxx.ignore.coal", false, true))
if (block.getType() == Material.COAL_ORE && !plugin.PermHandler.hasPermission(player, "foundboxx.ignore.coal", false, true))
{
prefix = ChatColor.GRAY;
item = "coal";
@ -106,7 +106,7 @@ public class Notify extends Thread {
}
}
plugin.sql.queueData("INSERT INTO `" + plugin.sqlPrefix + "-log` (`date`, `player`, `block`, `x`, `y`, `z`) VALUES (NOW(), '" + player.getName() + "', '" + block.getType().name() + "', " + block.getX() + ", " + block.getY() + ", " + block.getZ() + ");");
plugin.sql.queueData("INSERT INTO " + plugin.sqlPrefix + "_log (date, player, block, x, y, z) VALUES (NOW(), '" + player.getName() + "', '" + block.getType().name() + "', " + block.getX() + ", " + block.getY() + ", " + block.getZ() + ");");
}
private int getAllRelative(Block block, Player player)
@ -122,9 +122,9 @@ public class Notify extends Thread {
{
Block rel = block.getRelative(face);
if (plugin.canAnnounce(rel))
if (plugin.canAnnounce(rel) != null)
{
plugin.sql.queueData("INSERT INTO `" + plugin.sqlPrefix + "-log` (`date`, `player`, `block`, `x`, `y`, `z`) VALUES (NOW(), '" + player.getName() + "', '" + rel.getType().name() + "', '" + rel.getX() + "', '" + rel.getY() + "', '" + + rel.getZ() + "');");
plugin.sql.queueData("INSERT INTO " + plugin.sqlPrefix + "_log (date, player, block, x, y, z) VALUES (NOW(), '" + player.getName() + "', '" + rel.getType().name() + "', " + rel.getX() + ", " + rel.getY() + ", " + + rel.getZ() + ");");
rel.setMetadata("Found", new FixedMetadataValue(this.plugin, true));

Loading…
Cancel
Save