ConstructionWand/src/main/java/thetadev/constructionwand/basics/CommonEvents.java
2021-08-02 23:48:18 +02:00

18 lines
633 B
Java

package thetadev.constructionwand.basics;
import net.minecraft.world.entity.player.Player;
import net.minecraftforge.event.entity.player.PlayerEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
import thetadev.constructionwand.ConstructionWand;
@Mod.EventBusSubscriber(modid = ConstructionWand.MODID)
public class CommonEvents
{
@SubscribeEvent
public static void logOut(PlayerEvent.PlayerLoggedOutEvent e) {
Player player = e.getPlayer();
if(player.level.isClientSide) return;
ConstructionWand.instance.undoHistory.removePlayer(player);
}
}