Skip to content

Commit

Permalink
another one down
Browse files Browse the repository at this point in the history
  • Loading branch information
ALongStringOfNumbers committed Dec 4, 2023
1 parent 2b21101 commit ce48e0b
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 9 deletions.
17 changes: 9 additions & 8 deletions src/main/java/gregtech/asm/GregTechTransformer.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import gregtech.asm.util.TargetClassVisitor;
import gregtech.asm.visitors.AbstractCTMBakedModelVisitor;
import gregtech.asm.visitors.EnchantmentCanApplyVisitor;
import gregtech.asm.visitors.EntityRendererVisitor;
import gregtech.asm.visitors.JEIVisitor;
import gregtech.asm.visitors.LittleTilesVisitor;
import gregtech.asm.visitors.ModelCTMVisitor;
Expand Down Expand Up @@ -89,13 +88,15 @@ public byte[] transform(String name, String transformedName, byte[] basicClass)
* return classWriter.toByteArray();
* }
*/
case EntityRendererVisitor.TARGET_CLASS_NAME: {
ClassReader classReader = new ClassReader(basicClass);
ClassWriter classWriter = new ClassWriter(ClassWriter.COMPUTE_FRAMES | ClassWriter.COMPUTE_MAXS);
classReader.accept(new TargetClassVisitor(classWriter, EntityRendererVisitor.TARGET_METHOD,
EntityRendererVisitor::new), 0);
return classWriter.toByteArray();
}
/*
* case EntityRendererVisitor.TARGET_CLASS_NAME: {
* ClassReader classReader = new ClassReader(basicClass);
* ClassWriter classWriter = new ClassWriter(ClassWriter.COMPUTE_FRAMES | ClassWriter.COMPUTE_MAXS);
* classReader.accept(new TargetClassVisitor(classWriter, EntityRendererVisitor.TARGET_METHOD,
* EntityRendererVisitor::new), 0);
* return classWriter.toByteArray();
* }
*/
/*
* case BlockVisitor.TARGET_CLASS_NAME: {
* try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

// TODO, I am not quite sure if this matches with what the ASM was actually doing
// TODO, transition to using the direct path method, and remove the dependency on LittleTiles
@Mixin(TileEntityRenderManager.class)
@Mixin(value = TileEntityRenderManager.class, remap = false)
public class LittleTilesRenderMangerMixin {

@Mutable
Expand Down
28 changes: 28 additions & 0 deletions src/main/java/gregtech/mixins/minecraft/EntityRendererMixin.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package gregtech.mixins.minecraft;

import gregtech.client.utils.BloomEffectUtil;

import net.minecraft.client.renderer.EntityRenderer;
import net.minecraft.client.renderer.RenderGlobal;
import net.minecraft.entity.Entity;
import net.minecraft.util.BlockRenderLayer;

import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;

@Mixin(EntityRenderer.class)
public class EntityRendererMixin {

@WrapOperation(method = "renderWorldPass",
at = @At(value = "INVOKE",
target = "Lnet/minecraft/client/renderer/RenderGlobal;renderBlockLayer(Lnet/minecraft/util/BlockRenderLayer;DILnet/minecraft/entity/Entity;)I",
ordinal = 3))
public int renderBloomBlockLayer(RenderGlobal instance, BlockRenderLayer layer, double partialTicks, int pass,
Entity entity, Operation<Integer> original) {

return BloomEffectUtil.renderBloomBlockLayer(instance, layer, partialTicks, pass, entity);
}

}
1 change: 1 addition & 0 deletions src/main/resources/mixins.gregtech.minecraft.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
],
"client": [
"BlockMixin",
"EntityRendererMixin",
"LayerArmorBaseMixin",
"LayerCustomHeadMixin",
"RecipeRepairItemMixin",
Expand Down

0 comments on commit ce48e0b

Please sign in to comment.