Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/1.20.1' into 1.20.1
Browse files Browse the repository at this point in the history
  • Loading branch information
DaFuqs committed Oct 19, 2024
2 parents 6626609 + e10ccaa commit 2ae2588
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions src/main/java/de/dafuqs/revelationary/ClientRevelationHolder.java
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,19 @@ static void rebuildAllChunks() {
}

// BLOCKS
private static void cloak(BlockState blockState) {
public static void cloak(BlockState blockState) {
activeBlockStateSwaps.add(blockState);
if (blockState instanceof RevelationAware revelationAware) {
revelationAware.onCloak();
}
}

public static void uncloak(BlockState blockState) {
activeBlockStateSwaps.remove(blockState);
if (blockState instanceof RevelationAware revelationAware) {
revelationAware.onUncloak();
}
}

public static boolean isCloaked(Block block) {
return activeBlockStateSwaps.contains(block.getDefaultState());
Expand All @@ -157,14 +164,26 @@ public static BlockState getCloakTarget(BlockState blockState) {
return blockState;
}
}

public static Set<BlockState> getBlockCloaks() {
return activeBlockStateSwaps;
}


// ITEMS
private static void cloak(Item item) {
public static void cloak(Item item) {
activeItemSwaps.add(item);
if (item instanceof RevelationAware revelationAware) {
revelationAware.onCloak();
}
}

public static void uncloak(Item item) {
activeItemSwaps.remove(item);
if (item instanceof RevelationAware revelationAware) {
revelationAware.onUncloak();
}
}

public static boolean isCloaked(Item item) {
return activeItemSwaps.contains(item);
Expand All @@ -177,6 +196,10 @@ public static Item getCloakTarget(Item item) {
return item;
}
}

public static Set<Item> getItemCloaks() {
return activeItemSwaps;
}

public static void cloakAll() {
activeItemSwaps.clear();
Expand Down

0 comments on commit 2ae2588

Please sign in to comment.