Skip to content

Commit

Permalink
Fix issue #6
Browse files Browse the repository at this point in the history
bomp spigot version in build file
  • Loading branch information
xsmeths committed Nov 21, 2023
1 parent 02cf5a4 commit 722c103
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 5 deletions.
1 change: 0 additions & 1 deletion .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions .idea/jarRepositories.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.19.4-R0.1-SNAPSHOT</version>
<version>1.20.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public MedicalHandler(final Player p, CustomItem item) {
}
HealingPlayers.put(p, new BukkitRunnable() {
final Location position = p.getLocation();
boolean cancelled = false;
final int total = 60;
int progress = 0;
final int duration = 20 * item.getRegen_time();
Expand All @@ -39,14 +40,20 @@ public void cancel() {
super.cancel();
}
public void run() {
boolean cancelled = p.getLocation().distance(position) > 0.75D;
if (position.getWorld() != p.getWorld() || p.getLocation().distance(position) > 0.75D) {
cancelled = true;
}
if ((progress > total) || (cancelled)) {
if (cancelled) {
if (item.isDropifnotused()) {
p.getWorld().dropItem(p.getLocation(), item.getItem());
}
if (!item.isDropifnotused()) {
p.getInventory().addItem(item.getItem());
if (p.getInventory().firstEmpty() == -1) {
p.getWorld().dropItem(p.getLocation(), item.getItem());
} else {
p.getInventory().addItem(item.getItem());
}
}
}
MedicalHandler.HealingPlayers.remove(p);
Expand Down

0 comments on commit 722c103

Please sign in to comment.