Skip to content

Commit

Permalink
fixy fix
Browse files Browse the repository at this point in the history
  • Loading branch information
IThundxr committed Jun 17, 2024
1 parent f26c6fd commit 0f49a82
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
3 changes: 3 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ repositories {
maven("https://maven.jamieswhiteshirt.com/libs-release") // Reach Entity Attributes
maven("https://jitpack.io/") // Fabric ASM
maven("https://maven.tterrag.com/") // Flywheel
maven("https://api.modrinth.com/maven")
}

dependencies {
Expand All @@ -33,6 +34,8 @@ dependencies {
modImplementation("net.fabricmc.fabric-api:fabric-api:${"fabric_api_version"()}")

modImplementation("com.simibubi.create:create-fabric-${"minecraft_version"()}:${"create_version"()}")

compileOnly("maven.modrinth:copycats:fabric.1.20.1-1.3.2") { isTransitive = false }
}

tasks.processResources {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package dev.ithundxr.railwaystweaks.mixin.client;

import com.copycatsplus.copycats.content.copycat.base.model.multistate.fabric.MultiStateCopycatModel;
import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
import net.minecraft.world.level.block.state.BlockState;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Pseudo;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;

import java.util.Map;
import java.util.Set;

@Pseudo
@Mixin(MultiStateCopycatModel.class)
public class MultiStateCopycatModelMixin {
@Unique
private Set<Map.Entry<String, BlockState>> railwaysTweaks$set;

@WrapOperation(method = "emitBlockQuads", at = @At(value = "INVOKE", target = "Ljava/util/Map;entrySet()Ljava/util/Set;"))
private Set<Map.Entry<String, BlockState>> railwaysTweaks$fixCopycatPlusCME(Map<String, BlockState> instance, Operation<Set<Map.Entry<String, BlockState>>> original) {
railwaysTweaks$set = original.call(instance);
return railwaysTweaks$set;
}
}
1 change: 1 addition & 0 deletions src/main/resources/railwaystweaks.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
],
"client": [
"client.HttpTextureMixin",
"client.MultiStateCopycatModelMixin",
"client.PlayerRendererMixin"
],
"injectors": {
Expand Down

0 comments on commit 0f49a82

Please sign in to comment.