Proper season and time conditions for fishing
This commit is contained in:
@@ -6,6 +6,7 @@ import { block_states, get_state_value, is_waterlogged, liquid_block, set_state_
|
||||
import { LootTables } from "./loot.ts";
|
||||
import { collision_shape_at, covers_face, raycast_blocks, type Shape } from "$/common/block_shapes.ts";
|
||||
import { AIR, ID_MASK } from "$/common/constants.ts";
|
||||
import { clock } from "$/common/time.ts";
|
||||
import { BlockRules } from "$/common/block_rules.ts";
|
||||
import type { SharedContext } from "$/common/mod_api/shared.ts";
|
||||
import { tag_api } from "$/common/tags.ts";
|
||||
@@ -723,6 +724,10 @@ export class ModRuntime {
|
||||
get day() {
|
||||
return game().world.day;
|
||||
},
|
||||
get hour() {
|
||||
const { hour, minute } = clock(game().world.time);
|
||||
return hour + minute / 60;
|
||||
},
|
||||
set_time: (time) => {
|
||||
if (!Number.isInteger(time) || time < 0) {
|
||||
throw new Error(`time must be a whole number of ticks, not ${time}`);
|
||||
|
||||
Reference in New Issue
Block a user