Skip to content

Commit

Permalink
1.21 works
Browse files Browse the repository at this point in the history
  • Loading branch information
btwonion committed Jun 14, 2024
1 parent 2994efd commit 86cffba
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 30 deletions.
7 changes: 3 additions & 4 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import dev.kikugie.stonecutter.gradle.StonecutterSettings
import dev.kikugie.stonecutter.StonecutterSettings

rootProject.name = "telekinesis"

Expand All @@ -9,12 +9,11 @@ pluginManagement {
maven("https://server.bbkr.space/artifactory/libs-release/")
maven("https://repo.papermc.io/repository/maven-public/")
maven("https://maven.kikugie.dev/releases")
maven("https://maven.kikugie.dev/snapshots")
}
}

plugins {
id("dev.kikugie.stonecutter") version "0.3.9"
id("dev.kikugie.stonecutter") version "0.4"
}

buildscript {
Expand All @@ -34,5 +33,5 @@ extensions.configure<StonecutterSettings> {
versions("1.20.1", "1.20.4", "1.20.6", "1.21")
vcsVersion = "1.20.6"
}
create(project(":telekinesis-fabric"))
create(":telekinesis-fabric")
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import org.apache.commons.lang3.mutable.MutableInt;
import org.jetbrains.annotations.Nullable;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;

import java.util.ArrayList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,14 @@
import dev.nyon.telekinesis.utils.MixinHelper;
import net.minecraft.world.entity.vehicle.ChestBoat;
import org.spongepowered.asm.mixin.Mixin;

/*? if >1.20.2 {*/
import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.item.Item;
import org.spongepowered.asm.mixin.injection.At;
/*?}*/

@Mixin(ChestBoat.class)
public class ChestBoatMixin {
public abstract class ChestBoatMixin {

/*? if >1.20.2 {*/
@WrapOperation(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import net.minecraft.world.item.Items;
import net.minecraft.world.level.ItemLike;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.ModifyArg;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import net.minecraft.world.level.block.state.BlockState;
import org.apache.commons.lang3.mutable.MutableInt;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.ModifyArgs;
import org.spongepowered.asm.mixin.injection.invoke.arg.Args;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ import dev.nyon.telekinesis.config.Config
import net.fabricmc.loader.api.FabricLoader
import dev.nyon.telekinesis.config.config as internalConfig

/*? if <=1.20.6 {*//*
lateinit var telekinesis: TelekinesisEnchantment
*//*?}*/
//? if <=1.20.6
/*lateinit var telekinesis: TelekinesisEnchantment*/

fun init() {
config(FabricLoader.getInstance().configDir.resolve("telekinesis.json"), 1, Config()) { _, _ -> null }
Expand Down
26 changes: 10 additions & 16 deletions telekinesis-fabric/stonecutter.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import kotlinx.serialization.ExperimentalSerializationApi
import kotlinx.serialization.encodeToString
import kotlinx.serialization.json.Json
import kotlinx.serialization.json.buildJsonArray
import kotlinx.serialization.json.buildJsonObject
import kotlinx.serialization.json.put
import kotlinx.serialization.json.putJsonArray
import kotlinx.serialization.json.*
import java.net.URI
import java.net.http.HttpClient
import java.net.http.HttpRequest
Expand All @@ -16,17 +12,15 @@ plugins {
}
stonecutter active "1.21" /* [SC] DO NOT EDIT */

stonecutter registerChiseled
tasks.register("buildAllVersions", stonecutter.chiseled) {
group = "mod"
ofTask("build")
}
stonecutter registerChiseled tasks.register("buildAllVersions", stonecutter.chiseled) {
group = "mod"
ofTask("build")
}

stonecutter registerChiseled
tasks.register("releaseAllVersions", stonecutter.chiseled) {
group = "mod"
ofTask("releaseMod")
}
stonecutter registerChiseled tasks.register("releaseAllVersions", stonecutter.chiseled) {
group = "mod"
ofTask("releaseMod")
}

private data class Field(val name: String, val value: String, val inline: Boolean)

Expand Down Expand Up @@ -94,7 +88,7 @@ tasks.register("postUpdate") {
}

val jsonString = Json.encodeToString(json)
val response = HttpClient.newHttpClient().send(
HttpClient.newHttpClient().send(
HttpRequest.newBuilder(URI.create(url)).header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(jsonString)).build(), HttpResponse.BodyHandlers.ofString()
)
Expand Down

0 comments on commit 86cffba

Please sign in to comment.