-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a38b15b
commit 8de0312
Showing
8 changed files
with
55 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") | ||
} |
31 changes: 31 additions & 0 deletions
31
...sions/20_5/src/main/java/ru/spliterash/musicbox/minecraft/nms/jukebox/versions/V20_5.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters