-
Notifications
You must be signed in to change notification settings - Fork 168
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🐛 Fixed closed blinds causing visible cullfacing. Closes #447
- Loading branch information
1 parent
74283d7
commit 2a603c3
Showing
3 changed files
with
53 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
src/main/java/com/mrcrayfish/furniture/mixin/client/BlockMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package com.mrcrayfish.furniture.mixin.client; | ||
|
||
import com.mrcrayfish.furniture.block.BlindsBlock; | ||
import net.minecraft.block.Block; | ||
import net.minecraft.block.BlockState; | ||
import net.minecraft.util.Direction; | ||
import net.minecraft.util.math.BlockPos; | ||
import net.minecraft.world.IBlockReader; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; | ||
import org.spongepowered.asm.mixin.injection.callback.LocalCapture; | ||
|
||
/** | ||
* Author: MrCrayfish | ||
*/ | ||
@Mixin(Block.class) | ||
public class BlockMixin | ||
{ | ||
@Inject(method = "shouldSideBeRendered", at = @At(value = "INVOKE_ASSIGN", target = "Lnet/minecraft/util/math/shapes/VoxelShapes;compare(Lnet/minecraft/util/math/shapes/VoxelShape;Lnet/minecraft/util/math/shapes/VoxelShape;Lnet/minecraft/util/math/shapes/IBooleanFunction;)Z"), locals = LocalCapture.CAPTURE_FAILHARD, cancellable = true) | ||
private static void shouldRenderSideWithBlinds(BlockState blockState, IBlockReader blockAccess, BlockPos pos, Direction dir, CallbackInfoReturnable<Boolean> cir, BlockPos offsetPos, BlockState offsetState) | ||
{ | ||
if(offsetState.getBlock() instanceof BlindsBlock) | ||
{ | ||
cir.setReturnValue(true); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"required": true, | ||
"package": "com.mrcrayfish.furniture.mixin", | ||
"compatibilityLevel": "JAVA_8", | ||
"minVersion": "0.8", | ||
"refmap": "cfm.refmap.json", | ||
"client": [ | ||
"client.BlockMixin" | ||
], | ||
"injectors": { | ||
"defaultRequire": 1 | ||
} | ||
} |