Comments (10)
👍👌😊😘
from protocol.
???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
from protocol.
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.
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.
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 tonull
. 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.
just remove the line where you add empty camera set instructions, that's not needed and causes the issue here
from protocol.
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.
???
from protocol.
???????????????????????????????????
from protocol.
This looks to be user error, and isn't an issue with the library
from protocol.
Related Issues (20)
- Path in bedrock-v465 is wrong HOT 1
- PacketSerializeException: Error whilst deserializing PlayerAuthInputPacket HOT 2
- Unable to resolve through the repo given HOT 1
- Support proxying connections HOT 1
- Question for v389 & v390
- ClientboundDebugRendererPacket has wrong PacketType
- BedrockPacketHelper#getBlockingItemIdentifier() can return wrong value
- Entity metadata broken on BDS
- getFormData() from ModalFormResponsePacket returns corrupted/empty data
- please support for 1.19.21 HOT 2
- Comments regarding BossEventPacket are outdated HOT 1
- Wrong AuthoritativeMovementMode deseralizer in v3
- AvailableCommandsPacket wrong encoding HOT 1
- Add FLAG_FORCE_MOVE_LOCAL_ENTITY to MoveEntityAbsolutePacket HOT 1
- How to enable Experiments? HOT 2
- ForceExperimentalGameplay option error HOT 7
- Unable to deserialize camera instruction HOT 1
- Unable to serialize LevelSoundEvent2Packet when snowball projectiles are thrown HOT 1
- AvailableCommandsPacket issues
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from protocol.