mirror of
https://github.com/Jozufozu/Flywheel.git
synced 2025-01-10 14:26:10 +01:00
d53c9b0a32
- The lightmap moved - Begin to move away from access transformers - .textureManager -> .getTextureManager() - RIP cutout, saw that coming
32 lines
1.1 KiB
Java
32 lines
1.1 KiB
Java
package com.jozufozu.flywheel.mixin;
|
|
|
|
import org.spongepowered.asm.mixin.Final;
|
|
import org.spongepowered.asm.mixin.Mixin;
|
|
import org.spongepowered.asm.mixin.Shadow;
|
|
import org.spongepowered.asm.mixin.injection.At;
|
|
import org.spongepowered.asm.mixin.injection.Inject;
|
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
|
|
|
import com.jozufozu.flywheel.backend.instancing.InstancedRenderDispatcher;
|
|
|
|
import net.minecraft.world.level.Level;
|
|
import net.minecraft.world.level.block.entity.BlockEntity;
|
|
import net.minecraft.world.level.chunk.LevelChunk;
|
|
import net.minecraftforge.api.distmarker.Dist;
|
|
import net.minecraftforge.api.distmarker.OnlyIn;
|
|
|
|
@OnlyIn(Dist.CLIENT)
|
|
@Mixin(LevelChunk.class)
|
|
public class InstanceAddMixin {
|
|
|
|
@Shadow
|
|
@Final
|
|
Level level;
|
|
|
|
@Inject(method = "setBlockEntity",
|
|
at = @At(value = "INVOKE_ASSIGN", target = "Ljava/util/Map;put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;"))
|
|
private void tileAdded(BlockEntity be, CallbackInfo ci) {
|
|
if (level.isClientSide) InstancedRenderDispatcher.getTiles(this.level)
|
|
.add(be);
|
|
}
|
|
}
|