-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add xp workaround to dimension change tweak
- Loading branch information
Showing
2 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
...d/acgaming/universaltweaks/bugfixes/entities/dimensionchange/UTDimensionChangeEvents.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package mod.acgaming.universaltweaks.bugfixes.entities.dimensionchange; | ||
|
||
import net.minecraft.entity.player.EntityPlayer; | ||
import net.minecraft.entity.player.EntityPlayerMP; | ||
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; | ||
import mod.acgaming.universaltweaks.config.UTConfigGeneral; | ||
|
||
// Courtesy of MacTso | ||
public class UTDimensionChangeEvents | ||
{ | ||
@SubscribeEvent | ||
public void utDimensionChange(PlayerEvent.PlayerChangedDimensionEvent event) | ||
{ | ||
if (!UTConfigBugfixes.ENTITIES.utDimensionChangeToggle) return; | ||
if (UTConfigGeneral.DEBUG.utDebugToggle) UniversalTweaks.LOGGER.debug("UTDimensionChangeEvents ::: Change dimension"); | ||
EntityPlayer ep = event.player; | ||
if (ep instanceof EntityPlayerMP) | ||
{ | ||
EntityPlayerMP player = (EntityPlayerMP) ep; | ||
player.addExperienceLevel(0); | ||
} | ||
} | ||
} |