-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for CraftTweaker again.
- Loading branch information
Showing
7 changed files
with
712 additions
and
0 deletions.
There are no files selected for viewing
58 changes: 58 additions & 0 deletions
58
src/main/java/net/darkhax/gamestages/addons/crt/ExpandPlayer.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,58 @@ | ||
package net.darkhax.gamestages.addons.crt; | ||
|
||
import com.blamejared.crafttweaker.api.annotation.ZenRegister; | ||
import net.minecraft.server.level.ServerPlayer; | ||
import net.minecraft.world.entity.player.Player; | ||
import org.openzen.zencode.java.ZenCodeType; | ||
|
||
import net.darkhax.gamestages.GameStageHelper; | ||
|
||
@ZenRegister | ||
@ZenCodeType.Expansion("crafttweaker.api.entity.type.player.Player") | ||
public class ExpandPlayer { | ||
|
||
@ZenCodeType.Method | ||
public static void addGameStage (Player player, String stage) { | ||
|
||
if (player instanceof ServerPlayer) { | ||
|
||
GameStageHelper.addStage((ServerPlayer) player, stage); | ||
} | ||
} | ||
|
||
@ZenCodeType.Method | ||
public static void removeGameStage (Player player, String stage) { | ||
|
||
if (player instanceof ServerPlayer) { | ||
|
||
GameStageHelper.removeStage((ServerPlayer) player, stage); | ||
} | ||
} | ||
|
||
@ZenCodeType.Method | ||
public static void clearGameStages (Player player) { | ||
|
||
if (player instanceof ServerPlayer) { | ||
|
||
GameStageHelper.clearStages((ServerPlayer) player); | ||
} | ||
} | ||
|
||
@ZenCodeType.Method | ||
public static boolean hasGameStage (Player player, String stage) { | ||
|
||
return GameStageHelper.hasStage(player, stage); | ||
} | ||
|
||
@ZenCodeType.Method | ||
public static boolean hasAnyGameStages (Player player, String... stage) { | ||
|
||
return GameStageHelper.hasAnyOf(player, stage); | ||
} | ||
|
||
@ZenCodeType.Method | ||
public static boolean hasAllGameStages (Player player, String... stage) { | ||
|
||
return GameStageHelper.hasAllOf(player, stage); | ||
} | ||
} |
Oops, something went wrong.