initial commit
This commit is contained in:
commit
e05c16e0a6
22 changed files with 295 additions and 0 deletions
3
.idea/.gitignore
generated
vendored
Normal file
3
.idea/.gitignore
generated
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
1
.idea/.name
generated
Normal file
1
.idea/.name
generated
Normal file
|
@ -0,0 +1 @@
|
|||
Resurrection
|
1
.idea/description.html
generated
Normal file
1
.idea/description.html
generated
Normal file
|
@ -0,0 +1 @@
|
|||
<html>Simple <b>Java</b> application that includes a class with <code>main()</code> method</html>
|
7
.idea/encodings.xml
generated
Normal file
7
.idea/encodings.xml
generated
Normal file
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Encoding">
|
||||
<file url="file://$PROJECT_DIR$/data/player.data" charset="UTF-8" />
|
||||
<file url="PROJECT" charset="UTF-8" />
|
||||
</component>
|
||||
</project>
|
9
.idea/libraries/spigot_api_1_16_5_R0_1_20210524_223338_87.xml
generated
Normal file
9
.idea/libraries/spigot_api_1_16_5_R0_1_20210524_223338_87.xml
generated
Normal file
|
@ -0,0 +1,9 @@
|
|||
<component name="libraryTable">
|
||||
<library name="spigot-api-1.16.5-R0.1-20210524.223338-87">
|
||||
<CLASSES>
|
||||
<root url="jar://$PROJECT_DIR$/lib/spigot-api-1.16.5-R0.1-20210524.223338-87.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</component>
|
12
.idea/misc.xml
generated
Normal file
12
.idea/misc.xml
generated
Normal file
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="EntryPointsManager">
|
||||
<entry_points version="2.0" />
|
||||
</component>
|
||||
<component name="ProjectKey">
|
||||
<option name="state" value="project://e2804f05-5315-4fc6-a121-c522a6c26470" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_15" default="true" project-jdk-name="openjdk-15" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
</project>
|
8
.idea/modules.xml
generated
Normal file
8
.idea/modules.xml
generated
Normal file
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/Resurrection.iml" filepath="$PROJECT_DIR$/Resurrection.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
3
.idea/project-template.xml
generated
Normal file
3
.idea/project-template.xml
generated
Normal file
|
@ -0,0 +1,3 @@
|
|||
<template>
|
||||
<input-field default="com.company">IJ_BASE_PACKAGE</input-field>
|
||||
</template>
|
124
.idea/uiDesigner.xml
generated
Normal file
124
.idea/uiDesigner.xml
generated
Normal file
|
@ -0,0 +1,124 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Palette2">
|
||||
<group name="Swing">
|
||||
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
|
||||
</item>
|
||||
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
|
||||
</item>
|
||||
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
|
||||
</item>
|
||||
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
|
||||
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
|
||||
</item>
|
||||
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
|
||||
<initial-values>
|
||||
<property name="text" value="Button" />
|
||||
</initial-values>
|
||||
</item>
|
||||
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
|
||||
<initial-values>
|
||||
<property name="text" value="RadioButton" />
|
||||
</initial-values>
|
||||
</item>
|
||||
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
|
||||
<initial-values>
|
||||
<property name="text" value="CheckBox" />
|
||||
</initial-values>
|
||||
</item>
|
||||
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
|
||||
<initial-values>
|
||||
<property name="text" value="Label" />
|
||||
</initial-values>
|
||||
</item>
|
||||
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
||||
<preferred-size width="150" height="-1" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
||||
<preferred-size width="150" height="-1" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
||||
<preferred-size width="150" height="-1" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
|
||||
<preferred-size width="200" height="200" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
|
||||
<preferred-size width="200" height="200" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
|
||||
</item>
|
||||
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
|
||||
<preferred-size width="-1" height="20" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
|
||||
</item>
|
||||
</group>
|
||||
</component>
|
||||
</project>
|
12
Resurrection.iml
Normal file
12
Resurrection.iml
Normal file
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" name="spigot-api-1.16.5-R0.1-20210524.223338-87" level="project" />
|
||||
</component>
|
||||
</module>
|
1
data/player.data
Normal file
1
data/player.data
Normal file
|
@ -0,0 +1 @@
|
|||
username,false,0
|
BIN
lib/spigot-api-1.16.5-R0.1-20210524.223338-87.jar
Normal file
BIN
lib/spigot-api-1.16.5-R0.1-20210524.223338-87.jar
Normal file
Binary file not shown.
BIN
out/production/DeadForADay/net/brysonsteck/DeadForADay.class
Normal file
BIN
out/production/DeadForADay/net/brysonsteck/DeadForADay.class
Normal file
Binary file not shown.
BIN
out/production/DeadForADay/net/brysonsteck/PlayerData.class
Normal file
BIN
out/production/DeadForADay/net/brysonsteck/PlayerData.class
Normal file
Binary file not shown.
0
out/production/DeadForADay/net/brysonsteck/plugin.yml
Normal file
0
out/production/DeadForADay/net/brysonsteck/plugin.yml
Normal file
BIN
out/production/Resurrection/net/brysonsteck/PlayerData.class
Normal file
BIN
out/production/Resurrection/net/brysonsteck/PlayerData.class
Normal file
Binary file not shown.
BIN
out/production/Resurrection/net/brysonsteck/Resurrection.class
Normal file
BIN
out/production/Resurrection/net/brysonsteck/Resurrection.class
Normal file
Binary file not shown.
0
out/production/Resurrection/net/brysonsteck/plugin.yml
Normal file
0
out/production/Resurrection/net/brysonsteck/plugin.yml
Normal file
24
src/net/brysonsteck/PlayerAttributes.java
Normal file
24
src/net/brysonsteck/PlayerAttributes.java
Normal file
|
@ -0,0 +1,24 @@
|
|||
package net.brysonsteck;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.entity.PlayerDeathEvent;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
public class PlayerAttributes implements Listener {
|
||||
public Plugin plugin = Resurrection.getPlugin(Resurrection.class);
|
||||
|
||||
public void onDeath(PlayerDeathEvent event) {
|
||||
Player p = event.getEntity();
|
||||
Player k = event.getEntity().getKiller();
|
||||
int killcount = plugin.getConfig().getInt("Users." + k.getUniqueId().toString() + ".Kills") ;
|
||||
int deathcount = plugin.getConfig().getInt("Users." + p.getUniqueId().toString() + ".Deaths") ;
|
||||
|
||||
plugin.getConfig().set("Users." + p.getUniqueId().toString() + ".Deaths", deathcount + 1);
|
||||
plugin.getConfig().set("Users." + k.getUniqueId().toString() + ".Kills", killcount + 1);
|
||||
plugin.saveConfig();
|
||||
|
||||
|
||||
}
|
||||
}
|
46
src/net/brysonsteck/PlayerData.java
Normal file
46
src/net/brysonsteck/PlayerData.java
Normal file
|
@ -0,0 +1,46 @@
|
|||
package net.brysonsteck;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.Arrays;
|
||||
import java.util.Hashtable;
|
||||
|
||||
public class PlayerData {
|
||||
Hashtable<String, Hashtable<String, String>> playerData = new Hashtable<>();
|
||||
|
||||
public void saveData(String write) {
|
||||
try {
|
||||
FileWriter writer = new FileWriter("data/player.data");
|
||||
writer.write(write);
|
||||
writer.close();
|
||||
readData();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public void readData() {
|
||||
try {
|
||||
BufferedReader reader = new BufferedReader(new FileReader("data/player.data"));
|
||||
String line = "";
|
||||
String[] playerData;
|
||||
while (true) {
|
||||
playerData = new String[3];
|
||||
line = reader.readLine();
|
||||
if (line == null) {
|
||||
break;
|
||||
}
|
||||
playerData = line.split(",");
|
||||
Hashtable<String, String> playerHash = new Hashtable<>();
|
||||
playerHash.put("dead", playerData[1]);
|
||||
playerHash.put("timeLeft", playerData[2]);
|
||||
this.playerData.put(playerData[0], playerHash);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public Hashtable<String, Hashtable<String, String>> getPlayers() {
|
||||
return playerData;
|
||||
}
|
||||
}
|
44
src/net/brysonsteck/Resurrection.java
Normal file
44
src/net/brysonsteck/Resurrection.java
Normal file
|
@ -0,0 +1,44 @@
|
|||
package net.brysonsteck;
|
||||
|
||||
import org.bukkit.event.player.PlayerRespawnEvent;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import java.io.*;
|
||||
import java.nio.Buffer;
|
||||
|
||||
public class Resurrection extends JavaPlugin {
|
||||
public Plugin plugin = getPlugin(Resurrection.class);
|
||||
|
||||
//spigot things
|
||||
@Override
|
||||
public void onDisable() {
|
||||
super.onDisable();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEnable() {
|
||||
super.onEnable();
|
||||
|
||||
}
|
||||
|
||||
// end of spigot things
|
||||
public static void main(String[] args) {
|
||||
// PlayerData playerData = new PlayerData();
|
||||
// playerData.saveData("This is the first line\nthis is the second line");
|
||||
// System.out.println(playerData.getPlayers());
|
||||
// playerData.readData();
|
||||
|
||||
// playerData.saveData("username,false,0");
|
||||
// System.out.println("now adding two more lines");
|
||||
// playerData.saveData(playerData.getPlayers() + "this is the third line\nthis is the fourth line\nthe thread is now sleeping\nonce more\nand again");
|
||||
// System.out.println(playerData.getPlayers());
|
||||
// try {
|
||||
// Thread.sleep(100000);
|
||||
// } catch (InterruptedException e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
}
|
0
src/net/brysonsteck/plugin.yml
Normal file
0
src/net/brysonsteck/plugin.yml
Normal file
Loading…
Add table
Reference in a new issue