Skip to content

Commit cdd6392

Browse files
committed
Fixes
1 parent 5fef012 commit cdd6392

File tree

8 files changed

+27
-25
lines changed

8 files changed

+27
-25
lines changed

common/src/main/java/ca/fxco/moreculling/mixin/BakedQuad_cacheMixin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public class BakedQuad_cacheMixin implements QuadOpacity {
1414

1515
@Shadow
1616
@Final
17-
protected TextureAtlasSprite sprite;
17+
private TextureAtlasSprite sprite;
1818

1919
@Unique
2020
private Boolean moreculling$hasTranslucency;

common/src/main/java/ca/fxco/moreculling/mixin/MapItemSavedData_cacheMixin.java

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,23 @@
44
import com.llamalad7.mixinextras.sugar.Local;
55
import net.minecraft.core.HolderLookup;
66
import net.minecraft.nbt.CompoundTag;
7+
import net.minecraft.resources.ResourceKey;
78
import net.minecraft.world.level.saveddata.maps.MapItemSavedData;
89
import org.spongepowered.asm.mixin.Mixin;
10+
import org.spongepowered.asm.mixin.Shadow;
911
import org.spongepowered.asm.mixin.Unique;
1012
import org.spongepowered.asm.mixin.injection.At;
1113
import org.spongepowered.asm.mixin.injection.Inject;
1214
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
1315
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
1416

17+
import java.nio.ByteBuffer;
18+
import java.util.List;
19+
1520
@Mixin(MapItemSavedData.class)
1621
public class MapItemSavedData_cacheMixin implements MapOpacity {
1722

23+
@Shadow public byte[] colors;
1824
@Unique
1925
private boolean moreculling$hasTransparency = false;
2026

@@ -35,19 +41,20 @@ public class MapItemSavedData_cacheMixin implements MapOpacity {
3541
}
3642

3743
@Inject(
38-
method = "load",
44+
method = "<init>(Lnet/minecraft/resources/ResourceKey;IIBLjava/nio/ByteBuffer;ZZZLjava/util/List;Ljava/util/List;)V",
3945
at = @At(
4046
value = "FIELD",
4147
target = "Lnet/minecraft/world/level/saveddata/maps/MapItemSavedData;colors:[B",
4248
opcode = 181, // Opcodes.PUTFIELD
4349
shift = At.Shift.AFTER
4450
)
4551
)
46-
private static void moreculling$onLoad(CompoundTag tag, HolderLookup.Provider provider,
47-
CallbackInfoReturnable<MapItemSavedData> cir, @Local MapItemSavedData map) {
48-
for (byte b : map.colors) {
52+
private void moreculling$onLoad(ResourceKey p_401030_, int p_401084_, int p_401048_, byte p_401197_,
53+
ByteBuffer p_401348_, boolean p_401353_, boolean p_401003_, boolean p_401306_,
54+
List p_401007_, List p_401318_, CallbackInfo ci) {
55+
for (byte b : colors) {
4956
if (b == 0) {
50-
((MapItemSavedData_cacheMixin)(Object)map).moreculling$hasTransparency = true;
57+
moreculling$hasTransparency = true;
5158
return;
5259
}
5360
}

common/src/main/java/ca/fxco/moreculling/mixin/blockentity/BeaconRenderer_frustumMixin.java

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,31 +9,32 @@
99
import net.minecraft.client.renderer.MultiBufferSource;
1010
import net.minecraft.client.renderer.blockentity.BeaconRenderer;
1111
import net.minecraft.core.BlockPos;
12+
import net.minecraft.world.level.block.entity.BeaconBeamOwner;
1213
import net.minecraft.world.level.block.entity.BeaconBlockEntity;
14+
import net.minecraft.world.level.block.entity.BlockEntity;
1315
import net.minecraft.world.phys.AABB;
1416
import org.spongepowered.asm.mixin.Mixin;
1517
import org.spongepowered.asm.mixin.injection.At;
1618

1719
@Mixin(BeaconRenderer.class)
18-
public class BeaconRenderer_frustumMixin {
20+
public class BeaconRenderer_frustumMixin<T extends BlockEntity & BeaconBeamOwner> {
1921

2022
@WrapWithCondition(
21-
method = "render(Lnet/minecraft/world/level/block/entity/BeaconBlockEntity;" +
22-
"FLcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/MultiBufferSource;II)V",
23+
method = "render",
2324
at = @At(
2425
value = "INVOKE",
2526
target = "Lnet/minecraft/client/renderer/blockentity/BeaconRenderer;" +
2627
"renderBeaconBeam(Lcom/mojang/blaze3d/vertex/PoseStack;" +
27-
"Lnet/minecraft/client/renderer/MultiBufferSource;FJIII)V"
28+
"Lnet/minecraft/client/renderer/MultiBufferSource;FFJIII)V"
2829
)
2930
)
30-
private boolean moreculling$onRenderBeam(PoseStack poseStack, MultiBufferSource multiBufferSource,
31-
float tickDelta, long worldTime, int yOffset, int maxY, int color,
32-
BeaconBlockEntity beaconBlockEntity) {
31+
private boolean moreculling$onRenderBeam(PoseStack p_112185_, MultiBufferSource p_112186_,
32+
float i, float tickDelta, long worldTime, int yOffset,
33+
int maxY, int color, T blockEntity) {
3334
if (!MoreCulling.CONFIG.beaconBeamCulling) {
3435
return true;
3536
}
36-
BlockPos pos = beaconBlockEntity.getBlockPos();
37+
BlockPos pos = blockEntity.getBlockPos();
3738
LevelRenderer renderer = Minecraft.getInstance().levelRenderer;
3839
return renderer == null || ((LevelRendererAccessor) renderer).getFrustum().isVisible(new AABB(
3940
pos.getX() - 1, pos.getY() + yOffset - 1, pos.getZ() - 1,

common/src/main/java/ca/fxco/moreculling/mixin/blockentity/TheEndGatewayRenderer_beamMixin.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ public class TheEndGatewayRenderer_beamMixin {
2020

2121
@WrapWithCondition(
2222
method = "render(Lnet/minecraft/world/level/block/entity/TheEndGatewayBlockEntity;" +
23-
"FLcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/MultiBufferSource;II)V",
23+
"FLcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/MultiBufferSource;" +
24+
"IILnet/minecraft/world/phys/Vec3;)V",
2425
at = @At(
2526
value = "INVOKE",
2627
target = "Lnet/minecraft/client/renderer/blockentity/BeaconRenderer;renderBeaconBeam(" +

common/src/main/java/ca/fxco/moreculling/mixin/models/cullshape/BlockModel_cullShapeMixin.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,6 @@
2121
@Mixin(BlockModel.class)
2222
public abstract class BlockModel_cullShapeMixin implements ExtendedUnbakedModel {
2323

24-
@Final
25-
@Shadow
26-
@Nullable
27-
private UnbakedModel parent;
28-
2924
@Unique
3025
@Nullable
3126
private List<CullShapeElement> moreculling$cullShapeElements = null;
@@ -41,8 +36,8 @@ public abstract class BlockModel_cullShapeMixin implements ExtendedUnbakedModel
4136
@Override
4237
public @Nullable List<CullShapeElement> moreculling$getCullShapeElements(ResourceLocation id) {
4338
if (this.moreculling$cullShapeElements == null) {
44-
return this.parent instanceof BlockModel ?
45-
((ExtendedUnbakedModel) this.parent).moreculling$getCullShapeElements(id) : null;
39+
return null;//this.parent instanceof BlockModel ?
40+
//((ExtendedUnbakedModel) this.parent).moreculling$getCullShapeElements(id) : null;
4641
}
4742
return moreculling$cullShapeElements;
4843
}

common/src/main/java/ca/fxco/moreculling/mixin/models/cullshape/ModelManager_cullShapeMixin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
public class ModelManager_cullShapeMixin {
1818

1919
@ModifyArg(
20-
method = {"method_65750", "lambda$loadBlockModels$10"},
20+
method = {"method_65750", "lambda$loadBlockModels$9"},
2121
at = @At(
2222
value = "INVOKE",
2323
target = "com/mojang/datafixers/util/Pair.of(Ljava/lang/Object;" +

common/src/main/resources/META-INF/accesstransformer.cfg

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
public net.minecraft.world.level.block.Block OCCLUSION_CACHE
22
public net.minecraft.client.model.geom.ModelPart$Polygon
3-
public net.minecraft.client.renderer.block.model.BlockModel parentLocation
43
public net.minecraft.client.model.geom.ModelPart$Vertex
54
public net.minecraft.world.level.block.Block$ShapePairKey <init>(Lnet/minecraft/world/phys/shapes/VoxelShape;Lnet/minecraft/world/phys/shapes/VoxelShape;)V
65
public net.minecraft.world.level.block.Block$ShapePairKey

common/src/main/resources/moreculling.accesswidener

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
accessWidener v1 named
22
accessible field net/minecraft/world/level/block/Block OCCLUSION_CACHE Ljava/lang/ThreadLocal;
33
accessible method net/minecraft/world/level/block/state/BlockBehaviour getOcclusionShape (Lnet/minecraft/world/level/block/state/BlockState;)Lnet/minecraft/world/phys/shapes/VoxelShape;
4-
accessible field net/minecraft/client/renderer/block/model/BlockModel parentLocation Lnet/minecraft/resources/ResourceLocation;
54
accessible class net/minecraft/client/renderer/CloudRenderer$RelativeCameraPos
65
accessible class net/minecraft/world/level/block/Block$ShapePairKey
76
accessible method net/minecraft/world/level/block/Block$ShapePairKey <init> (Lnet/minecraft/world/phys/shapes/VoxelShape;Lnet/minecraft/world/phys/shapes/VoxelShape;)V

0 commit comments

Comments
 (0)