Skip to content

Commit

Permalink
fix: made unable to trade if other is trading and bump v1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
LazyGon committed Nov 3, 2022
1 parent a066dfe commit 421c73d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ plugins {
}

group = "net.okocraft.boxtradestick"
version = "1.1"
version = "1.2"

repositories {
mavenCentral()
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/net/okocraft/boxtradestick/PlayerListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import org.bukkit.event.inventory.InventoryCloseEvent;
import org.bukkit.event.player.PlayerInteractEntityEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.inventory.EquipmentSlot;

public class PlayerListener implements Listener {

Expand Down Expand Up @@ -54,7 +55,9 @@ public void onPlayerAttackVillager(EntityDamageByEntityEvent event) {
}
onEntityDamageByEntityEvent = false;

NMSUtil.startTrading(villager, player);
if (!NMSUtil.simulateMobInteract(player, villager, EquipmentSlot.HAND)) {
return;
}

MerchantRecipesGUI gui = new MerchantRecipesGUI(player, villager);
int selectedOfferIndex = gui.getCurrentSelected();
Expand Down

0 comments on commit 421c73d

Please sign in to comment.