Skip to content

Commit 917c1e0

Browse files
committed
Merge remote-tracking branch 'origin/master' into 1.21.1-multiloader
# Conflicts: # .github/workflows/devbuild.yml # .github/workflows/publish.yml # build.gradle # common/src/main/java/ca/fxco/moreculling/MoreCulling.java # common/src/main/java/ca/fxco/moreculling/api/block/MoreBlockCulling.java # common/src/main/java/ca/fxco/moreculling/api/blockstate/MoreStateCulling.java # common/src/main/java/ca/fxco/moreculling/mixin/blocks/EndRodBlock_cullMixin.java # common/src/main/java/ca/fxco/moreculling/mixin/blockstates/Block_drawSideMixin.java # common/src/main/java/ca/fxco/moreculling/mixin/blockstates/Minecraft_loadBlocksMixin.java # common/src/main/java/ca/fxco/moreculling/mixin/compat/BambooStalkBlock_clientTweaksMixin.java # common/src/main/java/ca/fxco/moreculling/mixin/models/SimpleBakedModel_cacheMixin.java # common/src/main/java/ca/fxco/moreculling/platform/services/IPlatformHelper.java # common/src/main/java/ca/fxco/moreculling/utils/CullingUtils.java # common/src/main/java/ca/fxco/moreculling/utils/VertexUtils.java # common/src/main/resources/assets/moreculling/lang/uk_ua.json # fabric/src/main/java/ca/fxco/moreculling/mixin/compat/AbstractBlockRenderContext_vulkanModMixin.java # fabric/src/main/java/ca/fxco/moreculling/platform/FabricPlatformHelper.java # fabric/src/main/resources/moreculling.fabric.mixins.json # gradle.properties # gradle/wrapper/gradle-wrapper.properties # neoforge/src/main/java/ca/fxco/moreculling/MoreCullingNeoforge.java # neoforge/src/main/java/ca/fxco/moreculling/platform/NeoForgePlatformHelper.java
2 parents 42f097d + bf0884a commit 917c1e0

File tree

82 files changed

+1775
-1357
lines changed

Some content is hidden

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

82 files changed

+1775
-1357
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
plugins {
22
// see https://fabricmc.net/develop/ for new versions
3-
id 'fabric-loom' version '1.8-SNAPSHOT' apply false
3+
id 'fabric-loom' version '1.9-SNAPSHOT' apply false
44
// see https://projects.neoforged.net/neoforged/moddevgradle for new versions
55
id 'net.neoforged.moddev' version '2.0.74' apply false
66
}

buildSrc/src/main/groovy/multiloader-common.gradle

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,6 @@ java {
1616
repositories {
1717
mavenCentral()
1818
// https://docs.gradle.org/current/userguide/declaring_repositories.html#declaring_content_exclusively_found_in_one_repository
19-
exclusiveContent {
20-
forRepository {
21-
maven {
22-
name = 'Sponge'
23-
url = 'https://repo.spongepowered.org/repository/maven-public'
24-
}
25-
}
26-
filter { includeGroupAndSubgroups('org.spongepowered') }
27-
}
2819
exclusiveContent {
2920
forRepositories(
3021
maven {
@@ -49,16 +40,13 @@ repositories {
4940
includeGroup "curse.maven"
5041
}
5142
}
52-
maven {
53-
name = 'BlameJared'
54-
url = 'https://maven.blamejared.com'
55-
}
5643
maven { //AutoConfig
5744
name = "Shedaniel's Maven"
5845
url = "https://maven.shedaniel.me/"
5946
}
6047
maven { url 'https://maven.fallenbreath.me/releases' }
6148
maven { url 'https://maven.bawnorton.com/releases' }
49+
maven { url 'https://libraries.minecraft.net/' }
6250
}
6351

6452
// Declare capabilities on the outgoing configurations.
@@ -74,17 +62,7 @@ repositories {
7462
}
7563
}
7664

77-
sourcesJar {
78-
from(rootProject.file('LICENSE')) {
79-
rename { "${it}_${mod_name}" }
80-
}
81-
}
82-
8365
jar {
84-
from(rootProject.file('LICENSE')) {
85-
rename { "${it}_${mod_name}" }
86-
}
87-
8866
manifest {
8967
attributes([
9068
'Specification-Title' : mod_name,

common/build.gradle

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ plugins {
55

66
neoForge {
77
neoFormVersion = neo_form_version
8+
validateAccessTransformers = true
89
// Automatically enable AccessTransformers if the file exists
910
def at = file('src/main/resources/META-INF/accesstransformer.cfg')
1011
if (at.exists()) {
@@ -17,12 +18,13 @@ neoForge {
1718
}
1819

1920
dependencies {
20-
compileOnly group: 'org.spongepowered', name: 'mixin', version: '0.8.5'
21+
compileOnly group: 'net.fabricmc', name: 'sponge-mixin', version: '0.15.3+mixin.0.8.7'
2122

2223
compileOnly group: 'io.github.llamalad7', name: 'mixinextras-common', version: '0.3.5'
2324
annotationProcessor group: 'io.github.llamalad7', name: 'mixinextras-common', version: '0.3.5'
2425

25-
implementation "maven.modrinth:sodium:${project.sodium_version}-neoforge"
26+
compileOnly "maven.modrinth:sodium:${project.sodium_version}-neoforge"
27+
//implementation "maven.modrinth:client-tweaks:${project.clienttweaks_version}+neoforge-${project.minecraft_version}"
2628

2729
api "me.shedaniel.cloth:cloth-config-neoforge:${project.cloth_config_version}"
2830

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package ca.fxco.moreculling.api.blockstate;
2+
3+
import net.minecraft.core.Direction;
4+
import net.minecraft.world.phys.shapes.VoxelShape;
5+
6+
/**
7+
* StateCullingShapeCache is an interface to access the shape cache.
8+
*
9+
* @since 1.2.3
10+
*/
11+
public interface StateCullingShapeCache {
12+
13+
/**
14+
* Get the voxelshape of a culling face
15+
*
16+
* @param face The face to get the shape from
17+
* @return The VoxelShape for the face.
18+
* @since 1.2.3
19+
*/
20+
VoxelShape moreculling$getFaceCullingShape(Direction face);
21+
22+
}

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ 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 0.25.0
56+
* @since 1.2.3
5757
*/
58-
default void moreculling$resetTranslucencyCache() {}
58+
default void moreculling$resetTranslucencyCache(BlockState state) {}
5959

6060
/**
6161
* Gets the VoxelShape culling shape for the baked model.
@@ -85,4 +85,10 @@ 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() {}
8894
}

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,28 +19,32 @@ public interface ExtendedUnbakedModel {
1919
*
2020
* @since 0.25.0
2121
*/
22-
void moreculling$setCullShapeElements(List<CullShapeElement> cullShapeElements);
22+
default void moreculling$setCullShapeElements(List<CullShapeElement> cullShapeElements) {}
2323

2424
/**
2525
* Gets the CullShapeElement for the extended unbaked model
2626
*
2727
* @since 0.25.0
2828
*/
29-
List<CullShapeElement> moreculling$getCullShapeElements(ResourceLocation id);
29+
default List<CullShapeElement> moreculling$getCullShapeElements(ResourceLocation id) {
30+
return List.of();
31+
}
3032

3133
/**
3234
* When set to true, the cull shape is completely ignored and instead the model will be used as the cull shape
3335
*
3436
* @since 0.25.0
3537
*/
36-
void moreculling$setUseModelShape(boolean useModelShape);
38+
default void moreculling$setUseModelShape(boolean useModelShape) {}
3739

3840
/**
3941
* Returns if it should use the model shape instead of the cull shape
4042
*
4143
* @since 0.25.0
4244
*/
43-
boolean moreculling$getUseModelShape(ResourceLocation id);
45+
default boolean moreculling$getUseModelShape(ResourceLocation id) {
46+
return false;
47+
}
4448

4549
/**
4650
* ModelElementFace is just final's, that should not change. However, you can create a new ModelElementFace or wrap

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,30 @@
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.ItemRenderer;
7+
import net.minecraft.client.renderer.entity.state.ItemFrameRenderState;
8+
import net.minecraft.client.renderer.item.ItemStackRenderState;
89
import net.minecraft.client.resources.model.BakedModel;
910
import net.minecraft.core.Direction;
10-
import net.minecraft.world.entity.decoration.ItemFrame;
11-
import net.minecraft.world.item.ItemStack;
1211
import org.jetbrains.annotations.Nullable;
1312

1413
/**
1514
* This interface allows you to call the MoreCulling methods used for item rendering.
1615
* This gives you access to the custom MoreCulling rendering methods, in order to allow everyone to benefit from the
1716
* performance boost that MoreCulling can offer.<br/>
18-
* Use these methods over ones provided in {@link ItemRenderer}
17+
* Use these methods over ones provided in {@link ItemStackRenderState}
1918
*
2019
* @since 0.8.0
2120
*/
2221

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

2524
/**
2625
* This will render a baked item model without a specific face. (Item Frame)
2726
* This can be used to skip the face of an item that cannot be seen
2827
*
2928
* @since 0.25.0
3029
*/
31-
void moreculling$renderBakedItemModelWithoutFace(BakedModel model, ItemStack stack, int light, int overlay,
30+
void moreculling$renderBakedItemModelWithoutFace(BakedModel model, int light, int overlay,
3231
PoseStack poseStack, VertexConsumer vertices,
3332
@Nullable Direction withoutFace);
3433

@@ -38,7 +37,7 @@ public interface ExtendedItemRenderer {
3837
*
3938
* @since 0.25.0
4039
*/
41-
void moreculling$renderBakedItemModelForFace(BakedModel model, ItemStack stack, int light, int overlay,
40+
void moreculling$renderBakedItemModelForFace(BakedModel model, int light, int overlay,
4241
PoseStack poseStack, VertexConsumer vertices, Direction face);
4342

4443
/**
@@ -47,16 +46,17 @@ public interface ExtendedItemRenderer {
4746
*
4847
* @since 0.25.0
4948
*/
50-
void moreculling$renderBakedItemModelOnly3Faces(BakedModel model, ItemStack stack, int light, int overlay,
49+
void moreculling$renderBakedItemModelOnly3Faces(BakedModel model, int light, int overlay,
5150
PoseStack poseStack, VertexConsumer vertices,
5251
Direction faceX, Direction faceY, Direction faceZ);
5352

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(ItemStack stack, PoseStack poseStack, MultiBufferSource multiBufferSource,
61-
int light, ItemFrame frame, Camera camera);
60+
void moreculling$renderItemFrameItem(PoseStack poseStack, MultiBufferSource multiBufferSource,
61+
int light, ItemFrameRenderState frame, Camera camera);
6262
}

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

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,42 @@ 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+
230266
// Item Frames
231267
DynamicBooleanListEntry itemFrameMapCulling = new DynamicBooleanBuilder("moreculling.config.option.itemFrameMapCulling")
232268
.setValue(MoreCulling.CONFIG.itemFrameMapCulling)
@@ -277,6 +313,16 @@ public static Screen createConfigScreen(Screen parent) {
277313
generalCategory.addEntry(itemFrame3FaceCulling);
278314
generalCategory.addEntry(itemFrame3FaceCullingRange);
279315

316+
// BlockStates
317+
generalCategory.addEntry(new DynamicBooleanBuilder("moreculling.config.option.paintingCulling")
318+
.setValue(MoreCulling.CONFIG.paintingCulling)
319+
.setDefaultValue(true)
320+
.setTooltip(Component.translatable("moreculling.config.option.paintingCulling.tooltip"))
321+
.setSaveConsumer(newValue -> {
322+
MoreCulling.CONFIG.paintingCulling = newValue;
323+
})
324+
.build());
325+
280326
generalCategory.addEntry(leavesCullingMode);
281327
generalCategory.addEntry(leavesCullingAmount);
282328
generalCategory.addEntry(includeMangroveRoots);

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ 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+
2123
public boolean cloudCulling = true;
2224

2325
public boolean signTextCulling = true;
@@ -40,6 +42,8 @@ public class MoreCullingConfig implements ConfigData {
4042

4143
public float itemFrame3FaceCullingRange = 4F; // default 4 blocks away
4244

45+
public boolean paintingCulling = true;
46+
4347
public LeavesCullingMode leavesCullingMode = LeavesCullingMode.DEFAULT;
4448

4549
public int leavesCullingAmount = 2;

0 commit comments

Comments
 (0)