Skip to content

Commit aa99669

Browse files
committed
Backport
1 parent 917c1e0 commit aa99669

File tree

61 files changed

+941
-1121
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+941
-1121
lines changed

common/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ plugins {
55

66
neoForge {
77
neoFormVersion = neo_form_version
8-
validateAccessTransformers = true
98
// Automatically enable AccessTransformers if the file exists
109
def at = file('src/main/resources/META-INF/accesstransformer.cfg')
1110
if (at.exists()) {

common/src/main/java/ca/fxco/moreculling/api/blockstate/StateCullingShapeCache.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,11 @@ public interface StateCullingShapeCache {
1818
* @since 1.2.3
1919
*/
2020
VoxelShape moreculling$getFaceCullingShape(Direction face);
21+
/**
22+
* Initialize the voxelshape used for culling
23+
*
24+
* @since 1.2.3
25+
*/
26+
void moreculling$initShapeCache();
2127

2228
}

common/src/main/java/ca/fxco/moreculling/api/model/BakedOpacity.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public interface BakedOpacity {
5353
* When called this method will reset the translucency cache of the model.
5454
* This should be called if the texture of the model is ever changed!
5555
*
56-
* @since 1.2.3
56+
* @since 1.0.5
5757
*/
5858
default void moreculling$resetTranslucencyCache(BlockState state) {}
5959

@@ -85,10 +85,4 @@ public interface BakedOpacity {
8585
default boolean moreculling$canSetCullingShape() {
8686
return false;
8787
}
88-
89-
default boolean moreculling$isItem() {
90-
return false;
91-
}
92-
93-
default void moreculling$setIsItem() {}
9488
}

common/src/main/java/ca/fxco/moreculling/api/renderers/ExtendedItemStackRenderState.java renamed to common/src/main/java/ca/fxco/moreculling/api/renderers/ExtendedItemRenderer.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,31 @@
44
import com.mojang.blaze3d.vertex.VertexConsumer;
55
import net.minecraft.client.Camera;
66
import net.minecraft.client.renderer.MultiBufferSource;
7-
import net.minecraft.client.renderer.entity.state.ItemFrameRenderState;
8-
import net.minecraft.client.renderer.item.ItemStackRenderState;
7+
import net.minecraft.client.renderer.entity.ItemRenderer;
98
import net.minecraft.client.resources.model.BakedModel;
109
import net.minecraft.core.Direction;
10+
import net.minecraft.world.entity.decoration.ItemFrame;
11+
import net.minecraft.world.item.ItemStack;
1112
import org.jetbrains.annotations.Nullable;
1213

1314
/**
1415
* This interface allows you to call the MoreCulling methods used for item rendering.
1516
* This gives you access to the custom MoreCulling rendering methods, in order to allow everyone to benefit from the
1617
* performance boost that MoreCulling can offer.<br/>
17-
* Use these methods over ones provided in {@link ItemStackRenderState}
18+
* Use these methods over ones provided in {@link ItemRenderer}
1819
*
1920
* @since 0.8.0
2021
*/
2122

22-
public interface ExtendedItemStackRenderState {
23+
public interface ExtendedItemRenderer {
2324

2425
/**
2526
* This will render a baked item model without a specific face. (Item Frame)
2627
* This can be used to skip the face of an item that cannot be seen
2728
*
2829
* @since 0.25.0
2930
*/
30-
void moreculling$renderBakedItemModelWithoutFace(BakedModel model, int light, int overlay,
31+
void moreculling$renderBakedItemModelWithoutFace(BakedModel model, ItemStack stack, int light, int overlay,
3132
PoseStack poseStack, VertexConsumer vertices,
3233
@Nullable Direction withoutFace);
3334

@@ -37,7 +38,7 @@ public interface ExtendedItemStackRenderState {
3738
*
3839
* @since 0.25.0
3940
*/
40-
void moreculling$renderBakedItemModelForFace(BakedModel model, int light, int overlay,
41+
void moreculling$renderBakedItemModelForFace(BakedModel model, ItemStack stack, int light, int overlay,
4142
PoseStack poseStack, VertexConsumer vertices, Direction face);
4243

4344
/**
@@ -46,17 +47,16 @@ public interface ExtendedItemStackRenderState {
4647
*
4748
* @since 0.25.0
4849
*/
49-
void moreculling$renderBakedItemModelOnly3Faces(BakedModel model, int light, int overlay,
50+
void moreculling$renderBakedItemModelOnly3Faces(BakedModel model, ItemStack stack, int light, int overlay,
5051
PoseStack poseStack, VertexConsumer vertices,
5152
Direction faceX, Direction faceY, Direction faceZ);
5253

53-
5454
/**
5555
* This will render an item as if it was in an item frame like MoreCulling, it will automatically include all of
5656
* MoreCulling's optimizations.
5757
*
5858
* @since 0.25.0
5959
*/
60-
void moreculling$renderItemFrameItem(PoseStack poseStack, MultiBufferSource multiBufferSource,
61-
int light, ItemFrameRenderState frame, Camera camera);
60+
void moreculling$renderItemFrameItem(ItemStack stack, PoseStack poseStack, MultiBufferSource multiBufferSource,
61+
int light, ItemFrame frame, Camera camera);
6262
}

common/src/main/java/ca/fxco/moreculling/config/ModMenuConfig.java

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -227,42 +227,6 @@ public static Screen createConfigScreen(Screen parent) {
227227
})
228228
.build());
229229

230-
//dont cull list
231-
generalCategory.addEntry(new StringListBuilder(
232-
Component.translatable("text.cloth-config.reset_value"),
233-
Component.translatable("moreculling.config.option.dontCull"), MoreCulling.CONFIG.dontCull)
234-
.setDefaultValue(new ArrayList<>())
235-
.setTooltip(Component.translatable("moreculling.config.option.dontCull.tooltip"))
236-
.setSaveConsumer(
237-
value -> {
238-
MoreCulling.CONFIG.dontCull.forEach(prevBlockId -> {
239-
Optional<Holder.Reference<Block>> optionalBlock =
240-
BuiltInRegistries.BLOCK.get(ResourceLocation.parse(prevBlockId));
241-
242-
if (optionalBlock.isEmpty())
243-
return;
244-
245-
((MoreBlockCulling) optionalBlock.get().value()).moreculling$setCanCull(true);
246-
}
247-
);
248-
249-
value.forEach(blockId -> {
250-
Optional<Holder.Reference<Block>> optionalBlock = BuiltInRegistries.BLOCK.get(ResourceLocation.parse(blockId));
251-
252-
if (optionalBlock.isEmpty()) {
253-
MoreCulling.LOGGER.warn("Block with id {} doesn't exist", blockId);
254-
return;
255-
}
256-
257-
MoreBlockCulling block = (MoreBlockCulling) optionalBlock.get().value();
258-
if (block.moreculling$canCull())
259-
block.moreculling$setCanCull(false);
260-
});
261-
262-
MoreCulling.CONFIG.dontCull = value;
263-
}
264-
).build());
265-
266230
// Item Frames
267231
DynamicBooleanListEntry itemFrameMapCulling = new DynamicBooleanBuilder("moreculling.config.option.itemFrameMapCulling")
268232
.setValue(MoreCulling.CONFIG.itemFrameMapCulling)

common/src/main/java/ca/fxco/moreculling/config/MoreCullingConfig.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ public class MoreCullingConfig implements ConfigData {
1818
// You can disable the sodium menu in the config
1919
public boolean enableSodiumMenu = true;
2020

21-
public List<String> dontCull = new ArrayList<>();
22-
2321
public boolean cloudCulling = true;
2422

2523
public boolean signTextCulling = true;

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

Lines changed: 0 additions & 149 deletions
This file was deleted.

0 commit comments

Comments
 (0)