Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9a703f6190 | ||
|
|
f8fec7eec4 | ||
|
|
f6aadda4ed | ||
|
|
d8fca0f348 | ||
|
|
65ff4c4a31 | ||
|
|
90702bc7aa | ||
|
|
e81b788a1b | ||
|
|
ebc0ee7940 | ||
|
|
82d269daf1 | ||
|
|
9d5300d6ae | ||
|
|
8870e4d6fb | ||
|
|
d826a9f71f | ||
|
|
7ec3355237 | ||
|
|
e59a8cc2e6 | ||
|
|
88f974fd10 |
@@ -77,9 +77,6 @@ allprojects {
|
|||||||
|
|
||||||
// LibsDisguises
|
// LibsDisguises
|
||||||
maven("https://repo.md-5.net/content/groups/public/")
|
maven("https://repo.md-5.net/content/groups/public/")
|
||||||
|
|
||||||
// FabledSkyblock
|
|
||||||
maven("https://repo.songoda.com/repository/public/")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
|||||||
@@ -230,11 +230,11 @@ public final class Items {
|
|||||||
|
|
||||||
String reformattedKey = keyID.replace("__", ":");
|
String reformattedKey = keyID.replace("__", ":");
|
||||||
|
|
||||||
item = provider.provideForKey(reformattedKey);
|
part = provider.provideForKey(reformattedKey);
|
||||||
if (item instanceof EmptyTestableItem || item == null) {
|
if (part instanceof EmptyTestableItem || part == null) {
|
||||||
return new EmptyTestableItem();
|
return new EmptyTestableItem();
|
||||||
}
|
}
|
||||||
registerCustomItem(namespacedKey, item);
|
registerCustomItem(namespacedKey, part);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ dependencies {
|
|||||||
compileOnly 'com.comphenix.protocol:ProtocolLib:5.0.0-SNAPSHOT'
|
compileOnly 'com.comphenix.protocol:ProtocolLib:5.0.0-SNAPSHOT'
|
||||||
compileOnly 'com.sk89q.worldguard:worldguard-bukkit:7.0.7-SNAPSHOT'
|
compileOnly 'com.sk89q.worldguard:worldguard-bukkit:7.0.7-SNAPSHOT'
|
||||||
compileOnly 'com.github.TechFortress:GriefPrevention:16.17.1'
|
compileOnly 'com.github.TechFortress:GriefPrevention:16.17.1'
|
||||||
compileOnly 'com.github.cryptomorin:kingdoms:1.12.3'
|
|
||||||
compileOnly('com.github.TownyAdvanced:Towny:0.97.2.6') {
|
compileOnly('com.github.TownyAdvanced:Towny:0.97.2.6') {
|
||||||
exclude group: 'com.zaxxer', module: 'HikariCP'
|
exclude group: 'com.zaxxer', module: 'HikariCP'
|
||||||
}
|
}
|
||||||
@@ -41,7 +40,6 @@ dependencies {
|
|||||||
compileOnly 'com.gmail.filoghost.holographicdisplays:holographicdisplays-api:2.4.0'
|
compileOnly 'com.gmail.filoghost.holographicdisplays:holographicdisplays-api:2.4.0'
|
||||||
compileOnly 'com.github.EssentialsX:Essentials:2.18.2'
|
compileOnly 'com.github.EssentialsX:Essentials:2.18.2'
|
||||||
compileOnly 'com.bgsoftware:SuperiorSkyblockAPI:1.8.3'
|
compileOnly 'com.bgsoftware:SuperiorSkyblockAPI:1.8.3'
|
||||||
compileOnly 'com.songoda:skyblock:2.3.30'
|
|
||||||
compileOnly 'com.github.MilkBowl:VaultAPI:1.7'
|
compileOnly 'com.github.MilkBowl:VaultAPI:1.7'
|
||||||
compileOnly 'com.github.WhipDevelopment:CrashClaim:f9cd7d92eb'
|
compileOnly 'com.github.WhipDevelopment:CrashClaim:f9cd7d92eb'
|
||||||
compileOnly 'com.wolfyscript.wolfyutilities:wolfyutilities:3.16.0.0'
|
compileOnly 'com.wolfyscript.wolfyutilities:wolfyutilities:3.16.0.0'
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ import com.willfp.eco.internal.spigot.data.PlayerBlockListener
|
|||||||
import com.willfp.eco.internal.spigot.data.storage.ProfileSaver
|
import com.willfp.eco.internal.spigot.data.storage.ProfileSaver
|
||||||
import com.willfp.eco.internal.spigot.display.PacketAutoRecipe
|
import com.willfp.eco.internal.spigot.display.PacketAutoRecipe
|
||||||
import com.willfp.eco.internal.spigot.display.PacketChat
|
import com.willfp.eco.internal.spigot.display.PacketChat
|
||||||
import com.willfp.eco.internal.spigot.display.PacketHeldWindowItems
|
import com.willfp.eco.internal.spigot.display.PacketHeldItemSlot
|
||||||
import com.willfp.eco.internal.spigot.display.PacketOpenWindowMerchant
|
import com.willfp.eco.internal.spigot.display.PacketOpenWindowMerchant
|
||||||
import com.willfp.eco.internal.spigot.display.PacketSetCreativeSlot
|
import com.willfp.eco.internal.spigot.display.PacketSetCreativeSlot
|
||||||
import com.willfp.eco.internal.spigot.display.PacketSetSlot
|
import com.willfp.eco.internal.spigot.display.PacketSetSlot
|
||||||
@@ -357,7 +357,7 @@ abstract class EcoSpigotPlugin : EcoPlugin() {
|
|||||||
PacketSetCreativeSlot(this),
|
PacketSetCreativeSlot(this),
|
||||||
PacketSetSlot(this),
|
PacketSetSlot(this),
|
||||||
PacketWindowItems(this),
|
PacketWindowItems(this),
|
||||||
PacketHeldWindowItems(this),
|
PacketHeldItemSlot(this),
|
||||||
PacketOpenWindowMerchant(this)
|
PacketOpenWindowMerchant(this)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package com.willfp.eco.internal.spigot.display
|
||||||
|
|
||||||
|
import com.comphenix.protocol.PacketType
|
||||||
|
import com.comphenix.protocol.events.PacketContainer
|
||||||
|
import com.comphenix.protocol.events.PacketEvent
|
||||||
|
import com.willfp.eco.core.AbstractPacketAdapter
|
||||||
|
import com.willfp.eco.core.EcoPlugin
|
||||||
|
import com.willfp.eco.internal.spigot.display.frame.DisplayFrame
|
||||||
|
import com.willfp.eco.internal.spigot.display.frame.lastDisplayFrame
|
||||||
|
import org.bukkit.entity.Player
|
||||||
|
|
||||||
|
class PacketHeldItemSlot(plugin: EcoPlugin) :
|
||||||
|
AbstractPacketAdapter(plugin, PacketType.Play.Server.HELD_ITEM_SLOT, false) {
|
||||||
|
override fun onSend(
|
||||||
|
packet: PacketContainer,
|
||||||
|
player: Player,
|
||||||
|
event: PacketEvent
|
||||||
|
) {
|
||||||
|
player.lastDisplayFrame = DisplayFrame.EMPTY
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onReceive(
|
||||||
|
packet: PacketContainer,
|
||||||
|
player: Player,
|
||||||
|
event: PacketEvent
|
||||||
|
) {
|
||||||
|
player.lastDisplayFrame = DisplayFrame.EMPTY
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
package com.willfp.eco.internal.spigot.display
|
|
||||||
|
|
||||||
import com.comphenix.protocol.PacketType
|
|
||||||
import com.comphenix.protocol.events.PacketContainer
|
|
||||||
import com.comphenix.protocol.events.PacketEvent
|
|
||||||
import com.willfp.eco.core.AbstractPacketAdapter
|
|
||||||
import com.willfp.eco.core.EcoPlugin
|
|
||||||
import com.willfp.eco.core.display.Display
|
|
||||||
import org.bukkit.entity.Player
|
|
||||||
import org.bukkit.inventory.ItemStack
|
|
||||||
|
|
||||||
class PacketHeldWindowItems(plugin: EcoPlugin) :
|
|
||||||
AbstractPacketAdapter(plugin, PacketType.Play.Server.WINDOW_ITEMS, false) {
|
|
||||||
override fun onSend(
|
|
||||||
packet: PacketContainer,
|
|
||||||
player: Player,
|
|
||||||
event: PacketEvent
|
|
||||||
) {
|
|
||||||
packet.itemModifier.modify(0) { item: ItemStack? ->
|
|
||||||
Display.display(
|
|
||||||
item!!, player
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -9,7 +9,6 @@ import com.willfp.eco.core.display.Display
|
|||||||
import com.willfp.eco.internal.spigot.display.frame.DisplayFrame
|
import com.willfp.eco.internal.spigot.display.frame.DisplayFrame
|
||||||
import com.willfp.eco.internal.spigot.display.frame.lastDisplayFrame
|
import com.willfp.eco.internal.spigot.display.frame.lastDisplayFrame
|
||||||
import org.bukkit.entity.Player
|
import org.bukkit.entity.Player
|
||||||
import org.bukkit.inventory.ItemStack
|
|
||||||
|
|
||||||
class PacketSetSlot(plugin: EcoPlugin) : AbstractPacketAdapter(plugin, PacketType.Play.Server.SET_SLOT, false) {
|
class PacketSetSlot(plugin: EcoPlugin) : AbstractPacketAdapter(plugin, PacketType.Play.Server.SET_SLOT, false) {
|
||||||
override fun onSend(
|
override fun onSend(
|
||||||
@@ -17,13 +16,12 @@ class PacketSetSlot(plugin: EcoPlugin) : AbstractPacketAdapter(plugin, PacketTyp
|
|||||||
player: Player,
|
player: Player,
|
||||||
event: PacketEvent
|
event: PacketEvent
|
||||||
) {
|
) {
|
||||||
packet.itemModifier.modify(0, object : VersionCompatiblePLibFunction<ItemStack> {
|
packet.itemModifier.modify(0) {
|
||||||
override fun apply(item: ItemStack) =
|
Display.display(
|
||||||
Display.display(
|
it,
|
||||||
item,
|
player
|
||||||
player
|
)
|
||||||
)
|
}
|
||||||
})
|
|
||||||
|
|
||||||
player.lastDisplayFrame = DisplayFrame.EMPTY
|
player.lastDisplayFrame = DisplayFrame.EMPTY
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,21 +14,32 @@ import org.bukkit.inventory.ItemStack
|
|||||||
import java.util.concurrent.ConcurrentHashMap
|
import java.util.concurrent.ConcurrentHashMap
|
||||||
|
|
||||||
class PacketWindowItems(plugin: EcoPlugin) : AbstractPacketAdapter(plugin, PacketType.Play.Server.WINDOW_ITEMS, false) {
|
class PacketWindowItems(plugin: EcoPlugin) : AbstractPacketAdapter(plugin, PacketType.Play.Server.WINDOW_ITEMS, false) {
|
||||||
private val ignorePacketList = ConcurrentHashMap.newKeySet<String>()
|
private val lastKnownWindowIDs = ConcurrentHashMap<String, Int>()
|
||||||
|
|
||||||
override fun onSend(
|
override fun onSend(
|
||||||
packet: PacketContainer,
|
packet: PacketContainer,
|
||||||
player: Player,
|
player: Player,
|
||||||
event: PacketEvent
|
event: PacketEvent
|
||||||
) {
|
) {
|
||||||
if (ignorePacketList.contains(player.name)) {
|
packet.itemModifier.modify(0) {
|
||||||
ignorePacketList.remove(player.name)
|
Display.display(
|
||||||
return
|
it, player
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
val windowId = packet.integers.read(0)
|
val windowId = packet.integers.read(0)
|
||||||
|
|
||||||
if (windowId != 0) {
|
// Using name because UUID is unreliable with ProtocolLib players.
|
||||||
|
val name = player.name
|
||||||
|
|
||||||
|
val lastKnownID = lastKnownWindowIDs[name]
|
||||||
|
lastKnownWindowIDs[name] = windowId
|
||||||
|
|
||||||
|
// If there is any change in window ID at any point,
|
||||||
|
// Remove the last display frame to prevent any potential conflicts.
|
||||||
|
// If the window ID is not zero (not a player inventory), then remove too,
|
||||||
|
// as GUIs are not player inventories.
|
||||||
|
if (lastKnownID != windowId || windowId != 0) {
|
||||||
player.lastDisplayFrame = DisplayFrame.EMPTY
|
player.lastDisplayFrame = DisplayFrame.EMPTY
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
package com.willfp.eco.internal.spigot.display
|
|
||||||
|
|
||||||
import com.google.common.base.Function
|
|
||||||
import java.util.function.UnaryOperator
|
|
||||||
|
|
||||||
interface VersionCompatiblePLibFunction<T> : Function<T, T>, UnaryOperator<T> {
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -6,10 +6,10 @@ import org.bukkit.block.Block
|
|||||||
import org.bukkit.entity.LivingEntity
|
import org.bukkit.entity.LivingEntity
|
||||||
import org.bukkit.entity.Player
|
import org.bukkit.entity.Player
|
||||||
import org.kingdoms.constants.group.Kingdom
|
import org.kingdoms.constants.group.Kingdom
|
||||||
import org.kingdoms.constants.group.model.KingdomRelation
|
import org.kingdoms.constants.group.model.relationships.StandardRelationAttribute
|
||||||
import org.kingdoms.constants.land.Land
|
import org.kingdoms.constants.land.Land
|
||||||
import org.kingdoms.constants.player.DefaultKingdomPermission
|
|
||||||
import org.kingdoms.constants.player.KingdomPlayer
|
import org.kingdoms.constants.player.KingdomPlayer
|
||||||
|
import org.kingdoms.constants.player.StandardKingdomPermission
|
||||||
import org.kingdoms.managers.PvPManager
|
import org.kingdoms.managers.PvPManager
|
||||||
|
|
||||||
class AntigriefKingdoms : AntigriefIntegration {
|
class AntigriefKingdoms : AntigriefIntegration {
|
||||||
@@ -23,11 +23,13 @@ class AntigriefKingdoms : AntigriefIntegration {
|
|||||||
}
|
}
|
||||||
val kingdom: Kingdom = kp.kingdom ?: return false
|
val kingdom: Kingdom = kp.kingdom ?: return false
|
||||||
val land = Land.getLand(block) ?: return true
|
val land = Land.getLand(block) ?: return true
|
||||||
val permission: DefaultKingdomPermission =
|
val permission = if (land.isNexusLand) {
|
||||||
if (land.isNexusLand) DefaultKingdomPermission.NEXUS_BUILD else DefaultKingdomPermission.BUILD
|
StandardKingdomPermission.NEXUS_BUILD
|
||||||
|
} else StandardKingdomPermission.BUILD
|
||||||
|
|
||||||
return if (!kp.hasPermission(permission)) {
|
return if (!kp.hasPermission(permission)) {
|
||||||
false
|
false
|
||||||
} else kingdom.hasAttribute(land.kingdom, KingdomRelation.Attribute.BUILD)
|
} else kingdom.hasAttribute(land.kingdom, StandardRelationAttribute.BUILD)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun canCreateExplosion(
|
override fun canCreateExplosion(
|
||||||
|
|||||||
@@ -27,11 +27,11 @@ class CustomItemsScyther : CustomItemsIntegration {
|
|||||||
Scyther.getInstance(),
|
Scyther.getInstance(),
|
||||||
material,
|
material,
|
||||||
0,
|
0,
|
||||||
null,
|
1.0,
|
||||||
1,
|
1,
|
||||||
Int.MAX_VALUE,
|
Int.MAX_VALUE,
|
||||||
null,
|
"AUTOSELL",
|
||||||
null
|
true
|
||||||
)
|
)
|
||||||
|
|
||||||
val namespacedKey = NamespacedKeyUtils.create("scyther", key)
|
val namespacedKey = NamespacedKeyUtils.create("scyther", key)
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
version = 6.41.0
|
version = 6.41.3
|
||||||
plugin-name = eco
|
plugin-name = eco
|
||||||
kotlin.code.style = official
|
kotlin.code.style = official
|
||||||
BIN
lib/FabledSkyblock-2.5.0.jar
Normal file
BIN
lib/FabledSkyblock-2.5.0.jar
Normal file
Binary file not shown.
BIN
lib/KingdomsX-1.14.13-BETA.jar
Normal file
BIN
lib/KingdomsX-1.14.13-BETA.jar
Normal file
Binary file not shown.
Reference in New Issue
Block a user