Reset echest on world change
This commit is contained in:
parent
6b670b8c88
commit
03d0c694e3
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue