Skip to content

Commit

Permalink
Moonstone chiseled
Browse files Browse the repository at this point in the history
  • Loading branch information
Electro593 committed Feb 9, 2025
1 parent 33969b7 commit 45b42f5
Show file tree
Hide file tree
Showing 21 changed files with 219 additions and 600 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"variants": {
"facing=down": {
"model": "spectrum:block/moonstone_chiseled_basalt_down"
},
"facing=east": {
"model": "spectrum:block/moonstone_chiseled_basalt"
},
"facing=north": {
"model": "spectrum:block/moonstone_chiseled_basalt",
"y": 270
},
"facing=south": {
"model": "spectrum:block/moonstone_chiseled_basalt",
"y": 90
},
"facing=up": {
"model": "spectrum:block/moonstone_chiseled_basalt_down",
"x": 180
},
"facing=west": {
"model": "spectrum:block/moonstone_chiseled_basalt",
"y": 180
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"variants": {
"facing=down": {
"model": "spectrum:block/moonstone_chiseled_calcite_down"
},
"facing=east": {
"model": "spectrum:block/moonstone_chiseled_calcite"
},
"facing=north": {
"model": "spectrum:block/moonstone_chiseled_calcite",
"y": 270
},
"facing=south": {
"model": "spectrum:block/moonstone_chiseled_calcite",
"y": 90
},
"facing=up": {
"model": "spectrum:block/moonstone_chiseled_calcite_down",
"x": 180
},
"facing=west": {
"model": "spectrum:block/moonstone_chiseled_calcite",
"y": 180
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"parent": "spectrum:templates/moonstone_chiseled",
"textures": {
"line": "spectrum:block/moonstone_chiseled_basalt",
"side": "spectrum:block/basalt_cap"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"parent": "spectrum:templates/moonstone_chiseled_down",
"textures": {
"line": "spectrum:block/moonstone_chiseled_basalt",
"side": "spectrum:block/basalt_cap"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"parent": "spectrum:templates/moonstone_chiseled",
"textures": {
"line": "spectrum:block/moonstone_chiseled_calcite",
"side": "spectrum:block/calcite_cap"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"parent": "spectrum:templates/moonstone_chiseled_down",
"textures": {
"line": "spectrum:block/moonstone_chiseled_calcite",
"side": "spectrum:block/calcite_cap"
}
}
35 changes: 23 additions & 12 deletions src/main/java/de/dafuqs/spectrum/registries/SpectrumBlocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ private static Settings blackslag(BlockSoundGroup blockSoundGroup) {
public static final Block AMETHYST_CHISELED_BASALT = registerSingleton("amethyst_chiseled_basalt", new Block(AbstractBlock.Settings.copy(BASALT_BRICKS).luminance(s -> 5)), TexturedModel.CUBE_ALL, DyeColor.MAGENTA);
public static final Block CITRINE_CHISELED_BASALT = registerSingleton("citrine_chiseled_basalt", new Block(AbstractBlock.Settings.copy(BASALT_BRICKS).luminance(s -> 7)), TexturedModel.CUBE_ALL, DyeColor.YELLOW);
public static final Block ONYX_CHISELED_BASALT = registerSingleton("onyx_chiseled_basalt", new Block(AbstractBlock.Settings.copy(BASALT_BRICKS).luminance(s -> 3)), TexturedModel.CUBE_ALL, DyeColor.BLACK);
public static final Block MOONSTONE_CHISELED_BASALT = new SpectrumLineFacingBlock(AbstractBlock.Settings.copy(BASALT_BRICKS).luminance(s -> 12));
public static final Block MOONSTONE_CHISELED_BASALT = registerMoonstoneChiseled("moonstone_chiseled_basalt", SpectrumTextures.BASALT_CAP, new SpectrumLineFacingBlock(AbstractBlock.Settings.copy(BASALT_BRICKS).luminance(s -> 12)), DyeColor.WHITE);

public static final Block CALCITE_STAIRS = registerBlockWithItemWithoutModel("calcite_stairs", new StairsBlock(Blocks.CALCITE.getDefaultState(), AbstractBlock.Settings.copy(Blocks.CALCITE)), DyeColor.BROWN);
public static final Block CALCITE_SLAB = registerBlockWithItemWithoutModel("calcite_slab", new SlabBlock(AbstractBlock.Settings.copy(Blocks.CALCITE)), DyeColor.BROWN);
Expand Down Expand Up @@ -394,7 +394,7 @@ private static Settings blackslag(BlockSoundGroup blockSoundGroup) {
public static final Block AMETHYST_CHISELED_CALCITE = registerSingleton("amethyst_chiseled_calcite", new Block(AbstractBlock.Settings.copy(CALCITE_BRICKS).luminance(s -> 5)), TexturedModel.CUBE_ALL, DyeColor.MAGENTA);
public static final Block CITRINE_CHISELED_CALCITE = registerSingleton("citrine_chiseled_calcite", new Block(AbstractBlock.Settings.copy(CALCITE_BRICKS).luminance(s -> 7)), TexturedModel.CUBE_ALL, DyeColor.YELLOW);
public static final Block ONYX_CHISELED_CALCITE = registerSingleton("onyx_chiseled_calcite", new Block(AbstractBlock.Settings.copy(CALCITE_BRICKS).luminance(s -> 3)), TexturedModel.CUBE_ALL, DyeColor.BLACK);
public static final Block MOONSTONE_CHISELED_CALCITE = new SpectrumLineFacingBlock(AbstractBlock.Settings.copy(CALCITE_BRICKS).luminance(s -> 12));
public static final Block MOONSTONE_CHISELED_CALCITE = registerMoonstoneChiseled("moonstone_chiseled_calcite", SpectrumTextures.CALCITE_CAP, new SpectrumLineFacingBlock(AbstractBlock.Settings.copy(CALCITE_BRICKS).luminance(s -> 12)), DyeColor.WHITE);

private static Settings gemstoneLight(AbstractBlock block) {
return AbstractBlock.Settings.copy(block).luminance(s -> 15).nonOpaque().solid();
Expand Down Expand Up @@ -1788,20 +1788,37 @@ public static <T extends Block> T registerWood(String name, Block logBlock, T wo
return registerBlockWithItemWithoutModel(name, woodBlock, color);
}

public static <T extends Block> T registerGemLight(String name, Block gemBlock, Identifier topTexture, T gemLightBlock, DyeColor color) {
public static <T extends Block> T registerGemLight(String name, Block gemBlock, Identifier capTexture, T gemLightBlock, DyeColor color) {
BLOCK_STATE_MODEL_REGISTRAR.defer(ctx -> {
ctx.registerAxisRotated(gemLightBlock, TexturedModel.makeFactory(
block -> new TextureMap()
.put(TextureKey.TOP, topTexture)
.put(TextureKey.TOP, capTexture)
.put(TextureKey.SIDE, TextureMap.getId(gemLightBlock))
.put(TextureKey.INSIDE, TextureMap.getId(gemBlock)),
new Model(Optional.of(SpectrumModels.MULTILAYER_LIGHT), Optional.empty(),
TextureKey.TOP, TextureKey.SIDE, TextureKey.INSIDE)));
SpectrumModels.MULTILAYER_LIGHT));
});
registerTranslucentRenderLayerEntry(gemLightBlock);
return registerBlockWithItemWithoutModel(name, gemLightBlock, color);
}

public static <T extends Block> T registerMoonstoneChiseled(String name, Identifier capTexture, T block, DyeColor color) {
BLOCK_STATE_MODEL_REGISTRAR.defer(ctx -> {
TextureMap textureMap = new TextureMap().put(TextureKey.SIDE, capTexture).put(SpectrumTextureKeys.LINE, TextureMap.getId(block));
Identifier base = SpectrumModels.MOONSTONE_CHISELED.upload(block, textureMap, ctx.modelCollector);
Identifier down = SpectrumModels.MOONSTONE_CHISELED_DOWN.upload(block, "_down", textureMap, ctx.modelCollector);
ctx.registerParentedItemModel(block, down);
ctx.blockStateCollector.accept(VariantsBlockStateSupplier.create(block).coordinate(BlockStateVariantMap
.create(FacingBlock.FACING)
.register(Direction.DOWN, BlockStateVariant.create().put(VariantSettings.MODEL, ModelIds.getBlockSubModelId(block, "_down")))
.register(Direction.EAST, BlockStateVariant.create().put(VariantSettings.MODEL, ModelIds.getBlockModelId(block)))
.register(Direction.NORTH, BlockStateVariant.create().put(VariantSettings.MODEL, ModelIds.getBlockModelId(block)).put(VariantSettings.Y, VariantSettings.Rotation.R270))
.register(Direction.SOUTH, BlockStateVariant.create().put(VariantSettings.MODEL, ModelIds.getBlockModelId(block)).put(VariantSettings.Y, VariantSettings.Rotation.R90))
.register(Direction.UP, BlockStateVariant.create().put(VariantSettings.MODEL, ModelIds.getBlockSubModelId(block, "_down")).put(VariantSettings.X, VariantSettings.Rotation.R180))
.register(Direction.WEST, BlockStateVariant.create().put(VariantSettings.MODEL, ModelIds.getBlockModelId(block)).put(VariantSettings.Y, VariantSettings.Rotation.R180))));
});
return registerBlockWithItemWithoutModel(name, block, color);
}

public static <T extends Block> T registerAxisRotated(String name, T block, TexturedModel.Factory factory, DyeColor color) {
BLOCK_STATE_MODEL_REGISTRAR.defer(ctx -> ctx.registerAxisRotated(block, factory));
return registerBlockWithItemWithoutModel(name, block, color);
Expand Down Expand Up @@ -1916,7 +1933,6 @@ public static void register() {
registerOreBlocks(IS.of(), IS.of().fireproof());
registerOreStorageBlocks(IS.of(), IS.of().fireproof());
registerShimmerstoneLights(IS.of());
registerRunes(IS.of());
registerGemstoneGlass(IS.of());
registerPlayerOnlyGlass(IS.of());
registerGemstoneChimes(IS.of());
Expand Down Expand Up @@ -2536,11 +2552,6 @@ private static void registerStoneBlocks(Item.Settings settings) {
registerBlockWithItem("cracked_dragonbone", CRACKED_DRAGONBONE, settings, DyeColor.GREEN);
}

private static void registerRunes(Item.Settings settings) {
registerBlockWithItem("moonstone_chiseled_basalt", MOONSTONE_CHISELED_BASALT, settings, DyeColor.WHITE);
registerBlockWithItem("moonstone_chiseled_calcite", MOONSTONE_CHISELED_CALCITE, settings, DyeColor.WHITE);
}

private static void registerGlowBlocks(Item.Settings settings) {
registerBlockWithItem("white_glowblock", WHITE_GLOWBLOCK, settings, DyeColor.WHITE);
registerBlockWithItem("orange_glowblock", ORANGE_GLOWBLOCK, settings, DyeColor.ORANGE);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
package de.dafuqs.spectrum.registries.client;

import de.dafuqs.spectrum.*;
import net.minecraft.util.*;
import net.minecraft.data.client.*;

import java.util.*;

public class SpectrumModels {

public static final Identifier MULTILAYER_LIGHT = SpectrumCommon.locate("templates/multilayer_light");
public static final Model MULTILAYER_LIGHT = new Model(Optional.of(SpectrumCommon.locate("templates/multilayer_light")), Optional.empty(), TextureKey.TOP, TextureKey.SIDE, TextureKey.INSIDE);
public static final Model MOONSTONE_CHISELED = new Model(Optional.of(SpectrumCommon.locate("templates/moonstone_chiseled")), Optional.empty(), TextureKey.SIDE, SpectrumTextureKeys.LINE);
public static final Model MOONSTONE_CHISELED_DOWN = new Model(Optional.of(SpectrumCommon.locate("templates/moonstone_chiseled_down")), Optional.empty(), TextureKey.SIDE, SpectrumTextureKeys.LINE);

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package de.dafuqs.spectrum.registries.client;

import net.minecraft.data.client.*;

public class SpectrumTextureKeys {

public static final TextureKey LINE = TextureKey.of("line");

}

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 45b42f5

Please sign in to comment.