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
Showing
26 changed files
with
77 additions
and
17 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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
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
41 changes: 41 additions & 0 deletions
41
...b-Core/src/main/java/de/Ste3et_C0st/FurnitureLib/NBT/ItemStackReader/ItemStackV120_1.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,41 @@ | ||
package de.Ste3et_C0st.FurnitureLib.NBT.ItemStackReader; | ||
|
||
import java.io.ByteArrayInputStream; | ||
import java.io.InputStream; | ||
import java.lang.reflect.Method; | ||
|
||
import org.bukkit.inventory.ItemStack; | ||
|
||
import de.Ste3et_C0st.FurnitureLib.NBT.NBTCompressedStreamTools; | ||
import de.Ste3et_C0st.FurnitureLib.NBT.NBTTagCompound; | ||
|
||
public class ItemStackV120_1 extends ItemStackReader{ | ||
|
||
private static Class<?> nmsNBTReadLimiter; | ||
private static Method a, asBukkitCopy; | ||
|
||
|
||
static { | ||
try { | ||
nmsNBTReadLimiter = Class.forName(getNbtFolder() + ".NBTReadLimiter"); | ||
a = clazz_nms_item.getMethod("a", clazz_nms_nbt); | ||
asBukkitCopy = clazz_obc_CraftItemStack.getMethod("asBukkitCopy", clazz_nms_item); | ||
clazz_nbttools_method_a_input = clazz_nbttools.getMethod("a", InputStream.class, nmsNBTReadLimiter); | ||
}catch(Exception ex) { | ||
ex.printStackTrace(); | ||
} | ||
} | ||
|
||
public ItemStack getItemStack(NBTTagCompound nbt) { | ||
try { | ||
byte[] data = NBTCompressedStreamTools.toByte(nbt); | ||
Object nbtTag = clazz_nbttools_method_a_input.invoke(null, new ByteArrayInputStream(data), nmsNBTReadLimiter.getMethod("a").invoke(null)); | ||
Object nms_item = a.invoke(null, nbtTag); | ||
return (ItemStack) asBukkitCopy.invoke(null, nms_item); | ||
} catch (Exception e) { | ||
e.printStackTrace(); | ||
return null; | ||
} | ||
} | ||
|
||
} |
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
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
buildSrc/.gradle/7.2/executionHistory/executionHistory.lock
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
buildSrc/.gradle/buildOutputCleanup/buildOutputCleanup.lock
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...tput/plugin-classes/precompiled_DeSte3et_c0stFurnitureJavaConventions$_run_closure7.class
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...re.java-conventions/precompiled_DeSte3et_c0stFurnitureJavaConventions$_run_closure7.class
Binary file not shown.
Binary file not shown.
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