1
0
Fork 0

Add glass detection

main
reya 6 years ago
parent 378a557ee1
commit 897a45be11
  1. 4
      .idea/runConfigurations/Run_Server.xml
  2. 2
      build.gradle
  3. 30
      src/main/kotlin/net/deliciousreya/minecraftportal/MinecraftPortalPlugin.kt

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

@ -25,7 +25,7 @@ dependencies {
} }
bukkit { bukkit {
version = "1.13.2" version = "1.12.2"
// Attributes for plugin.yml // Attributes for plugin.yml
meta { meta {

@ -1,19 +1,31 @@
package net.deliciousreya.minecraftportal package net.deliciousreya.minecraftportal
import org.bukkit.plugin.PluginDescriptionFile import org.bukkit.Material
import org.bukkit.event.EventHandler
import org.bukkit.event.block.BlockPlaceEvent
import org.bukkit.event.player.PlayerJoinEvent
import org.bukkit.inventory.ItemStack
import org.bukkit.plugin.java.JavaPlugin import org.bukkit.plugin.java.JavaPlugin
import org.bukkit.plugin.java.JavaPluginLoader
import java.io.File
class MinecraftPortalPlugin( class MinecraftPortalPlugin() : JavaPlugin()
loader: JavaPluginLoader,
description: PluginDescriptionFile,
dataFolder: File,
file: File
) : JavaPlugin(loader, description, dataFolder, file)
{ {
override fun onEnable() { override fun onEnable() {
super.onEnable() super.onEnable()
logger.info("Loaded the portal plugin!") 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))
}
@EventHandler
fun onBlockPlaced(e: BlockPlaceEvent) {
if (e.block.type.equals(Material.GLASS)) {
logger.info("put down glass at " + e.block.location + " in " + e.block.world)
}
} }
} }
Loading…
Cancel
Save