forked from RepoMirrors/baritone
58 lines
1.6 KiB
Java
58 lines
1.6 KiB
Java
|
/*
|
||
|
* This file is part of Baritone.
|
||
|
*
|
||
|
* Baritone is free software: you can redistribute it and/or modify
|
||
|
* it under the terms of the GNU Lesser General Public License as published by
|
||
|
* the Free Software Foundation, either version 3 of the License, or
|
||
|
* (at your option) any later version.
|
||
|
*
|
||
|
* Baritone is distributed in the hope that it will be useful,
|
||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
|
* GNU Lesser General Public License for more details.
|
||
|
*
|
||
|
* You should have received a copy of the GNU Lesser General Public License
|
||
|
* along with Baritone. If not, see <https://www.gnu.org/licenses/>.
|
||
|
*/
|
||
|
|
||
|
package comms.upward;
|
||
|
|
||
|
import comms.HandlableMessage;
|
||
|
import comms.IMessageListener;
|
||
|
import comms.SerializableMessage;
|
||
|
|
||
|
import java.io.DataInputStream;
|
||
|
import java.io.DataOutputStream;
|
||
|
import java.io.IOException;
|
||
|
|
||
|
public class MessageStatus implements SerializableMessage, HandlableMessage {
|
||
|
|
||
|
public final double x;
|
||
|
public final double y;
|
||
|
public final double z;
|
||
|
|
||
|
public MessageStatus(DataInputStream in) throws IOException {
|
||
|
this.x = in.readDouble();
|
||
|
this.y = in.readDouble();
|
||
|
this.z = in.readDouble();
|
||
|
}
|
||
|
|
||
|
public MessageStatus(double x, double y, double z) {
|
||
|
this.x = x;
|
||
|
this.y = y;
|
||
|
this.z = z;
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public void write(DataOutputStream out) throws IOException {
|
||
|
out.writeDouble(x);
|
||
|
out.writeDouble(y);
|
||
|
out.writeDouble(z);
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public void handle(IMessageListener listener) {
|
||
|
listener.handle(this);
|
||
|
}
|
||
|
}
|