Backported successfully!
This commit is contained in:
@@ -5,7 +5,7 @@ plugins {
|
||||
}
|
||||
|
||||
group = 'me.trouper'
|
||||
version = '1.0-SNAPSHOT'
|
||||
version = '1.0-1.21.1-SNAPSHOT'
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
@@ -20,7 +20,7 @@ repositories {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly("io.papermc.paper:paper-api:1.21.5-R0.1-SNAPSHOT")
|
||||
compileOnly("io.papermc.paper:paper-api:1.21.1-R0.1-SNAPSHOT")
|
||||
}
|
||||
|
||||
tasks {
|
||||
|
||||
@@ -7,13 +7,13 @@ import java.io.*;
|
||||
|
||||
public interface JsonSerializable<T> {
|
||||
|
||||
Gson gson = new GsonBuilder().setPrettyPrinting().serializeNulls().setStrictness(Strictness.LENIENT).create();
|
||||
Gson gson = new GsonBuilder().setPrettyPrinting().serializeNulls().setLenient().create();
|
||||
File getFile();
|
||||
|
||||
default String serialize(boolean pretty) {
|
||||
Gson gson;
|
||||
if (pretty) {
|
||||
gson = new GsonBuilder().setPrettyPrinting().setStrictness(Strictness.LENIENT).create();
|
||||
gson = new GsonBuilder().setPrettyPrinting().setLenient().create();
|
||||
}
|
||||
else {
|
||||
gson = new Gson();
|
||||
|
||||
@@ -16,9 +16,8 @@ public class TaskManager implements Main {
|
||||
if (closed) return -1;
|
||||
|
||||
int taskId = Bukkit.getScheduler().runTaskLater(main.getPlugin(), () -> {
|
||||
if (!closed && tasks.containsKey(taskId)) {
|
||||
if (!closed) {
|
||||
task.run();
|
||||
tasks.remove(taskId);
|
||||
}
|
||||
}, delay).getTaskId();
|
||||
|
||||
|
||||
@@ -442,7 +442,7 @@ public class Text implements Main {
|
||||
TextColor.color(0xFFB0C1), // Light pink for default args
|
||||
TextColor.color(0xB6F5B6), // Light green for second arg
|
||||
TextColor.color(0xB0C1FF), // Light blue for third arg
|
||||
new SoundData(Sound.UI_HUD_BUBBLE_POP, 2)
|
||||
new SoundData(Sound.UI_TOAST_IN, 2)
|
||||
);
|
||||
|
||||
private final TextColor mainText;
|
||||
|
||||
@@ -10,7 +10,6 @@ import org.bukkit.enchantments.Enchantment;
|
||||
import org.bukkit.inventory.ItemFlag;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
import org.bukkit.inventory.meta.components.CustomModelDataComponent;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
@@ -20,7 +19,6 @@ import java.util.function.Function;
|
||||
public class ItemBuilder {
|
||||
private ItemStack stack;
|
||||
private ItemMeta meta;
|
||||
private CustomModelDataComponent modelData;
|
||||
private final MiniMessage miniMessage = MiniMessage.miniMessage();
|
||||
|
||||
public ItemBuilder() {
|
||||
@@ -186,16 +184,6 @@ public class ItemBuilder {
|
||||
return unbreakable(true);
|
||||
}
|
||||
|
||||
public ItemBuilder customModelData(CustomModelDataComponent data) {
|
||||
this.modelData = data;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ItemBuilder clearCustomModelData() {
|
||||
this.modelData = null;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ItemBuilder modifyStack(Function<ItemStack, ItemStack> modifier) {
|
||||
this.stack = modifier.apply(this.build());
|
||||
this.meta = this.stack.getItemMeta();
|
||||
@@ -215,7 +203,6 @@ public class ItemBuilder {
|
||||
}
|
||||
|
||||
public ItemStack build() {
|
||||
this.meta.setCustomModelDataComponent(this.modelData);
|
||||
this.stack.setItemMeta(this.meta);
|
||||
return this.stack.clone();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user