Skip to content

Commit 65cf4d0

Browse files
committed
add dog label filter
1 parent 7c08b69 commit 65cf4d0

File tree

5 files changed

+19
-4
lines changed

5 files changed

+19
-4
lines changed

src/components/objects/gui.config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ export const allLabelFilters: Record<string, string> = {
2626
brewingStand: 'Brewing',
2727
enderChests: 'Ender Chest',
2828
cherryTrees: 'Cherry Trees',
29+
dogs: 'Tamed Wolves',
30+
cats: 'Tamed Cats',
2931
};
3032

3133
export const allCameraPositionsKeys: Record<string, string> = {
@@ -51,6 +53,7 @@ const labelFiltersAvailable: Record<string, string[]> = {
5153
'brewingStand',
5254
'enderChests',
5355
'cherryTrees',
56+
'dogs',
5457
],
5558
};
5659

src/components/objects/gui.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ function updateLabelFolder(worldId: string) {
4040

4141
labelFolder
4242
.add(options, 'labelFilter', Object.values(activeLabelFilters[worldId]))
43-
.name('Filter Amenities')
43+
.name('Filter')
4444
.onChange(changeLabelFilter);
4545
}
4646

@@ -74,7 +74,7 @@ export function setupGUI() {
7474
'labelFilter',
7575
Object.values(activeLabelFilters[startingWorldKey]),
7676
)
77-
.name('Filter Amenities')
77+
.name('Filter')
7878
.onChange(changeLabelFilter);
7979

8080
const showHideFolder = gui.addFolder('Show/Hide');
@@ -218,6 +218,11 @@ function changeLabelFilter() {
218218
label.element.classList.add('portalLabel-filtered');
219219
break;
220220

221+
case allLabelFilters.dogs:
222+
if (!label.userData.dogs)
223+
label.element.classList.add('portalLabel-filtered');
224+
break;
225+
221226
case allLabelFilters.none:
222227
default:
223228
}

src/components/objects/mapObjects.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,8 @@ export function createPortal(
265265
hasEnchantingTable,
266266
hasFood,
267267
hasLava,
268+
dogs,
269+
cats,
268270
} = portalData;
269271

270272
// Create portal marker
@@ -290,6 +292,9 @@ export function createPortal(
290292
portalLabel.userData.lava = hasLava;
291293
portalLabel.userData.enderChest = hasEnderChest;
292294
portalLabel.userData.cherryTree = hasCherryTree;
295+
portalLabel.userData.dogs = dogs > 0;
296+
portalLabel.userData.cats = cats > 0;
297+
293298
world.portalLabels.push(portalLabel);
294299

295300
portalLabel.position.set(

src/data/chocolateBnuuy/bases.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
"hasSmithing": false,
4444
"hasBrewingStand": false,
4545
"hasEnchantingTable": false,
46-
"hasFood": false,
46+
"hasFood": true,
4747
"hasLava": false,
4848
"hasEnderChest": true,
4949
"hasCherryTree": false,
@@ -179,7 +179,7 @@
179179
"hasSmithing": true,
180180
"hasBrewingStand": false,
181181
"hasEnchantingTable": false,
182-
"hasFood": false,
182+
"hasFood": true,
183183
"hasLava": false,
184184
"hasEnderChest": true,
185185
"hasCherryTree": false,

src/data/data.types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,4 +72,6 @@ export type BaseData = {
7272
hasEnchantingTable: boolean;
7373
hasFood: boolean;
7474
hasLava: boolean;
75+
dogs: number;
76+
cats: number;
7577
};

0 commit comments

Comments
 (0)