1
0
Fork 0

Fix glass detection

main
Marissa Staib 6 years ago
parent e38c1383c8
commit bc83629876
  1. 2
      .idea/minecraftportal.iml
  2. 3
      .idea/misc.xml
  3. 4
      .idea/runConfigurations/Run_Server.xml
  4. 148
      .idea/workspace.xml
  5. 2
      TODO
  6. 20
      build.gradle
  7. 15
      src/main/kotlin/net/deliciousreya/minecraftportal/MinecraftPortalPlugin.kt

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4" />

@ -1,6 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="JavaScriptSettings">
<option name="languageLevel" value="ES6" />
</component>
<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>

@ -1,9 +1,9 @@
<component name='ProjectRunConfigurationManager'>
<configuration default='false' name='Run Server' type='JarApplication' factoryName='JAR Application' singleton='true'>
<option name='JAR_PATH' value='/home/reya/IdeaProjects/minecraftportal/build/server/1.12.2/core.jar' />
<option name='JAR_PATH' value='C:\Users\serynth\IdeaProjects\minecraftportal\build\server\1.12.2\core.jar' />
<option name='VM_PARAMETERS' value='-Dfile.encoding=UTF-8 -Xmx1G' />
<option name='PROGRAM_PARAMETERS' value='' />
<option name='WORKING_DIRECTORY' value='/home/reya/IdeaProjects/minecraftportal/build/server/1.12.2' />
<option name='WORKING_DIRECTORY' value='C:\Users\serynth\IdeaProjects\minecraftportal\build\server\1.12.2' />
<envs />
<method>
<option name='Gradle.BeforeRunTask' enabled='true' tasks='prepareServer' externalProjectPath='$PROJECT_DIR$' vmOptions='' scriptParameters='' />

@ -2,8 +2,13 @@
<project version="4">
<component name="ChangeListManager">
<list default="true" id="859a87a7-9353-4bac-b28a-a1d9067ab6a4" name="Default Changelist" comment="">
<change afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.gitignore" beforeDir="false" afterPath="$PROJECT_DIR$/.gitignore" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/minecraftportal.iml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/misc.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/misc.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/runConfigurations/Run_Server.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/runConfigurations/Run_Server.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/TODO" beforeDir="false" afterPath="$PROJECT_DIR$/TODO" afterDir="false" />
<change beforePath="$PROJECT_DIR$/build.gradle" beforeDir="false" afterPath="$PROJECT_DIR$/build.gradle" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/kotlin/net/deliciousreya/minecraftportal/MinecraftPortalPlugin.kt" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/kotlin/net/deliciousreya/minecraftportal/MinecraftPortalPlugin.kt" afterDir="false" />
</list>
<ignored path="$PROJECT_DIR$/out/" />
<ignored path="$PROJECT_DIR$/.gradle/" />
@ -29,33 +34,15 @@
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/build.gradle">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="173">
<caret line="27" column="19" selection-start-line="27" selection-start-column="19" selection-end-line="27" selection-end-column="19" />
<state relative-caret-position="282">
<caret line="56" column="27" lean-forward="true" selection-start-line="56" selection-start-column="27" selection-end-line="56" selection-end-column="27" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.bukkit/bukkit/1.13.2-R0.1-SNAPSHOT/8c23739471b160ecd666176a158f14bb4d7e4f12/bukkit-1.13.2-R0.1-SNAPSHOT-sources.jar!/org/bukkit/plugin/java/PluginClassLoader.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="261">
<caret line="97" selection-start-line="97" selection-end-line="97" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/local.properties">
<provider selected="true" editor-type-id="text-editor" />
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/TODO">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="125">
<caret line="5" column="46" selection-start-line="5" selection-start-column="46" selection-end-line="5" selection-end-column="46" />
</state>
</provider>
<provider selected="true" editor-type-id="text-editor" />
</entry>
</file>
<file pinned="false" current-in-tab="false">
@ -72,22 +59,19 @@
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/src/main/kotlin/net/deliciousreya/minecraftportal/MinecraftPortalPlugin.kt">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="500">
<caret line="20" column="4" selection-start-line="20" selection-start-column="4" selection-end-line="20" selection-end-column="4" />
<folding>
<element signature="e#43#193#0" expanded="true" />
</folding>
<state relative-caret-position="248">
<caret line="22" column="63" lean-forward="true" selection-start-line="22" selection-start-column="63" selection-end-line="22" selection-end-column="63" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="true">
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/.gitignore">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="50">
<state relative-caret-position="34">
<caret line="2" column="5" selection-start-line="2" selection-start-column="5" selection-end-line="2" selection-end-column="5" />
</state>
</provider>
@ -119,17 +103,18 @@
<option value="$PROJECT_DIR$/src/main/kotlin/MinecraftPortalPlugin.kt" />
<option value="$PROJECT_DIR$/src/main/kotlin/org/deliciousreya/minecraftportal/MinecraftPortalPlugin.kt" />
<option value="$PROJECT_DIR$/src/main/resources/plugin.yml" />
<option value="$PROJECT_DIR$/TODO" />
<option value="$PROJECT_DIR$/.gitignore" />
<option value="$PROJECT_DIR$/build.gradle" />
<option value="$PROJECT_DIR$/TODO" />
<option value="$PROJECT_DIR$/src/main/kotlin/net/deliciousreya/minecraftportal/MinecraftPortalPlugin.kt" />
<option value="$PROJECT_DIR$/.gitignore" />
</list>
</option>
</component>
<component name="ProjectFrameBounds">
<option name="y" value="88" />
<option name="width" value="2400" />
<option name="height" value="1424" />
<component name="ProjectFrameBounds" extendedState="6">
<option name="x" value="5" />
<option name="y" value="61" />
<option name="width" value="1940" />
<option name="height" value="1100" />
</component>
<component name="ProjectLevelVcsManager" settingsEditedManually="true" />
<component name="ProjectView">
@ -137,8 +122,8 @@
<foldersAlwaysOnTop value="true" />
</navigator>
<panes>
<pane id="PackagesPane" />
<pane id="Scope" />
<pane id="PackagesPane" />
<pane id="ProjectPane">
<subPane>
<expand>
@ -149,28 +134,12 @@
<path>
<item name="minecraftportal" type="b2602c69:ProjectViewProjectNode" />
<item name="minecraftportal" type="8a07ba80:GradleTreeStructureProvider$GradleModuleDirectoryNode" />
<item name="src" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="minecraftportal" type="b2602c69:ProjectViewProjectNode" />
<item name="minecraftportal" type="8a07ba80:GradleTreeStructureProvider$GradleModuleDirectoryNode" />
<item name="src" type="462c0819:PsiDirectoryNode" />
<item name="main" type="8a07ba80:GradleTreeStructureProvider$GradleModuleDirectoryNode" />
</path>
<path>
<item name="minecraftportal" type="b2602c69:ProjectViewProjectNode" />
<item name="minecraftportal" type="8a07ba80:GradleTreeStructureProvider$GradleModuleDirectoryNode" />
<item name="src" type="462c0819:PsiDirectoryNode" />
<item name="main" type="8a07ba80:GradleTreeStructureProvider$GradleModuleDirectoryNode" />
<item name="kotlin" type="462c0819:PsiDirectoryNode" />
<item name="build" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="minecraftportal" type="b2602c69:ProjectViewProjectNode" />
<item name="minecraftportal" type="8a07ba80:GradleTreeStructureProvider$GradleModuleDirectoryNode" />
<item name="src" type="462c0819:PsiDirectoryNode" />
<item name="main" type="8a07ba80:GradleTreeStructureProvider$GradleModuleDirectoryNode" />
<item name="kotlin" type="462c0819:PsiDirectoryNode" />
<item name="minecraftportal" type="462c0819:PsiDirectoryNode" />
</path>
</expand>
<select />
@ -245,6 +214,8 @@
<updated>1554828986806</updated>
<workItem from="1554828993158" duration="8169000" />
<workItem from="1554897237397" duration="4177000" />
<workItem from="1554901673860" duration="1439000" />
<workItem from="1554903259740" duration="889000" />
</task>
<task id="LOCAL-00001" summary="Base check-in of build settings etc.">
<created>1554832667584</created>
@ -313,7 +284,7 @@
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="12346000" />
<option name="totallyTimeSpent" value="14674000" />
</component>
<component name="TodoView">
<todo-panel id="selected-file">
@ -325,10 +296,10 @@
</todo-panel>
</component>
<component name="ToolWindowManager">
<frame x="0" y="88" width="2400" height="1424" extended-state="0" />
<frame x="-8" y="-8" width="1936" height="1096" extended-state="6" />
<editor active="true" />
<layout>
<window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.25452977" />
<window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.26066098" />
<window_info id="Structure" order="1" side_tool="true" weight="0.25" />
<window_info id="Designer" order="2" />
<window_info id="Image Layers" order="3" />
@ -338,12 +309,12 @@
<window_info anchor="bottom" id="Message" order="0" />
<window_info anchor="bottom" id="Find" order="1" />
<window_info anchor="bottom" id="Run" order="2" weight="0.32931727" />
<window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
<window_info anchor="bottom" id="Debug" order="3" weight="0.3997923" />
<window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
<window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
<window_info anchor="bottom" id="TODO" order="6" weight="0.32931727" />
<window_info anchor="bottom" id="Build" order="7" weight="0.20963855" />
<window_info anchor="bottom" id="Terminal" order="8" visible="true" weight="0.32931727" />
<window_info anchor="bottom" id="Build" order="7" weight="0.3509865" />
<window_info anchor="bottom" id="Terminal" order="8" visible="true" weight="0.5867082" />
<window_info anchor="bottom" id="Docker" order="9" show_stripe_button="false" />
<window_info anchor="bottom" id="Event Log" order="10" side_tool="true" />
<window_info anchor="bottom" id="Database Changes" order="11" />
@ -376,62 +347,47 @@
<option name="LAST_COMMIT_MESSAGE" value="Add glass detection" />
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/build/resources/main/plugin.yml">
<provider selected="true" editor-type-id="text-editor">
<state>
<caret selection-end-column="21" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/build/resources/main/plugin.yml" />
<entry file="file://$PROJECT_DIR$/src/main/resources/plugin.yml" />
<entry file="file://$PROJECT_DIR$/local.properties">
<entry file="file://$PROJECT_DIR$/local.properties" />
<entry file="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.bukkit/bukkit/1.13.2-R0.1-SNAPSHOT/8c23739471b160ecd666176a158f14bb4d7e4f12/bukkit-1.13.2-R0.1-SNAPSHOT-sources.jar!/org/bukkit/plugin/java/PluginClassLoader.java" />
<entry file="file://$PROJECT_DIR$/build/server/1.12.2/eula.txt">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/gradle.properties">
<provider selected="true" editor-type-id="text-editor">
<state>
<caret column="26" selection-start-column="26" selection-end-column="26" />
</state>
</provider>
<entry file="file://$PROJECT_DIR$/build/server/1.12.2/server.properties">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/settings.gradle">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/TODO">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="125">
<caret line="5" column="46" selection-start-line="5" selection-start-column="46" selection-end-line="5" selection-end-column="46" />
</state>
</provider>
</entry>
<entry file="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.bukkit/bukkit/1.13.2-R0.1-SNAPSHOT/8c23739471b160ecd666176a158f14bb4d7e4f12/bukkit-1.13.2-R0.1-SNAPSHOT-sources.jar!/org/bukkit/plugin/java/PluginClassLoader.java">
<entry file="file://$PROJECT_DIR$/gradle.properties">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="261">
<caret line="97" selection-start-line="97" selection-end-line="97" />
<state>
<caret column="26" selection-start-column="26" selection-end-column="26" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/main/kotlin/net/deliciousreya/minecraftportal/MinecraftPortalPlugin.kt">
<entry file="file://$PROJECT_DIR$/.gitignore">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="500">
<caret line="20" column="4" selection-start-line="20" selection-start-column="4" selection-end-line="20" selection-end-column="4" />
<folding>
<element signature="e#43#193#0" expanded="true" />
</folding>
<state relative-caret-position="34">
<caret line="2" column="5" selection-start-line="2" selection-start-column="5" selection-end-line="2" selection-end-column="5" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/build.gradle">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="173">
<caret line="27" column="19" selection-start-line="27" selection-start-column="19" selection-end-line="27" selection-end-column="19" />
<state relative-caret-position="282">
<caret line="56" column="27" lean-forward="true" selection-start-line="56" selection-start-column="27" selection-end-line="56" selection-end-column="27" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/.gitignore">
<entry file="file://$PROJECT_DIR$/TODO">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/src/main/kotlin/net/deliciousreya/minecraftportal/MinecraftPortalPlugin.kt">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="50">
<caret line="2" column="5" selection-start-line="2" selection-start-column="5" selection-end-line="2" selection-end-column="5" />
<state relative-caret-position="248">
<caret line="22" column="63" lean-forward="true" selection-start-line="22" selection-start-column="63" selection-end-line="22" selection-end-column="63" />
</state>
</provider>
</entry>

@ -1,5 +1,3 @@
* Boot server with plugin
* Detect a single glass block being placed
* Detect a glass frame being placed
* Detect a glass frame with a mineral block
* Transform the glass frame to stained glass

@ -17,10 +17,16 @@ repositories {
}
}
configurations {
shade
compile.extendsFrom shade
}
dependencies {
compileOnly bukkit()
compile group: 'com.destroystokyo.paper', name: 'paper-api', version: '1.13.2-R0.1-SNAPSHOT'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
compileOnly group: 'com.destroystokyo.paper', name: 'paper-api', version: '1.13.2-R0.1-SNAPSHOT'
shade "com.google.guava:guava:27.1-jre"
shade "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
testCompile group: 'junit', name: 'junit', version: '4.12'
}
@ -41,7 +47,7 @@ bukkit {
// Accept EULA
eula = true
// Set online-mode flag
onlineMode = false
onlineMode = true
// Debug mode (listen 5005 port, if you use running from IDEA this option will be ignored)
debug = true
// Set server encoding (flag -Dfile.encoding)
@ -59,3 +65,11 @@ compileKotlin {
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}
jar {
configurations.shade.each { dep ->
from(project.zipTree(dep)) {
exclude 'META-INF', 'META-INF/**'
}
}
}

@ -2,30 +2,25 @@ package net.deliciousreya.minecraftportal
import org.bukkit.Material
import org.bukkit.event.EventHandler
import org.bukkit.event.Listener
import org.bukkit.event.block.BlockPlaceEvent
import org.bukkit.event.player.PlayerJoinEvent
import org.bukkit.inventory.ItemStack
import org.bukkit.plugin.java.JavaPlugin
class MinecraftPortalPlugin() : JavaPlugin()
class MinecraftPortalPlugin() : JavaPlugin(), Listener
{
override fun onEnable() {
super.onEnable()
logger.info("Loaded the portal plugin!")
for (player in server.onlinePlayers) {
player.inventory.setItem(0, ItemStack(Material.GLASS, 10))
}
}
@EventHandler
fun onPlayerJoin(e: PlayerJoinEvent) {
e.player.inventory.setItem(0, ItemStack(Material.GLASS, 10))
server.pluginManager.registerEvents(this, this)
}
@EventHandler
fun onBlockPlaced(e: BlockPlaceEvent) {
logger.info("block placed of type " + e.block.type)
if (e.block.type.equals(Material.GLASS)) {
logger.info("put down glass at " + e.block.location + " in " + e.block.world)
logger.info("put down glass at " + e.block.location)
}
}
}
Loading…
Cancel
Save