2.0.1 release

This commit is contained in:
mfnalex 2021-05-28 18:27:35 +02:00
parent bb813d746b
commit a778b0bbde
3 changed files with 10 additions and 3 deletions

View File

@ -1,3 +1,6 @@
## 2.0.1
- Fixed tridents getting lost on return when throwing many of them from the offhand while having "return-to-offhand" set to "true"
## 2.0.0
- Renamed plugin to "BetterTridents"
- Added new mechanics and config options:

View File

@ -6,7 +6,7 @@
<groupId>de.jeff_media</groupId>
<name>BetterTridents</name>
<artifactId>BetterTridents</artifactId>
<version>2.0.0</version>
<version>2.0.1</version>
<properties>
<spigot.prefix>${project.name}</spigot.prefix>

View File

@ -1,5 +1,6 @@
package de.jeff_media.bettertridents.tasks;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.scheduler.BukkitRunnable;
@ -17,8 +18,11 @@ public class MoveToOffhand extends BukkitRunnable {
public void run() {
for (ItemStack item : player.getInventory()) {
if (item != null && item.equals(tridentItem)) {
player.getInventory().remove(item);
player.getInventory().setItemInOffHand(item.clone());
ItemStack offhand = player.getInventory().getItemInOffHand();
if(offhand == null || offhand.getType() == Material.AIR) {
player.getInventory().remove(item);
player.getInventory().setItemInOffHand(item.clone());
}
break;
}
}