mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-23 13:37:58 +01:00
Fixed block destructions not showing on tile entities when sodium is installed
This commit is contained in:
parent
bc19a32a41
commit
0e74cc6bbe
4 changed files with 26 additions and 2 deletions
|
@ -53,6 +53,8 @@ dependencies {
|
||||||
include "com.minelittlepony:kirin:${project.kirin_version}"
|
include "com.minelittlepony:kirin:${project.kirin_version}"
|
||||||
|
|
||||||
modCompileOnly("com.terraformersmc:modmenu:${project.modmenu_version}")
|
modCompileOnly("com.terraformersmc:modmenu:${project.modmenu_version}")
|
||||||
|
// implementation 'org.jetbrains:intellij-fernflower:1.2.1.16'
|
||||||
|
modCompileOnly("net.caffienemc.sodium:sodium-fabric-mc1.19.2:0.4.4+build.18")
|
||||||
}
|
}
|
||||||
|
|
||||||
processResources {
|
processResources {
|
||||||
|
|
|
@ -18,7 +18,7 @@ import net.minecraft.client.render.BlockBreakingInfo;
|
||||||
import net.minecraft.client.render.WorldRenderer;
|
import net.minecraft.client.render.WorldRenderer;
|
||||||
import net.minecraft.resource.SynchronousResourceReloader;
|
import net.minecraft.resource.SynchronousResourceReloader;
|
||||||
|
|
||||||
@Mixin(WorldRenderer.class)
|
@Mixin(value = WorldRenderer.class, priority = 1001)
|
||||||
abstract class MixinWorldRenderer implements SynchronousResourceReloader, AutoCloseable, ClientBlockDestructionManager.Source {
|
abstract class MixinWorldRenderer implements SynchronousResourceReloader, AutoCloseable, ClientBlockDestructionManager.Source {
|
||||||
|
|
||||||
private final ClientBlockDestructionManager destructions = new ClientBlockDestructionManager();
|
private final ClientBlockDestructionManager destructions = new ClientBlockDestructionManager();
|
||||||
|
|
|
@ -0,0 +1,21 @@
|
||||||
|
package com.minelittlepony.unicopia.mixin.client.sodium;
|
||||||
|
|
||||||
|
import java.util.SortedSet;
|
||||||
|
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.injection.*;
|
||||||
|
import com.minelittlepony.unicopia.client.ClientBlockDestructionManager;
|
||||||
|
|
||||||
|
import it.unimi.dsi.fastutil.longs.Long2ObjectMap;
|
||||||
|
import me.jellysquid.mods.sodium.client.render.SodiumWorldRenderer;
|
||||||
|
import net.minecraft.client.MinecraftClient;
|
||||||
|
import net.minecraft.client.render.*;
|
||||||
|
|
||||||
|
@Mixin(SodiumWorldRenderer.class)
|
||||||
|
abstract class MixinSodiumWorldRenderer {
|
||||||
|
@ModifyVariable(method = "renderTileEntities", at = @At("HEAD"))
|
||||||
|
public Long2ObjectMap<SortedSet<BlockBreakingInfo>> modifyDestruction(Long2ObjectMap<SortedSet<BlockBreakingInfo>> blockBreakingProgressions) {
|
||||||
|
ClientBlockDestructionManager destructions = ((ClientBlockDestructionManager.Source)MinecraftClient.getInstance().worldRenderer).getDestructionManager();
|
||||||
|
return destructions.getCombinedDestructions(blockBreakingProgressions);
|
||||||
|
}
|
||||||
|
}
|
|
@ -50,7 +50,8 @@
|
||||||
"client.MixinMouse",
|
"client.MixinMouse",
|
||||||
"client.MixinPlayerEntityRenderer",
|
"client.MixinPlayerEntityRenderer",
|
||||||
"client.MixinTooltipComponent",
|
"client.MixinTooltipComponent",
|
||||||
"client.MixinWorldRenderer"
|
"client.MixinWorldRenderer",
|
||||||
|
"client.sodium.MixinSodiumWorldRenderer"
|
||||||
],
|
],
|
||||||
"injectors": {
|
"injectors": {
|
||||||
"defaultRequire": 1
|
"defaultRequire": 1
|
||||||
|
|
Loading…
Reference in a new issue