Reset echest on world change

This commit is contained in:
cannabidiol 2021-01-21 02:34:25 -09:00
parent 6b670b8c88
commit 03d0c694e3
1 changed files with 10 additions and 0 deletions

View File

@ -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)