Skip to content

Commit ec70b22

Browse files
committed
version 1.5 - also switch to Paper
This is the last CB/spigot-compatible update. Paper has made the death event cancelable, so this plugin will use that instead of trying it's best with the damage event and avoid the hassle of faking the deathEvent.
1 parent 4fc6572 commit ec70b22

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>to.us.tf</groupId>
88
<artifactId>DeathSpectating</artifactId>
9-
<version>1.4.2</version>
9+
<version>1.5</version>
1010
<properties>
1111
<maven.compiler.source>1.8</maven.compiler.source>
1212
<maven.compiler.target>1.8</maven.compiler.target>
@@ -33,7 +33,7 @@
3333
<dependency>
3434
<groupId>com.destroystokyo.paper</groupId>
3535
<artifactId>paper-api</artifactId>
36-
<version>1.12-R0.1-SNAPSHOT</version>
36+
<version>1.13.1-R0.1-SNAPSHOT</version>
3737
<type>jar</type>
3838
<scope>provided</scope>
3939
</dependency>

src/main/java/to/us/tf/DeathSpectating/DeathSpectating.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package to.us.tf.DeathSpectating;
22

33
import org.bukkit.GameMode;
4+
import org.bukkit.GameRule;
45
import org.bukkit.Location;
56
import org.bukkit.Material;
67
import org.bukkit.Particle;
@@ -28,7 +29,6 @@
2829
import to.us.tf.DeathSpectating.listeners.MiscListeners;
2930
import to.us.tf.DeathSpectating.tasks.SpectateTask;
3031

31-
import javax.annotation.Nullable;
3232
import java.util.ArrayList;
3333
import java.util.HashSet;
3434
import java.util.List;
@@ -159,8 +159,8 @@ public boolean startDeathSpectating(Player player)
159159

160160
try
161161
{
162-
boolean keepInventory = Boolean.valueOf(player.getWorld().getGameRuleValue("keepInventory")) || player.getGameMode() == GameMode.SPECTATOR;
163-
boolean showDeathMessages = Boolean.valueOf(player.getWorld().getGameRuleValue("showDeathMessages"));
162+
boolean keepInventory = player.getWorld().getGameRuleValue(GameRule.KEEP_INVENTORY) || player.getGameMode() == GameMode.SPECTATOR;
163+
boolean showDeathMessages = player.getWorld().getGameRuleValue(GameRule.SHOW_DEATH_MESSAGES);
164164

165165
/*Set spectating attributes*/
166166
//Player#isDead() == true when PlayerDeathEvent is fired.

src/main/java/to/us/tf/DeathSpectating/listeners/DamageListener.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ void onPlayerBasicallyWouldBeDead(EntityDamageEvent event)
4242

4343
//Ignore if player is holding a totem of undying
4444
PlayerInventory inventory = player.getInventory();
45-
if (inventory.getItemInMainHand().getType() == Material.TOTEM || inventory.getItemInOffHand().getType() == Material.TOTEM)
45+
if (inventory.getItemInMainHand().getType() == Material.TOTEM_OF_UNDYING || inventory.getItemInOffHand().getType() == Material.TOTEM_OF_UNDYING)
4646
return;
4747

4848
//Ignore if this is probably the result of the Essentials suicide command

src/main/resources/plugin.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ version: ${project.version}
44
main: to.us.tf.DeathSpectating.DeathSpectating
55
website: https://github.com/MLG-Fortress/DeathSpectating/
66
softdepend: [Multiverse-Core, MultiWorld]
7+
api-version: 1.13
78
permissions:
89
deathspectating.*:
910
description: Grants ALL THE THINGS

0 commit comments

Comments
 (0)