Skip to content

Commit

Permalink
1.20.5 - 1.20.6 support
Browse files Browse the repository at this point in the history
  • Loading branch information
Spliterash committed Jun 11, 2024
1 parent a38b15b commit 8de0312
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 10 deletions.
11 changes: 6 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
plugins {
`java-library`
id("com.github.johnrengelman.shadow") version "7.1.2"
id("io.freefair.lombok") version "8.0.1"
id("net.minecrell.plugin-yml.bukkit") version "0.5.2"
id("io.papermc.paperweight.userdev") version "1.5.4" apply false
id("io.github.goooler.shadow") version "8.1.7"
id("io.freefair.lombok") version "8.6"
id("net.minecrell.plugin-yml.bukkit") version "0.6.0"
id("io.papermc.paperweight.userdev") version "1.7.1" apply false
}

bukkit {
Expand All @@ -24,7 +24,7 @@ allprojects {
apply(plugin = "java-library");
apply(plugin = "io.freefair.lombok")

version = "2.1.0"
version = "2.1.1"

repositories {
mavenCentral()
Expand Down Expand Up @@ -66,4 +66,5 @@ dependencies {
api(project(":nms:versions:20_1", "reobf"))
api(project(":nms:versions:20_2", "reobf"))
api(project(":nms:versions:20_3", "reobf"))
api(project(":nms:versions:20_5", "reobf"))
}
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.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ public class JukeboxFactory {
case "1.20.4":
className = START_PATH + "V20_3";
break;
case "1.20.5":
case "1.20.6":
default:
className = null;
className = START_PATH + "V20_5";
break;
}
} else if (iV == 19) {
Expand Down
2 changes: 1 addition & 1 deletion nms/versions/20_3/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ java {
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
}
dependencies {
paperweight.paperDevBundle("1.20.4-R0.1-SNAPSHOT")
paperweight.paperDevBundle("1.20.3-R0.1-SNAPSHOT")
}
9 changes: 9 additions & 0 deletions nms/versions/20_5/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
plugins {
id("io.papermc.paperweight.userdev")
}
java {
toolchain.languageVersion.set(JavaLanguageVersion.of(21))
}
dependencies {
paperweight.paperDevBundle("1.20.5-R0.1-SNAPSHOT")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package ru.spliterash.musicbox.minecraft.nms.jukebox.versions;

import net.minecraft.world.level.block.entity.JukeboxBlockEntity;
import org.bukkit.block.Jukebox;
import org.bukkit.craftbukkit.block.CraftJukebox;
import org.bukkit.craftbukkit.inventory.CraftItemStack;
import org.bukkit.inventory.ItemStack;
import ru.spliterash.musicbox.minecraft.nms.jukebox.IJukebox;

public class V20_5 implements IJukebox {
private final JukeboxBlockEntity tileEntity;

public V20_5(Jukebox jukebox) {
CraftJukebox craft = (CraftJukebox) jukebox;
tileEntity = craft.getTileEntity();
}

public void setJukebox(ItemStack item) {
net.minecraft.world.item.ItemStack converted = CraftItemStack.asNMSCopy(item);
tileEntity.setRecordWithoutPlaying(converted);

}

public ItemStack getJukebox() {
net.minecraft.world.item.ItemStack nmsItem = tileEntity.getItem(0);
if (nmsItem.isEmpty())
return null;

return CraftItemStack.asBukkitCopy(nmsItem);
}
}
3 changes: 2 additions & 1 deletion plugin/src/main/java/ru/spliterash/musicbox/MusicBox.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import org.bukkit.command.PluginCommand;
import org.bukkit.command.TabExecutor;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.java.JavaPlugin;
import ru.spliterash.musicbox.commands.MusicBoxExecutor;
import ru.spliterash.musicbox.customPlayers.abstracts.AbstractBlockPlayer;
Expand Down Expand Up @@ -80,7 +81,7 @@ public void reloadPlugin() {
PlayerWrapper.clearAll();
MusicBoxSongManager.reload(new File(getDataFolder(), "songs"));
GUIActions.reloadGUI();

ItemStack stack;


if (configObject.isBStats() && bStats == null) {
Expand Down
3 changes: 2 additions & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ include "nms:versions:19_3"
include "nms:versions:19_4"
include "nms:versions:20_1"
include "nms:versions:20_2"
include "nms:versions:20_3"
include "nms:versions:20_3"
include "nms:versions:20_5"

0 comments on commit 8de0312

Please sign in to comment.