got boolean directrix textured and modelled properly.

This commit is contained in:
Talia-12 2023-07-20 15:40:03 +10:00
parent 88270d541f
commit d25682902d
20 changed files with 80 additions and 22 deletions

View file

@ -60,8 +60,8 @@ public class BlockBooleanDirectrix extends BlockCircleComponent {
world.setBlockAndUpdate(pos, bs.setValue(STATE, biota.getBool() ? State.TRUE : State.FALSE));
var outputDir = biota.getBool()
? bs.getValue(FACING)
: bs.getValue(FACING).getOpposite();
? bs.getValue(FACING).getOpposite()
: bs.getValue(FACING);
var imageOut = imageIn.copy(stack, imageIn.getParenCount(), imageIn.getParenthesized(),
imageIn.getEscapeNext(), imageIn.getOpsConsumed(), imageIn.getUserData());

View file

@ -45,7 +45,7 @@ public class HexLootTables extends PaucalLootTableSubProvider {
Map<ResourceLocation, LootTable.Builder> lootTables) {
dropSelf(blockTables, HexBlocks.IMPETUS_EMPTY,
HexBlocks.IMPETUS_RIGHTCLICK, HexBlocks.IMPETUS_LOOK, HexBlocks.IMPETUS_REDSTONE,
HexBlocks.DIRECTRIX_REDSTONE, HexBlocks.EMPTY_DIRECTRIX,
HexBlocks.EMPTY_DIRECTRIX, HexBlocks.DIRECTRIX_REDSTONE, HexBlocks.DIRECTRIX_BOOLEAN,
HexBlocks.AKASHIC_RECORD, HexBlocks.AKASHIC_BOOKSHELF, HexBlocks.AKASHIC_LIGATURE,
HexBlocks.SLATE_BLOCK, HexBlocks.SLATE_TILES, HexBlocks.SLATE_BRICKS, HexBlocks.SLATE_BRICKS_SMALL,
HexBlocks.SLATE_PILLAR, HexBlocks.AMETHYST_DUST_BLOCK, HexBlocks.AMETHYST_TILES, HexBlocks.AMETHYST_BRICKS,

View file

@ -26,7 +26,7 @@ public class HexBlockTagProvider extends PaucalBlockTagProvider {
add(tag(HexTags.Blocks.IMPETI),
HexBlocks.IMPETUS_LOOK, HexBlocks.IMPETUS_RIGHTCLICK, HexBlocks.IMPETUS_REDSTONE);
add(tag(HexTags.Blocks.DIRECTRICES),
HexBlocks.DIRECTRIX_REDSTONE);
HexBlocks.DIRECTRIX_REDSTONE, HexBlocks.DIRECTRIX_BOOLEAN);
tag(HexTags.Blocks.MINDFLAYED_CIRCLE_COMPONENTS)
.addTag(HexTags.Blocks.IMPETI)
.addTag(HexTags.Blocks.DIRECTRICES);
@ -34,7 +34,7 @@ public class HexBlockTagProvider extends PaucalBlockTagProvider {
add(tag(BlockTags.MINEABLE_WITH_PICKAXE),
HexBlocks.SLATE_BLOCK, HexBlocks.SLATE_TILES, HexBlocks.SLATE_BRICKS,
HexBlocks.SLATE_BRICKS_SMALL, HexBlocks.SLATE_PILLAR, HexBlocks.SLATE,
HexBlocks.EMPTY_DIRECTRIX, HexBlocks.DIRECTRIX_REDSTONE,
HexBlocks.EMPTY_DIRECTRIX, HexBlocks.DIRECTRIX_REDSTONE, HexBlocks.DIRECTRIX_BOOLEAN,
HexBlocks.IMPETUS_EMPTY,
HexBlocks.IMPETUS_RIGHTCLICK, HexBlocks.IMPETUS_LOOK, HexBlocks.IMPETUS_REDSTONE,
HexBlocks.AMETHYST_TILES, HexBlocks.AMETHYST_BRICKS, HexBlocks.AMETHYST_BRICKS_SMALL,

Binary file not shown.

After

Width:  |  Height:  |  Size: 420 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 453 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 373 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 409 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 448 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 372 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 392 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 341 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 415 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 377 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 313 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 377 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 414 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 390 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 411 B

View file

@ -182,28 +182,28 @@ mixin {
// > Gradle task execution avoidance breaks it that way
// > At one point i got it to work reliably bu forcing some specific task to always run i just don't remember the syntax and which task it was
// > It might have been compileJava
task invalidateJavaForRefmap {
doFirst {
compileJava {
if (!didWork) {
outputs.upToDateWhen { false }
}
}
compileKotlin {
if (!didWork) {
outputs.upToDateWhen { false }
}
}
}
}
//task invalidateJavaForRefmap {
// doFirst {
// compileJava {
// if (!didWork) {
// outputs.upToDateWhen { false }
// }
// }
// compileKotlin {
// if (!didWork) {
// outputs.upToDateWhen { false }
// }
// }
// }
//}
compileJava {
source(project(":Common").sourceSets.main.allSource)
shouldRunAfter(invalidateJavaForRefmap)
// shouldRunAfter(invalidateJavaForRefmap)
}
compileKotlin {
source(project(":Common").sourceSets.main.kotlin)
shouldRunAfter(invalidateJavaForRefmap)
// shouldRunAfter(invalidateJavaForRefmap)
}
compileTestKotlin {
source(project(":Common").sourceSets.main.kotlin)
@ -216,7 +216,7 @@ sourceSets {
}
jar {
dependsOn(invalidateJavaForRefmap)
// dependsOn(invalidateJavaForRefmap)
}
processResources {

View file

@ -4,6 +4,7 @@ import at.petrak.hexcasting.api.HexAPI;
import at.petrak.hexcasting.api.block.circle.BlockCircleComponent;
import at.petrak.hexcasting.common.blocks.akashic.BlockAkashicBookshelf;
import at.petrak.hexcasting.common.blocks.circles.BlockSlate;
import at.petrak.hexcasting.common.blocks.circles.directrix.BlockBooleanDirectrix;
import at.petrak.hexcasting.common.blocks.circles.directrix.BlockRedstoneDirectrix;
import at.petrak.hexcasting.common.lib.HexBlocks;
import at.petrak.paucal.api.forge.datagen.PaucalBlockStateAndModelProvider;
@ -356,5 +357,62 @@ public class HexBlockStatesAndModels extends PaucalBlockStateAndModelProvider {
.build();
});
getVariantBuilder(HexBlocks.DIRECTRIX_BOOLEAN).forAllStates(bs -> {
var isLit = bs.getValue(BlockCircleComponent.ENERGIZED);
var litness = isLit ? "lit" : "dim";
var boolState = bs.getValue(BlockBooleanDirectrix.STATE);
var boolStateString = boolState.toString().toLowerCase();
var dir = bs.getValue(BlockStateProperties.FACING);
var top = "block/circle/directrix/boolean/top_" + boolStateString;
var left = "block/circle/directrix/boolean/left_" + boolStateString;
var right = "block/circle/directrix/boolean/right_" + boolStateString;
// The front face can never be both lit and unpowered (b/c otherwise it would exit the other way)
String frontEnding = null, backEnding = null;
switch (boolState) {
case NEITHER -> {
frontEnding = "not_false";
backEnding = "not_true";
}
case TRUE -> {
frontEnding = "not_false";
backEnding = litness + "_true";
}
case FALSE -> {
frontEnding = litness + "_false";
backEnding = "not_true";
}
}
var front = "block/circle/directrix/boolean/front_" + frontEnding;
var back = "block/circle/directrix/boolean/back_" + backEnding;
// and always the same
var bottom = "block/circle/bottom";
var modelName = "block/circle/directrix/boolean/" + litness + "_" + boolStateString + "_" + dir.getName();
var model = models().cube(modelName, modLoc(bottom), modLoc(top), modLoc(front), modLoc(back),
modLoc(left), modLoc(right))
.texture("particle", modLoc("block/slate"));
if (isLit && boolState == BlockBooleanDirectrix.State.FALSE && dir == Direction.EAST) {
// getBuilder does not add the block/etc to the front if the path contains any slashes
// this is a problem because the block IDs have slashes in them
itemModels().getBuilder("item/directrix/boolean").parent(model);
}
return ConfiguredModel.builder()
.modelFile(model)
// this code has been stolen from myself several times
.rotationX(dir.getAxis() == Direction.Axis.Y
? dir.getAxisDirection().getStep() * -90
: 0)
.rotationY(dir.getAxis() != Direction.Axis.Y
? ((dir.get2DDataValue() + 2) % 4) * 90
: 0)
.build();
});
}
}