chore: add CODEOWNERS

This commit is contained in:
Alexander Medvedev 2026-08-09 11:58:59 +02:00
parent 8ea6fe9f9b
commit 3150bd13de
5 changed files with 66 additions and 53 deletions

27
.github/CODEOWNERS vendored Normal file
View File

@ -0,0 +1,27 @@
# GitHub CODEOWNERS File
# https://docs.github.com/en/repositories/managing-repository-settings-and-features/customizing-your-repository/about-code-owners
# Default owner for the entire project
* @Snowiiii
# Protocol related changes
crates/pumpkin-protocol/ @Snowiiii @xRookieFight
crates/pumpkin/src/net/ @Snowiiii @xRookieFight
# Bedrock related changes
assets/bedrock/ @ZlordHUN @xRookieFight
crates/pumpkin-protocol/src/bedrock/ @ZlordHUN @xRookieFight
crates/pumpkin/src/net/bedrock/ @ZlordHUN @xRookieFight
# Command related changes
crates/pumpkin/src/command/ @aure31
# Plugin related changes & WASM Host
crates/pumpkin-plugin-api/ @vyPal @yunuservices @QuantumSegfault
crates/pumpkin-plugin-wit/ @vyPal @yunuservices @QuantumSegfault
crates/pumpkin-api-macros/ @vyPal @yunuservices @QuantumSegfault
crates/pumpkin/src/plugin/ @vyPal @yunuservices @QuantumSegfault
# Documentation related changes
*.md @Q2297045667
docs/ @Q2297045667

View File

@ -21,4 +21,4 @@ jobs:
with: with:
submodules: recursive submodules: recursive
- name: Spell Check Repo - name: Spell Check Repo
uses: crate-ci/typos@v1.48.0 uses: crate-ci/typos@v1.49.0

View File

@ -67,7 +67,9 @@ impl RoomGraph {
grid[index as usize] = Some(graph.push(index)); grid[index as usize] = Some(graph.push(index));
} }
} }
graph.source = grid[SOURCE_INDEX as usize].unwrap(); if let Some(src) = grid[SOURCE_INDEX as usize] {
graph.source = src;
}
for x in 0..5 { for x in 0..5 {
for z in 0..5 { for z in 0..5 {
@ -101,27 +103,23 @@ impl RoomGraph {
let roof = graph.push(1003); let roof = graph.push(1003);
let left_wing = graph.push(1001); let left_wing = graph.push(1001);
let right_wing = graph.push(1002); let right_wing = graph.push(1002);
graph.connect( if let Some(top) = grid[TOP_CONNECT_INDEX as usize] {
grid[TOP_CONNECT_INDEX as usize].unwrap(), graph.connect(top, BlockDirection::Up, roof);
BlockDirection::Up, }
roof, if let Some(left) = grid[LEFT_CONNECT_INDEX as usize] {
); graph.connect(left, BlockDirection::South, left_wing);
graph.connect( }
grid[LEFT_CONNECT_INDEX as usize].unwrap(), if let Some(right) = grid[RIGHT_CONNECT_INDEX as usize] {
BlockDirection::South, graph.connect(right, BlockDirection::South, right_wing);
left_wing, }
);
graph.connect(
grid[RIGHT_CONNECT_INDEX as usize].unwrap(),
BlockDirection::South,
right_wing,
);
graph.rooms[roof].claimed = true; graph.rooms[roof].claimed = true;
graph.rooms[left_wing].claimed = true; graph.rooms[left_wing].claimed = true;
graph.rooms[right_wing].claimed = true; graph.rooms[right_wing].claimed = true;
graph.rooms[graph.source].source = true; graph.rooms[graph.source].source = true;
graph.core = grid[room_index(random.next_bounded_i32(4), 0, 2) as usize].unwrap(); if let Some(core_room) = grid[room_index(random.next_bounded_i32(4), 0, 2) as usize] {
graph.core = core_room;
}
graph.claim_core(); graph.claim_core();
for room in &mut graph.rooms { for room in &mut graph.rooms {
// Vanilla updates every grid room and the roof room here. The two wing // Vanilla updates every grid room and the roof room here. The two wing
@ -147,7 +145,9 @@ impl RoomGraph {
if !graph.rooms[room].openings[direction] { if !graph.rooms[room].openings[direction] {
continue; continue;
} }
let neighbor = graph.rooms[room].connections[direction].unwrap(); let Some(neighbor) = graph.rooms[room].connections[direction] else {
continue;
};
let opposite = opposite_index(direction); let opposite = opposite_index(direction);
graph.rooms[room].openings[direction] = false; graph.rooms[room].openings[direction] = false;
graph.rooms[neighbor].openings[opposite] = false; graph.rooms[neighbor].openings[opposite] = false;
@ -218,7 +218,7 @@ impl RoomGraph {
} }
pub fn connection(&self, room: usize, direction: BlockDirection) -> usize { pub fn connection(&self, room: usize, direction: BlockDirection) -> usize {
self.rooms[room].connections[direction as usize].unwrap() self.rooms[room].connections[direction as usize].unwrap_or(0)
} }
} }

View File

@ -116,8 +116,8 @@ impl RoomPiece {
&& graph.rooms[east].connections[BlockDirection::Up as usize] && graph.rooms[east].connections[BlockDirection::Up as usize]
.is_some_and(|up| !graph.rooms[up].claimed) .is_some_and(|up| !graph.rooms[up].claimed)
}) { }) {
let east = east.unwrap(); let east = east.unwrap_or(0);
let up = up.unwrap(); let up = up.unwrap_or(0);
let east_up = graph.connection(east, BlockDirection::Up); let east_up = graph.connection(east, BlockDirection::Up);
claim(graph, &[room, east, up, east_up]); claim(graph, &[room, east, up, east_up]);
RoomKind::DoubleXY RoomKind::DoubleXY
@ -131,26 +131,30 @@ impl RoomPiece {
.is_some_and(|up| !graph.rooms[up].claimed) .is_some_and(|up| !graph.rooms[up].claimed)
}) })
{ {
let north = north.unwrap(); let north = north.unwrap_or(0);
let up = up.unwrap(); let up = up.unwrap_or(0);
let north_up = graph.connection(north, BlockDirection::Up); let north_up = graph.connection(north, BlockDirection::Up);
claim(graph, &[room, north, up, north_up]); claim(graph, &[room, north, up, north_up]);
RoomKind::DoubleYZ RoomKind::DoubleYZ
} else if opening(&graph.rooms[room], BlockDirection::North) } else if opening(&graph.rooms[room], BlockDirection::North)
&& north.is_some_and(|north| !graph.rooms[north].claimed) && north.is_some_and(|north| !graph.rooms[north].claimed)
{ {
let north = north.unwrap(); let north = north.unwrap_or(0);
claim(graph, &[room, north]); claim(graph, &[room, north]);
RoomKind::DoubleZ RoomKind::DoubleZ
} else if opening(&graph.rooms[room], BlockDirection::East) } else if opening(&graph.rooms[room], BlockDirection::East)
&& east.is_some_and(|east| !graph.rooms[east].claimed) && east.is_some_and(|east| !graph.rooms[east].claimed)
{ {
claim(graph, &[room, east.unwrap()]); if let Some(east) = east {
claim(graph, &[room, east]);
}
RoomKind::DoubleX RoomKind::DoubleX
} else if opening(&graph.rooms[room], BlockDirection::Up) } else if opening(&graph.rooms[room], BlockDirection::Up)
&& up.is_some_and(|up| !graph.rooms[up].claimed) && up.is_some_and(|up| !graph.rooms[up].claimed)
{ {
claim(graph, &[room, up.unwrap()]); if let Some(up) = up {
claim(graph, &[room, up]);
}
RoomKind::DoubleY RoomKind::DoubleY
} else if ![ } else if ![
BlockDirection::West, BlockDirection::West,
@ -204,7 +208,7 @@ impl RoomPiece {
} }
fn room<'a>(&self, graph: &'a RoomGraph) -> &'a RoomDefinition { fn room<'a>(&self, graph: &'a RoomGraph) -> &'a RoomDefinition {
&graph.rooms[self.room.unwrap()] &graph.rooms[self.room.unwrap_or(0)]
} }
fn place_entry( fn place_entry(
@ -308,7 +312,7 @@ impl RoomPiece {
graph: &RoomGraph, graph: &RoomGraph,
) { ) {
let p = &self.piece; let p = &self.piece;
let west = self.room.unwrap(); let west = self.room.unwrap_or(0);
let east = graph.connection(west, BlockDirection::East); let east = graph.connection(west, BlockDirection::East);
let west_room = &graph.rooms[west]; let west_room = &graph.rooms[west];
let east_room = &graph.rooms[east]; let east_room = &graph.rooms[east];
@ -370,7 +374,7 @@ impl RoomPiece {
graph: &RoomGraph, graph: &RoomGraph,
) { ) {
let p = &self.piece; let p = &self.piece;
let west = self.room.unwrap(); let west = self.room.unwrap_or(0);
let east = graph.connection(west, BlockDirection::East); let east = graph.connection(west, BlockDirection::East);
let west_up = graph.connection(west, BlockDirection::Up); let west_up = graph.connection(west, BlockDirection::Up);
let east_up = graph.connection(east, BlockDirection::Up); let east_up = graph.connection(east, BlockDirection::Up);
@ -515,7 +519,7 @@ impl RoomPiece {
graph: &RoomGraph, graph: &RoomGraph,
) { ) {
let p = &self.piece; let p = &self.piece;
let lower = self.room.unwrap(); let lower = self.room.unwrap_or(0);
let upper = graph.connection(lower, BlockDirection::Up); let upper = graph.connection(lower, BlockDirection::Up);
let lower_room = &graph.rooms[lower]; let lower_room = &graph.rooms[lower];
let upper_room = &graph.rooms[upper]; let upper_room = &graph.rooms[upper];
@ -680,7 +684,7 @@ impl RoomPiece {
graph: &RoomGraph, graph: &RoomGraph,
) { ) {
let p = &self.piece; let p = &self.piece;
let south = self.room.unwrap(); let south = self.room.unwrap_or(0);
let north = graph.connection(south, BlockDirection::North); let north = graph.connection(south, BlockDirection::North);
let south_up = graph.connection(south, BlockDirection::Up); let south_up = graph.connection(south, BlockDirection::Up);
let north_up = graph.connection(north, BlockDirection::Up); let north_up = graph.connection(north, BlockDirection::Up);
@ -833,7 +837,7 @@ impl RoomPiece {
graph: &RoomGraph, graph: &RoomGraph,
) { ) {
let p = &self.piece; let p = &self.piece;
let south = self.room.unwrap(); let south = self.room.unwrap_or(0);
let north = graph.connection(south, BlockDirection::North); let north = graph.connection(south, BlockDirection::North);
let south_room = &graph.rooms[south]; let south_room = &graph.rooms[south];
let north_room = &graph.rooms[north]; let north_room = &graph.rooms[north];

View File

@ -36,7 +36,7 @@
let let
naersk' = pkgs.callPackage naersk { }; naersk' = pkgs.callPackage naersk { };
manifest = (lib.importTOML ./pumpkin/Cargo.toml).package; manifest = (lib.importTOML ./crates/pumpkin/Cargo.toml).package;
workspace-manifest = (lib.importTOML ./Cargo.toml).workspace.package; workspace-manifest = (lib.importTOML ./Cargo.toml).workspace.package;
in in
{ {
@ -48,25 +48,7 @@
src = lib.fileset.toSource { src = lib.fileset.toSource {
root = ./.; root = ./.;
fileset = lib.fileset.unions [ fileset = lib.fileset.gitTracked ./.;
./Cargo.lock
./Cargo.toml
./assets
./pumpkin
./pumpkin-api-macros
./pumpkin-codecs
./pumpkin-config
./pumpkin-data
./pumpkin-inventory
./pumpkin-macros
./pumpkin-nbt
./pumpkin-plugin-api
./pumpkin-plugin-wit
./pumpkin-protocol
./pumpkin-util
./pumpkin-world
];
}; };
}; };