Skip to content

Commit 479c53c

Browse files
authored
- Command to create block culling rule file (#543)
* - Command to create block culling rule file * - Templates for block culling
1 parent 56658f2 commit 479c53c

File tree

6 files changed

+34
-0
lines changed

6 files changed

+34
-0
lines changed

client/src/Commands/Create/Create.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ const AnimationControllerID: IDExample = { ID: /^[0-9a-zA-Z_\\.\\-]+$/, example:
1212
const AnimationID: IDExample = { ID: /^[0-9a-zA-Z_\\.\\-]+$/, example: "example.foo | example" };
1313
const AttachableID: IDExample = { ID: /^[0-9a-zA-Z:_\\.\\-]+$/, example: "namespace:attachable" };
1414
const BlockID: IDExample = { ID: /^[0-9a-zA-Z:_\\.\\-]+$/, example: "namespace:block" };
15+
const BlockCullingRuleID: IDExample = { ID: /^[0-9a-zA-Z:_\\.\\-]+$/, example: "namespace:culling_rule" };
1516
const DialogueID: IDExample = { ID: /^[0-9a-zA-Z:_\\.\\-]+$/, example: "dialogue" };
1617
const EntityID: IDExample = { ID: /^[0-9a-zA-Z:_\\.\\-]+$/, example: "namespace:entity" };
1718
const FogID: IDExample = { ID: /^[0-9a-zA-Z:_\\.\\-]+$/, example: "namespace:item" };
@@ -72,6 +73,7 @@ export function Activate(context: ExtensionContext): void {
7273
CreateID(context, Commands.Create.Resourcepack.Animation_Controller, "Create animation controllers files", AnimationControllerID);
7374
CreateID(context, Commands.Create.Resourcepack.Animation, "Create animations files", AnimationID);
7475
CreateID(context, Commands.Create.Resourcepack.Attachable, "Create attachable files", AttachableID);
76+
CreateID(context, Commands.Create.Resourcepack.BlockCulling, "Create the block culling rule file", BlockCullingRuleID)
7577
CreateID(context, Commands.Create.Resourcepack.Entity, "Create entities files", EntityID);
7678
CreateID(context, Commands.Create.Resourcepack.Fog, "Create fog file", FogID);
7779
CreateID(context, Commands.Create.Resourcepack.Model, "Create reate model file", ModelID);

documentation/Commands.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ resource pack to exist.
5454
| `Resource Pack: Create attachable files` | Creates an attachable for the resource pack |
5555
| `Resource Pack: Create the biomes_client file` | Creates the `biomes_client.json` file in the resource pack |
5656
| `Resource Pack: Create the blocks file files` | Creates the `blocks.json` file in the resource pack |
57+
| `Resource Pack: Create block culling rule file` | Creates a block culling rule file in the resource pack |
5758
| `Resource Pack: Create entities files` | Creates an entities for the resource pack |
5859
| `Resource Pack: Create flipbook_textures files` | Creates the `flipbook_textures.json` file in the resource pack |
5960
| `Resource Pack: Create language files` | Creates the language files for the resource pack |

package.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,12 @@
337337
"category": "Blockception",
338338
"enablement": "ext:is_active"
339339
},
340+
{
341+
"title": "Resource Pack: Create block culling rule file",
342+
"command": "bc-create-resource-block_culling",
343+
"category": "Blockception",
344+
"enablement": "ext:is_active"
345+
},
340346
{
341347
"title": "Resource Pack: Create entities files",
342348
"command": "bc-create-resource-entity",

server/src/Lib/Commands/Templates/Templates.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export interface TemplateMap<T> {
2424
"resource-attachable": T;
2525
"resource-biomes_client": T;
2626
"resource-blocks": T;
27+
"resource-block_culling": T;
2728
"resource-entity": T;
2829
"resource-fog": T;
2930
"resource-flipbook_textures": T;
@@ -156,6 +157,10 @@ export const TemplateFilenames: TemplateMap<TemplateItem> = {
156157
content: RP.rp_blocks,
157158
filename: "blocks.json",
158159
},
160+
"resource-block_culling": {
161+
content: RP.rp_block_culling,
162+
filename: path.join("block_culling", "${{id.safe}}.rule.json")
163+
},
159164
"resource-entity": {
160165
content: RP.rp_entity,
161166
filename: path.join("entity", "${{id.safe}}.entity.rp.json"),

server/src/Lib/Data/Templates/resourcepack.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,24 @@ export const rp_blocks: string = `{
6060
}
6161
}`;
6262

63+
export const rp_block_culling: string = `{
64+
"format_version": "1.20.60",
65+
"minecraft:block_culling_rules": {
66+
"description": {
67+
"identifier": "$\{\{id\}\}"
68+
},
69+
"rules": [
70+
{
71+
"part": {
72+
"bone": "",
73+
"cube": 0,
74+
"face": ""
75+
}
76+
}
77+
]
78+
}
79+
}`
80+
6381
export const rp_biomes_client: string = `{
6482
"biomes" : {
6583

shared/src/Constants.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@ export namespace Commands {
122122
export const Biomes_Client: string = RPBase + "biomes_client";
123123
/**The command to create animations files */
124124
export const Blocks: string = RPBase + "blocks";
125+
/**The command to create block_culling rule files */
126+
export const BlockCulling : string = RPBase + "block_culling";
125127
/**The command to create entities files */
126128
export const Entity: string = RPBase + "entity";
127129
/**The command to create flipbook_textures files */

0 commit comments

Comments
 (0)