Skip to content

Commit 0ce0791

Browse files
committed
bug: Fixed display of upside down Cannon Mount and manual Autocannon when solid blocks are above player
1 parent eec6d9e commit 0ce0791

5 files changed

Lines changed: 55 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Changed:
1111
Fixed:
1212
- Fixed NO_DAMAGE munition damage setting not applying to shrapnel (including flak and grapeshot)
1313
- Fixed Create Pulleys and Gantries pushing more blocks than in vanilla Create
14+
- Fixed display of upside down Cannon Mount and manual Autocannon when solid blocks are above player
1415

1516
## [5.11.2] - 2026-02-27
1617

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package rbasamoyai.createbigcannons.forge.mixin.client;
2+
3+
import javax.annotation.Nullable;
4+
5+
import org.apache.commons.lang3.tuple.Pair;
6+
import org.spongepowered.asm.mixin.Mixin;
7+
8+
import com.llamalad7.mixinextras.injector.wrapmethod.WrapMethod;
9+
import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
10+
11+
import net.minecraft.client.renderer.ScreenEffectRenderer;
12+
import net.minecraft.core.BlockPos;
13+
import net.minecraft.world.entity.player.Player;
14+
import net.minecraft.world.level.block.state.BlockState;
15+
import rbasamoyai.createbigcannons.cannon_control.contraption.PitchOrientedContraptionEntity;
16+
17+
@Mixin(ScreenEffectRenderer.class)
18+
public class ScreenEffectRendererMixin {
19+
20+
@WrapMethod(method = "getOverlayBlock")
21+
private static @Nullable Pair<BlockState, BlockPos> createbigcannons$getViewBlockingState(Player player, Operation<Pair<BlockState, BlockPos>> original) {
22+
if (player.getVehicle() instanceof PitchOrientedContraptionEntity poce && poce.getSeatPos(player) != null)
23+
return null;
24+
return original.call(player);
25+
}
26+
27+
}

forge/src/main/resources/createbigcannons.mixins.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"client": [
77
"client.GasMaskModelMixin",
88
"client.GoggleOverlayRendererMixin",
9+
"client.ScreenEffectRendererMixin",
910
"client.ValueSettingsClientMixin"
1011
],
1112
"mixins": [
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package rbasamoyai.createbigcannons.mixin.client;
2+
3+
import javax.annotation.Nullable;
4+
5+
import org.spongepowered.asm.mixin.Mixin;
6+
7+
import com.llamalad7.mixinextras.injector.wrapmethod.WrapMethod;
8+
import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
9+
10+
import net.minecraft.client.renderer.ScreenEffectRenderer;
11+
import net.minecraft.world.entity.player.Player;
12+
import net.minecraft.world.level.block.state.BlockState;
13+
import rbasamoyai.createbigcannons.cannon_control.contraption.PitchOrientedContraptionEntity;
14+
15+
@Mixin(ScreenEffectRenderer.class)
16+
public class ScreenEffectRendererMixin {
17+
18+
@WrapMethod(method = "getViewBlockingState")
19+
private static @Nullable BlockState createbigcannons$getViewBlockingState(Player player, Operation<BlockState> original) {
20+
if (player.getVehicle() instanceof PitchOrientedContraptionEntity poce && poce.getSeatPos(player) != null)
21+
return null;
22+
return original.call(player);
23+
}
24+
25+
}

src/main/resources/createbigcannons-common.mixins.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"client.LightingMixin",
1616
"client.PitchOrientedContraptionEntityMixin",
1717
"client.RPLClientHandlersMixin",
18+
"client.ScreenEffectRendererMixin",
1819
"client.SoundEngineMixin",
1920
"client.ValueSettingsClientMixin"
2021
],

0 commit comments

Comments
 (0)