Skip to content

Commit

Permalink
Merge branch 'trunk' into 1.18.2
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/main/java/net/coderbot/iris/mixin/entity_render_context/MixinBlockEntityRenderDispatcher.java
  • Loading branch information
IMS212 committed Dec 7, 2022
2 parents 22b39f8 + 1d83e84 commit 82ff39a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package net.coderbot.iris.mixin.entity_render_context;

import it.unimi.dsi.fastutil.objects.Object2IntMap;
import net.coderbot.batchedentityrendering.impl.Groupable;
import net.coderbot.iris.block_rendering.BlockRenderingSettings;
import net.coderbot.iris.layer.BlockEntityRenderStateShard;
import net.coderbot.iris.layer.OuterWrappedRenderType;
Expand Down Expand Up @@ -33,6 +34,11 @@ public class MixinBlockEntityRenderDispatcher {
target = "Lnet/minecraft/world/level/block/entity/BlockEntityType;isValid(Lnet/minecraft/world/level/block/state/BlockState;)Z"),
allow = 1, require = 1)
private <E extends BlockEntity> MultiBufferSource iris$wrapBufferSource(MultiBufferSource bufferSource, BlockEntity blockEntity) {
if (!(bufferSource instanceof Groupable)) {
// Fully batched entity rendering is not being used, do not use this wrapper!!!
return bufferSource;
}

Object2IntMap<BlockState> blockStateIds = BlockRenderingSettings.INSTANCE.getBlockStateIds();

if (blockStateIds == null ) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package net.coderbot.iris.mixin.entity_render_context;

import it.unimi.dsi.fastutil.objects.Object2IntFunction;
import net.coderbot.batchedentityrendering.impl.Groupable;
import net.coderbot.iris.block_rendering.BlockRenderingSettings;
import net.coderbot.iris.layer.EntityRenderStateShard;
import net.coderbot.iris.layer.OuterWrappedRenderType;
Expand All @@ -26,6 +27,11 @@ public class MixinEntityRenderDispatcher {
@ModifyVariable(method = "render", at = @At(value = "INVOKE", target = "Lcom/mojang/blaze3d/vertex/PoseStack;pushPose()V", shift = At.Shift.AFTER),
allow = 1, require = 1)
private MultiBufferSource iris$beginEntityRender(MultiBufferSource bufferSource, Entity entity) {
if (!(bufferSource instanceof Groupable)) {
// Fully batched entity rendering is not being used, do not use this wrapper!!!
return bufferSource;
}

ResourceLocation entityId = Registry.ENTITY_TYPE.getKey(entity.getType());

Object2IntFunction<NamespacedId> entityIds = BlockRenderingSettings.INSTANCE.getEntityIds();
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"schemaVersion": 1,
"id": "iris",
"version": "1.4.4-development-environment",
"version": "1.4.5-development-environment",

"name": "Iris",
"description": "A modern shaders mod for Minecraft intended to be compatible with existing OptiFine shader packs",
Expand Down

0 comments on commit 82ff39a

Please sign in to comment.