-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make Myths & Legends spawning bypass spawn protection
- Loading branch information
1 parent
6b40636
commit c69ae69
Showing
3 changed files
with
63 additions
and
9 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
30 changes: 30 additions & 0 deletions
30
common/src/main/java/abeshutt/staracademy/mixin/mythsandlegends/MixinForceSpawningUtils.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,30 @@ | ||
package abeshutt.staracademy.mixin.mythsandlegends; | ||
|
||
import abeshutt.staracademy.StarAcademyMod; | ||
import com.github.d0ctorleon.mythsandlegends.utils.ForceSpawningUtils; | ||
import net.minecraft.entity.player.PlayerEntity; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.util.Hand; | ||
import net.minecraft.util.TypedActionResult; | ||
import net.minecraft.world.World; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; | ||
|
||
@Mixin(ForceSpawningUtils.class) | ||
public class MixinForceSpawningUtils { | ||
|
||
@Inject(method = "forceSpawnv1", at = @At("HEAD")) | ||
private static void forceSpawnv1Head(World world, PlayerEntity playerEntity, Hand hand, String keyItemIdentifierPath, | ||
CallbackInfoReturnable<TypedActionResult<ItemStack>> cir) { | ||
StarAcademyMod.FORCE_SPAWNING.set(true); | ||
} | ||
|
||
@Inject(method = "forceSpawnv1", at = @At("RETURN")) | ||
private static void forceSpawnv1Return(World world, PlayerEntity playerEntity, Hand hand, String keyItemIdentifierPath, | ||
CallbackInfoReturnable<TypedActionResult<ItemStack>> cir) { | ||
StarAcademyMod.FORCE_SPAWNING.set(false); | ||
} | ||
|
||
} |
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