Massive varp/varbit related refactoring + new client command
This commit is contained in:
@@ -7,8 +7,14 @@ import core.net.packet.context.VarbitContext;
|
||||
public class Varbit implements OutgoingPacket<VarbitContext> {
|
||||
@Override
|
||||
public void send(VarbitContext varbitContext) {
|
||||
IoBuffer buffer = new IoBuffer(37);
|
||||
buffer.put((byte) varbitContext.value);
|
||||
IoBuffer buffer;
|
||||
if(varbitContext.value > 255){
|
||||
buffer = new IoBuffer(84);
|
||||
buffer.putLEInt((128 | varbitContext.value) & 255);
|
||||
} else {
|
||||
buffer = new IoBuffer(37);
|
||||
buffer.put((byte) 128 | varbitContext.value);
|
||||
}
|
||||
buffer.putLEShort(varbitContext.varbitId);
|
||||
varbitContext.getPlayer().getSession().write(buffer);
|
||||
}
|
||||
|
||||
@@ -261,6 +261,15 @@ class VisualCommand : CommandPlugin() {
|
||||
PacketRepository.send(Varbit::class.java, VarbitContext(player, value, val2))
|
||||
return true
|
||||
}
|
||||
"setbits" -> {
|
||||
args ?: return false
|
||||
val start = toInteger(args[1]!!)
|
||||
val end = toInteger(args[2]!!)
|
||||
val value = toInteger(args[3]!!)
|
||||
for(i in start until end){
|
||||
player?.varpManager?.setVarbit(i, value)
|
||||
}
|
||||
}
|
||||
"loop_anim_on_i" -> {
|
||||
var anim = toInteger(args!![1]!!)
|
||||
ContentAPI.submitWorldPulse(object : Pulse(3){
|
||||
|
||||
Reference in New Issue
Block a user