This commit is contained in:
2026-10-22 19:55:59 -03:00
parent 1b30d71a47
commit 4cd29a17b3
37 changed files with 427 additions and 155 deletions
+32
View File
@@ -2237,3 +2237,35 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```
# Create
https://github.com/Creators-of-Create/Create by simibubi and the Create team. The pulse repeater's textures
(`pulse_repeater_*.png`) and model (`models/pulse_repeater.json`) come from its version 0.5.0.j for Minecraft 1.19.3,
whose only license was this one:
license:
```
MIT License
Copyright (c) 2019 simibubi
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```
+64
View File
@@ -0,0 +1,64 @@
{
"format_version": 1,
"block": {
"id": "bworld:pulse_repeater",
"textures": {
"base": "bworld:pulse_repeater_base",
"top": "bworld:pulse_repeater_idle",
"torch": "bworld:verdigris_torch_off"
},
"model": "bworld:pulse_repeater",
"item_model": "bworld:pulse_repeater_item",
"render_layer": "cutout",
"shape": [[0, 0, 0, 16, 2, 16]],
"mining": { "toughness": 0 },
"drops": "bworld:pulse_repeater",
"interactive": true,
"scrollable": true,
"states": [
{ "name": "facing", "bits": 2, "default": 0 },
{ "name": "powered", "bits": 1, "default": 0 },
{ "name": "powering", "bits": 1, "default": 0 },
{ "name": "inverted", "bits": 1, "default": 0 },
{ "name": "delay", "bits": 8, "default": 0 }
],
"variants": {
"powered=1,powering=1": {
"textures": {
"base": "bworld:pulse_repeater_base",
"top": "bworld:pulse_repeater_powered_powering",
"torch": "bworld:verdigris_torch"
}
},
"powered=1": {
"textures": {
"base": "bworld:pulse_repeater_base",
"top": "bworld:pulse_repeater_powered",
"torch": "bworld:verdigris_torch_off"
}
},
"powering=1": {
"textures": {
"base": "bworld:pulse_repeater_base",
"top": "bworld:pulse_repeater_powering",
"torch": "bworld:verdigris_torch"
}
},
"facing=1": { "y": 90 },
"facing=2": { "y": 180 },
"facing=3": { "y": 270 }
},
"components": {
"bworld:verdigris_source": {
"power": 15,
"when": "powering",
"facing": "facing",
"out": ["front"],
"strong": ["front"],
"connects": ["front", "back"]
},
"bworld:verdigris_input": { "state": "powered", "facing": "facing", "in": ["back"] },
"bworld:pulse_repeater": {}
}
}
}
@@ -1,13 +1,7 @@
{
"format_version": 1,
"model": {
"id": "create:block_diodes_pulse_repeater",
"textures": {
"4": "create:block_diodes_brass_diode_base",
"particle": "create:block_diodes_brass_diode_base",
"top": "create:block_diodes_pulse_repeater_idle",
"torch": "bworld:verdigris_torch_off"
},
"id": "bworld:pulse_repeater",
"elements": [
{
"from": [5, 2.1, 5],
@@ -24,12 +18,12 @@
"from": [0, 0, 0],
"to": [16, 2, 16],
"faces": {
"north": { "texture": "#4", "uv": [0, 14, 16, 16] },
"east": { "texture": "#4", "uv": [0, 0, 2, 16], "rotation": 270 },
"south": { "texture": "#4", "uv": [0, 0, 16, 2], "rotation": 180 },
"west": { "texture": "#4", "uv": [14, 0, 16, 16], "rotation": 90 },
"north": { "texture": "#base", "uv": [0, 14, 16, 16] },
"east": { "texture": "#base", "uv": [0, 0, 2, 16], "rotation": 270 },
"south": { "texture": "#base", "uv": [0, 0, 16, 2], "rotation": 180 },
"west": { "texture": "#base", "uv": [14, 0, 16, 16], "rotation": 90 },
"top": { "texture": "#top", "uv": [0, 0, 16, 16] },
"bottom": { "texture": "#4", "uv": [0, 0, 16, 16] }
"bottom": { "texture": "#base", "uv": [0, 0, 16, 16] }
}
},
{
@@ -48,13 +42,7 @@
"west": { "texture": "#torch", "uv": [6, 5, 10, 11] }
}
},
{
"from": [7, 6, 1],
"to": [9, 7, 3],
"faces": {
"top": { "texture": "#torch", "uv": [7, 6, 9, 8] }
}
}
{ "from": [7, 6, 1], "to": [9, 7, 3], "faces": { "top": { "texture": "#torch", "uv": [7, 6, 9, 8] } } }
],
"display": {
"gui": { "rotation": [30, 45, 0], "translation": [0, 2.5, 0], "scale": [0.625, 0.625, 0.625] },
@@ -0,0 +1,8 @@
{
"format_version": 1,
"model": {
"id": "bworld:pulse_repeater_item",
"parent": "bworld:pulse_repeater",
"textures": { "top": "bworld:pulse_repeater_item" }
}
}
+55
View File
@@ -19,6 +19,16 @@ const TORCH_BURNOUT = 8;
const TORCH_BURNOUT_WINDOW = 60;
const TORCH_BURNOUT_TICKS = 160;
// how long a pulse repeater's pulse lasts, in ticks
const PULSE_TICKS = 2;
// the delays a pulse repeater's delay state picks from, in ticks: scrolled through a tick at a time below a second, a
// second at a time below a minute, then a minute at a time up to an hour
export const PULSE_DELAYS: readonly number[] = [
...Array.from({ length: 18 }, (_, i) => 2 + i),
...Array.from({ length: 59 }, (_, i) => 20 + i * 20),
...Array.from({ length: 60 }, (_, i) => 1200 + i * 1200),
];
// switched on and off by right clicking it, and it breaks when what it's on goes
export function register_lever(ctx: ServerContext) {
ctx.components.register_block("bworld:lever", {
@@ -94,6 +104,51 @@ export function register_torch(ctx: ServerContext, world: SignalReader) {
});
}
// once the block behind it is powered, it waits its delay and then gives a PULSE_TICKS pulse out of its front. it
// pulses once each time that block is powered, and while it's counting down or pulsing it doesn't start again. powering
// is its output, so inverted it's on, and the pulse turns it off. right clicking it inverts it, and scrolling the mouse
// wheel at it changes its delay
export function register_pulse_repeater(ctx: ServerContext) {
const state = (block: Position, name: string) => ctx.world.get_state(block.x, block.y, block.z, name) ?? 0;
const set = (block: Position, name: string, value: number) =>
ctx.world.set_state(block.x, block.y, block.z, name, value);
ctx.components.register_block("bworld:pulse_repeater", {
on_interact(block) {
set(block, "inverted", 1 - state(block, "inverted"));
set(block, "powering", 1 - state(block, "powering"));
return true;
},
on_scroll(block, _params, player, scroll) {
const delay = Math.max(0, Math.min(PULSE_DELAYS.length - 1, state(block, "delay") + scroll.amount));
set(block, "delay", delay);
player.send_message(`Delay: ${delay_text(PULSE_DELAYS[delay])}`, { overlay: true });
},
on_neighbor_change(block, _params, neighbor) {
breaks_without(ctx, block, "bottom", neighbor);
},
on_state_change(block, _params, before) {
const started = state(block, "powered") === 1 && before.powered === 0;
if (started && !ctx.world.has_scheduled_tick(block.x, block.y, block.z)) {
ctx.world.schedule_tick(block.x, block.y, block.z, PULSE_DELAYS[state(block, "delay")]);
}
},
// its delay is up and the pulse starts, or the pulse is over
on_scheduled_tick(block) {
const inverted = state(block, "inverted");
const pulsing = state(block, "powering") !== inverted;
set(block, "powering", pulsing ? inverted : 1 - inverted);
if (!pulsing) ctx.world.schedule_tick(block.x, block.y, block.z, PULSE_TICKS);
},
});
}
// a delay in ticks the way a player reads it: ticks below a second, then seconds, then minutes
function delay_text(ticks: number) {
if (ticks < 20) return `${ticks} ticks`;
const [count, unit] = ticks < 1200 ? [ticks / 20, "second"] : [ticks / 1200, "minute"];
return `${count} ${unit}${count === 1 ? "" : "s"}`;
}
// breaks a block that hangs from the block toward face when the neighbor that changed is that block and its face isn't
// something to attach to anymore. whether it broke
function breaks_without(ctx: ServerContext, block: BlockRef, face: Face, neighbor: Position) {
+2 -1
View File
@@ -4,7 +4,7 @@
// verdigris's components, see REDSTONE.md: the wire, which keeps its net's power through the net index, sources,
// inputs, and the devices
import type { BlockRef, Face, Position, ServerContext } from "bworld/server";
import { register_lever, register_torch } from "./devices.ts";
import { register_lever, register_pulse_repeater, register_torch } from "./devices.ts";
import { arms_of, around_edge, can_cover, covers, face_states, faces_of, MAX_ARMS } from "./joins.ts";
import { input_power } from "./inputs.ts";
import {
@@ -79,6 +79,7 @@ export function register_verdigris(ctx: ServerContext) {
register_lever(ctx);
register_torch(ctx, world);
register_pulse_repeater(ctx);
}
function set_input(ctx: ServerContext, world: SignalReader, block: BlockRef, params: InputParams) {
+8
View File
@@ -43,6 +43,14 @@ export function register_verdigris_rules(ctx: SharedContext) {
},
});
// on a floor, its front the way the player placing it looks, so it gives power away from them
ctx.components.register_block("bworld:pulse_repeater", {
state_for_placement(placement) {
const { x, y, z } = placement;
return ctx.world.is_face_sturdy(x, y - 1, z, "top") ? { facing: FACES.indexOf(placement.facing) } : false;
},
});
// on a floor pointing up, or on a wall pointing out of it. not under a ceiling
ctx.components.register_block("bworld:verdigris_torch", {
state_for_placement(placement) {
Binary file not shown.

After

Width:  |  Height:  |  Size: 301 B

Before

Width:  |  Height:  |  Size: 313 B

After

Width:  |  Height:  |  Size: 313 B

Before

Width:  |  Height:  |  Size: 310 B

After

Width:  |  Height:  |  Size: 310 B

Before

Width:  |  Height:  |  Size: 320 B

After

Width:  |  Height:  |  Size: 320 B

Before

Width:  |  Height:  |  Size: 314 B

After

Width:  |  Height:  |  Size: 314 B

Before

Width:  |  Height:  |  Size: 319 B

After

Width:  |  Height:  |  Size: 319 B

-70
View File
@@ -1,70 +0,0 @@
{
"format_version": 1,
"block": {
"id": "create:pulse_repeater",
"textures": {},
"model": "create:block_diodes_pulse_repeater",
"variants": {
"facing=1,inverted=0,powered=0,powering=0": { "model": "create:block_diodes_pulse_repeater", "y": 270 },
"facing=1,inverted=0,powered=0,powering=1": { "model": "create:block_pulse_repeater_powering", "y": 270 },
"facing=1,inverted=0,powered=1,powering=0": { "model": "create:block_pulse_repeater_powered", "y": 270 },
"facing=1,inverted=0,powered=1,powering=1": {
"model": "create:block_pulse_repeater_powered_powering",
"y": 270
},
"facing=1,inverted=1,powered=0,powering=0": { "model": "create:block_pulse_repeater_powering", "y": 270 },
"facing=1,inverted=1,powered=0,powering=1": { "model": "create:block_diodes_pulse_repeater", "y": 270 },
"facing=1,inverted=1,powered=1,powering=0": {
"model": "create:block_pulse_repeater_powered_powering",
"y": 270
},
"facing=1,inverted=1,powered=1,powering=1": { "model": "create:block_pulse_repeater_powered", "y": 270 },
"facing=0,inverted=0,powered=0,powering=0": { "model": "create:block_diodes_pulse_repeater", "y": 180 },
"facing=0,inverted=0,powered=0,powering=1": { "model": "create:block_pulse_repeater_powering", "y": 180 },
"facing=0,inverted=0,powered=1,powering=0": { "model": "create:block_pulse_repeater_powered", "y": 180 },
"facing=0,inverted=0,powered=1,powering=1": {
"model": "create:block_pulse_repeater_powered_powering",
"y": 180
},
"facing=0,inverted=1,powered=0,powering=0": { "model": "create:block_pulse_repeater_powering", "y": 180 },
"facing=0,inverted=1,powered=0,powering=1": { "model": "create:block_diodes_pulse_repeater", "y": 180 },
"facing=0,inverted=1,powered=1,powering=0": {
"model": "create:block_pulse_repeater_powered_powering",
"y": 180
},
"facing=0,inverted=1,powered=1,powering=1": { "model": "create:block_pulse_repeater_powered", "y": 180 },
"facing=2,inverted=0,powered=0,powering=0": { "model": "create:block_diodes_pulse_repeater" },
"facing=2,inverted=0,powered=0,powering=1": { "model": "create:block_pulse_repeater_powering" },
"facing=2,inverted=0,powered=1,powering=0": { "model": "create:block_pulse_repeater_powered" },
"facing=2,inverted=0,powered=1,powering=1": { "model": "create:block_pulse_repeater_powered_powering" },
"facing=2,inverted=1,powered=0,powering=0": { "model": "create:block_pulse_repeater_powering" },
"facing=2,inverted=1,powered=0,powering=1": { "model": "create:block_diodes_pulse_repeater" },
"facing=2,inverted=1,powered=1,powering=0": { "model": "create:block_pulse_repeater_powered_powering" },
"facing=2,inverted=1,powered=1,powering=1": { "model": "create:block_pulse_repeater_powered" },
"facing=3,inverted=0,powered=0,powering=0": { "model": "create:block_diodes_pulse_repeater", "y": 90 },
"facing=3,inverted=0,powered=0,powering=1": { "model": "create:block_pulse_repeater_powering", "y": 90 },
"facing=3,inverted=0,powered=1,powering=0": { "model": "create:block_pulse_repeater_powered", "y": 90 },
"facing=3,inverted=0,powered=1,powering=1": {
"model": "create:block_pulse_repeater_powered_powering",
"y": 90
},
"facing=3,inverted=1,powered=0,powering=0": { "model": "create:block_pulse_repeater_powering", "y": 90 },
"facing=3,inverted=1,powered=0,powering=1": { "model": "create:block_diodes_pulse_repeater", "y": 90 },
"facing=3,inverted=1,powered=1,powering=0": {
"model": "create:block_pulse_repeater_powered_powering",
"y": 90
},
"facing=3,inverted=1,powered=1,powering=1": { "model": "create:block_pulse_repeater_powered", "y": 90 }
},
"states": [
{ "name": "facing", "bits": 2, "default": 0 },
{ "name": "inverted", "bits": 1, "default": 0 },
{ "name": "powered", "bits": 1, "default": 0 },
{ "name": "powering", "bits": 1, "default": 0 }
],
"render_layer": "cutout",
"mining": { "toughness": 1 },
"drops": "create:pulse_repeater",
"item_model": "create:item_pulse_repeater"
}
}
+4 -1
View File
@@ -29,4 +29,7 @@ turn it. Each block's fields there replace the ones the importer would write.
`block/radial_chassis_side_x` would both be `create:block_radial_chassis_side_x`.
Its `skip` leaves out the crimson and warped windows and window panes, and their models and textures, since bworld won't
have those woods.
have those woods. It leaves out the pulse repeater too, which is bworld's now
(`mods/bworld/blocks/pulse_repeater.json`): its id becomes bworld's, and so does the texture of the `indicator` model,
which uses the pulse repeater's. Its `textures` and `ids` also turn Minecraft's redstone torch into bworld's verdigris
torch.
+10 -1
View File
@@ -2,8 +2,17 @@
"models": {
"create:block/radial_chassis/": "create:block/radial_chassis/template_"
},
"textures": {
"minecraft:block/redstone_torch": "bworld:verdigris_torch",
"minecraft:block/redstone_torch_off": "bworld:verdigris_torch_off",
"create:block/diodes/pulse_repeater/idle": "bworld:pulse_repeater_idle"
},
"ids": {
"minecraft:redstone_torch": "bworld:verdigris_torch"
},
"skip": [
"crimson",
"warped"
"warped",
"pulse_repeater"
]
}
@@ -2,7 +2,7 @@
"format_version": 1,
"model": {
"id": "create:block_diodes_indicator",
"textures": { "flexpeater_off": "create:block_diodes_pulse_repeater_idle" },
"textures": { "flexpeater_off": "bworld:pulse_repeater_idle" },
"elements": [
{
"from": [3.96875, 1.96875, 3.96875],
@@ -1,8 +0,0 @@
{
"format_version": 1,
"model": {
"id": "create:block_pulse_repeater_powered",
"parent": "create:block_diodes_pulse_repeater",
"textures": { "top": "create:block_diodes_pulse_repeater_powered" }
}
}
@@ -1,8 +0,0 @@
{
"format_version": 1,
"model": {
"id": "create:block_pulse_repeater_powered_powering",
"parent": "create:block_diodes_pulse_repeater",
"textures": { "top": "create:block_diodes_pulse_repeater_powered_powering", "torch": "bworld:verdigris_torch" }
}
}
@@ -1,8 +0,0 @@
{
"format_version": 1,
"model": {
"id": "create:block_pulse_repeater_powering",
"parent": "create:block_diodes_pulse_repeater",
"textures": { "top": "create:block_diodes_pulse_repeater_powering", "torch": "bworld:verdigris_torch" }
}
}
@@ -1,8 +0,0 @@
{
"format_version": 1,
"model": {
"id": "create:item_pulse_repeater",
"parent": "create:block_diodes_pulse_repeater",
"textures": { "top": "create:block_diodes_pulse_repeater_item" }
}
}
@@ -24,7 +24,6 @@
"create:redstone_link",
"create:analog_lever",
"create:placard",
"create:pulse_repeater",
"create:pulse_extender",
{ "id": "#bworld:banners", "required": false },
{ "id": "#bworld:signs", "required": false }
@@ -3,9 +3,9 @@
"tag": {
"values": [
{ "id": "bworld:redstone_wire", "required": false },
{ "id": "bworld:verdigris_torch", "required": false },
"bworld:verdigris_torch",
{ "id": "bworld:repeater", "required": false },
{ "id": "bworld:lever", "required": false },
"bworld:lever",
{ "id": "bworld:comparator", "required": false },
{ "id": "bworld:observer", "required": false },
{ "id": "bworld:redstone_wall_torch", "required": false },