diff --git a/src/main/java/mod/acgaming/universaltweaks/bugfixes/entities/dimensionchange/UTDimensionChange.java b/src/main/java/mod/acgaming/universaltweaks/bugfixes/entities/dimensionchange/UTDimensionChange.java new file mode 100644 index 00000000..8ad642e8 --- /dev/null +++ b/src/main/java/mod/acgaming/universaltweaks/bugfixes/entities/dimensionchange/UTDimensionChange.java @@ -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); + } + } +}