Skip to content

Commit 9935e56

Browse files
committed
Add more model templates
1 parent 2ac4c6a commit 9935e56

2 files changed

Lines changed: 1075 additions & 15 deletions

File tree

‎libraries/data-gen/data-gen-mc18w43a-mc1.14.4/src/main/java/net/ornithemc/osl/datagen/api/model/block/BlockModelTemplates.java‎

Lines changed: 308 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,6 @@ public interface BlockModelTemplates {
1717
*/
1818
BlockModelTemplates simpleBlock(Block block, NamespacedIdentifier texture);
1919

20-
/**
21-
* Creates a simple block model, definition, and item model with the given textures.
22-
*
23-
* @param block the block
24-
* @param firstLayer the first texture
25-
* @param secondLayer the second texture
26-
*/
27-
BlockModelTemplates simpleBlock(Block block, NamespacedIdentifier firstLayer, NamespacedIdentifier secondLayer);
28-
2920
/**
3021
* Creates a simple block model, definition, without an item model with the given texture.
3122
*
@@ -72,6 +63,80 @@ public interface BlockModelTemplates {
7263
*/
7364
BlockModelTemplates simpleStairs(Block block, NamespacedIdentifier texture);
7465

66+
/**
67+
* Creates a wall block model, definition, and item model with the given texture.
68+
*
69+
* @param block the block
70+
* @param texture the texture
71+
* @return the model builder
72+
*/
73+
BlockModelTemplates wall(Block block, NamespacedIdentifier texture);
74+
75+
/**
76+
* Creates a fence block model, definition, and item model with the given texture.
77+
*
78+
* @param block the block
79+
* @param texture the texture
80+
* @return the model builder
81+
*/
82+
BlockModelTemplates fence(Block block, NamespacedIdentifier texture);
83+
84+
/**
85+
* Creates a button block model, definition, and item model with the given texture.
86+
*
87+
* @param block the block
88+
* @param texture the texture
89+
* @return the model builder
90+
*/
91+
BlockModelTemplates button(Block block, NamespacedIdentifier texture);
92+
93+
/**
94+
* Creates a door block model, definition, and item model with the given textures.
95+
*
96+
* @param block the block
97+
* @param inventoryTexture the inventory texture
98+
* @param topTexture the top texture
99+
* @param bottomTexture the bottom texture
100+
* @return the model builder
101+
*/
102+
BlockModelTemplates door(Block block, NamespacedIdentifier inventoryTexture, NamespacedIdentifier topTexture, NamespacedIdentifier bottomTexture);
103+
104+
/**
105+
* Creates a fence gate block model, definition, and item model with the given texture.
106+
*
107+
* @param block the block
108+
* @param texture the texture
109+
* @return the model builder
110+
*/
111+
BlockModelTemplates fenceGate(Block block, NamespacedIdentifier texture);
112+
113+
/**
114+
* Creates a leaves block model, definition, and item model with the given texture.
115+
*
116+
* @param block the block
117+
* @param texture the texture
118+
* @return the model builder
119+
*/
120+
BlockModelTemplates leaves(Block block, NamespacedIdentifier texture);
121+
122+
/**
123+
* Creates a pressure plate block model, definition, and item model with the given texture.
124+
*
125+
* @param block the block
126+
* @param texture the texture
127+
* @return the model builder
128+
*/
129+
BlockModelTemplates pressurePlate(Block block, NamespacedIdentifier texture);
130+
131+
/**
132+
* Creates a trapdoor block model, definition, and item model with the given texture.
133+
*
134+
* @param block the block
135+
* @param texture the texture
136+
* @return the model builder
137+
*/
138+
BlockModelTemplates trapdoor(Block block, NamespacedIdentifier texture);
139+
75140
/**
76141
* Creates a cube block model with the given textures.
77142
*
@@ -301,4 +366,238 @@ static ModelBuilder stairsOuter(NamespacedIdentifier sideTexture, NamespacedIden
301366
.texture("top", topTexture)
302367
.texture("bottom", bottomTexture);
303368
}
369+
370+
/**
371+
* Creates a wall inventory block model with the given texture.
372+
*
373+
* @param texture the texture
374+
* @return the model builder
375+
*/
376+
static ModelBuilder wallInventory(NamespacedIdentifier texture) {
377+
return ModelBuilder.create(NamespacedIdentifiers.from("block/wall_inventory")).texture("wall", texture);
378+
}
379+
380+
/**
381+
* Creates a wall post block model with the given texture.
382+
*
383+
* @param texture the texture
384+
* @return the model builder
385+
*/
386+
static ModelBuilder wallPost(NamespacedIdentifier texture) {
387+
return ModelBuilder.create(NamespacedIdentifiers.from("block/template_wall_post")).texture("wall", texture);
388+
}
389+
390+
/**
391+
* Creates a wall side block model with the given texture.
392+
*
393+
* @param texture the texture
394+
* @return the model builder
395+
*/
396+
static ModelBuilder wallSide(NamespacedIdentifier texture) {
397+
return ModelBuilder.create(NamespacedIdentifiers.from("block/template_wall_side")).texture("wall", texture);
398+
}
399+
400+
/**
401+
* Creates a fence inventory block model with the given texture.
402+
*
403+
* @param texture the texture
404+
* @return the model builder
405+
*/
406+
static ModelBuilder fenceInventory(NamespacedIdentifier texture) {
407+
return ModelBuilder.create(NamespacedIdentifiers.from("block/fence_inventory")).texture("texture", texture);
408+
}
409+
410+
/**
411+
* Creates a fence post, block model with the given texture.
412+
*
413+
* @param texture the texture
414+
* @return the model builder
415+
*/
416+
static ModelBuilder fencePost(NamespacedIdentifier texture) {
417+
return ModelBuilder.create(NamespacedIdentifiers.from("block/fence_post")).texture("texture", texture);
418+
}
419+
420+
/**
421+
* Creates a fence side block model with the given texture.
422+
*
423+
* @param texture the texture
424+
* @return the model builder
425+
*/
426+
static ModelBuilder fenceSide(NamespacedIdentifier texture) {
427+
return ModelBuilder.create(NamespacedIdentifiers.from("block/fence_side")).texture("texture", texture);
428+
}
429+
430+
/**
431+
* Creates a button block model with the given texture.
432+
*
433+
* @param texture the texture
434+
* @return the model builder
435+
*/
436+
static ModelBuilder button(NamespacedIdentifier texture) {
437+
return ModelBuilder.create(NamespacedIdentifiers.from("block/button")).texture("texture", texture);
438+
}
439+
440+
/**
441+
* Creates a button inventory block model with the given texture.
442+
*
443+
* @param texture the texture
444+
* @return the model builder
445+
*/
446+
static ModelBuilder buttonInventory(NamespacedIdentifier texture) {
447+
return ModelBuilder.create(NamespacedIdentifiers.from("block/button_inventory")).texture("texture", texture);
448+
}
449+
450+
/**
451+
* Creates a button pressed, block model with the given texture.
452+
*
453+
* @param texture the texture
454+
* @return the model builder
455+
*/
456+
static ModelBuilder buttonPressed(NamespacedIdentifier texture) {
457+
return ModelBuilder.create(NamespacedIdentifiers.from("block/button_pressed")).texture("texture", texture);
458+
}
459+
460+
/**
461+
* Creates a door bottom block model with the given top and bottom textures.
462+
*
463+
* @param topTexture the top texture
464+
* @param bottomTexture the bottom texture
465+
* @return the model builder
466+
*/
467+
static ModelBuilder doorBottom(NamespacedIdentifier topTexture, NamespacedIdentifier bottomTexture) {
468+
return ModelBuilder.create(NamespacedIdentifiers.from("block/door_bottom")).texture("top", topTexture).texture("bottom", bottomTexture);
469+
}
470+
471+
/**
472+
* Creates a door bottom block model with the given top and bottom textures, with the hinge on the right.
473+
*
474+
* @param topTexture the top texture
475+
* @param bottomTexture the bottom texture
476+
* @return the model builder
477+
*/
478+
static ModelBuilder doorBottomHinge(NamespacedIdentifier topTexture, NamespacedIdentifier bottomTexture) {
479+
return ModelBuilder.create(NamespacedIdentifiers.from("block/door_bottom_rh")).texture("top", topTexture).texture("bottom", bottomTexture);
480+
}
481+
482+
/**
483+
* Creates a door top block model with the given top and bottom textures.
484+
*
485+
* @param topTexture the top texture
486+
* @param bottomTexture the bottom texture
487+
* @return the model builder
488+
*/
489+
static ModelBuilder doorTop(NamespacedIdentifier topTexture, NamespacedIdentifier bottomTexture) {
490+
return ModelBuilder.create(NamespacedIdentifiers.from("block/door_top")).texture("top", topTexture).texture("bottom", bottomTexture);
491+
}
492+
493+
/**
494+
* Creates a door top block model with the given top and bottom textures, with the hinge on the right.
495+
*
496+
* @param topTexture the top texture
497+
* @param bottomTexture the bottom texture
498+
* @return the model builder
499+
*/
500+
static ModelBuilder doorTopHinge(NamespacedIdentifier topTexture, NamespacedIdentifier bottomTexture) {
501+
return ModelBuilder.create(NamespacedIdentifiers.from("block/door_top_rh")).texture("top", topTexture).texture("bottom", bottomTexture);
502+
}
503+
504+
/**
505+
* Creates a fence gate block model with the given texture.
506+
*
507+
* @param texture the texture
508+
* @return the model builder
509+
*/
510+
static ModelBuilder fenceGate(NamespacedIdentifier texture) {
511+
return ModelBuilder.create(NamespacedIdentifiers.from("block/template_fence_gate")).texture("texture", texture);
512+
}
513+
514+
/**
515+
* Creates a fence gate block model with the given texture, with the gate open.
516+
*
517+
* @param texture the texture
518+
* @return the model builder
519+
*/
520+
static ModelBuilder fenceGateOpen(NamespacedIdentifier texture) {
521+
return ModelBuilder.create(NamespacedIdentifiers.from("block/template_fence_gate_open")).texture("texture", texture);
522+
}
523+
524+
/**
525+
* Creates a fence gate block model with the given texture, with the gate open and on a wall.
526+
*
527+
* @param texture the texture
528+
* @return the model builder
529+
*/
530+
static ModelBuilder fenceGateWall(NamespacedIdentifier texture) {
531+
return ModelBuilder.create(NamespacedIdentifiers.from("block/template_fence_gate_wall")).texture("texture", texture);
532+
}
533+
534+
/**
535+
* Creates a fence gate block model with the given texture, with the gate open and on a wall.
536+
*
537+
* @param texture the texture
538+
* @return the model builder
539+
*/
540+
static ModelBuilder fenceGateWallOpen(NamespacedIdentifier texture) {
541+
return ModelBuilder.create(NamespacedIdentifiers.from("block/template_fence_gate_wall_open")).texture("texture", texture);
542+
}
543+
544+
/**
545+
* Creates a leaves block model with the given texture.
546+
*
547+
* @param texture the texture
548+
* @return the model builder
549+
*/
550+
static ModelBuilder leaves(NamespacedIdentifier texture) {
551+
return ModelBuilder.create(NamespacedIdentifiers.from("block/leaves")).texture("all", texture);
552+
}
553+
554+
/**
555+
* Creates a pressure plate block model with the given texture, with the plate up.
556+
*
557+
* @param texture the texture
558+
* @return the model builder
559+
*/
560+
static ModelBuilder pressurePlateUp(NamespacedIdentifier texture) {
561+
return ModelBuilder.create(NamespacedIdentifiers.from("block/pressure_plate_up")).texture("texture", texture);
562+
}
563+
564+
/**
565+
* Creates a pressure plate block model with the given texture, with the plate down.
566+
*
567+
* @param texture the texture
568+
* @return the model builder
569+
*/
570+
static ModelBuilder pressurePlateDown(NamespacedIdentifier texture) {
571+
return ModelBuilder.create(NamespacedIdentifiers.from("block/pressure_plate_down")).texture("texture", texture);
572+
}
573+
574+
/**
575+
* Creates a closed trapdoor block model with the given texture, with the trapdoor at the bottom.
576+
*
577+
* @param texture the texture
578+
* @return the model builder
579+
*/
580+
static ModelBuilder trapdoorBottom(NamespacedIdentifier texture) {
581+
return ModelBuilder.create(NamespacedIdentifiers.from("block/template_orientable_trapdoor_bottom")).texture("texture", texture);
582+
}
583+
584+
/**
585+
* Creates a trapdoor block model with the given texture, with the trapdoor open.
586+
*
587+
* @param texture the texture
588+
* @return the model builder
589+
*/
590+
static ModelBuilder trapdoorOpen(NamespacedIdentifier texture) {
591+
return ModelBuilder.create(NamespacedIdentifiers.from("block/template_orientable_trapdoor_open")).texture("texture", texture);
592+
}
593+
594+
/**
595+
* Creates a closed trapdoor block model with the given texture, with the trapdoor at the top.
596+
*
597+
* @param texture the texture
598+
* @return the model builder
599+
*/
600+
static ModelBuilder trapdoorTop(NamespacedIdentifier texture) {
601+
return ModelBuilder.create(NamespacedIdentifiers.from("block/template_orientable_trapdoor_top")).texture("texture", texture);
602+
}
304603
}

0 commit comments

Comments
 (0)