Skip to content

Commit

Permalink
Re-implement band-aid fix for XP on dimension change
Browse files Browse the repository at this point in the history
Fix #562
  • Loading branch information
ACGaming committed Oct 12, 2024
1 parent 42d45b1 commit 03d7e52
Showing 1 changed file with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package mod.acgaming.universaltweaks.bugfixes.entities.dimensionchange;

import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.PlayerEvent;

import mod.acgaming.universaltweaks.UniversalTweaks;
import mod.acgaming.universaltweaks.config.UTConfigBugfixes;

// Courtesy of MacTso
@Mod.EventBusSubscriber(modid = UniversalTweaks.MODID)
public class UTDimensionChange
{
@SubscribeEvent
public static void utDimensionChangeXP(PlayerEvent.PlayerChangedDimensionEvent event)
{
if (UTConfigBugfixes.ENTITIES.utDimensionChangeToggle && event.player instanceof EntityPlayerMP)
{
EntityPlayerMP player = (EntityPlayerMP) event.player;
player.addExperienceLevel(0);
}
}
}

0 comments on commit 03d7e52

Please sign in to comment.