File tree Expand file tree Collapse file tree 3 files changed +12
-7
lines changed
Expand file tree Collapse file tree 3 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -20,13 +20,13 @@ repositories {
2020}
2121
2222dependencies {
23- compileOnly(" io.papermc.paper:paper-api:1.21.1 -R0.1-SNAPSHOT" )
24- compileOnly(" dev.plex:server:1.5-SNAPSHOT " )
25- implementation(" com.comphenix.protocol:ProtocolLib:5.3.0-SNAPSHOT " )
23+ compileOnly(" io.papermc.paper:paper-api:1.21.7 -R0.1-SNAPSHOT" )
24+ compileOnly(" dev.plex:server:1.5" )
25+ implementation(" com.comphenix.protocol:ProtocolLib:5.3.0" )
2626}
2727
2828group = " dev.plex"
29- version = " 1.5-SNAPSHOT "
29+ version = " 1.5"
3030description = " Module-FalseOp"
3131
3232java {
Original file line number Diff line number Diff line change 44import com .comphenix .protocol .ProtocolLibrary ;
55import com .comphenix .protocol .ProtocolManager ;
66import com .comphenix .protocol .events .*;
7+ import io .papermc .paper .datacomponent .DataComponentType ;
8+ import io .papermc .paper .datacomponent .DataComponentTypes ;
9+ import io .papermc .paper .datacomponent .item .ItemAdventurePredicate ;
710import org .bukkit .GameMode ;
811import org .bukkit .Location ;
912import org .bukkit .Material ;
@@ -27,6 +30,8 @@ public class PlayerListener extends PlexListener
2730{
2831 private final ProtocolManager protocolManager ;
2932 private final PacketListener packetListener ;
33+ public static final DataComponentType .Valued <ItemAdventurePredicate > CAN_PLACE_ON = valued ("can_place_on" );
34+
3035
3136 public PlayerListener ()
3237 {
@@ -80,8 +85,8 @@ private void onBlock(PlayerInteractEvent event)
8085 ItemMeta meta = item .getItemMeta ();
8186 if (meta != null )
8287 {
83- canPlace = meta . getPlaceableKeys (). contains ( clicked . getType (). getKey () );
84- canBreak = meta . getDestroyableKeys (). contains ( clicked . getType (). getKey () );
88+ canPlace = item . hasData ( DataComponentTypes . CAN_PLACE_ON );
89+ canBreak = item . hasData ( DataComponentTypes . CAN_BREAK );
8590 }
8691 }
8792 }
Original file line number Diff line number Diff line change 11name : Module-FalseOp
22main : dev.plex.FalseOp
33description : Make clients think they have OP!
4- version : 1.5-SNAPSHOT
4+ version : 1.5
You can’t perform that action at this time.
0 commit comments