The modifier for PlayServerMap doesn't seem to match up to examples.
elee1766 opened this issue ยท 0 comments
Describe the question
im working on paper 1.17.1
the fields in the modifier of PlayServerMap when i print them out are
a - int
b - byte
c - boolean
d - List
e - class net.minecraft.world.level.saveddata.maps.WorldMap$b
however, in the recommend WrappedPlayServerMap i was using as an example, it does things like
public void setX(int value) {
handle.getIntegers().write(3, value);
}
which as expected, gives me an out of range error, since i only have one integer spot, a (as i understand, at least)
I tried to use getMaps(), but that didnt' seem to match up with the type required
Perhaps related to this issue, whenever I sent packet 39 to a client, i get this
https://i.imgur.com/FhGpw5h.png
Packet 0/39 (rb) was larger than I expected, found 4 bytes extra whilst reading packet 39
Expected behavior
I expected there to be many more field letters which corresponded to the fields in the vg wiki.
I don't have access to nms as I thought that protocollib would make it so i didn't need to access/create an nms object
sorry this is my first day using the plugin, so i may just be doing everything wrong...
Code
this is what i used to try to figure out what was wrong, along with what im doing to send myself some information
as an aside, i'm able to do this fine for the spawnentity packet, it seems to be just this packet so far that is misbehaving
PacketContainer packetContainer = new PacketContainer(PacketType.Play.Server.MAP);
packetContainer.getIntegers().write(0,50000);
for (Field field : packetContainer.getModifier().getFields()){
Bukkit.getLogger().info(field.getType().toString());
Bukkit.getLogger().info(field.toString());
Bukkit.getLogger().info(field.toGenericString());
}
//..
//..
manager.sendServerPacket(gamer,packetContainer);
Additional context
https://i.imgur.com/ikT1L4n.png
this is what the code returns
also here is the debug file that i had the plugin generate
ProtocolLib Dump
Timestamp: 09/23/21 15:00:03
ProtocolLib Version: ProtocolLib v4.7.0
Bukkit Version: 1.17.1-R0.1-SNAPSHOT
Server Version: git-Paper-276 (MC: 1.17.1)
Java Version: 16.0.2
ProtocolLib: com.comphenix.protocol.ProtocolLib@20e5c1c6[
statistics=com.comphenix.protocol.metrics.Statistics@2b000362
backgroundCompiler=com.comphenix.protocol.reflect.compiler.BackgroundCompiler@45a14174
packetTask=7
tickCounter=2836
unhookTask=com.comphenix.protocol.injector.DelayedSingleTask@27b8c8cb
configExpectedMod=1
updater=com.comphenix.protocol.updater.SpigotUpdater@295dd60b
redirectHandler=com.comphenix.protocol.ProtocolLib$2@2eddb51
commandProtocol=com.comphenix.protocol.CommandProtocol@4d888099
commandPacket=com.comphenix.protocol.CommandPacket@2c97e773
commandFilter=com.comphenix.protocol.CommandFilter@6bbd9164
packetLogging=com.comphenix.protocol.PacketLogging@766f811
skipDisable=false
isEnabled=true
loader=org.bukkit.plugin.java.JavaPluginLoader@ee32c2c
server=CraftServer{serverName=Paper,serverVersion=git-Paper-276,minecraftVersion=1.17.1}
file=plugins/ProtocolLib.jar
description=org.bukkit.plugin.PluginDescriptionFile@1aed7a82
dataFolder=plugins/ProtocolLib
classLoader=PluginClassLoader{plugin=ProtocolLib v4.7.0, pluginEnabled=true, url=plugins/ProtocolLib.jar}
naggable=true
newConfig=YamlConfiguration[path='', root='YamlConfiguration']
configFile=plugins/ProtocolLib/config.yml
logger=com.destroystokyo.paper.utils.PaperPluginLogger@3dee7481
]
Manager: com.comphenix.protocol.injector.PacketFilterManager@47bf56ce[
unhookTask=com.comphenix.protocol.injector.DelayedSingleTask@27b8c8cb
packetListeners=[]
packetInjector=com.comphenix.protocol.injector.netty.ProtocolInjector$5@36f70dd1
playerInjection=com.comphenix.protocol.injector.netty.ProtocolInjector$4@4106d2ee
inputBufferedPackets=[]
recievedListeners=com.comphenix.protocol.injector.SortedPacketListenerList@f02ec33
sendingListeners=com.comphenix.protocol.injector.SortedPacketListenerList@32b6c23b
hasClosed=false
classLoader=PluginClassLoader{plugin=ProtocolLib v4.7.0, pluginEnabled=true, url=plugins/ProtocolLib.jar}
reporter=com.comphenix.protocol.ProtocolLib$1@3ca1c839
server=CraftServer{serverName=Paper,serverVersion=git-Paper-276,minecraftVersion=1.17.1}
library=ProtocolLib v4.7.0
asyncFilterManager=com.comphenix.protocol.async.AsyncFilterManager@4b47fce1
knowsServerPackets=true
knowsClientPackets=true
phaseLoginCount=0
phasePlayingCount=1
packetCreation=true
nettyInjector=com.comphenix.protocol.injector.netty.ProtocolInjector@1199e7fe
pluginVerifier=com.comphenix.protocol.injector.PluginVerifier@25075d91
hasRecycleDistance=true
minecraftVersion=(MC: 1.17.1)
debug=false
]
No listeners