added death-location message

This commit is contained in:
Bea 2020-08-07 23:35:07 +02:00
parent bcc950f25f
commit 61337d8f74
7 changed files with 95 additions and 18 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
out/

View File

@ -1,6 +1,6 @@
<component name="ArtifactManager"> <component name="ArtifactManager">
<artifact type="jar" name="Spigot Plugin:jar"> <artifact type="jar" name="Spigot Plugin:jar">
<output-path>$PROJECT_DIR$/../../# Server per Test Plugins #/plugins</output-path> <output-path>$PROJECT_DIR$/../Server/plugins</output-path>
<root id="archive" name="FunPlugin.jar"> <root id="archive" name="FunPlugin.jar">
<element id="module-output" name="Kisses" /> <element id="module-output" name="Kisses" />
</root> </root>

View File

@ -1,11 +1,9 @@
<component name="libraryTable"> <component name="libraryTable">
<library name="spigot-1.15.2"> <library name="spigot-1.15.2">
<CLASSES> <CLASSES>
<root url="jar://$PROJECT_DIR$/../../../spigot-1.15.2.jar!/" /> <root url="jar://$MAVEN_REPOSITORY$/org/bukkit/bukkit/1.15.2-R0.1-SNAPSHOT/bukkit-1.15.2-R0.1-SNAPSHOT.jar!/" />
</CLASSES> </CLASSES>
<JAVADOC /> <JAVADOC />
<SOURCES> <SOURCES />
<root url="jar://$PROJECT_DIR$/../../../spigot-1.15.2.jar!/" />
</SOURCES>
</library> </library>
</component> </component>

View File

@ -5,8 +5,44 @@
<artifact name="Spigot Plugin:jar" /> <artifact name="Spigot Plugin:jar" />
</artifacts-to-build> </artifacts-to-build>
</component> </component>
<component name="BranchesTreeState">
<expand>
<path>
<item name="ROOT" type="e8cecc67:BranchNodeDescriptor" />
<item name="LOCAL_ROOT" type="e8cecc67:BranchNodeDescriptor" />
</path>
<path>
<item name="ROOT" type="e8cecc67:BranchNodeDescriptor" />
<item name="REMOTE_ROOT" type="e8cecc67:BranchNodeDescriptor" />
</path>
<path>
<item name="ROOT" type="e8cecc67:BranchNodeDescriptor" />
<item name="REMOTE_ROOT" type="e8cecc67:BranchNodeDescriptor" />
<item name="GROUP_NODE:origin" type="e8cecc67:BranchNodeDescriptor" />
</path>
</expand>
<select />
</component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="07a2bd62-176f-41f3-8d41-79f3572514cb" name="Default Changelist" comment="" /> <list default="true" id="07a2bd62-176f-41f3-8d41-79f3572514cb" name="Default Changelist" comment="">
<change afterPath="$PROJECT_DIR$/out/production/Kisses/net/mindoverflow/kissplugin/Main.class" afterDir="false" />
<change afterPath="$PROJECT_DIR$/out/production/Kisses/net/mindoverflow/kissplugin/commands/AngryCommand.class" afterDir="false" />
<change afterPath="$PROJECT_DIR$/out/production/Kisses/net/mindoverflow/kissplugin/commands/ClearChatCommand.class" afterDir="false" />
<change afterPath="$PROJECT_DIR$/out/production/Kisses/net/mindoverflow/kissplugin/commands/FunCommand.class" afterDir="false" />
<change afterPath="$PROJECT_DIR$/out/production/Kisses/net/mindoverflow/kissplugin/commands/KissCommand.class" afterDir="false" />
<change afterPath="$PROJECT_DIR$/out/production/Kisses/net/mindoverflow/kissplugin/commands/SpookCommand$1.class" afterDir="false" />
<change afterPath="$PROJECT_DIR$/out/production/Kisses/net/mindoverflow/kissplugin/commands/SpookCommand.class" afterDir="false" />
<change afterPath="$PROJECT_DIR$/out/production/Kisses/net/mindoverflow/kissplugin/listeners/CollisionListener.class" afterDir="false" />
<change afterPath="$PROJECT_DIR$/out/production/Kisses/net/mindoverflow/kissplugin/listeners/PlayerDeathListener.class" afterDir="false" />
<change afterPath="$PROJECT_DIR$/out/production/Kisses/net/mindoverflow/kissplugin/utils/RunningTask.class" afterDir="false" />
<change afterPath="$PROJECT_DIR$/out/production/Kisses/plugin.yml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/net/mindoverflow/kissplugin/listeners/PlayerDeathListener.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/artifacts/Spigot_Plugin_jar.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/artifacts/Spigot_Plugin_jar.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/libraries/spigot_1_15_2.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/libraries/spigot_1_15_2.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/net/mindoverflow/kissplugin/Main.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/net/mindoverflow/kissplugin/Main.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/plugin.yml" beforeDir="false" afterPath="$PROJECT_DIR$/src/plugin.yml" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" /> <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
@ -26,7 +62,6 @@
<component name="ProjectLevelVcsManager" settingsEditedManually="true" /> <component name="ProjectLevelVcsManager" settingsEditedManually="true" />
<component name="ProjectViewState"> <component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" /> <option name="hideEmptyMiddlePackages" value="true" />
<option name="showExcludedFiles" value="true" />
<option name="showLibraryContents" value="true" /> <option name="showLibraryContents" value="true" />
</component> </component>
<component name="PropertiesComponent"> <component name="PropertiesComponent">
@ -34,12 +69,15 @@
<property name="GenerateAntBuildDialog.enableUiFormCompile" value="true" /> <property name="GenerateAntBuildDialog.enableUiFormCompile" value="true" />
<property name="GenerateAntBuildDialog.forceTargetJdk" value="true" /> <property name="GenerateAntBuildDialog.forceTargetJdk" value="true" />
<property name="GenerateAntBuildDialog.outputFileNameProperty" value="kisses" /> <property name="GenerateAntBuildDialog.outputFileNameProperty" value="kisses" />
<property name="RunOnceActivity.OpenProjectViewOnStart" value="true" />
<property name="SHARE_PROJECT_CONFIGURATION_FILES" value="true" /> <property name="SHARE_PROJECT_CONFIGURATION_FILES" value="true" />
<property name="last_opened_file_path" value="$PROJECT_DIR$" /> <property name="last_opened_file_path" value="$PROJECT_DIR$/../Server/plugins" />
<property name="project.structure.last.edited" value="Artifacts" /> <property name="project.structure.last.edited" value="Artifacts" />
<property name="project.structure.proportion" value="0.15" /> <property name="project.structure.proportion" value="0.15" />
<property name="project.structure.side.proportion" value="0.2" /> <property name="project.structure.side.proportion" value="0.2" />
<property name="settings.editor.selected.configurable" value="preferences.lookFeel" />
</component> </component>
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
<component name="SvnConfiguration"> <component name="SvnConfiguration">
<configuration /> <configuration />
</component> </component>
@ -53,18 +91,30 @@
</task> </task>
<servers /> <servers />
</component> </component>
<component name="Vcs.Log.Tabs.Properties">
<option name="TAB_STATES">
<map>
<entry key="MAIN">
<value>
<State />
</value>
</entry>
</map>
</option>
<option name="oldMeFiltersMigrated" value="true" />
</component>
<component name="WindowStateProjectService"> <component name="WindowStateProjectService">
<state x="873" y="359" key="#Project_Structure" timestamp="1583805186710"> <state x="249" y="0" key="#Project_Structure" timestamp="1596835802288">
<screen x="0" y="0" width="2560" height="1400" /> <screen x="0" y="0" width="1536" height="834" />
</state> </state>
<state x="873" y="359" key="#Project_Structure/0.0.2560.1400/3840.1065.1600.860/-1360.1191.1360.728@0.0.2560.1400" timestamp="1583805186710" /> <state x="249" y="0" key="#Project_Structure/0.0.1536.834@0.0.1536.834" timestamp="1596835802288" />
<state x="1086" y="404" key="#com.intellij.ide.util.MemberChooser" timestamp="1583804513083"> <state x="501" y="158" key="FileChooserDialogImpl" timestamp="1596835796216">
<screen x="0" y="0" width="2560" height="1400" /> <screen x="0" y="0" width="1536" height="834" />
</state> </state>
<state x="1086" y="404" key="#com.intellij.ide.util.MemberChooser/0.0.2560.1400/3840.1065.1600.860/-1360.1191.1360.728@0.0.2560.1400" timestamp="1583804513083" /> <state x="501" y="158" key="FileChooserDialogImpl/0.0.1536.834@0.0.1536.834" timestamp="1596835796216" />
<state x="967" y="441" key="FileChooserDialogImpl" timestamp="1583790955612"> <state x="277" y="0" key="SettingsEditor" timestamp="1596835536928">
<screen x="0" y="0" width="2560" height="1400" /> <screen x="0" y="0" width="1536" height="834" />
</state> </state>
<state x="967" y="441" key="FileChooserDialogImpl/0.0.2560.1400/3840.1065.1600.860/-1360.1191.1360.728@0.0.2560.1400" timestamp="1583790955612" /> <state x="277" y="0" key="SettingsEditor/0.0.1536.834@0.0.1536.834" timestamp="1596835536928" />
</component> </component>
</project> </project>

View File

@ -2,6 +2,7 @@ package net.mindoverflow.kissplugin;
import net.mindoverflow.kissplugin.commands.*; import net.mindoverflow.kissplugin.commands.*;
import net.mindoverflow.kissplugin.listeners.CollisionListener; import net.mindoverflow.kissplugin.listeners.CollisionListener;
import net.mindoverflow.kissplugin.listeners.PlayerDeathListener;
import net.mindoverflow.kissplugin.utils.RunningTask; import net.mindoverflow.kissplugin.utils.RunningTask;
import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.plugin.java.JavaPlugin;
@ -27,6 +28,7 @@ public class Main extends JavaPlugin
getCommand("angry").setExecutor(new AngryCommand(this)); getCommand("angry").setExecutor(new AngryCommand(this));
getServer().getPluginManager().registerEvents(new CollisionListener(this), this); getServer().getPluginManager().registerEvents(new CollisionListener(this), this);
getServer().getPluginManager().registerEvents(new PlayerDeathListener(), this);
runningTask.task = getServer().getScheduler().runTaskTimer(this, runningTask, 10, 10); runningTask.task = getServer().getScheduler().runTaskTimer(this, runningTask, 10, 10);
} }

View File

@ -0,0 +1,26 @@
package net.mindoverflow.kissplugin.listeners;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.PlayerDeathEvent;
public class PlayerDeathListener implements Listener {
@EventHandler
public void onPlayerDeath(PlayerDeathEvent event)
{
Player player = event.getEntity();
Location loc = player.getLocation();
int x = loc.getBlockX();
int y = loc.getBlockY();
int z = loc.getBlockZ();
event.getEntity().sendMessage("§7You died at coordinates: " +
"§7X = §e" + x +
"§7Y = §e" + y +
"§7Z = §e" + z +
"§r");
}
}

View File

@ -1,5 +1,5 @@
name: FunPlugin name: FunPlugin
version: 0.5.0 version: 0.6.0
author: mind_overflow author: mind_overflow
main: net.mindoverflow.kissplugin.Main main: net.mindoverflow.kissplugin.Main
api-version: 1.15 api-version: 1.15