fix (!) blockstates not working properly

This commit is contained in:
Oth3r 2024-08-06 15:28:40 -05:00
commit f4ac860799

View file

@ -56,8 +56,11 @@ public class CustomBlock {
// now check if the state is one of the acceptable states // now check if the state is one of the acceptable states
for (String state : blockStates) { for (String state : blockStates) {
// if there is a NOT (!) blockstate, and it is contained in the block, return false // if there is a NOT (!) blockstate
if (state.startsWith("!") && blockState.toString().contains(state.substring(1))) return false; if (state.startsWith("!")) {
// if it is contained in the block, return false
if (blockState.toString().contains(state.substring(1))) return false;
}
// else check if the blockstate matches, if not return false // else check if the blockstate matches, if not return false
else if (!blockState.toString().contains(state)) return false; else if (!blockState.toString().contains(state)) return false;
} }