mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-02 06:28:49 +00:00
Add fabric builds for older MC versions & add checkstyle (#449)
* Remove instance getters, improve command logic, register APi * Publish multiple fabric builds, enforce checkstyle * Bump guava * Bump to 4.4.2
This commit is contained in:
1 parent
51baf196b3
commit
c9f5262292
219 files changed
+8032
-1392
No files matched your search
@@ -39,6 +39,28 @@ public class UnsafeBlocks {
|
||||
@YamlKey("safe_occupation_blocks")
|
||||
public List<String> safeOccupationBlocks;
|
||||
|
||||
/**
|
||||
* Returns if the block, by provided identifier, are unsafe.
|
||||
*
|
||||
* @param blockId The block identifier (e.g. {@code minecraft:stone})
|
||||
* @return {@code true} if the block is on the unsafe blocks list, {@code false} otherwise
|
||||
*/
|
||||
public boolean isUnsafe(@NotNull String blockId) {
|
||||
return unsafeBlocks.contains(this.formatBlockId(blockId));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns if the block, by provided identifier, is unsafe to stand in.
|
||||
*
|
||||
* @param blockId The block identifier (e.g. {@code minecraft:stone})
|
||||
* @return {@code true} if the block is on the unsafe blocks list, {@code false} otherwise
|
||||
*/
|
||||
public boolean isUnsafeToOccupy(@NotNull String blockId) {
|
||||
return !safeOccupationBlocks.contains(this.formatBlockId(blockId));
|
||||
}
|
||||
|
||||
// Format a block ID to be in the format namespace:id
|
||||
@NotNull
|
||||
private String formatBlockId(@NotNull String blockId) {
|
||||
if (!blockId.startsWith(Key.MINECRAFT_NAMESPACE + ":")) {
|
||||
blockId = Key.MINECRAFT_NAMESPACE + ":" + blockId;
|
||||
@@ -46,28 +68,6 @@ public class UnsafeBlocks {
|
||||
return blockId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns if the block, by provided identifier, is unsafe
|
||||
*
|
||||
* @param blockId The block identifier (e.g. {@code minecraft:stone})
|
||||
* @return {@code true} if the block is on the unsafe blocks list, {@code false} otherwise
|
||||
*/
|
||||
public boolean isUnsafe(@NotNull String blockId) {
|
||||
blockId = this.formatBlockId(blockId);
|
||||
return unsafeBlocks.contains(blockId);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns if the block, by provided identifier, is unsafe to stand in
|
||||
*
|
||||
* @param blockId The block identifier (e.g. {@code minecraft:stone})
|
||||
* @return {@code true} if the block is on the unsafe blocks list, {@code false} otherwise
|
||||
*/
|
||||
public boolean isUnsafeToOccupy(@NotNull String blockId) {
|
||||
blockId = this.formatBlockId(blockId);
|
||||
return !safeOccupationBlocks.contains(blockId);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public UnsafeBlocks() {
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user