Skip to content

Commit

Permalink
Merge branch 'refs/heads/multiloader' into 1.19.2/multiloader
Browse files Browse the repository at this point in the history
  • Loading branch information
hlysine committed Sep 15, 2024
2 parents 135a98f + aa880c5 commit b49fcd0
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 9 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## 2.1.4 - 2024-09-15

### Fixed

- Fixed an incompatibility with Immersive Engineering due to block states being initialized before the block registry

## 2.1.3 - 2024-09-15

## Changed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,12 @@ public class BlockStateBaseCacheMixin {
)
private boolean canCopycatOcclude(BlockState instance,
Operation<Boolean> original) {
if (instance.getBlockHolder().is(Mods.CREATE.rl("copycat_base"))) {
return false;
try {
if (instance.getBlockHolder().is(Mods.CREATE.rl("copycat_base"))) {
return false;
}
} catch (IllegalStateException e) {
// todo: illegal access if resource location is accessed before registry is initialized
}
if (instance.getBlock() instanceof BracketBlock) {
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import com.copycatsplus.copycats.compat.Mods;
import com.simibubi.create.content.decoration.bracket.BracketBlock;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.BlockBehaviour;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
Expand All @@ -16,9 +16,13 @@ public class BlockStateBaseMixin {
cancellable = true
)
private void customOcclusion(CallbackInfoReturnable<Boolean> cir) {
BlockState instance = (BlockState) (Object) this;
if (instance.getBlockHolder().is(Mods.CREATE.rl("copycat_base"))) {
cir.setReturnValue(false);
BlockBehaviour.BlockStateBase instance = (BlockBehaviour.BlockStateBase) (Object) this;
try {
if (instance.getBlockHolder().is(Mods.CREATE.rl("copycat_base"))) {
cir.setReturnValue(false);
}
} catch (IllegalStateException e) {
// todo: illegal access if resource location is accessed before registry is initialized
}
if (instance.getBlock() instanceof BracketBlock) {
cir.setReturnValue(false);
Expand Down
6 changes: 3 additions & 3 deletions update.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"homepage": "https://github.com/copycats-plus/copycats/",
"promos": {
"1.20.1-recommended": "1.20.1-2.1.3",
"1.19.2-recommended": "1.19.2-2.1.3",
"1.18.2-recommended": "1.18.2-2.1.3"
"1.20.1-recommended": "1.20.1-2.1.4",
"1.19.2-recommended": "1.19.2-2.1.4",
"1.18.2-recommended": "1.18.2-2.1.4"
}
}

0 comments on commit b49fcd0

Please sign in to comment.