Skip to content

Commit

Permalink
Fix code for 1.18
Browse files Browse the repository at this point in the history
  • Loading branch information
hlysine committed Sep 15, 2024
1 parent e39fc91 commit 7f85361
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ public class BlockStateBaseCacheMixin {
private boolean canCopycatOcclude(BlockState instance,
Operation<Boolean> original) {
try {
if (instance.is(TagKey.create(Registry.BLOCK.key(), Mods.CREATE.rl("copycat_base")))) {
return false;
}
if (instance.is(TagKey.create(Registry.BLOCK.key(), Mods.CREATE.rl("copycat_base")))) {
return false;
}
} catch (IllegalStateException e) {
// todo: illegal access if resource location is accessed before registry is initialized
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import net.minecraft.core.Registry;
import net.minecraft.tags.TagKey;
import net.minecraft.world.level.block.state.BlockBehaviour;
import net.minecraft.world.level.block.state.BlockState;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
Expand All @@ -20,9 +21,9 @@ public class BlockStateBaseMixin {
private void customOcclusion(CallbackInfoReturnable<Boolean> cir) {
BlockState instance = (BlockState) (Object) this;
try {
if (instance.is(TagKey.create(Registry.BLOCK.key(), Mods.CREATE.rl("copycat_base")))) {
cir.setReturnValue(false);
}
if (instance.is(TagKey.create(Registry.BLOCK.key(), Mods.CREATE.rl("copycat_base")))) {
cir.setReturnValue(false);
}
} catch (IllegalStateException e) {
// todo: illegal access if resource location is accessed before registry is initialized
}
Expand Down

0 comments on commit 7f85361

Please sign in to comment.