mirror of
https://github.com/ChestShop-authors/ChestShop-3.git
synced 2025-02-04 12:31:19 +01:00
Added a fix for inventory not closing on /tp
This commit is contained in:
parent
a8e8078348
commit
8d7389b7e0
@ -26,6 +26,7 @@ import com.Acrobot.ChestShop.Listeners.PreTransaction.*;
|
|||||||
import com.Acrobot.ChestShop.Listeners.PreTransaction.ErrorMessageSender;
|
import com.Acrobot.ChestShop.Listeners.PreTransaction.ErrorMessageSender;
|
||||||
import com.Acrobot.ChestShop.Listeners.PreTransaction.PermissionChecker;
|
import com.Acrobot.ChestShop.Listeners.PreTransaction.PermissionChecker;
|
||||||
import com.Acrobot.ChestShop.Listeners.ShopRefundListener;
|
import com.Acrobot.ChestShop.Listeners.ShopRefundListener;
|
||||||
|
import com.Acrobot.ChestShop.Listeners.TeleportFixListener;
|
||||||
import com.Acrobot.ChestShop.Logging.FileFormatter;
|
import com.Acrobot.ChestShop.Logging.FileFormatter;
|
||||||
import com.Acrobot.ChestShop.Metadata.ItemDatabase;
|
import com.Acrobot.ChestShop.Metadata.ItemDatabase;
|
||||||
import com.Acrobot.ChestShop.Signs.RestrictedSign;
|
import com.Acrobot.ChestShop.Signs.RestrictedSign;
|
||||||
@ -180,6 +181,7 @@ public class ChestShop extends JavaPlugin {
|
|||||||
registerEvent(new ShopRefundListener());
|
registerEvent(new ShopRefundListener());
|
||||||
|
|
||||||
registerEvent(new ShortNameSaver());
|
registerEvent(new ShortNameSaver());
|
||||||
|
registerEvent(new TeleportFixListener());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void registerPreShopCreationEvents() {
|
private void registerPreShopCreationEvents() {
|
||||||
|
@ -1,7 +1,21 @@
|
|||||||
package com.Acrobot.ChestShop.Listeners;
|
package com.Acrobot.ChestShop.Listeners;
|
||||||
|
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.EventPriority;
|
||||||
|
import org.bukkit.event.Listener;
|
||||||
|
import org.bukkit.event.player.PlayerTeleportEvent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Acrobot
|
* @author Acrobot
|
||||||
*/
|
*/
|
||||||
public class TeleportFixListener {
|
public class TeleportFixListener implements Listener {
|
||||||
|
|
||||||
|
@EventHandler(priority = EventPriority.MONITOR)
|
||||||
|
public static void onTeleport(PlayerTeleportEvent event) {
|
||||||
|
if (event.isCancelled()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
event.getPlayer().closeInventory();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user