Skip to content

Commit e10ccaa

Browse files
authored
Merge pull request #24 from f-raZ0R/patch-1
Make ClientRevelationHolder more accessible
2 parents 2f700ad + 4d2fbd4 commit e10ccaa

File tree

1 file changed

+25
-2
lines changed

1 file changed

+25
-2
lines changed

src/main/java/de/dafuqs/revelationary/ClientRevelationHolder.java

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,12 +135,19 @@ static void rebuildAllChunks() {
135135
}
136136

137137
// BLOCKS
138-
private static void cloak(BlockState blockState) {
138+
public static void cloak(BlockState blockState) {
139139
activeBlockStateSwaps.add(blockState);
140140
if (blockState instanceof RevelationAware revelationAware) {
141141
revelationAware.onCloak();
142142
}
143143
}
144+
145+
public static void uncloak(BlockState blockState) {
146+
activeBlockStateSwaps.remove(blockState);
147+
if (blockState instanceof RevelationAware revelationAware) {
148+
revelationAware.onUncloak();
149+
}
150+
}
144151

145152
public static boolean isCloaked(Block block) {
146153
return activeBlockStateSwaps.contains(block.getDefaultState());
@@ -157,14 +164,26 @@ public static BlockState getCloakTarget(BlockState blockState) {
157164
return blockState;
158165
}
159166
}
167+
168+
public static Set<BlockState> getBlockCloaks() {
169+
return activeBlockStateSwaps;
170+
}
171+
160172

161173
// ITEMS
162-
private static void cloak(Item item) {
174+
public static void cloak(Item item) {
163175
activeItemSwaps.add(item);
164176
if (item instanceof RevelationAware revelationAware) {
165177
revelationAware.onCloak();
166178
}
167179
}
180+
181+
public static void uncloak(Item item) {
182+
activeItemSwaps.remove(item);
183+
if (item instanceof RevelationAware revelationAware) {
184+
revelationAware.onUncloak();
185+
}
186+
}
168187

169188
public static boolean isCloaked(Item item) {
170189
return activeItemSwaps.contains(item);
@@ -177,6 +196,10 @@ public static Item getCloakTarget(Item item) {
177196
return item;
178197
}
179198
}
199+
200+
public static Set<Item> getItemCloaks() {
201+
return activeItemSwaps;
202+
}
180203

181204
public static void cloakAll() {
182205
activeItemSwaps.clear();

0 commit comments

Comments
 (0)