Giter Site home page Giter Site logo

Comments (10)

Toper9636 avatar Toper9636 commented on June 9, 2024 2

👍👌😊😘

from protocol.

Toper9636 avatar Toper9636 commented on June 9, 2024 2

???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????

from protocol.

Alemiz112 avatar Alemiz112 commented on June 9, 2024

The packet you are sending is wrong. CameraSetInstruction is not properly initialized, does not have any properties. If you do not wish to use set instruction, simply set it to null. If you need to use it, you are required to set preset definitions.

from protocol.

Toper9636 avatar Toper9636 commented on June 9, 2024
CameraInstructionPacket pk = new CameraInstructionPacket();
CameraFadeInstruction fadeInstruction = new CameraFadeInstruction();
fadeInstruction.setTimeData(new CameraFadeInstruction.TimeData(0.5f, 0.6f, 0.5f));
fadeInstruction.setColor(new Color(0, 0, 0.2352941334247589f));
pk.setSetInstruction(new CameraSetInstruction());
pk.setFadeInstruction(fadeInstruction);

event.getPlayer().sendPacket(pk);

Here is the code I use to send the packet

from protocol.

Toper9636 avatar Toper9636 commented on June 9, 2024

The packet you are sending is wrong. CameraSetInstruction is not properly initialized, does not have any properties. If you do not wish to use set instruction, simply set it to null. If you need to use it, you are required to set preset definitions.

I don't get it, what do I need to change to make it work?

from protocol.

onebeastchris avatar onebeastchris commented on June 9, 2024

just remove the line where you add empty camera set instructions, that's not needed and causes the issue here

from protocol.

Toper9636 avatar Toper9636 commented on June 9, 2024
CameraInstructionPacket pk = new CameraInstructionPacket();
pk.setFadeInstruction(new CameraFadeInstruction(
        new CameraFadeInstruction.TimeData(0.5f, 0.6f, 0.5f),
        new Color(0, 0, 0.2352941334247589f)
));

event.getPlayer().sendPacket(pk);

This code causes the same error

19:25:26 [ERROR] Error encoding packet CameraInstructionPacket(setInstruction=null, fadeInstruction=CameraFadeInstruction(timeData=CameraFadeInstruction.TimeData(fadeInTime=0.5, waitTime=0.6, fadeOutTime=0.5), color=java.awt.Color[r=0,g=0,b=60]), clear=OptionalBoolean.empty)
java.lang.NullPointerException: Cannot invoke "org.cloudburstmc.protocol.bedrock.codec.BedrockPacketDefinition.getId()" because the return value of "org.cloudburstmc.protocol.bedrock.codec.BedrockCodec.getPacketDefinition(java.lang.Class)" is null
        at dev.waterdog.waterdogpe.network.connection.codec.packet.BedrockPacketCodec.getPacketId(BedrockPacketCodec.java:143) ~[server.jar:?]        at dev.waterdog.waterdogpe.network.connection.codec.packet.BedrockPacketCodec.encode(BedrockPacketCodec.java:86) ~[server.jar:?]
        at dev.waterdog.waterdogpe.network.connection.codec.packet.BedrockPacketCodec.encode(BedrockPacketCodec.java:58) ~[server.jar:?]
        at dev.waterdog.waterdogpe.network.connection.codec.packet.BedrockPacketCodec.encode(BedrockPacketCodec.java:36) ~[server.jar:?]
        at io.netty.handler.codec.MessageToMessageCodec$1.encode(MessageToMessageCodec.java:67) ~[server.jar:?]
        at io.netty.handler.codec.MessageToMessageEncoder.write(MessageToMessageEncoder.java:90) ~[server.jar:?]
        at io.netty.handler.codec.MessageToMessageCodec.write(MessageToMessageCodec.java:116) ~[server.jar:?]
        at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:879) ~[server.jar:?]
        at io.netty.channel.AbstractChannelHandlerContext.invokeWriteAndFlush(AbstractChannelHandlerContext.java:940) ~[server.jar:?]
        at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:966) ~[server.jar:?]
        at io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:934) ~[server.jar:?]
        at io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:984) ~[server.jar:?]
        at io.netty.channel.DefaultChannelPipeline.writeAndFlush(DefaultChannelPipeline.java:1025) ~[server.jar:?]
        at io.netty.channel.AbstractChannel.writeAndFlush(AbstractChannel.java:306) ~[server.jar:?]
        at dev.waterdog.waterdogpe.network.connection.peer.ProxiedBedrockPeer.onTick(ProxiedBedrockPeer.java:106) ~[server.jar:?]
        at dev.waterdog.waterdogpe.network.connection.peer.ProxiedBedrockPeer.sendPacket0(ProxiedBedrockPeer.java:126) ~[server.jar:?]
        at dev.waterdog.waterdogpe.network.connection.peer.ProxiedBedrockPeer.lambda$sendPacket$0(ProxiedBedrockPeer.java:114) ~[server.jar:?]        at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:173) ~[server.jar:?]
        at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:166) ~[server.jar:?]
        at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470) ~[server.jar:?]
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:569) ~[server.jar:?]
        at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) ~[server.jar:?]
        at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[server.jar:?]
        at java.lang.Thread.run(Thread.java:842) [?:?]

from protocol.

Toper9636 avatar Toper9636 commented on June 9, 2024

???

from protocol.

Toper9636 avatar Toper9636 commented on June 9, 2024

???????????????????????????????????

from protocol.

SupremeMortal avatar SupremeMortal commented on June 9, 2024

This looks to be user error, and isn't an issue with the library

from protocol.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.