diff --git a/.idea/minecraftportal.iml b/.idea/minecraftportal.iml
new file mode 100644
index 0000000..78b2cc5
--- /dev/null
+++ b/.idea/minecraftportal.iml
@@ -0,0 +1,2 @@
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
index bc8d0a3..216536e 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -1,6 +1,9 @@
+
+
+
diff --git a/.idea/runConfigurations/Run_Server.xml b/.idea/runConfigurations/Run_Server.xml
index db34fec..06270eb 100644
--- a/.idea/runConfigurations/Run_Server.xml
+++ b/.idea/runConfigurations/Run_Server.xml
@@ -1,9 +1,9 @@
-
+
-
+
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 4e96e01..06379bf 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -2,8 +2,13 @@
-
-
+
+
+
+
+
+
+
@@ -29,33 +34,15 @@
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -72,22 +59,19 @@
-
+
-
-
-
-
-
+
+
-
+
-
+
@@ -119,17 +103,18 @@
-
+
+
-
-
-
-
-
+
+
+
+
+
@@ -137,8 +122,8 @@
-
+
@@ -149,28 +134,12 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
@@ -245,6 +214,8 @@
1554828986806
+
+
1554832667584
@@ -313,7 +284,7 @@
-
+
@@ -325,10 +296,10 @@
-
+
-
+
@@ -338,12 +309,12 @@
-
+
-
-
+
+
@@ -376,62 +347,47 @@
-
-
-
-
-
-
-
+
-
+
+
+
-
-
-
-
-
-
+
+
-
-
-
-
-
-
-
-
+
-
-
+
+
-
+
-
-
-
-
-
+
+
-
-
+
+
-
+
+
+
+
-
-
+
+
diff --git a/TODO b/TODO
index 42bb103..98405f2 100644
--- a/TODO
+++ b/TODO
@@ -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
diff --git a/build.gradle b/build.gradle
index 7d2567e..85b38ff 100644
--- a/build.gradle
+++ b/build.gradle
@@ -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)
@@ -58,4 +64,12 @@ compileKotlin {
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
+}
+
+jar {
+ configurations.shade.each { dep ->
+ from(project.zipTree(dep)) {
+ exclude 'META-INF', 'META-INF/**'
+ }
+ }
}
\ No newline at end of file
diff --git a/src/main/kotlin/net/deliciousreya/minecraftportal/MinecraftPortalPlugin.kt b/src/main/kotlin/net/deliciousreya/minecraftportal/MinecraftPortalPlugin.kt
index f7dc4c2..902a786 100644
--- a/src/main/kotlin/net/deliciousreya/minecraftportal/MinecraftPortalPlugin.kt
+++ b/src/main/kotlin/net/deliciousreya/minecraftportal/MinecraftPortalPlugin.kt
@@ -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)
}
}
}
\ No newline at end of file