aboutsummaryrefslogtreecommitdiffstats
path: root/src/ru/olamedia/player/Player.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/ru/olamedia/player/Player.java')
-rw-r--r--src/ru/olamedia/player/Player.java23
1 files changed, 16 insertions, 7 deletions
diff --git a/src/ru/olamedia/player/Player.java b/src/ru/olamedia/player/Player.java
index 08811b5..bb62201 100644
--- a/src/ru/olamedia/player/Player.java
+++ b/src/ru/olamedia/player/Player.java
@@ -4,6 +4,9 @@ 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 {
@@ -17,15 +20,21 @@ public class Player extends LiveEntity {
}
public Player() {
-
+ }
+
+ public void pickBlock(Block b){
+ b.removeFromWorld();
}
public void onMouseClick() {
- 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);
+ 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);
}
}