Scrap !!
This commit is contained in:
+6
-3
@@ -318,7 +318,7 @@ export class Client {
|
||||
player.entity_interaction_range,
|
||||
(entity) =>
|
||||
entity instanceof RemotePlayer ||
|
||||
(entity instanceof RemoteEntity && !entity.dead && is_hittable(entity)),
|
||||
(entity instanceof RemoteEntity && !entity.dead && is_pickable(entity)),
|
||||
);
|
||||
// a block in front of the entity hides it
|
||||
this.hit_result = this.level.pick(
|
||||
@@ -377,6 +377,8 @@ export class Client {
|
||||
if (!attacking && using) {
|
||||
this.game_mode.use_item_on(hit);
|
||||
}
|
||||
} else if (use_pressed && this.entity_hit) {
|
||||
this.game_mode.interact(this.entity_hit);
|
||||
} else if (use_pressed) {
|
||||
this.game_mode.use_item();
|
||||
} else if (!this.entity_hit && InputManager.is_mouse_pressed(0)) {
|
||||
@@ -413,7 +415,8 @@ export class Client {
|
||||
}
|
||||
}
|
||||
|
||||
// mobs can be hit, scripted entities like the fishing hook can't. kinds the client doesn't know are left to the server
|
||||
function is_hittable(entity: RemoteEntity) {
|
||||
// what the crosshair can be on: mobs and objects, not scripted entities like the fishing hook. kinds the client doesn't
|
||||
// know are left to the server
|
||||
function is_pickable(entity: RemoteEntity) {
|
||||
return EverythingRegistry.get<EntityJson>("entities", entity.type)?.behavior !== "scripted";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user