Cool 3d
This commit is contained in:
@@ -7,7 +7,7 @@ interface TileChestData {
|
||||
inventory: Inventory;
|
||||
}
|
||||
|
||||
EverythingRegistry.register<TileRegistry<TileChestData>>("tiles", "bworld:chest", {
|
||||
EverythingRegistry.register<TileRegistry<TileChestData>>("blocks", "bworld:chest", {
|
||||
texture_id: "bworld:chest",
|
||||
has_collision: false,
|
||||
|
||||
|
||||
@@ -125,22 +125,22 @@ function create_crop_tile(crop_id: string) {
|
||||
}
|
||||
|
||||
EverythingRegistry.register<TileRegistry<TileCropData>>(
|
||||
"tiles",
|
||||
"blocks",
|
||||
"bworld:tomato_crop",
|
||||
create_crop_tile("bworld:tomato"),
|
||||
);
|
||||
EverythingRegistry.register<TileRegistry<TileCropData>>(
|
||||
"tiles",
|
||||
"blocks",
|
||||
"bworld:carrot_crop",
|
||||
create_crop_tile("bworld:carrot"),
|
||||
);
|
||||
EverythingRegistry.register<TileRegistry<TileCropData>>(
|
||||
"tiles",
|
||||
"blocks",
|
||||
"bworld:potato_crop",
|
||||
create_crop_tile("bworld:potato"),
|
||||
);
|
||||
EverythingRegistry.register<TileRegistry<TileCropData>>(
|
||||
"tiles",
|
||||
"blocks",
|
||||
"bworld:pumpkin_crop",
|
||||
create_crop_tile("bworld:pumpkin"),
|
||||
);
|
||||
|
||||
@@ -2,7 +2,7 @@ import { EverythingRegistry, TileRegistry } from "$/common/everything_registry.t
|
||||
import { WateringCanData } from "../items/watering_can.ts";
|
||||
import { PlayerComponent } from "../player.ts";
|
||||
|
||||
EverythingRegistry.register<TileRegistry>("tiles", "bworld:dirt", {
|
||||
EverythingRegistry.register<TileRegistry>("blocks", "bworld:dirt", {
|
||||
texture_id: "bworld:dirt",
|
||||
has_collision: false,
|
||||
|
||||
@@ -16,7 +16,7 @@ EverythingRegistry.register<TileRegistry>("tiles", "bworld:dirt", {
|
||||
},
|
||||
});
|
||||
|
||||
EverythingRegistry.register<TileRegistry>("tiles", "bworld:hoed_dirt", {
|
||||
EverythingRegistry.register<TileRegistry>("blocks", "bworld:hoed_dirt", {
|
||||
texture_id: "bworld:hoed_dirt",
|
||||
has_collision: false,
|
||||
|
||||
@@ -50,7 +50,7 @@ EverythingRegistry.register<TileRegistry>("tiles", "bworld:hoed_dirt", {
|
||||
},
|
||||
});
|
||||
|
||||
EverythingRegistry.register<TileRegistry>("tiles", "bworld:hoed_watered_dirt", {
|
||||
EverythingRegistry.register<TileRegistry>("blocks", "bworld:hoed_watered_dirt", {
|
||||
texture_id: "bworld:hoed_watered_dirt",
|
||||
has_collision: false,
|
||||
|
||||
@@ -75,19 +75,19 @@ EverythingRegistry.register<TileRegistry>("tiles", "bworld:hoed_watered_dirt", {
|
||||
}
|
||||
|
||||
if (item.type_id === "bworld:tomato_seeds") {
|
||||
world.dimension.add_tile(world, { x: tile.x, y: tile.y, id: "bworld:tomato_crop", tickable: true });
|
||||
world.dimension.add_block(world, { x: tile.x, y: tile.y, id: "bworld:tomato_crop", tickable: true });
|
||||
item.amount -= 1;
|
||||
player_inventory.container.set_item(player_inventory.hotbar_selected, item);
|
||||
} else if (item.type_id === "bworld:potato_seeds") {
|
||||
world.dimension.add_tile(world, { x: tile.x, y: tile.y, id: "bworld:potato_crop", tickable: true });
|
||||
world.dimension.add_block(world, { x: tile.x, y: tile.y, id: "bworld:potato_crop", tickable: true });
|
||||
item.amount -= 1;
|
||||
player_inventory.container.set_item(player_inventory.hotbar_selected, item);
|
||||
} else if (item.type_id === "bworld:pumpkin_seeds") {
|
||||
world.dimension.add_tile(world, { x: tile.x, y: tile.y, id: "bworld:pumpkin_crop", tickable: true });
|
||||
world.dimension.add_block(world, { x: tile.x, y: tile.y, id: "bworld:pumpkin_crop", tickable: true });
|
||||
item.amount -= 1;
|
||||
player_inventory.container.set_item(player_inventory.hotbar_selected, item);
|
||||
} else if (item.type_id === "bworld:carrot_seeds") {
|
||||
world.dimension.add_tile(world, { x: tile.x, y: tile.y, id: "bworld:carrot_crop", tickable: true });
|
||||
world.dimension.add_block(world, { x: tile.x, y: tile.y, id: "bworld:carrot_crop", tickable: true });
|
||||
item.amount -= 1;
|
||||
player_inventory.container.set_item(player_inventory.hotbar_selected, item);
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ interface TileChestData {
|
||||
fuel: number;
|
||||
}
|
||||
|
||||
EverythingRegistry.register<TileRegistry<TileChestData>>("tiles", "bworld:furnace", {
|
||||
EverythingRegistry.register<TileRegistry<TileChestData>>("blocks", "bworld:furnace", {
|
||||
texture_id: "bworld:furnace",
|
||||
has_collision: false,
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { EverythingRegistry, TileRegistry } from "$/common/everything_registry.ts";
|
||||
import { PlayerComponent } from "../player.ts";
|
||||
|
||||
EverythingRegistry.register<TileRegistry>("tiles", "bworld:grass", {
|
||||
EverythingRegistry.register<TileRegistry>("blocks", "bworld:grass", {
|
||||
texture_id: "bworld:grass",
|
||||
has_collision: false,
|
||||
|
||||
@@ -12,9 +12,9 @@ EverythingRegistry.register<TileRegistry>("tiles", "bworld:grass", {
|
||||
if (item?.type_id === "bworld:hoe") {
|
||||
tile.id = "bworld:hoed_dirt";
|
||||
} else if (item?.type_id === "bworld:chest") {
|
||||
world.dimension.add_tile(world, { x: tile.x, y: tile.y, id: "bworld:chest" });
|
||||
// world.dimension.add_block(world, { x: tile.x, y: tile.y, id: "bworld:chest" });
|
||||
} else if (item?.type_id === "bworld:furnace") {
|
||||
world.dimension.add_tile(world, { x: tile.x, y: tile.y, id: "bworld:furnace", tickable: true });
|
||||
// world.dimension.add_block(world, { x: tile.x, y: tile.y, id: "bworld:furnace", tickable: true });
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
@@ -5,3 +5,4 @@ import "./crops.ts";
|
||||
import "./water.ts";
|
||||
import "./chest.ts";
|
||||
import "./furnace.ts";
|
||||
import "./stone.ts";
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
import { EverythingRegistry, TileRegistry } from "$/common/everything_registry.ts";
|
||||
|
||||
EverythingRegistry.register<TileRegistry>("blocks", "bworld:stone", {
|
||||
texture_id: "bworld:stone",
|
||||
has_collision: true,
|
||||
});
|
||||
@@ -2,7 +2,7 @@ import { EverythingRegistry, TileRegistry } from "$/common/everything_registry.t
|
||||
import { ItemStack } from "../inventory.ts";
|
||||
import { PlayerComponent } from "../player.ts";
|
||||
|
||||
EverythingRegistry.register<TileRegistry>("tiles", "bworld:tree", {
|
||||
EverythingRegistry.register<TileRegistry>("blocks", "bworld:tree", {
|
||||
texture_id: "bworld:tree",
|
||||
has_collision: false,
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import { EverythingRegistry, TileRegistry } from "$/common/everything_registry.t
|
||||
import { WateringCanData } from "../items/watering_can.ts";
|
||||
import { PlayerComponent } from "../player.ts";
|
||||
|
||||
EverythingRegistry.register<TileRegistry>("tiles", "bworld:water", {
|
||||
EverythingRegistry.register<TileRegistry>("blocks", "bworld:water", {
|
||||
texture_id: "bworld:water",
|
||||
has_collision: true,
|
||||
|
||||
|
||||
Reference in New Issue
Block a user