This commit is contained in:
gamma-delta 2022-11-05 20:11:58 +01:00
commit e9c45c803e
43 changed files with 312 additions and 188 deletions

View file

@ -1,4 +1,4 @@
// 1.19.2 2022-11-04T11:49:15.7613829 Item Models: hexcasting
// 1.19.2 2022-11-05T14:56:40.628663 Item Models: hexcasting
f2156b3a7041cf99891b528393db64c6b9ca1a4f assets/hexcasting/models/item/abacus.json
783d8454d6b74f926be0d3e02d87c6505e9d76d0 assets/hexcasting/models/item/acacia_staff.json
19730853397b109cfedd0c3bbda83d5de6cd15b9 assets/hexcasting/models/item/akashic_record.json
@ -41,9 +41,9 @@ c9faada6299f388afc2d2798843d2b45159950d1 assets/hexcasting/models/item/edified_d
2584421c2e9e1cdf22a703018b54cf449613d7d9 assets/hexcasting/models/item/edified_stairs.json
ae58c5b7c304d33cbde60caf44a4c4ee4ec1a633 assets/hexcasting/models/item/edified_trapdoor.json
084183e4351973c8165f6f459c0f0dba2463d957 assets/hexcasting/models/item/edified_wood.json
65fe891f55bc2284690cb1e294cf92dc86dacc7f assets/hexcasting/models/item/focus.json
19b3474a96fa5631ed2a36c6f72cd8853ae4b3cc assets/hexcasting/models/item/focus_filled.json
f7f67f4dce21cdd309ae3dae665e4fb141bded30 assets/hexcasting/models/item/focus_sealed.json
7659d7b7bf93deba4c55405c29b8fa6b8b810ac1 assets/hexcasting/models/item/focus.json
947d1539d88f9d6fd0afcdf831f4327356d19baf assets/hexcasting/models/item/focus_filled.json
cb2d973af25a2ec07e6094ecc106c896a06918dc assets/hexcasting/models/item/focus_sealed.json
6ec61fea7d8c49cc0c45b64857fd926451b4845f assets/hexcasting/models/item/jeweler_hammer.json
e8ce683966f007b56cc551b3137c77f0a1fe2d9a assets/hexcasting/models/item/jungle_staff.json
abfc028c974a02780aed3d7a5859352503bbd920 assets/hexcasting/models/item/lens.json
@ -94,9 +94,9 @@ c809785d09b2545dac68d4a10b1e576454dd51e7 assets/hexcasting/models/item/scroll_sm
9b82beea7667a8f9de3d1e8df136bb2034ed51a8 assets/hexcasting/models/item/slate.json
612d4c65fb907c75975659edf00c7d92bf1b43d8 assets/hexcasting/models/item/slate_blank.json
e6452f95b60240e0067769d7f32a0b9fa7718a1b assets/hexcasting/models/item/slate_written.json
a36727102e1debfd1839a8f9e4e9107b8470658e assets/hexcasting/models/item/spellbook.json
162687ccff4ea2a140883fc708b8bb5c781a4791 assets/hexcasting/models/item/spellbook_filled.json
af553b3d434c3db667329338735393912c7866d7 assets/hexcasting/models/item/spellbook_sealed.json
986674763b45e0f9381f9f34a708082e5230652a assets/hexcasting/models/item/spellbook.json
f962c13ab9e299885387cee35b16006651821e81 assets/hexcasting/models/item/spellbook_filled.json
c29e6e7b2168eeeb13b1fc3e93ffc3e0c9bd11ce assets/hexcasting/models/item/spellbook_sealed.json
7f03c6ea7a07cfedc7d580bb9ba5fcdc54cccb86 assets/hexcasting/models/item/spruce_staff.json
d6ebc87cb0fa6f86bee3a4eade7329ebb0cf2d38 assets/hexcasting/models/item/stripped_edified_log.json
ea3f18f75776022127f3a108119e3f7a5c211c0f assets/hexcasting/models/item/stripped_edified_wood.json

View file

@ -1,4 +1,4 @@
// 1.19.2 2022-11-04T11:49:15.7663843 Block States: hexcasting
// 1.19.2 2022-11-05T14:30:43.69127 Block States: hexcasting
901e38574bdaa40ea4a0f6e773a88a95d9c03e55 assets/hexcasting/blockstates/akashic_bookshelf.json
32a77ef668198002563d68be35a24fa93c8d454a assets/hexcasting/blockstates/akashic_connector.json
85080ce0a0387583a839e4788517d675a1a35e24 assets/hexcasting/blockstates/akashic_record.json
@ -35,30 +35,32 @@ ef6b44bd2360926cb9dcde5bb3f1380385acea90 assets/hexcasting/blockstates/slate.jso
571fe1d5dfdfd9dacd88bc6d04b1a10e01920bd9 assets/hexcasting/blockstates/slate_block.json
13fc293e23c575b19f81f9c4bcd7131d2c34f678 assets/hexcasting/blockstates/stripped_edified_log.json
d66dd72dfbc57537c39d98cf221cc0bfd108dc47 assets/hexcasting/blockstates/stripped_edified_wood.json
b2f3c31e92c7ce6d5b42d95d7ece82b898a9f4f7 assets/hexcasting/models/block/akashic_bookshelf.json
4e925a9a46bd486e5d245dc88911ea57ef0b6319 assets/hexcasting/models/block/akashic_bookshelf_1.json
1a61088aa8efb77c9132bcd3fc69b1d7b9536603 assets/hexcasting/models/block/akashic_bookshelf_2.json
25f6c17cd7b73a83a86e4c15389722d7abfe737e assets/hexcasting/models/block/akashic_bookshelf_3.json
d3b9ed0fd896d96d9bf571ccf3e37d1101e5c162 assets/hexcasting/models/block/akashic_bookshelf_4.json
12871356fc4ecaff1247b7350de79b8783cec96c assets/hexcasting/models/block/akashic_bookshelf_empty.json
215f340a583d72345410c21c43691cd2d8c86724 assets/hexcasting/models/block/akashic_ligature.json
e2a738dede302484f7c8d19dde58c08f841f0432 assets/hexcasting/models/block/akashic_record.json
218a4e73a221eae6b0da7ecdd7f64c0532be46ee assets/hexcasting/models/block/amethyst_dust_block.json
922686586b6eb932d05c094ccdf8269fae0190d3 assets/hexcasting/models/block/amethyst_edified_leaves.json
031fefc08eaad4f0d5b7b4b23a0f311f5b5b84b4 assets/hexcasting/models/block/amethyst_edified_leaves.json
a01a3f7c666a611dbf675b66eea2087d435e99d9 assets/hexcasting/models/block/amethyst_tiles.json
c0a2818ae1162e8b93d32a913602ba8523476695 assets/hexcasting/models/block/ancient_scroll_paper.json
77d0a5c4496678f96da5103b49777e612e3cba1e assets/hexcasting/models/block/ancient_scroll_paper_lantern.json
bf2ac4bb632b79584105cd97da8bff4277f82883 assets/hexcasting/models/block/aventurine_edified_leaves.json
c2b44b5c2221789ef82f7fdff20da174fe9d490c assets/hexcasting/models/block/citrine_edified_leaves.json
3fcdaeb2f5addc90e290fef3ebe5e12805ace0ca assets/hexcasting/models/block/conjured.json
8b6de8cb9ccea9a8e4ce207f0b72048881c11da9 assets/hexcasting/models/block/aventurine_edified_leaves.json
7b47963b4fb1598595cc972f8ac6a38d542c6cf8 assets/hexcasting/models/block/citrine_edified_leaves.json
8b556039d842c21d8cb4cb902aaa5ab6f657a566 assets/hexcasting/models/block/conjured.json
d04e6e7976a44e4286f0693a0ea173bc08525c6d assets/hexcasting/models/block/edified_button.json
79b149288702e1239dee1f94f8562f8c37410d14 assets/hexcasting/models/block/edified_button_pressed.json
01f69ba1c6fa772d2ce27b208bb70ed2657535a1 assets/hexcasting/models/block/edified_door_bottom_left.json
b211bc9cb6ee06cb81a33d8e6350fb6de6b01fb5 assets/hexcasting/models/block/edified_door_bottom_left_open.json
1baf7ed7c9ef61ed9105d7c0038ebc1ba3339a40 assets/hexcasting/models/block/edified_door_bottom_right.json
346813b29069fa8e19164a660d9179e47fd87a6d assets/hexcasting/models/block/edified_door_bottom_right_open.json
cf55585376d16ae26009cb07b063f4ef23e56d50 assets/hexcasting/models/block/edified_door_top_left.json
ae5f925b138c9f3039f0399624396a3b36eb9627 assets/hexcasting/models/block/edified_door_top_left_open.json
f02f9f92d14d1848f8e41d431ae72f60e6b3acf4 assets/hexcasting/models/block/edified_door_top_right.json
a2e8a3612226f36f53f63b4e9b43e4956575726c assets/hexcasting/models/block/edified_door_top_right_open.json
b13efe9e1aade0163a8d378184a19a639b98c460 assets/hexcasting/models/block/edified_door_bottom_left.json
1e138fe4503fa0d37713ff5b76e8ff82090e8e8e assets/hexcasting/models/block/edified_door_bottom_left_open.json
3d001d0388fd3287ad14dca7eac1581c5ce75b0c assets/hexcasting/models/block/edified_door_bottom_right.json
9dd09e2267b2ae77314c86b1ea1c7406b5b25ce2 assets/hexcasting/models/block/edified_door_bottom_right_open.json
5525ac927fa8165243862504325be6219b40a968 assets/hexcasting/models/block/edified_door_top_left.json
11922c18e84d393bc99380d52c187bbaa6079359 assets/hexcasting/models/block/edified_door_top_left_open.json
729cf57ba13bf915999b4297aadb2ef6848d0337 assets/hexcasting/models/block/edified_door_top_right.json
db3008a51e611ee3ffb86b5829df6b7da6bfcc61 assets/hexcasting/models/block/edified_door_top_right_open.json
c5433d0b5c9f039ae3c314c8a82c7e1d3238447d assets/hexcasting/models/block/edified_log.json
71f1505d8255e1d57b8a9100b008dbaf73beacdc assets/hexcasting/models/block/edified_log_horizontal.json
e691e8592c9ba75a2c67979ebef11e1c9280075b assets/hexcasting/models/block/edified_panel.json
@ -73,9 +75,9 @@ dfd5d21b09dea57135e50dc025a1652c9eb74a29 assets/hexcasting/models/block/edified_
fbd8b3a4e77e4488e25e5b49e4ef7dcb73eb4785 assets/hexcasting/models/block/edified_stairs_inner.json
f0100add1e9997b68bc2e910da63e5a772959486 assets/hexcasting/models/block/edified_stairs_outer.json
e76164c5fd831acccf914c7f05d7fe9639c27c30 assets/hexcasting/models/block/edified_tile.json
c8275464703da726ab683f7c01bacd8248138fbd assets/hexcasting/models/block/edified_trapdoor_bottom.json
79cb6d21c9d8e6cb338a19cc391f2bb90d45be75 assets/hexcasting/models/block/edified_trapdoor_open.json
09eb09e1312da4deec21878bd688ee776b2316d9 assets/hexcasting/models/block/edified_trapdoor_top.json
abca4332771fe0c3e24b6624907b3206d8cb02f4 assets/hexcasting/models/block/edified_trapdoor_bottom.json
807d363ca1fffe9af1c40319a8c2338822b54f31 assets/hexcasting/models/block/edified_trapdoor_open.json
ba95ea7a856895ca2a3438293b79fe4798b212ad assets/hexcasting/models/block/edified_trapdoor_top.json
d4f286180e320c0ca819067b9e9a9b1db7f72e0a assets/hexcasting/models/block/edified_wood.json
b2e1617c6549ffdf0a38bfbb6e9270a54c7a2718 assets/hexcasting/models/block/edified_wood_horizontal.json
ce5a129137f8783bcec10017b8511c6e547be790 assets/hexcasting/models/block/empty_directrix_dim_x.json

View file

@ -0,0 +1,68 @@
{
"elements": [
{
"faces": {
"down": {
"cullface": "down",
"texture": "#top_bottom"
},
"east": {
"cullface": "east",
"texture": "#side"
},
"north": {
"cullface": "north",
"texture": "#front"
},
"south": {
"cullface": "south",
"texture": "#side"
},
"up": {
"cullface": "up",
"texture": "#top_bottom"
},
"west": {
"cullface": "west",
"texture": "#side"
}
},
"from": [
0,
0,
0
],
"to": [
16,
16,
16
]
},
{
"faces": {
"north": {
"cullface": "north",
"texture": "#overlay",
"tintindex": 0
}
},
"from": [
0,
0,
0
],
"to": [
16,
16,
16
]
}
],
"render_type": "minecraft:cutout",
"textures": {
"front": "hexcasting:block/akashic_bookshelf",
"particle": "hexcasting:block/akashic_bookshelf_vert",
"side": "hexcasting:block/akashic_bookshelf_horiz",
"top_bottom": "hexcasting:block/akashic_bookshelf_vert"
}
}

View file

@ -0,0 +1,87 @@
{
"parent": "minecraft:block/block",
"elements": [
{
"faces": {
"down": {
"cullface": "down",
"texture": "#outer"
},
"east": {
"cullface": "east",
"texture": "#outer"
},
"north": {
"cullface": "north",
"texture": "#outer"
},
"south": {
"cullface": "south",
"texture": "#outer"
},
"up": {
"cullface": "up",
"texture": "#outer"
},
"west": {
"cullface": "west",
"texture": "#outer"
}
},
"from": [
0,
0,
0
],
"to": [
16,
16,
16
]
},
{
"faces": {
"down": {
"rotation": 180,
"texture": "#inner"
},
"east": {
"rotation": 180,
"texture": "#inner"
},
"north": {
"rotation": 180,
"texture": "#inner"
},
"south": {
"rotation": 180,
"texture": "#inner"
},
"up": {
"rotation": 180,
"texture": "#inner"
},
"west": {
"rotation": 180,
"texture": "#inner"
}
},
"from": [
15.75,
15.75,
15.75
],
"to": [
0.25,
0.25,
0.25
]
}
],
"render_type": "minecraft:translucent",
"textures": {
"inner": "hexcasting:block/akashic_ligature",
"outer": "hexcasting:block/akashic_record",
"particle": "hexcasting:block/akashic_ligature"
}
}

View file

@ -1,6 +1,7 @@
{
"parent": "minecraft:block/leaves",
"render_type": "minecraft:cutout_mipped",
"textures": {
"all": "hexcasting:block/amethyst_edified_leaves"
}
}
}

View file

@ -1,6 +1,7 @@
{
"parent": "minecraft:block/leaves",
"render_type": "minecraft:cutout_mipped",
"textures": {
"all": "hexcasting:block/aventurine_edified_leaves"
}
}
}

View file

@ -1,6 +1,7 @@
{
"parent": "minecraft:block/leaves",
"render_type": "minecraft:cutout_mipped",
"textures": {
"all": "hexcasting:block/citrine_edified_leaves"
}
}
}

View file

@ -1,5 +1,6 @@
{
"render_type": "minecraft:cutout",
"textures": {
"particle": "minecraft:block/amethyst_block"
}
}
}

View file

@ -1,7 +1,8 @@
{
"parent": "minecraft:block/door_bottom_left",
"render_type": "minecraft:cutout",
"textures": {
"bottom": "hexcasting:block/edified_door_lower",
"top": "hexcasting:block/edified_door_upper"
}
}
}

View file

@ -1,7 +1,8 @@
{
"parent": "minecraft:block/door_bottom_left_open",
"render_type": "minecraft:cutout",
"textures": {
"bottom": "hexcasting:block/edified_door_lower",
"top": "hexcasting:block/edified_door_upper"
}
}
}

View file

@ -1,7 +1,8 @@
{
"parent": "minecraft:block/door_bottom_right",
"render_type": "minecraft:cutout",
"textures": {
"bottom": "hexcasting:block/edified_door_lower",
"top": "hexcasting:block/edified_door_upper"
}
}
}

View file

@ -1,7 +1,8 @@
{
"parent": "minecraft:block/door_bottom_right_open",
"render_type": "minecraft:cutout",
"textures": {
"bottom": "hexcasting:block/edified_door_lower",
"top": "hexcasting:block/edified_door_upper"
}
}
}

View file

@ -1,7 +1,8 @@
{
"parent": "minecraft:block/door_top_left",
"render_type": "minecraft:cutout",
"textures": {
"bottom": "hexcasting:block/edified_door_lower",
"top": "hexcasting:block/edified_door_upper"
}
}
}

View file

@ -1,7 +1,8 @@
{
"parent": "minecraft:block/door_top_left_open",
"render_type": "minecraft:cutout",
"textures": {
"bottom": "hexcasting:block/edified_door_lower",
"top": "hexcasting:block/edified_door_upper"
}
}
}

View file

@ -1,7 +1,8 @@
{
"parent": "minecraft:block/door_top_right",
"render_type": "minecraft:cutout",
"textures": {
"bottom": "hexcasting:block/edified_door_lower",
"top": "hexcasting:block/edified_door_upper"
}
}
}

View file

@ -1,7 +1,8 @@
{
"parent": "minecraft:block/door_top_right_open",
"render_type": "minecraft:cutout",
"textures": {
"bottom": "hexcasting:block/edified_door_lower",
"top": "hexcasting:block/edified_door_upper"
}
}
}

View file

@ -1,6 +1,7 @@
{
"parent": "minecraft:block/template_orientable_trapdoor_bottom",
"render_type": "minecraft:cutout",
"textures": {
"texture": "hexcasting:block/edified_trapdoor"
}
}
}

View file

@ -1,6 +1,7 @@
{
"parent": "minecraft:block/template_orientable_trapdoor_open",
"render_type": "minecraft:cutout",
"textures": {
"texture": "hexcasting:block/edified_trapdoor"
}
}
}

View file

@ -1,6 +1,7 @@
{
"parent": "minecraft:block/template_orientable_trapdoor_top",
"render_type": "minecraft:cutout",
"textures": {
"texture": "hexcasting:block/edified_trapdoor"
}
}
}

View file

@ -21,6 +21,6 @@
}
],
"textures": {
"layer0": "hexcasting:item/focus"
"layer0": "hexcasting:item/focus_empty"
}
}

View file

@ -1,7 +1,7 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "hexcasting:item/focus",
"layer0": "hexcasting:item/focus_base",
"layer1": "hexcasting:item/focus_overlay"
}
}

View file

@ -1,7 +1,7 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "hexcasting:item/focus",
"layer0": "hexcasting:item/focus_base_sealed",
"layer1": "hexcasting:item/focus_overlay_sealed"
}
}

View file

@ -21,6 +21,6 @@
}
],
"textures": {
"layer0": "hexcasting:item/spellbook"
"layer0": "hexcasting:item/spellbook_empty"
}
}

View file

@ -1,7 +1,7 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "hexcasting:item/spellbook",
"layer0": "hexcasting:item/spellbook_base",
"layer1": "hexcasting:item/spellbook_overlay"
}
}

View file

@ -1,7 +1,7 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "hexcasting:item/spellbook",
"layer0": "hexcasting:item/spellbook_base_sealed",
"layer1": "hexcasting:item/spellbook_overlay_sealed"
}
}

View file

@ -118,7 +118,7 @@ public class ListIota extends Iota {
// We aim to not break one iota between lines
var listTag = HexUtils.downcast(tag, ListTag.TYPE);
var start = FormattedCharSequence.forward("[", Style.EMPTY.withColor(ChatFormatting.DARK_PURPLE));
var start = FormattedCharSequence.forward(listTag.isEmpty() ? "[]" : "[", Style.EMPTY.withColor(ChatFormatting.DARK_PURPLE));
var cursor = font.width(start);
var currentLine = new ArrayList<>(List.of(start));
var out = new ArrayList<FormattedCharSequence>();

View file

@ -67,7 +67,8 @@ public class PatternIota extends Iota {
}
public static Component display(HexPattern pat) {
var bob = new StringBuilder("HexPattern(");
var component = Component.literal("HexPattern(").withStyle(ChatFormatting.GOLD);
var bob = new StringBuilder();
bob.append(pat.getStartDir());
var sig = pat.anglesSignature();
@ -75,7 +76,8 @@ public class PatternIota extends Iota {
bob.append(" ");
bob.append(sig);
}
bob.append(")");
return Component.literal(bob.toString()).withStyle(ChatFormatting.GOLD);
component.append(Component.literal(bob.toString()).withStyle(ChatFormatting.WHITE));
component.append(Component.literal(")").withStyle(ChatFormatting.GOLD));
return component;
}
}

View file

@ -8,7 +8,9 @@ import at.petrak.hexcasting.api.spell.math.HexCoord
import at.petrak.hexcasting.common.lib.HexIotaTypes
import net.minecraft.ChatFormatting
import net.minecraft.nbt.*
import net.minecraft.network.chat.*
import net.minecraft.network.chat.Component
import net.minecraft.network.chat.MutableComponent
import net.minecraft.network.chat.Style
import net.minecraft.world.InteractionHand
import net.minecraft.world.item.ItemStack
import net.minecraft.world.phys.Vec2
@ -245,6 +247,7 @@ fun ItemStack.serializeToNBT(): CompoundTag {
return out
}
@Suppress("UNCHECKED_CAST")
@Throws(IllegalArgumentException::class)
fun <T : Tag> Tag.downcast(type: TagType<T>): T {
if (this.type == type) {

View file

@ -5,7 +5,7 @@ import at.petrak.hexcasting.api.spell.OperationResult
import at.petrak.hexcasting.api.spell.asActionResult
import at.petrak.hexcasting.api.spell.casting.CastingContext
import at.petrak.hexcasting.api.spell.casting.SpellContinuation
import at.petrak.hexcasting.api.spell.getPositiveIntUnder
import at.petrak.hexcasting.api.spell.getIntBetween
import at.petrak.hexcasting.api.spell.iota.Iota
import at.petrak.hexcasting.api.spell.mishaps.MishapNotEnoughArgs
@ -18,7 +18,7 @@ object OpLastNToList : Action {
): OperationResult {
if (stack.isEmpty())
throw MishapNotEnoughArgs(1, 0)
val yoinkCount = stack.takeLast(1).getPositiveIntUnder(0, stack.size - 1)
val yoinkCount = stack.takeLast(1).getIntBetween(0, 0, stack.size - 1)
stack.removeLast()
val output = mutableListOf<Iota>()
output.addAll(stack.takeLast(yoinkCount))

View file

@ -1,32 +0,0 @@
{
"credit": "Made with Blockbench",
"textures": {
"front": "hexcasting:block/akashic_bookshelf",
"side": "hexcasting:block/akashic_bookshelf_horiz",
"particle": "hexcasting:block/akashic_bookshelf_vert",
"top_bottom": "hexcasting:block/akashic_bookshelf_vert"
},
"elements": [
{
"name": "body",
"from": [0, 0, 0],
"to": [16, 16, 16],
"faces": {
"north": {"uv": [0, 0, 16, 16], "texture": "#front", "cullface": "north"},
"east": {"uv": [0, 0, 16, 16], "texture": "#side", "cullface": "east"},
"south": {"uv": [0, 0, 16, 16], "texture": "#side", "cullface": "south"},
"west": {"uv": [0, 0, 16, 16], "texture": "#side", "cullface": "west"},
"up": {"uv": [0, 0, 16, 16], "texture": "#top_bottom", "cullface": "up"},
"down": {"uv": [0, 0, 16, 16], "texture": "#top_bottom", "cullface": "down"}
}
},
{
"name": "overlay",
"from": [0, 0, 0],
"to": [16, 16, 0],
"faces": {
"north": {"uv": [0, 0, 16, 16], "texture": "#overlay", "cullface": "north", "tintindex": 0}
}
}
]
}

View file

@ -1,67 +0,0 @@
{
"credit": "Made with Blockbench",
"textures": {
"0": "hexcasting:block/akashic_record",
"1": "hexcasting:block/akashic_ligature",
"particle": "hexcasting:block/akashic_ligature"
},
"elements": [
{
"name": "body",
"from": [0, 0, 0],
"to": [16, 16, 16],
"faces": {
"north": {"uv": [0, 0, 16, 16], "texture": "#0"},
"east": {"uv": [0, 0, 16, 16], "texture": "#0"},
"south": {"uv": [0, 0, 16, 16], "texture": "#0"},
"west": {"uv": [0, 0, 16, 16], "texture": "#0"},
"up": {"uv": [0, 0, 16, 16], "texture": "#0"},
"down": {"uv": [0, 0, 16, 16], "texture": "#0"}
}
},
{
"name": "inner",
"from": [15.75, 15.75, 15.75],
"to": [0.25, 0.25, 0.25],
"faces": {
"north": {"uv": [0, 0, 16, 16], "rotation": 180, "texture": "#1"},
"east": {"uv": [0, 0, 16, 16], "rotation": 180, "texture": "#1"},
"south": {"uv": [0, 0, 16, 16], "rotation": 180, "texture": "#1"},
"west": {"uv": [0, 0, 16, 16], "rotation": 180, "texture": "#1"},
"up": {"uv": [0, 0, 16, 16], "rotation": 180, "texture": "#1"},
"down": {"uv": [0, 0, 16, 16], "rotation": 180, "texture": "#1"}
}
}
],
"display": {
"thirdperson_righthand": {
"rotation": [75, 45, 0],
"translation": [0, 2.5, 0],
"scale": [0.375, 0.375, 0.375]
},
"thirdperson_lefthand": {
"rotation": [75, 45, 0],
"translation": [0, 2.5, 0],
"scale": [0.375, 0.375, 0.375]
},
"firstperson_righthand": {
"rotation": [0, 45, 0],
"scale": [0.4, 0.4, 0.4]
},
"firstperson_lefthand": {
"rotation": [0, 225, 0],
"scale": [0.4, 0.4, 0.4]
},
"ground": {
"translation": [0, 3, 0],
"scale": [0.25, 0.25, 0.25]
},
"gui": {
"rotation": [30, 225, 0],
"scale": [0.625, 0.625, 0.625]
},
"fixed": {
"scale": [0.5, 0.5, 0.5]
}
}
}

View file

@ -5,6 +5,7 @@
"3": "block/large_amethyst_bud",
"particle": "block/cut_copper"
},
"render_type": "cutout",
"elements": [
{
"name": "base",

Binary file not shown.

After

Width:  |  Height:  |  Size: 417 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 305 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

View file

@ -23,12 +23,12 @@ import net.minecraft.world.item.Items;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.phys.Vec3;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.common.capabilities.ForgeCapabilities;
import net.minecraftforge.common.capabilities.ICapabilityProvider;
import net.minecraftforge.common.capabilities.RegisterCapabilitiesEvent;
import net.minecraftforge.common.util.LazyOptional;
import net.minecraftforge.common.util.NonNullSupplier;
import net.minecraftforge.event.AttachCapabilitiesEvent;
import net.minecraftforge.items.CapabilityItemHandler;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@ -116,7 +116,7 @@ public class ForgeCapabilityHandler {
public static void attachBlockEntityCaps(AttachCapabilitiesEvent<BlockEntity> evt) {
if (evt.getObject() instanceof BlockEntityAbstractImpetus impetus) {
evt.addCapability(IMPETUS_HANDLER, provide(impetus, CapabilityItemHandler.ITEM_HANDLER_CAPABILITY,
evt.addCapability(IMPETUS_HANDLER, provide(impetus, ForgeCapabilities.ITEM_HANDLER,
() -> new ForgeImpetusCapability(impetus)));
}
}

View file

@ -14,6 +14,7 @@ import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
import net.minecraftforge.client.model.generators.BlockModelBuilder;
import net.minecraftforge.client.model.generators.ConfiguredModel;
import net.minecraftforge.client.model.generators.ModelBuilder;
import net.minecraftforge.common.data.ExistingFileHelper;
import static net.minecraftforge.client.model.generators.ModelProvider.BLOCK_FOLDER;
@ -122,12 +123,41 @@ public class HexBlockStatesAndModels extends PaucalBlockStateAndModelProvider {
.build();
});
var akashicRecordModel = models().getExistingFile(modLoc("block/akashic_record"));
var akashicRecordModel = models().withExistingParent("akashic_record", "block/block")
.renderType("translucent")
.texture("inner", modLoc("block/akashic_ligature"))
.texture("outer", modLoc("block/akashic_record"))
.texture("particle", modLoc("block/akashic_ligature"))
.element()
.cube("#outer")
.end()
.element()
.from(15.75f, 15.75f, 15.75f)
.to(0.25f, 0.25f, 0.25f)
.allFaces((dir, builder) -> builder.texture("#inner").rotation(ModelBuilder.FaceRotation.UPSIDE_DOWN))
.end();
simpleBlock(HexBlocks.AKASHIC_RECORD, akashicRecordModel);
simpleBlockItem(HexBlocks.AKASHIC_RECORD, akashicRecordModel);
blockAndItem(HexBlocks.AKASHIC_LIGATURE,
models().cubeAll("akashic_ligature", modLoc("block/akashic_ligature")));
models().getBuilder("akashic_bookshelf")
.renderType("cutout")
.texture("front", modLoc("block/akashic_bookshelf"))
.texture("side", modLoc("block/akashic_bookshelf_horiz"))
.texture("top_bottom", modLoc("block/akashic_bookshelf_vert"))
.texture("particle", modLoc("block/akashic_bookshelf_vert"))
.element()
.allFaces((dir, builder) -> builder.texture(switch (dir) {
case DOWN, UP -> "#top_bottom";
case EAST, SOUTH, WEST -> "#side";
default -> "#front";
}).cullface(dir))
.end()
.element()
.face(Direction.NORTH).texture("#overlay").cullface(Direction.NORTH).tintindex(0);
getVariantBuilder(HexBlocks.AKASHIC_BOOKSHELF).forAllStates(bs -> {
Direction dir = bs.getValue(BlockAkashicBookshelf.FACING);
@ -197,17 +227,20 @@ public class HexBlockStatesAndModels extends PaucalBlockStateAndModelProvider {
ResourceLocation leavesParent = new ResourceLocation("block/leaves");
blockAndItem(HexBlocks.AMETHYST_EDIFIED_LEAVES,
models().withExistingParent("amethyst_edified_leaves", leavesParent)
.texture("all", modLoc("block/amethyst_edified_leaves")));
.texture("all", modLoc("block/amethyst_edified_leaves"))
.renderType("cutout_mipped"));
blockAndItem(HexBlocks.AVENTURINE_EDIFIED_LEAVES,
models().withExistingParent("aventurine_edified_leaves", leavesParent)
.texture("all", modLoc("block/aventurine_edified_leaves")));
.texture("all", modLoc("block/aventurine_edified_leaves"))
.renderType("cutout_mipped"));
blockAndItem(HexBlocks.CITRINE_EDIFIED_LEAVES,
models().withExistingParent("citrine_edified_leaves", leavesParent)
.texture("all", modLoc("block/citrine_edified_leaves")));
.texture("all", modLoc("block/citrine_edified_leaves"))
.renderType("cutout_mipped"));
doorBlock(HexBlocks.EDIFIED_DOOR, modLoc("block/edified_door_lower"), modLoc("block/edified_door_upper"));
doorBlockWithRenderType(HexBlocks.EDIFIED_DOOR, modLoc("block/edified_door_lower"), modLoc("block/edified_door_upper"), "cutout");
// door model via the given texture
trapdoorBlock(HexBlocks.EDIFIED_TRAPDOOR, modLoc("block/edified_trapdoor"), true);
trapdoorBlockWithRenderType(HexBlocks.EDIFIED_TRAPDOOR, modLoc("block/edified_trapdoor"), true, "cutout");
ResourceLocation planks1 = modLoc("block/edified_planks");
BlockModelBuilder planksModel = models().cubeAll("edified_planks", planks1);
@ -231,7 +264,8 @@ public class HexBlockStatesAndModels extends PaucalBlockStateAndModelProvider {
simpleBlock(HexBlocks.SCONCE, sconceModel);
simpleBlockItem(HexBlocks.SCONCE, sconceModel);
var conjuredModel = models().getBuilder("conjured").texture("particle", mcLoc("block/amethyst_block"));
var conjuredModel = models().getBuilder("conjured").texture("particle", mcLoc("block/amethyst_block"))
.renderType("cutout");
simpleBlock(HexBlocks.CONJURED_BLOCK, conjuredModel);
simpleBlock(HexBlocks.CONJURED_LIGHT, conjuredModel);
}

View file

@ -12,13 +12,16 @@ import at.petrak.hexcasting.common.lib.HexBlocks;
import at.petrak.hexcasting.common.lib.HexItems;
import at.petrak.paucal.api.forge.datagen.PaucalItemModelProvider;
import net.minecraft.client.renderer.block.model.ItemTransforms;
import net.minecraft.core.Registry;
import net.minecraft.data.DataGenerator;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.DyeColor;
import net.minecraft.world.item.Item;
import net.minecraft.world.level.block.Block;
import net.minecraftforge.client.model.generators.ModelFile;
import net.minecraftforge.common.data.ExistingFileHelper;
import net.minecraftforge.registries.ForgeRegistries;
import java.util.Objects;
public class HexItemModels extends PaucalItemModelProvider {
public HexItemModels(DataGenerator generator, ExistingFileHelper existingFileHelper) {
@ -27,6 +30,14 @@ public class HexItemModels extends PaucalItemModelProvider {
private static final String[] PHIAL_SIZES = {"small", "medium", "large"};
private static String getPath(Item item) {
return Objects.requireNonNull(ForgeRegistries.ITEMS.getKey(item)).getPath();
}
private static String getPath(Block block) {
return Objects.requireNonNull(ForgeRegistries.BLOCKS.getKey(block)).getPath();
}
@Override
protected void registerModels() {
simpleItem(HexItems.AMETHYST_DUST);
@ -37,10 +48,10 @@ public class HexItemModels extends PaucalItemModelProvider {
simpleItem(HexItems.CREATIVE_UNLOCKER);
simpleItem(HexItems.LORE_FRAGMENT);
singleTexture(Registry.BLOCK.getKey(HexBlocks.CONJURED_BLOCK).getPath(),
singleTexture(getPath(HexBlocks.CONJURED_BLOCK),
new ResourceLocation("item/generated"),
"layer0", new ResourceLocation("item/amethyst_shard"));
singleTexture(Registry.BLOCK.getKey(HexBlocks.CONJURED_LIGHT).getPath(),
singleTexture(getPath(HexBlocks.CONJURED_LIGHT),
new ResourceLocation("item/generated"),
"layer0", new ResourceLocation("item/amethyst_shard"));
@ -54,7 +65,7 @@ public class HexItemModels extends PaucalItemModelProvider {
buildScroll(HexItems.SCROLL_LARGE, "large");
simpleItem(HexItems.SCRYING_LENS);
getBuilder(Registry.ITEM.getKey(HexItems.SCRYING_LENS).getPath())
getBuilder(getPath(HexItems.SCRYING_LENS))
.transforms()
.transform(ItemTransforms.TransformType.HEAD)
.rotation(0f, 0f, 0f)
@ -95,7 +106,7 @@ public class HexItemModels extends PaucalItemModelProvider {
"layer0", modLoc("item/phial/" + name));
float fillProp = (float) fill / maxFill;
getBuilder(Registry.ITEM.getKey(HexItems.BATTERY).getPath()).override()
getBuilder(getPath(HexItems.BATTERY)).override()
.predicate(ItemMediaBattery.MANA_PREDICATE, fillProp)
.predicate(ItemMediaBattery.MAX_MANA_PREDICATE, size)
.model(new ModelFile.UncheckedModelFile(modLoc("item/" + name)))
@ -104,21 +115,21 @@ public class HexItemModels extends PaucalItemModelProvider {
}
for (var dye : DyeColor.values()) {
singleTexture(Registry.ITEM.getKey(HexItems.DYE_COLORIZERS.get(dye)).getPath(),
singleTexture(getPath(HexItems.DYE_COLORIZERS.get(dye)),
new ResourceLocation("item/generated"),
"layer0", modLoc("item/colorizer/dye_" + dye.getName()));
}
for (var type : ItemPrideColorizer.Type.values()) {
singleTexture(Registry.ITEM.getKey(HexItems.PRIDE_COLORIZERS.get(type)).getPath(),
singleTexture(getPath(HexItems.PRIDE_COLORIZERS.get(type)),
new ResourceLocation("item/generated"),
"layer0", modLoc("item/colorizer/pride_" + type.getName()));
}
singleTexture(Registry.ITEM.getKey(HexItems.UUID_COLORIZER).getPath(), new ResourceLocation("item/generated"),
singleTexture(getPath(HexItems.UUID_COLORIZER), new ResourceLocation("item/generated"),
"layer0", modLoc("item/colorizer/uuid"));
simpleItem(modLoc("slate_blank"));
simpleItem(modLoc("slate_written"));
getBuilder(Registry.ITEM.getKey(HexItems.SLATE).getPath()).override()
getBuilder(getPath(HexItems.SLATE)).override()
.predicate(ItemSlate.WRITTEN_PRED, 0)
.model(new ModelFile.UncheckedModelFile(modLoc("item/slate_blank")))
.end()
@ -127,39 +138,39 @@ public class HexItemModels extends PaucalItemModelProvider {
.model(new ModelFile.UncheckedModelFile(modLoc("item/slate_written")))
.end();
getBuilder(Registry.BLOCK.getKey(HexBlocks.AKASHIC_RECORD).getPath()).parent(
getBuilder(getPath(HexBlocks.AKASHIC_RECORD)).parent(
new ModelFile.UncheckedModelFile(modLoc("block/akashic_record")));
simpleItem(modLoc("edified_door"));
getBuilder(Registry.BLOCK.getKey(HexBlocks.EDIFIED_TRAPDOOR).getPath()).parent(
getBuilder(getPath(HexBlocks.EDIFIED_TRAPDOOR)).parent(
new ModelFile.UncheckedModelFile(modLoc("block/edified_trapdoor_bottom")));
getBuilder(Registry.BLOCK.getKey(HexBlocks.EDIFIED_LOG).getPath()).parent(
getBuilder(getPath(HexBlocks.EDIFIED_LOG)).parent(
new ModelFile.UncheckedModelFile(modLoc("block/edified_log")));
getBuilder(Registry.BLOCK.getKey(HexBlocks.STRIPPED_EDIFIED_LOG).getPath()).parent(
getBuilder(getPath(HexBlocks.STRIPPED_EDIFIED_LOG)).parent(
new ModelFile.UncheckedModelFile(modLoc("block/stripped_edified_log")));
getBuilder(Registry.BLOCK.getKey(HexBlocks.EDIFIED_WOOD).getPath()).parent(
getBuilder(getPath(HexBlocks.EDIFIED_WOOD)).parent(
new ModelFile.UncheckedModelFile(modLoc("block/edified_wood")));
getBuilder(Registry.BLOCK.getKey(HexBlocks.STRIPPED_EDIFIED_WOOD).getPath()).parent(
getBuilder(getPath(HexBlocks.STRIPPED_EDIFIED_WOOD)).parent(
new ModelFile.UncheckedModelFile(modLoc("block/stripped_edified_wood")));
getBuilder(Registry.BLOCK.getKey(HexBlocks.EDIFIED_STAIRS).getPath()).parent(
getBuilder(getPath(HexBlocks.EDIFIED_STAIRS)).parent(
new ModelFile.UncheckedModelFile(modLoc("block/edified_stairs")));
getBuilder(Registry.BLOCK.getKey(HexBlocks.EDIFIED_SLAB).getPath()).parent(
getBuilder(getPath(HexBlocks.EDIFIED_SLAB)).parent(
new ModelFile.UncheckedModelFile(modLoc("block/edified_slab")));
getBuilder(Registry.BLOCK.getKey(HexBlocks.EDIFIED_BUTTON).getPath()).parent(
getBuilder(getPath(HexBlocks.EDIFIED_BUTTON)).parent(
new ModelFile.UncheckedModelFile(new ResourceLocation("block/button_inventory")))
.texture("texture", modLoc("block/edified_planks"));
getBuilder(Registry.BLOCK.getKey(HexBlocks.EDIFIED_PRESSURE_PLATE).getPath())
getBuilder(getPath(HexBlocks.EDIFIED_PRESSURE_PLATE))
.parent(new ModelFile.UncheckedModelFile(modLoc("block/edified_pressure_plate")));
}
private void buildSealableIotaHolder(Item item, String stub) {
var name = Registry.ITEM.getKey(item).getPath();
var name = getPath(item);
var plain = singleTexture(name, new ResourceLocation("item/generated"),
"layer0", modLoc("item/" + stub));
"layer0", modLoc("item/" + stub + "_empty"));
var unsealed = withExistingParent(name + "_filled", new ResourceLocation("item/generated"))
.texture("layer0", modLoc("item/" + stub))
.texture("layer0", modLoc("item/" + stub + "_base"))
.texture("layer1", modLoc("item/" + stub) + "_overlay");
var sealed = withExistingParent(name + "_sealed", new ResourceLocation("item/generated"))
.texture("layer0", modLoc("item/" + stub))
.texture("layer0", modLoc("item/" + stub + "_base_sealed"))
.texture("layer1", modLoc("item/" + stub) + "_overlay_sealed");
getBuilder(name)
.override().predicate(ItemFocus.OVERLAY_PRED, 0f)
@ -171,7 +182,7 @@ public class HexItemModels extends PaucalItemModelProvider {
}
private void buildScroll(Item item, String size) {
getBuilder(Registry.ITEM.getKey(item).getPath())
getBuilder(getPath(item))
.override()
.predicate(ItemScroll.ANCIENT_PREDICATE, 0f)
.model(new ModelFile.UncheckedModelFile(modLoc("item/scroll_pristine_" + size))).end()
@ -181,9 +192,9 @@ public class HexItemModels extends PaucalItemModelProvider {
}
private void buildStaff(Item item, String name) {
singleTexture(Registry.ITEM.getKey(item).getPath(), new ResourceLocation("item/handheld_rod"),
singleTexture(getPath(item), new ResourceLocation("item/handheld_rod"),
"layer0", modLoc("item/staves/" + name));
getBuilder(Registry.ITEM.getKey(item).getPath())
getBuilder(getPath(item))
.override()
.predicate(ItemStaff.FUNNY_LEVEL_PREDICATE, 0)
.model(new ModelFile.UncheckedModelFile(modLoc("item/" + name + "_staff")))
@ -199,7 +210,7 @@ public class HexItemModels extends PaucalItemModelProvider {
private void buildPackagedSpell(Item item, String name) {
simpleItem(modLoc(name));
simpleItem(modLoc(name + "_filled"));
getBuilder(Registry.ITEM.getKey(item).getPath())
getBuilder(getPath(item))
.override()
.predicate(ItemPackagedHex.HAS_PATTERNS_PRED, -0.01f)
.model(new ModelFile.UncheckedModelFile(modLoc("item/" + name)))

View file

@ -6,7 +6,6 @@ import at.petrak.hexcasting.xplat.IClientXplatAbstractions;
import net.minecraft.client.Minecraft;
import net.minecraft.client.particle.ParticleProvider;
import net.minecraft.client.particle.SpriteSet;
import net.minecraft.client.renderer.ItemBlockRenderTypes;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.client.renderer.entity.EntityRendererProvider;
import net.minecraft.client.renderer.entity.EntityRenderers;
@ -31,7 +30,8 @@ public class ForgeClientXplatImpl implements IClientXplatAbstractions {
@Override
public void setRenderLayer(Block block, RenderType type) {
ItemBlockRenderTypes.setRenderLayer(block, type);
// For forge, handled in block models
// ItemBlockRenderTypes.setRenderLayer(block, type);
}
@Override