ProtocolLib

3M Downloads

[1.12.2] BLOCK_CHANGE missing BlockData from bukkit, cant compile

gw2princeps opened this issue ยท 0 comments

commented

Hello,
I have this tiny piece of code:

public void send_fake_block_packet(Player p, Location loc, Material mat) {
        PacketContainer fakeblock = new PacketContainer(PacketType.Play.Server.BLOCK_CHANGE);
        fakeblock.getBlockPositionModifier().write(0,
                new BlockPosition(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()));
        fakeblock.getBlockData().write(0, WrappedBlockData.createData(mat));
        try {
            ProtocolLibrary.getProtocolManager().sendServerPacket(p, fakeblock);
        } catch (InvocationTargetException e) {
            throw new RuntimeException("Cannot send packet " + fakeblock, e);
        }
    }

Whenever I try to package this piece with maven, I get following error:

[ERROR] --redacted--/LandLord-legacy/src/main/java/biz/princeps/landlord/UtilsProxy.java:[33,59] cannot access org.bukkit.block.data.BlockData
[ERROR] class file for org.bukkit.block.data.BlockData not found

pom dependencies

       <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot-api</artifactId>
            <version>1.12.2-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.bukkit</groupId>
            <artifactId>bukkit</artifactId>
            <version>1.12.2-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>

I've tried to compile it with my own self compiled spigot jar as dependency, same error.

Thanks!