From 03d0c694e3d4397c07c56e8d9e1ed178cc3c6706 Mon Sep 17 00:00:00 2001 From: cannabidiol Date: Thu, 21 Jan 2021 02:34:25 -0900 Subject: [PATCH] Reset echest on world change --- .../seppuku/impl/module/world/InfEnderChestModule.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/java/me/rigamortis/seppuku/impl/module/world/InfEnderChestModule.java b/src/main/java/me/rigamortis/seppuku/impl/module/world/InfEnderChestModule.java index 3f1c328..6876b87 100644 --- a/src/main/java/me/rigamortis/seppuku/impl/module/world/InfEnderChestModule.java +++ b/src/main/java/me/rigamortis/seppuku/impl/module/world/InfEnderChestModule.java @@ -2,11 +2,13 @@ package me.rigamortis.seppuku.impl.module.world; import me.rigamortis.seppuku.Seppuku; import me.rigamortis.seppuku.api.event.EventStageable; +import me.rigamortis.seppuku.api.event.client.EventLoad; import me.rigamortis.seppuku.api.event.minecraft.EventDisplayGui; import me.rigamortis.seppuku.api.event.network.EventReceivePacket; import me.rigamortis.seppuku.api.event.network.EventSendPacket; import me.rigamortis.seppuku.api.event.player.EventPlayerUpdate; import me.rigamortis.seppuku.api.event.player.EventRightClickBlock; +import me.rigamortis.seppuku.api.event.world.EventLoadWorld; import me.rigamortis.seppuku.api.module.Module; import net.minecraft.block.Block; import net.minecraft.block.BlockContainer; @@ -51,6 +53,14 @@ public final class InfEnderChestModule extends Module { } } + @Listener + public void loadWorld(EventLoadWorld event) { + if (Minecraft.getMinecraft().world != null) { + Minecraft.getMinecraft().player.connection.sendPacket(new CPacketCloseWindow(Minecraft.getMinecraft().player.inventoryContainer.windowId)); + this.resetBackupEnderChest(); + } + } + @Listener public void onUpdate(EventPlayerUpdate event) { if (event.getStage() != EventStageable.EventStage.PRE)