Skip to content

Commit

Permalink
Reimplemented lost commits
Browse files Browse the repository at this point in the history
  • Loading branch information
WillFP committed Jan 6, 2024
1 parent d6e50e3 commit e7a5d8d
Show file tree
Hide file tree
Showing 15 changed files with 21 additions and 15 deletions.
2 changes: 1 addition & 1 deletion eco-core/core-backend/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ dependencies {
implementation("org.reflections:reflections:0.9.12")
implementation("org.objenesis:objenesis:3.2")

compileOnly("org.spigotmc:spigot-api:1.20.2-R0.1-SNAPSHOT")
compileOnly("io.papermc.paper:paper-api:1.20.2-R0.1-SNAPSHOT")
compileOnly("me.clip:placeholderapi:2.11.4")
compileOnly("net.kyori:adventure-text-minimessage:4.10.0")
compileOnly("net.kyori:adventure-platform-bukkit:4.1.0")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package com.willfp.eco.internal.command
import com.willfp.eco.core.EcoPlugin
import com.willfp.eco.core.command.CommandBase
import com.willfp.eco.core.command.NotificationException
import com.willfp.eco.core.config.base.LangYml
import org.bukkit.Bukkit
import org.bukkit.command.Command
import org.bukkit.command.CommandExecutor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package com.willfp.eco.internal.config

import com.willfp.eco.core.config.ConfigType
import com.willfp.eco.core.placeholder.InjectablePlaceholder
import java.util.concurrent.ConcurrentHashMap

class EcoConfigSection(
type: ConfigType,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import java.nio.channels.AsynchronousFileChannel
import java.nio.file.Files
import java.nio.file.StandardOpenOption

@Suppress("UNCHECKED_CAST")
open class EcoLoadableConfig(
type: ConfigType,
configName: String,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.willfp.eco.internal.drops

import com.willfp.eco.core.Prerequisite
import com.willfp.eco.core.drops.DropQueue
import com.willfp.eco.core.events.DropQueuePushEvent
import com.willfp.eco.core.integrations.antigrief.AntigriefManager
Expand Down Expand Up @@ -72,10 +73,17 @@ open class EcoDropQueue(val player: Player) : DropQueue() {
world.dropItem(location, drop!!).velocity = Vector()
}
if (xp > 0) {
val orb =
world.spawnEntity(player.location.add(0.0, 0.2, 0.0), EntityType.EXPERIENCE_ORB) as ExperienceOrb
orb.velocity = Vector(0, 0, 0)
orb.experience = xp
if (Prerequisite.HAS_PAPER.isMet) {
player.giveExp(xp, true)
} else {
val orb =
world.spawnEntity(
player.location.add(0.0, 0.2, 0.0),
EntityType.EXPERIENCE_ORB
) as ExperienceOrb
orb.velocity = Vector(0, 0, 0)
orb.experience = xp
}
}
} else {
for (drop in items) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ object EntityArgParserName : EntityArgParser {

val formatted = StringUtils.format(name)

@Suppress("DEPRECATION")
return EntityArgParseResult(
{ it.customName == formatted },
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class EcoExtensionLoader(
}
}

@Suppress("DEPRECATION")
@Throws(MalformedExtensionException::class)
private fun loadExtension(extensionJar: File) {
val url = extensionJar.toURI().toURL()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ import org.bukkit.NamespacedKey

class EcoNamespacedKeyFactory(private val plugin: EcoPlugin) : NamespacedKeyFactory {
override fun create(key: String): NamespacedKey {
return NamespacedKeyUtils.create(plugin.name, key)
return NamespacedKeyUtils.create(plugin.id, key)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ class FastInternalNamespacedKeyFactory : InternalNamespacedKeyFactory {

class SafeInternalNamespacedKeyFactory : InternalNamespacedKeyFactory {
override fun create(namespace: String, key: String): NamespacedKey {
@Suppress("DEPRECATION")
return NamespacedKey(namespace, key)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class EcoMenu(
getPossiblyReactiveSlot(row, column, player)

override fun open(player: Player): Inventory {
@Suppress("DEPRECATION")
val inventory = if (columns == 9) {
Bukkit.createInventory(null, rows * columns, title)
} else {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.willfp.eco.internal.gui.menu

import com.willfp.eco.core.gui.menu.events.CaptiveItemChangeEvent
import com.willfp.eco.core.items.isEmpty
import com.willfp.eco.core.recipe.parts.EmptyTestableItem
import com.willfp.eco.util.MenuUtils
import com.willfp.eco.util.openMenu
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import com.willfp.eco.core.placeholder.context.placeholderContext
import me.clip.placeholderapi.expansion.PlaceholderExpansion
import org.bukkit.entity.Player

@Suppress("DEPRECATION")
class PAPIExpansion(private val plugin: EcoPlugin) : PlaceholderExpansion() {
init {
register()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ object ArgParserHead : LookupArgParser {

playerName ?: return null

@Suppress("DEPRECATION")
val player = Bukkit.getOfflinePlayer(playerName)

meta.owningPlayer = player
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@ object ArgParserName : LookupArgParser {
val formatted = StringUtils.format(name)

// I don't know why it says it's redundant, the compiler yells at me
@Suppress("UsePropertyAccessSyntax", "RedundantSuppression")
@Suppress("UsePropertyAccessSyntax", "RedundantSuppression", "DEPRECATION")
meta.setDisplayName(formatted)

return Predicate {
val testMeta = it.itemMeta ?: return@Predicate false

@Suppress("DEPRECATION")
testMeta.displayName == formatted
}
}
Expand All @@ -37,6 +38,7 @@ object ArgParserName : LookupArgParser {
return null
}

@Suppress("DEPRECATION")
return "name:\"${meta.displayName}\""
}
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
package com.willfp.eco.internal.items

import com.willfp.eco.core.items.args.LookupArgParser
import org.bukkit.Color
import org.bukkit.NamespacedKey
import org.bukkit.Registry
import org.bukkit.inventory.ItemStack
import org.bukkit.inventory.meta.ArmorMeta
import org.bukkit.inventory.meta.ItemMeta
import org.bukkit.inventory.meta.LeatherArmorMeta
import org.bukkit.inventory.meta.trim.ArmorTrim
import org.bukkit.inventory.meta.trim.TrimMaterial
import org.bukkit.inventory.meta.trim.TrimPattern
Expand Down

0 comments on commit e7a5d8d

Please sign in to comment.