blob: bb62201e05fc09b91b67ccb36f3f4208fb4d6361 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
package ru.olamedia.player;
import ru.olamedia.liveEntity.LiveEntity;
import ru.olamedia.olacraft.game.Game;
import ru.olamedia.olacraft.network.packet.LiveEntityLocationUpdatePacket;
import ru.olamedia.olacraft.weapon.Bullet;
import ru.olamedia.olacraft.world.block.Block;
import ru.olamedia.olacraft.world.chunk.Chunk;
import ru.olamedia.olacraft.world.data.ChunkData;
public class Player extends LiveEntity {
@Override
public void notifyLocationUpdate() {
LiveEntityLocationUpdatePacket p = new LiveEntityLocationUpdatePacket();
p.x = getX();
p.y = getY();
p.z = getZ();
Game.client.send(p);
}
public Player() {
}
public void pickBlock(Block b){
b.removeFromWorld();
}
public void onMouseClick() {
if (null != Game.client.getScene().nearestBlock){
pickBlock(Game.client.getScene().nearestBlock);
}
// Bullet b = new Bullet();
// b.velocity.set(Game.instance.camera.getLook());
// b.velocity.negate();
// b.velocity.scale(100);
// b.location.set(getX(), getCameraY(), getZ());
// Game.client.getScene().addBullet(b);
}
}
|