Scrap !!
This commit is contained in:
+10
-2
@@ -196,20 +196,28 @@ export class MultiPlayerGameMode {
|
||||
this.client.player.last_attack = performance.now();
|
||||
}
|
||||
|
||||
// right click on an entity or another player, for mods' entity_interact. the server uses the held item when none
|
||||
// of them stops it
|
||||
interact(entity: Entity) {
|
||||
this.client.player.send_position_now();
|
||||
this.client.connection.send({ type: "interact_entity", id: entity.id });
|
||||
}
|
||||
|
||||
// right click on nothing
|
||||
use_item() {
|
||||
this.client.connection.send({ type: "use_item" });
|
||||
}
|
||||
|
||||
// whether a mob's or player's collision box overlaps the block, the server doesn't let solid blocks go there. mobs
|
||||
// are the mod entities that aren't scripted, players are this one and the others
|
||||
// are the mod entities that aren't scripted or objects, players are this one and the others
|
||||
#occupied(x: number, y: number, z: number, block: BlockRegistry, value: number) {
|
||||
const shape = collision_shape_at(block, value);
|
||||
for (const entity of this.client.level.entities.values()) {
|
||||
const json = entity instanceof RemoteEntity
|
||||
? EverythingRegistry.get<EntityJson>("entities", entity.type)
|
||||
: undefined;
|
||||
const blocks = entity instanceof Player || (json !== undefined && json.behavior !== "scripted");
|
||||
const blocks = entity instanceof Player ||
|
||||
(json !== undefined && json.behavior !== "scripted" && json.behavior !== "object");
|
||||
if (blocks && box_overlaps_block(entity, x, y, z, shape)) return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user