mirror of
https://github.com/Jacobwasbeast/LegacyWeaveLoader.git
synced 2026-05-25 07:04:34 +00:00
feat(models): add block model boxes + picking
This commit is contained in:
@@ -14,6 +14,7 @@ public class ExampleMod : IMod
|
||||
public static RegisteredBlock? RubyOre;
|
||||
public static RegisteredBlock? RubyStone;
|
||||
public static RegisteredBlock? RubyWoodPlanks;
|
||||
public static RegisteredBlock? RubyChair;
|
||||
public static RegisteredBlock? RubySand;
|
||||
public static RegisteredSlabBlock? RubyStoneSlab;
|
||||
public static RegisteredSlabBlock? RubyWoodSlab;
|
||||
@@ -236,6 +237,16 @@ public class ExampleMod : IMod
|
||||
.Name(Text.Translatable("block.examplemod.ruby_wood_planks"))
|
||||
.InCreativeTab(CreativeTab.BuildingBlocks));
|
||||
|
||||
RubyChair = Registry.Block.Register("examplemod:ruby_chair",
|
||||
new BlockProperties()
|
||||
.Material(MaterialType.Wood)
|
||||
.Hardness(1.5f)
|
||||
.Resistance(5f)
|
||||
.Sound(SoundType.Wood)
|
||||
.Model("examplemod:block/ruby_chair")
|
||||
.Name(Text.Translatable("block.examplemod.ruby_chair"))
|
||||
.InCreativeTab(CreativeTab.Decoration));
|
||||
|
||||
RubySand = Registry.Block.Register("examplemod:ruby_sand",
|
||||
new RubySandBlock(),
|
||||
new BlockProperties()
|
||||
|
||||
@@ -39,3 +39,14 @@ Block and item models are supported using Java-style JSON assets:
|
||||
- **Entities (future):** `assets/examplemod/models/entity/{name}.json`
|
||||
|
||||
The `examplemod` namespace should match your mod ID (lowercase).
|
||||
|
||||
To drive an icon from a model JSON, use:
|
||||
|
||||
```csharp
|
||||
.Model("examplemod:block/ruby_ore")
|
||||
.Model("examplemod:item/ruby")
|
||||
```
|
||||
|
||||
WeaveLoader reads the model JSON and uses its texture for the icon.
|
||||
|
||||
For block items, WeaveLoader uses the block model by default. Item models are optional.
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
block.examplemod.ruby_ore=Ruby Ore
|
||||
block.examplemod.ruby_stone=Ruby Stone
|
||||
block.examplemod.ruby_wood_planks=Ruby Wood Planks
|
||||
block.examplemod.ruby_chair=Ruby Chair
|
||||
block.examplemod.ruby_stone_slab=Ruby Stone Slab
|
||||
block.examplemod.ruby_stone_slab_double=Ruby Stone Slab
|
||||
block.examplemod.ruby_wood_slab=Ruby Wood Slab
|
||||
|
||||
13
ExampleMod/assets/examplemod/models/block/ruby_chair.json
Normal file
13
ExampleMod/assets/examplemod/models/block/ruby_chair.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"textures": {
|
||||
"all": "examplemod:block/ruby_wood_planks"
|
||||
},
|
||||
"elements": [
|
||||
{ "from": [2, 8, 2], "to": [14, 10, 14], "faces": { "north": { "texture": "#all" }, "south": { "texture": "#all" }, "west": { "texture": "#all" }, "east": { "texture": "#all" }, "up": { "texture": "#all" }, "down": { "texture": "#all" } } },
|
||||
{ "from": [2, 10, 12], "to": [14, 22, 14], "faces": { "north": { "texture": "#all" }, "south": { "texture": "#all" }, "west": { "texture": "#all" }, "east": { "texture": "#all" }, "up": { "texture": "#all" }, "down": { "texture": "#all" } } },
|
||||
{ "from": [2, 0, 2], "to": [4, 8, 4], "faces": { "north": { "texture": "#all" }, "south": { "texture": "#all" }, "west": { "texture": "#all" }, "east": { "texture": "#all" }, "up": { "texture": "#all" }, "down": { "texture": "#all" } } },
|
||||
{ "from": [12, 0, 2], "to": [14, 8, 4], "faces": { "north": { "texture": "#all" }, "south": { "texture": "#all" }, "west": { "texture": "#all" }, "east": { "texture": "#all" }, "up": { "texture": "#all" }, "down": { "texture": "#all" } } },
|
||||
{ "from": [2, 0, 12], "to": [4, 8, 14], "faces": { "north": { "texture": "#all" }, "south": { "texture": "#all" }, "west": { "texture": "#all" }, "east": { "texture": "#all" }, "up": { "texture": "#all" }, "down": { "texture": "#all" } } },
|
||||
{ "from": [12, 0, 12], "to": [14, 8, 14], "faces": { "north": { "texture": "#all" }, "south": { "texture": "#all" }, "west": { "texture": "#all" }, "east": { "texture": "#all" }, "up": { "texture": "#all" }, "down": { "texture": "#all" } } }
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user