-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement Disable Sleeping Setting Spawn tweak
Closes #578
- Loading branch information
Showing
5 changed files
with
36 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
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
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
22 changes: 22 additions & 0 deletions
22
...ain/java/mod/acgaming/universaltweaks/tweaks/entities/sleeping/mixin/UTSleepingMixin.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,22 @@ | ||
package mod.acgaming.universaltweaks.tweaks.entities.sleeping.mixin; | ||
|
||
import net.minecraft.entity.player.EntityPlayer; | ||
import net.minecraft.util.math.BlockPos; | ||
|
||
import com.llamalad7.mixinextras.injector.v2.WrapWithCondition; | ||
import mod.acgaming.universaltweaks.UniversalTweaks; | ||
import mod.acgaming.universaltweaks.config.UTConfigGeneral; | ||
import mod.acgaming.universaltweaks.config.UTConfigTweaks; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
|
||
@Mixin(EntityPlayer.class) | ||
public class UTSleepingMixin | ||
{ | ||
@WrapWithCondition(method = "wakeUpPlayer", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/player/EntityPlayer;setSpawnPoint(Lnet/minecraft/util/math/BlockPos;Z)V")) | ||
public boolean utSleepingSpawn(EntityPlayer player, BlockPos pos, boolean forced) | ||
{ | ||
if (UTConfigGeneral.DEBUG.utDebugToggle) UniversalTweaks.LOGGER.debug("UTSleepingSpawn ::: Sleeping set spawn point"); | ||
return !UTConfigTweaks.ENTITIES.SLEEPING.utDisableSettingSpawnToggle; | ||
} | ||
} |
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,7 @@ | ||
{ | ||
"package": "mod.acgaming.universaltweaks.tweaks.entities.sleeping.mixin", | ||
"refmap": "universaltweaks.refmap.json", | ||
"minVersion": "0.8", | ||
"compatibilityLevel": "JAVA_8", | ||
"mixins": ["UTSleepingMixin"] | ||
} |