-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c314e31
commit 7023162
Showing
241 changed files
with
11,759 additions
and
2,332 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,3 +24,6 @@ test | |
|
||
# Files from Forge MDK | ||
forge*changelog.txt | ||
|
||
# vscode | ||
.vscode |
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
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
38 changes: 38 additions & 0 deletions
38
src/main/java/com/github/tartaricacid/touhoulittlemaid/api/bauble/IChestType.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,38 @@ | ||
package com.github.tartaricacid.touhoulittlemaid.api.bauble; | ||
|
||
import net.minecraft.core.BlockPos; | ||
import net.minecraft.world.entity.player.Player; | ||
import net.minecraft.world.level.BlockGetter; | ||
import net.minecraft.world.level.block.entity.BlockEntity; | ||
|
||
public interface IChestType { | ||
int ALLOW_COUNT = 0; | ||
int DENY_COUNT = Integer.MAX_VALUE; | ||
|
||
/** | ||
* 该传入的 BlockEntity 是不是可识别的箱子 | ||
* | ||
* @param chest 待检测的箱子 | ||
* @return 是否能识别 | ||
*/ | ||
boolean isChest(BlockEntity chest); | ||
|
||
/** | ||
* 用于检测箱子能否被玩家打开,防止标记非法的箱子 | ||
* | ||
* @param chest 需要检查权限的箱子 | ||
* @param player 检查权限的玩家 | ||
* @return 能否打开 | ||
*/ | ||
boolean canOpenByPlayer(BlockEntity chest, Player player); | ||
|
||
/** | ||
* 目前箱子的打开计数,原版用这个方法防止多个玩家同时操作一个箱子 | ||
* | ||
* @param level 世界 | ||
* @param pos 坐标 | ||
* @param chest 箱子 | ||
* @return <=0 代表可以放入,其他情况表示不能放入 | ||
*/ | ||
int getOpenCount(BlockGetter level, BlockPos pos, BlockEntity chest); | ||
} |
Oops, something went wrong.