mirror of
https://github.com/plexusorg/Module-FalseOp.git
synced 2025-07-14 23:38:34 +00:00
Take a crack at updating the deprecated code
This commit is contained in:
@ -20,13 +20,13 @@ repositories {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly("io.papermc.paper:paper-api:1.21.1-R0.1-SNAPSHOT")
|
||||
compileOnly("dev.plex:server:1.5-SNAPSHOT")
|
||||
implementation("com.comphenix.protocol:ProtocolLib:5.3.0-SNAPSHOT")
|
||||
compileOnly("io.papermc.paper:paper-api:1.21.7-R0.1-SNAPSHOT")
|
||||
compileOnly("dev.plex:server:1.5")
|
||||
implementation("com.comphenix.protocol:ProtocolLib:5.3.0")
|
||||
}
|
||||
|
||||
group = "dev.plex"
|
||||
version = "1.5-SNAPSHOT"
|
||||
version = "1.5"
|
||||
description = "Module-FalseOp"
|
||||
|
||||
java {
|
||||
|
@ -4,6 +4,9 @@ import com.comphenix.protocol.PacketType;
|
||||
import com.comphenix.protocol.ProtocolLibrary;
|
||||
import com.comphenix.protocol.ProtocolManager;
|
||||
import com.comphenix.protocol.events.*;
|
||||
import io.papermc.paper.datacomponent.DataComponentType;
|
||||
import io.papermc.paper.datacomponent.DataComponentTypes;
|
||||
import io.papermc.paper.datacomponent.item.ItemAdventurePredicate;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
@ -27,6 +30,8 @@ public class PlayerListener extends PlexListener
|
||||
{
|
||||
private final ProtocolManager protocolManager;
|
||||
private final PacketListener packetListener;
|
||||
public static final DataComponentType.Valued<ItemAdventurePredicate> CAN_PLACE_ON = valued("can_place_on");
|
||||
|
||||
|
||||
public PlayerListener()
|
||||
{
|
||||
@ -80,8 +85,8 @@ public class PlayerListener extends PlexListener
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
if (meta != null)
|
||||
{
|
||||
canPlace = meta.getPlaceableKeys().contains(clicked.getType().getKey());
|
||||
canBreak = meta.getDestroyableKeys().contains(clicked.getType().getKey());
|
||||
canPlace = item.hasData(DataComponentTypes.CAN_PLACE_ON);
|
||||
canBreak = item.hasData(DataComponentTypes.CAN_BREAK);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
name: Module-FalseOp
|
||||
main: dev.plex.FalseOp
|
||||
description: Make clients think they have OP!
|
||||
version: 1.5-SNAPSHOT
|
||||
version: 1.5
|
Reference in New Issue
Block a user