Skip to content

Commit

Permalink
Re-Textures (#18)
Browse files Browse the repository at this point in the history
* Re-Textures

* Fix drive cells and move those to datagen

---------

Co-authored-by: 90 <[email protected]>
  • Loading branch information
Ridanisaurus and 62832 authored Oct 14, 2024
1 parent 5b4771c commit ba49e43
Show file tree
Hide file tree
Showing 42 changed files with 496 additions and 56 deletions.
66 changes: 51 additions & 15 deletions src/data/java/gripe/_90/arseng/data/ItemModelProvider.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package gripe._90.arseng.data;

import net.minecraft.core.Direction;
import net.minecraft.data.PackOutput;
import net.minecraft.resources.ResourceLocation;
import net.neoforged.neoforge.client.model.generators.ItemModelBuilder;
import net.neoforged.neoforge.common.data.ExistingFileHelper;

Expand All @@ -23,31 +23,67 @@ protected void registerModels() {

ArsEngItems.getCells()
.forEach(cell -> flatSingleLayer(cell).texture("layer1", AppEng.makeId("item/storage_cell_led")));
ArsEngItems.getPortables()
.forEach(cell -> flatSingleLayer(cell).texture("layer1", AppEng.makeId("item/portable_cell_led")));
ArsEngItems.getPortables().forEach(this::portable);

var p2pTunnelItem = AppEng.makeId("item/p2p_tunnel_base");
var p2pTunnelPart = AppEng.makeId("part/p2p/p2p_tunnel_base");
var sourceGem = ResourceLocation.fromNamespaceAndPath("ars_nouveau", "block/source_gem_block");
var sourceStone = ResourceLocation.fromNamespaceAndPath("ars_nouveau", "block/gilded_sourcestone_large_bricks");
withExistingParent("item/source_p2p_tunnel", p2pTunnelItem).texture("type", sourceGem);
withExistingParent("part/source_p2p_tunnel", p2pTunnelPart).texture("type", sourceGem);
withExistingParent("item/spell_p2p_tunnel", p2pTunnelItem).texture("type", sourceStone);
withExistingParent("part/spell_p2p_tunnel", p2pTunnelPart).texture("type", sourceStone);
var sourceP2P = ArsEnergistique.makeId("part/p2p_tunnel_source");
var spellP2P = ArsEnergistique.makeId("part/p2p_tunnel_spell");
withExistingParent("item/source_p2p_tunnel", p2pTunnelItem).texture("type", sourceP2P);
withExistingParent("part/source_p2p_tunnel", p2pTunnelPart).texture("type", sourceP2P);
withExistingParent("item/spell_p2p_tunnel", p2pTunnelItem).texture("type", spellP2P);
withExistingParent("part/spell_p2p_tunnel", p2pTunnelPart).texture("type", spellP2P);

withExistingParent("part/source_acceptor", AppEng.makeId("part/energy_acceptor"))
.texture("sides", "part/source_acceptor_sides")
.texture("back", "part/source_acceptor_back")
.texture("front", "block/source_acceptor")
.texture("particle", "part/source_acceptor_back");
.texture("front", "block/source_acceptor");
withExistingParent("item/cable_source_acceptor", AppEng.makeId("item/cable_energy_acceptor"))
.texture("sides", "part/source_acceptor_sides")
.texture("back", "part/source_acceptor_back")
.texture("front", "block/source_acceptor");

driveCell("1k_source_cell", 0);
driveCell("4k_source_cell", 2);
driveCell("16k_source_cell", 4);
driveCell("64k_source_cell", 6);
driveCell("256k_source_cell", 8);
driveCell("creative_source_cell", 12);
}

private ItemModelBuilder flatSingleLayer(ItemDefinition<?> item) {
var path = item.id().getPath();
return singleTexture(path, mcLoc("item/generated"), "layer0", ArsEnergistique.makeId("item/" + path));
}

private void portable(ItemDefinition<?> portable) {
var id = portable.id().getPath();
var tierSuffix = id.substring(id.lastIndexOf('_'));

singleTexture(
id,
mcLoc("item/generated"),
"layer0",
ArsEnergistique.makeId("item/portable_source_cell_housing"))
.texture("layer1", AppEng.makeId("item/portable_cell_led"))
.texture("layer2", ArsEnergistique.makeId("item/portable_cell_screen"))
.texture("layer3", ArsEnergistique.makeId("item/portable_source_cell" + tierSuffix));
}

private void driveCell(String cell, int offset) {
getBuilder("block/drive/cells/" + cell)
.ao(false)
.texture("cell", "block/source_drive_cell")
.texture("particle", "block/source_drive_cell")
.element()
.to(6, 2, 2)
.face(Direction.NORTH)
.uvs(0, offset, 6, offset + 2)
.end()
.face(Direction.UP)
.uvs(6, offset, 0, offset + 2)
.end()
.face(Direction.DOWN)
.uvs(6, offset, 0, offset + 2)
.end()
.faces((dir, builder) ->
builder.texture("#cell").cullface(Direction.NORTH).end())
.end();
}
}
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
// 1.21.1 2024-10-14T17:14:05.228710396 vanilla/Item Models: arseng
5e0ac1547737efc70ac338999073eb3ca1bc165b assets/arseng/models/item/cable_source_acceptor.json
// 1.21.1 2024-10-14T22:01:59.171191456 vanilla/Item Models: arseng
66bc1729f1f221cd1d3c8a0f58bb69fe08d12462 assets/arseng/models/block/drive/cells/16k_source_cell.json
49d3a9e55d23a7d96b2d4b4450476824ef2f3fdf assets/arseng/models/block/drive/cells/1k_source_cell.json
c8e0ac2a3628a7b0e8b7a31d729507aa70c63a74 assets/arseng/models/block/drive/cells/256k_source_cell.json
ac22bdd6370fcc2b35f68f00042e550931a0cbfc assets/arseng/models/block/drive/cells/4k_source_cell.json
7947e4cd4e52a907471b0b566b4973f59ae7b1c2 assets/arseng/models/block/drive/cells/64k_source_cell.json
8e71cf9cab73153d59e9254e5ee1f4b2f0bf87d2 assets/arseng/models/block/drive/cells/creative_source_cell.json
304a285a28f80e721d055733ba19972f0ec8bed4 assets/arseng/models/item/cable_source_acceptor.json
ad365c33a88aa0653d765ef149f35edeae671c08 assets/arseng/models/item/creative_source_cell.json
128da6cdb959ea4b84726d3a021ec509808bd73c assets/arseng/models/item/portable_source_cell_16k.json
af3483adbb815e78d9b1798fbfe81a5f5f4ff1ee assets/arseng/models/item/portable_source_cell_1k.json
3c57ac2bcac6bab6d2e50aed28cae01a344b6a74 assets/arseng/models/item/portable_source_cell_256k.json
0a8a0d3008d6a1f06dbe646e339cc67b3c1afb99 assets/arseng/models/item/portable_source_cell_4k.json
9331a9d24557295bf95d778367a7fc7526a1954e assets/arseng/models/item/portable_source_cell_64k.json
089f760efa2857a2c389e795762d9cdb57cf68b7 assets/arseng/models/item/portable_source_cell_16k.json
892a1cedba9ac63ab93205fb4d55ef6e2cc3730e assets/arseng/models/item/portable_source_cell_1k.json
a3703deb57fcb16a0352df140787cc46cfffa550 assets/arseng/models/item/portable_source_cell_256k.json
fda32a408b550caeed24ed5ed90227b94a7b7100 assets/arseng/models/item/portable_source_cell_4k.json
77753352abfdc5a4abb10270cea2640843a00ef3 assets/arseng/models/item/portable_source_cell_64k.json
37e4abf9b48ef35dfe4675e1de16bdbb3ad655c8 assets/arseng/models/item/source_cell_housing.json
7fedd922cddc0b7d70d5f12612c0798cdd9ff2b1 assets/arseng/models/item/source_p2p_tunnel.json
b6e4b7a7b76ccc7ce9c3fabb494656a0d74ebe30 assets/arseng/models/item/source_p2p_tunnel.json
ff1e556ac1bda4f4b6e9c3b72d08f1c779f42454 assets/arseng/models/item/source_storage_cell_16k.json
b052c06578dc6e2f547a44a2a7be3dd8803d5f03 assets/arseng/models/item/source_storage_cell_1k.json
aecc62ab7981f76cceacf74e8a9effb4b86ddfef assets/arseng/models/item/source_storage_cell_256k.json
4ed1adc579a371fccbdad2902c14b8812b4a3ce4 assets/arseng/models/item/source_storage_cell_4k.json
875ce8a0ea8d8c59ec75aa5ab2d5e0a69023b0ef assets/arseng/models/item/source_storage_cell_64k.json
b6e1fda4d1cc56b272877e0b337373f617da734c assets/arseng/models/item/spell_p2p_tunnel.json
d37e90bd66cf69000027e529e0e39bcb57d2487b assets/arseng/models/part/source_acceptor.json
8889e1c80ea161d97b5c413e393de32d3ac2a9fe assets/arseng/models/part/source_p2p_tunnel.json
e7c78c889ca9b34e97d4e54679057371a7fbf917 assets/arseng/models/part/spell_p2p_tunnel.json
2f4bb2f0fffd9b97718cbfdb2a673054c9f40dee assets/arseng/models/item/spell_p2p_tunnel.json
b646cbbce331c210b7c0b1c33dacc4d026fc2c3a assets/arseng/models/part/source_acceptor.json
bbcf249ef47224aa8971034da128b92afe66add1 assets/arseng/models/part/source_p2p_tunnel.json
463ed705806c99667ac52bcd508462a37c949cbc assets/arseng/models/part/spell_p2p_tunnel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"ambientocclusion": false,
"elements": [
{
"faces": {
"down": {
"cullface": "north",
"texture": "#cell",
"uv": [
6.0,
4.0,
0.0,
6.0
]
},
"north": {
"cullface": "north",
"texture": "#cell",
"uv": [
0.0,
4.0,
6.0,
6.0
]
},
"up": {
"cullface": "north",
"texture": "#cell",
"uv": [
6.0,
4.0,
0.0,
6.0
]
}
},
"from": [
0,
0,
0
],
"rotation": {
"angle": 0.0,
"axis": "y",
"origin": [
9,
8,
8
]
},
"to": [
6,
2,
2
]
}
],
"textures": {
"cell": "arseng:block/source_drive_cell",
"particle": "arseng:block/source_drive_cell"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"ambientocclusion": false,
"elements": [
{
"faces": {
"down": {
"cullface": "north",
"texture": "#cell",
"uv": [
6.0,
0.0,
0.0,
2.0
]
},
"north": {
"cullface": "north",
"texture": "#cell",
"uv": [
0.0,
0.0,
6.0,
2.0
]
},
"up": {
"cullface": "north",
"texture": "#cell",
"uv": [
6.0,
0.0,
0.0,
2.0
]
}
},
"from": [
0,
0,
0
],
"rotation": {
"angle": 0.0,
"axis": "y",
"origin": [
9,
8,
8
]
},
"to": [
6,
2,
2
]
}
],
"textures": {
"cell": "arseng:block/source_drive_cell",
"particle": "arseng:block/source_drive_cell"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"ambientocclusion": false,
"elements": [
{
"faces": {
"down": {
"cullface": "north",
"texture": "#cell",
"uv": [
6.0,
8.0,
0.0,
10.0
]
},
"north": {
"cullface": "north",
"texture": "#cell",
"uv": [
0.0,
8.0,
6.0,
10.0
]
},
"up": {
"cullface": "north",
"texture": "#cell",
"uv": [
6.0,
8.0,
0.0,
10.0
]
}
},
"from": [
0,
0,
0
],
"rotation": {
"angle": 0.0,
"axis": "y",
"origin": [
9,
8,
8
]
},
"to": [
6,
2,
2
]
}
],
"textures": {
"cell": "arseng:block/source_drive_cell",
"particle": "arseng:block/source_drive_cell"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"ambientocclusion": false,
"elements": [
{
"faces": {
"down": {
"cullface": "north",
"texture": "#cell",
"uv": [
6.0,
2.0,
0.0,
4.0
]
},
"north": {
"cullface": "north",
"texture": "#cell",
"uv": [
0.0,
2.0,
6.0,
4.0
]
},
"up": {
"cullface": "north",
"texture": "#cell",
"uv": [
6.0,
2.0,
0.0,
4.0
]
}
},
"from": [
0,
0,
0
],
"rotation": {
"angle": 0.0,
"axis": "y",
"origin": [
9,
8,
8
]
},
"to": [
6,
2,
2
]
}
],
"textures": {
"cell": "arseng:block/source_drive_cell",
"particle": "arseng:block/source_drive_cell"
}
}
Loading

0 comments on commit ba49e43

Please sign in to comment.