diff --git a/.gitignore b/.gitignore
index 59f6603..e9bf2c5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,114 +1,4 @@
# User-specific stuff
-!*/.idea/libraries/spigot.xml
-
-#*.iml
-*.ipr
-*.iws
-
-# IntelliJ
+.idea/
out/
-
-# Compiled class file
-*.class
-
-# Log file
-*.log
-
-# BlueJ files
-*.ctxt
-
-# Package Files #
-*.jar
-*.war
-*.nar
-*.ear
-*.zip
-*.tar.gz
-*.rar
-
-# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
-hs_err_pid*
-
-*~
-
-# temporary files which can be created if a process still has a handle open of a deleted file
-.fuse_hidden*
-
-# KDE directory preferences
-.directory
-
-# Linux trash folder which might appear on any partition or disk
-.Trash-*
-
-# .nfs files are created when an open file is removed but is still being accessed
-.nfs*
-
-# General
-.DS_Store
-.AppleDouble
-.LSOverride
-
-# Icon must end with two \r
-Icon
-
-# Thumbnails
-._*
-
-# Files that might appear in the root of a volume
-.DocumentRevisions-V100
-.fseventsd
-.Spotlight-V100
-.TemporaryItems
-.Trashes
-.VolumeIcon.icns
-.com.apple.timemachine.donotpresent
-
-# Directories potentially created on remote AFP share
-.AppleDB
-.AppleDesktop
-Network Trash Folder
-Temporary Items
-.apdisk
-
-# Windows thumbnail cache files
-Thumbs.db
-Thumbs.db:encryptable
-ehthumbs.db
-ehthumbs_vista.db
-
-# Dump file
-*.stackdump
-
-# Folder config file
-[Dd]esktop.ini
-
-# Recycle Bin used on file shares
-$RECYCLE.BIN/
-
-# Windows Installer files
-*.cab
-*.msi
-*.msix
-*.msm
-*.msp
-
-# Windows shortcuts
-*.lnk
-
-target/
-server/
-
-pom.xml.tag
-pom.xml.releaseBackup
-pom.xml.versionsBackup
-pom.xml.next
-
-release.properties
-dependency-reduced-pom.xml
-buildNumber.properties
-.mvn/timing.properties
-.mvn/wrapper/maven-wrapper.jar
-.flattened-pom.xml
-
-# Common working directory
-run/
\ No newline at end of file
+target/
\ No newline at end of file
diff --git a/.idea/artifacts/Sharehealth.xml b/.idea/artifacts/Sharehealth.xml
deleted file mode 100644
index ad3ff49..0000000
--- a/.idea/artifacts/Sharehealth.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
- $PROJECT_DIR$/target/
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml
index 861936a..c22d104 100644
--- a/.idea/jarRepositories.xml
+++ b/.idea/jarRepositories.xml
@@ -21,6 +21,11 @@
+
+
+
+
+
diff --git a/.idea/libraries/spigot.xml b/.idea/libraries/spigot.xml
deleted file mode 100644
index 136beaf..0000000
--- a/.idea/libraries/spigot.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
index e9daee1..0caf762 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -12,7 +12,7 @@
-
+
\ No newline at end of file
diff --git a/Sharehealth.iml b/Sharehealth.iml
index 4e5b39a..ef75da4 100644
--- a/Sharehealth.iml
+++ b/Sharehealth.iml
@@ -4,7 +4,8 @@
- SPIGOT
+ PAPER
+ ADVENTURE
@@ -14,11 +15,41 @@
-
+
+
+
+
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..16fcb83
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,76 @@
+
+
+ 4.0.0
+
+ com.benjocraeft
+ sharehealth
+ 1.0
+ jar
+
+ Sharehealth
+
+ This plugin makes all players on the server share their health, if one dies, everybody dies.
+
+
+ 1.8
+ UTF-8
+
+ https://mc.benjocraeft.com
+
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ 3.8.1
+
+
+ ${java.version}
+
+
+
+ org.apache.maven.plugins
+ maven-shade-plugin
+ 3.2.4
+
+
+ package
+
+ shade
+
+
+ false
+
+
+
+
+
+
+
+ src/main/resources
+ true
+
+
+
+
+
+
+ papermc-repo
+ https://papermc.io/repo/repository/maven-public/
+
+
+ sonatype
+ https://oss.sonatype.org/content/groups/public/
+
+
+
+
+
+ io.papermc.paper
+ paper-api
+ 1.18.1-R0.1-SNAPSHOT
+ provided
+
+
+
diff --git a/scripts/deploy.sh b/scripts/deploy.sh
index 948b8a6..7b0b9ff 100644
--- a/scripts/deploy.sh
+++ b/scripts/deploy.sh
@@ -1 +1 @@
-cp target/Sharehealth.jar server/plugins/
+cp target/sharehealth-1.0.jar server/plugins/
diff --git a/scripts/start_server.sh b/scripts/start_server.sh
index 9711431..9818b48 100644
--- a/scripts/start_server.sh
+++ b/scripts/start_server.sh
@@ -1,2 +1,2 @@
cd server || exit
-java -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005 -jar spigot.jar nogui
\ No newline at end of file
+java -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005 -jar paper.jar nogui
\ No newline at end of file
diff --git a/src/main/java/com/benjocraeft/sharehealth/Messenger.java b/src/main/java/com/benjocraeft/sharehealth/Messenger.java
index 49f7f0b..8de7030 100644
--- a/src/main/java/com/benjocraeft/sharehealth/Messenger.java
+++ b/src/main/java/com/benjocraeft/sharehealth/Messenger.java
@@ -4,7 +4,7 @@ import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.block.Block;
import org.bukkit.command.CommandSender;
-import org.bukkit.craftbukkit.v1_17_R1.projectiles.CraftBlockProjectileSource;
+import org.bukkit.projectiles.BlockProjectileSource;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.entity.Projectile;
@@ -21,7 +21,7 @@ import java.util.logging.Logger;
public class Messenger {
- private Logger logger;
+ private final Logger logger;
Messenger(Logger logger){
this.logger = logger;
@@ -74,8 +74,8 @@ public class Messenger {
Entity shooterEntity = (Entity) source;
name = shooterEntity.getName();
}
- if (source instanceof CraftBlockProjectileSource){
- CraftBlockProjectileSource shooterBlock = (CraftBlockProjectileSource) source;
+ if (source instanceof BlockProjectileSource){
+ BlockProjectileSource shooterBlock = (BlockProjectileSource) source;
return damageMessage(player, damage, shooterBlock.getBlock());
}
}
diff --git a/src/main/java/com/benjocraeft/sharehealth/Sharehealth.java b/src/main/java/com/benjocraeft/sharehealth/Sharehealth.java
index 71d0fe2..f714971 100644
--- a/src/main/java/com/benjocraeft/sharehealth/Sharehealth.java
+++ b/src/main/java/com/benjocraeft/sharehealth/Sharehealth.java
@@ -105,7 +105,7 @@ public class Sharehealth extends JavaPlugin {
healthManager.updatePlayer(player);
}
-
+
void onPlayerGotDamage(Player player, double damage, DamageCause cause, boolean allowed, double absorbedDamage){
if (isFailed)
return;
@@ -239,3 +239,4 @@ public class Sharehealth extends JavaPlugin {
}
}
+
diff --git a/plugin.yml b/src/main/resources/plugin.yml
similarity index 80%
rename from plugin.yml
rename to src/main/resources/plugin.yml
index 62b96fa..8f1cf54 100644
--- a/plugin.yml
+++ b/src/main/resources/plugin.yml
@@ -1,7 +1,8 @@
name: Sharehealth
-version: 1.0
+version: '${project.version}'
main: com.benjocraeft.sharehealth.Sharehealth
-api-version: 1.17
+api-version: 1.18
+prefix: Sharehealth
authors: [ BenjoCraeft ]
description: This plugin makes all players on the server share their health, if one dies, everybody dies.
website: https://mc.benjocraeft.com
@@ -9,4 +10,4 @@ website: https://mc.benjocraeft.com
commands:
sharehealth:
aliases: [sh]
- description: Commands to control the Sharehealth System added by the Plugin
\ No newline at end of file
+ description: Commands to control the Sharehealth System added by the Plugin