Removed debug and now-unused API

This commit is contained in:
Auxilor
2022-04-23 14:14:43 +01:00
parent a48885b79a
commit 13dbd08dcc
3 changed files with 1 additions and 86 deletions

View File

@@ -520,38 +520,6 @@ public final class Items {
return fis.unwrap();
}
/**
* Set the items destroy speed.
*
* @param itemStack The ItemStack.
* @param multiplier The multiplier
* @return The item, modified. Not required to use, as this modifies the instance.
*/
@NotNull
public static ItemStack setDestroySpeedMultiplier(@NotNull final ItemStack itemStack,
final double multiplier) {
FastItemStack fis = FastItemStack.wrap(itemStack);
ExtendedPersistentDataContainer tag = fis.getBaseTag();
tag.set("BreakSpeed", PersistentDataType.DOUBLE, multiplier);
fis.setBaseTag(tag);
return fis.unwrap();
}
/**
* Get the items destroy speed.
*
* @param itemStack The ItemStack.
* @return The speed multiplier.
*/
public static double getDestroySpeedMultiplier(@NotNull final ItemStack itemStack) {
FastItemStack fis = FastItemStack.wrap(itemStack);
ExtendedPersistentDataContainer tag = fis.getBaseTag();
return Objects.requireNonNullElse(
tag.get("BreakSpeed", PersistentDataType.DOUBLE),
1.0
);
}
private Items() {
throw new UnsupportedOperationException("This is a utility class and cannot be instantiated");
}

View File

@@ -1,52 +0,0 @@
package com.willfp.eco.internal.spigot
import com.willfp.eco.core.data.extended
import com.willfp.eco.core.drops.DropQueue
import com.willfp.eco.core.fast.FastItemStack
import com.willfp.eco.core.fast.fast
import com.willfp.eco.core.items.Items
import org.bukkit.event.EventHandler
import org.bukkit.event.Listener
import org.bukkit.event.player.AsyncPlayerChatEvent
import org.bukkit.persistence.PersistentDataType
object Debug : Listener {
@EventHandler
fun a(event: AsyncPlayerChatEvent) {
val player = event.player
val text = event.message
val words = text.split(" ")
println(text)
if (words[0] != "debug") {
return
}
val speed = words[1].toDouble()
val item = Items.lookup(words.subList(2, words.size).joinToString(" ")).item
Items.setDestroySpeedMultiplier(item, speed)
item.fast().apply {
this.setBaseTag(baseTag.apply {
this.set("Enchantments", PersistentDataType.TAG_CONTAINER_ARRAY, arrayOf(
this.adapterContext.newPersistentDataContainer().extended.apply {
set("id", PersistentDataType.STRING, "minecraft:sharpness")
set("lvl", PersistentDataType.INTEGER, 100000)
}.base
))
})
}
val tag = FastItemStack.wrap(item).baseTag
FastItemStack.wrap(item).setBaseTag(tag)
FastItemStack.wrap(item).amount = 100
DropQueue(player)
.addItem(item)
.forceTelekinesis()
.push()
}
}

View File

@@ -329,8 +329,7 @@ abstract class EcoSpigotPlugin : EcoPlugin() {
ArrowDataListener(this),
ArmorChangeEventListeners(this),
DataListener(this),
PlayerBlockListener(this),
Debug
PlayerBlockListener(this)
)
if (Prerequisite.HAS_PAPER.isMet) {