Skip to content

Commit

Permalink
Fix #52, use stock JanksonOps, verbump
Browse files Browse the repository at this point in the history
  • Loading branch information
Juuxel committed Dec 18, 2019
1 parent 0aabc36 commit 6c5f562
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 180 deletions.
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ org.gradle.jvmargs=-Xmx3G -XX:+UseG1GC
kotlin.code.style = official

# Adorn
mod-version = 1.6.0
mod-version = 1.6.1
local-build = false

# Minecraft
minecraft = 1.15.1
mappings = build.1
mappings = build.3

# Fabric
fabric-loader = 0.7.2+build.175
Expand Down
60 changes: 60 additions & 0 deletions src/main/java/juuxel/adorn/AdornMixinPlugin.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
package juuxel.adorn;

import com.google.common.collect.ImmutableMap;
import net.fabricmc.loader.api.FabricLoader;
import org.objectweb.asm.tree.ClassNode;
import org.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin;
import org.spongepowered.asm.mixin.extensibility.IMixinInfo;

import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.function.Supplier;

// https://github.com/FabricMC/fabric-loader/issues/188
/** :irritatered: */
public final class AdornMixinPlugin implements IMixinConfigPlugin {
private static final Supplier<Boolean> TRUE = () -> true;

private static final Map<String, Supplier<Boolean>> CONDITIONS = ImmutableMap.of(
"juuxel.adorn.mixin.fluidloggable.FluidloggableMixin", () -> FabricLoader.getInstance().isModLoaded("towelette"),
"juuxel.adorn.mixin.fluidloggable.FluidUtilMixin", () -> FabricLoader.getInstance().isModLoaded("towelette")
);

@Override
public boolean shouldApplyMixin(String targetClassName, String mixinClassName) {
return CONDITIONS.getOrDefault(mixinClassName, TRUE).get();
}

// Boilerplate

@Override
public void onLoad(String mixinPackage) {

}

@Override
public String getRefMapperConfig() {
return null;
}

@Override
public void acceptTargets(Set<String> myTargets, Set<String> otherTargets) {

}

@Override
public List<String> getMixins() {
return null;
}

@Override
public void preApply(String targetClassName, ClassNode targetClass, String mixinClassName, IMixinInfo mixinInfo) {

}

@Override
public void postApply(String targetClassName, ClassNode targetClass, String mixinClassName, IMixinInfo mixinInfo) {

}
}
33 changes: 0 additions & 33 deletions src/main/kotlin/juuxel/adorn/AdornMixinPlugin.kt

This file was deleted.

4 changes: 2 additions & 2 deletions src/main/kotlin/juuxel/adorn/book/Book.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import blue.endless.jankson.JsonElement
import com.mojang.datafixers.Dynamic
import com.mojang.datafixers.types.JsonOps
import io.github.cottonmc.jankson.JanksonFactory
import io.github.cottonmc.jankson.JanksonOps
import juuxel.adorn.gui.widget.WBigLabel
import juuxel.adorn.util.JanksonOps
import net.fabricmc.api.EnvType
import net.fabricmc.api.Environment
import net.minecraft.text.LiteralText
Expand All @@ -24,7 +24,7 @@ data class Book(
private val MISSINGNO: Text = LiteralText("missingno")

private fun readText(json: JsonElement): Text? =
Text.Serializer.fromJson(Dynamic.convert(JanksonOps, JsonOps.INSTANCE, json))
Text.Serializer.fromJson(Dynamic.convert(JanksonOps.INSTANCE, JsonOps.INSTANCE, json))

fun jankson(): Jankson.Builder =
JanksonFactory.builder()
Expand Down
143 changes: 0 additions & 143 deletions src/main/kotlin/juuxel/adorn/util/JanksonOps.kt

This file was deleted.

0 comments on commit 6c5f562

Please sign in to comment.