Skip to content

Commit

Permalink
Merge pull request #1 from RappyLabyAddons/master
Browse files Browse the repository at this point in the history
Add support for 1.20.1, fix 1.19.4
  • Loading branch information
ByteExceptionM authored Jun 14, 2023
2 parents 5f5b275 + 127ec49 commit 623ff6c
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 18 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ cmake-build-*/

# IntelliJ
out/
.assetsroot

# mpeltonen/sbt-idea plugin
.idea_modules/
Expand Down
4 changes: 2 additions & 2 deletions api/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ labyModProcessor {
}

java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
13 changes: 3 additions & 10 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ labyMod {
author = "ByteException_"
description = "LabyMod addon to view item nbt data in minecraft. Enable Advanced Tooltips (F3+H), hover over an item and press SHIFT. Magic starts..."
minecraftVersion = "1.17.1<*"
version = System.getenv().getOrDefault("VERSION", "0.0.1")
version = System.getenv().getOrDefault("VERSION", "1.2.0")
}

minecraft {
Expand All @@ -26,7 +26,8 @@ labyMod {
"1.18.2",
"1.19.2",
"1.19.3",
"1.19.4-pre3"
"1.19.4",
"1.20.1"
) { version, provider ->
configureRun(provider, version)
}
Expand Down Expand Up @@ -68,14 +69,6 @@ fun configureRun(provider: net.labymod.gradle.core.minecraft.provider.VersionPro
}

provider.javaVersion = when (gameVersion) {
"1.8.9", "1.12.2", "1.16.5" -> {
JavaVersion.VERSION_1_8
}

"1.17.1" -> {
JavaVersion.VERSION_16
}

else -> {
JavaVersion.VERSION_17
}
Expand Down
4 changes: 2 additions & 2 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ labyModProcessor {
}

java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
2 changes: 1 addition & 1 deletion core/src/main/java/io/masel/nbtaddon/core/NBTAddon.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class NBTAddon extends LabyAddon<NBTAddonConfiguration> {

@Override
protected void load() {
this.nbtApi = ((DefaultReferenceStorage) this.getReferenceStorageAccessor()).inbtApi();
this.nbtApi = ((DefaultReferenceStorage) this.referenceStorageAccessor()).inbtApi();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.masel.nbtaddon.v1_19_4_pre3;
package io.masel.nbtaddon.v1_19_4;

import io.masel.nbtaddon.api.INBTApi;
import net.labymod.api.models.Implements;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package io.masel.nbtaddon.v1_20_1;

import io.masel.nbtaddon.api.INBTApi;
import net.labymod.api.models.Implements;
import net.labymod.api.nbt.tags.NBTTagCompound;
import net.minecraft.client.Minecraft;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.nbt.NbtUtils;

@Implements(INBTApi.class)
public class NBTApiImpl implements INBTApi {

@Override
public boolean hasAdvancedToolsTips() {
return Minecraft.getInstance().options.advancedItemTooltips;
}

@Override
public String prettyPrint(NBTTagCompound nbtTagCompound) {
CompoundTag compound = (CompoundTag) nbtTagCompound;

return NbtUtils.prettyPrint(compound);
}

}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
rootProject.name = "laby-nbt-addon"

pluginManagement {
val labyGradlePluginVersion = "0.3.18"
val labyGradlePluginVersion = "0.3.25"
plugins {
id("net.labymod.gradle") version (labyGradlePluginVersion)
}
Expand Down

0 comments on commit 623ff6c

Please sign in to comment.