|
When i execute the following code
Code:for (int i = 0; i < FarmingPatches.values().length; i++) { int value = getConfigFor(FarmingPatches.values()[i].config), config = FarmingPatches.values()[i].config; if(value < Byte.MIN_VALUE || value > Byte.MAX_VALUE) { player.getPacketSender().sendConfig(config, value); System.out.println("config: " + config + " value: " + value); } else { player.getPacketSender().sendConfig(config, value); System.out.println("Else if conditin" + " config: " + config + " value: " + value); } }
it updates all my farming patches...how do i make it so it only updates the one clicked...?
https://pastebin.com/aLNteWM8 heres my entire farming class.
I tried changing the config ids, that did nothing if i change the values they will update at different speeds...
I am just using the first patch Home1Code:HOME1(3045, 2952, 3048, 2955, 1, 529, 5343, 2275, 5329, SeedType.HERB), HOME2(3048, 2952, 3051, 2955, 1, 522, 5343, 2275, 5329, SeedType.HERB), HOME3(3051, 2952, 3054, 2955, 1, 522, 5343, 2275, 5329, SeedType.HERB), HOME4(3045, 2948, 3048, 2951, 1, 522, 5343, 2275, 5329, SeedType.HERB), HOME5(3048, 2948, 3051, 2951, 1, 522, 5343, 2275, 5329, SeedType.HERB);
its definatly this...i just dont know how to make it read the one i am using...
Code:public void doConfig() { for (int i = 0; i < FarmingPatches.values().length; i++) { int value = getConfigFor(FarmingPatches.values()[i].config), config = FarmingPatches.values()[i].config; if(value < Byte.MIN_VALUE || value > Byte.MAX_VALUE) player.getPacketSender().sendToggle(config, value); else player.getPacketSender().sendConfig(config, value); } }
Have a look at opcode 77 in objectdef
I dont understand...
Code:if (type == 77 || type == 92) { varp = stream.readUShort(); if (varp == 0xFFFF) { varp = -1; } varbit = stream.readUShort(); if (varbit == 0xFFFF) { varbit = -1; } int value = -1; if (type == 92) { value = stream.readUShort(); if (value == 0xFFFF) { value = -1; } } int len = stream.readUnsignedByte(); childrenIDs = new int[len + 2]; for (int i = 0; i <= len; ++i) { childrenIDs[i] = stream.readUShort(); if (childrenIDs[i] == 0xFFFF) { childrenIDs[i] = -1; } } childrenIDs[len + 1] = value; }
idk if this is what you mean....
Spoiler for dump:
and i have already gotCode:else if (type == 77 || type == 92) { System.out.println("varp: " + varp); varp = stream.readUShort(); if (varp == 0xFFFF) { varp = -1; } varbit = stream.readUShort(); System.out.println("varbit: " + varp); if (varbit == 0xFFFF) { varbit = -1; } int value = -1; if (type == 92) { value = stream.readUShort(); System.out.println("value: " + value); if (value == 0xFFFF) { value = -1; } } int len = stream.readUnsignedByte(); System.out.println("len: " + len); childrenIDs = new int[len + 2]; for (int i = 0; i <= len; ++i) { childrenIDs[i] = stream.readUShort(); System.out.println("childrenIDs["+i+"]"+ childrenIDs[i]); if (childrenIDs[i] == 0xFFFF) { childrenIDs[i] = -1; } } childrenIDs[len + 1] = value; }
case 18816:
objectDef.varbit = 4771;
break;
and now dump varbit 4771 it should tell you the config id and values
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |