+ glow glass
TODO: fix glow glass texture
This commit is contained in:
@@ -21,6 +21,7 @@ import net.neoforged.fml.ModContainer;
|
||||
import net.neoforged.fml.common.EventBusSubscriber;
|
||||
import net.neoforged.fml.common.Mod;
|
||||
import net.neoforged.fml.config.ModConfig;
|
||||
import net.neoforged.fml.event.IModBusEvent;
|
||||
import net.neoforged.fml.event.lifecycle.FMLClientSetupEvent;
|
||||
import net.neoforged.fml.event.lifecycle.FMLCommonSetupEvent;
|
||||
import net.neoforged.neoforge.common.NeoForge;
|
||||
@@ -31,6 +32,8 @@ import net.neoforged.neoforge.registries.DeferredHolder;
|
||||
import net.neoforged.neoforge.registries.DeferredItem;
|
||||
import net.neoforged.neoforge.registries.DeferredRegister;
|
||||
import org.slf4j.Logger;
|
||||
import ovh.glitchlabs.ornamentum.blocks.ModBlocks;
|
||||
import ovh.glitchlabs.ornamentum.items.ModItems;
|
||||
|
||||
// The value here should match an entry in the META-INF/neoforge.mods.toml file
|
||||
@Mod(Ornamentum.MODID)
|
||||
@@ -43,6 +46,11 @@ public class Ornamentum {
|
||||
// The constructor for the mod class is the first code that is run when your mod is loaded.
|
||||
// FML will recognize some parameter types like IEventBus or ModContainer and pass them in automatically.
|
||||
public Ornamentum(IEventBus modEventBus, ModContainer modContainer) {
|
||||
|
||||
|
||||
ModBlocks.register(modEventBus);
|
||||
ModItems.register(modEventBus);
|
||||
|
||||
// Register the commonSetup method for modloading
|
||||
modEventBus.addListener(this::commonSetup);
|
||||
|
||||
@@ -64,6 +72,8 @@ public class Ornamentum {
|
||||
LOGGER.info(Config.magicNumberIntroduction + Config.magicNumber);
|
||||
|
||||
Config.items.forEach((item) -> LOGGER.info("ITEM >> {}", item.toString()));
|
||||
|
||||
|
||||
}
|
||||
|
||||
// You can use SubscribeEvent and let the Event Bus discover methods to call
|
||||
|
||||
@@ -1,10 +1,17 @@
|
||||
package ovh.glitchlabs.ornamentum.blocks;
|
||||
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.world.item.BlockItem;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.level.BlockGetter;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.state.BlockBehaviour;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.phys.shapes.CollisionContext;
|
||||
import net.minecraft.world.phys.shapes.Shapes;
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
import net.neoforged.bus.api.IEventBus;
|
||||
import net.neoforged.neoforge.registries.DeferredBlock;
|
||||
import net.neoforged.neoforge.registries.DeferredRegister;
|
||||
@@ -17,10 +24,61 @@ public class ModBlocks {
|
||||
public static final DeferredRegister.Blocks BLOCKS =
|
||||
DeferredRegister.createBlocks(Ornamentum.MODID);
|
||||
|
||||
//public static final DeferredBlock<Block> OBSIDIAN_BRICKS = registerBlock("obsidian_bricks",
|
||||
// () -> new Block(BlockBehaviour.Properties.ofFullCopy(Blocks.OBSIDIAN)
|
||||
// ));
|
||||
//
|
||||
//GlowGlass
|
||||
public static final DeferredBlock<Block> LIME_GLOW_STAINED_GLASS = registerBlock("lime_glow_stained_glass",
|
||||
() -> new Block(BlockBehaviour.Properties.ofFullCopy(Blocks.GLASS)
|
||||
.emissiveRendering(((blockState, blockGetter, blockPos) -> true))
|
||||
.lightLevel(blockstate -> 10)
|
||||
.noOcclusion()
|
||||
.hasPostProcess((bs, br, bp) -> true))
|
||||
);
|
||||
|
||||
public static final DeferredBlock<Block> WHITE_GLOW_STAINED_GLASS = registerBlock("white_glow_stained_glass",
|
||||
() -> new Block(BlockBehaviour.Properties.ofFullCopy(LIME_GLOW_STAINED_GLASS.get())));
|
||||
|
||||
public static final DeferredBlock<Block> LIGHT_GRAY_GLOW_STAINED_GLASS = registerBlock("light_gray_glow_stained_glass",
|
||||
() -> new Block(BlockBehaviour.Properties.ofFullCopy(LIME_GLOW_STAINED_GLASS.get())));
|
||||
|
||||
public static final DeferredBlock<Block> GRAY_GLOW_STAINED_GLASS = registerBlock("gray_glow_stained_glass",
|
||||
() -> new Block(BlockBehaviour.Properties.ofFullCopy(LIME_GLOW_STAINED_GLASS.get())));
|
||||
|
||||
public static final DeferredBlock<Block> BLACK_GLOW_STAINED_GLASS = registerBlock("black_glow_stained_glass",
|
||||
() -> new Block(BlockBehaviour.Properties.ofFullCopy(LIME_GLOW_STAINED_GLASS.get())));
|
||||
|
||||
public static final DeferredBlock<Block> BROWN_GLOW_STAINED_GLASS = registerBlock("brown_glow_stained_glass",
|
||||
() -> new Block(BlockBehaviour.Properties.ofFullCopy(LIME_GLOW_STAINED_GLASS.get())));
|
||||
|
||||
public static final DeferredBlock<Block> RED_GLOW_STAINED_GLASS = registerBlock("red_glow_stained_glass",
|
||||
() -> new Block(BlockBehaviour.Properties.ofFullCopy(LIME_GLOW_STAINED_GLASS.get())));
|
||||
|
||||
public static final DeferredBlock<Block> ORANGE_GLOW_STAINED_GLASS = registerBlock("orange_glow_stained_glass",
|
||||
() -> new Block(BlockBehaviour.Properties.ofFullCopy(LIME_GLOW_STAINED_GLASS.get())));
|
||||
|
||||
public static final DeferredBlock<Block> YELLOW_GLOW_STAINED_GLASS = registerBlock("yellow_glow_stained_glass",
|
||||
() -> new Block(BlockBehaviour.Properties.ofFullCopy(LIME_GLOW_STAINED_GLASS.get())));
|
||||
|
||||
public static final DeferredBlock<Block> GREEN_GLOW_STAINED_GLASS = registerBlock("green_glow_stained_glass",
|
||||
() -> new Block(BlockBehaviour.Properties.ofFullCopy(LIME_GLOW_STAINED_GLASS.get())));
|
||||
|
||||
public static final DeferredBlock<Block> CYAN_GLOW_STAINED_GLASS = registerBlock("cyan_glow_stained_glass",
|
||||
() -> new Block(BlockBehaviour.Properties.ofFullCopy(LIME_GLOW_STAINED_GLASS.get())));
|
||||
|
||||
public static final DeferredBlock<Block> LIGHT_BLUE_GLOW_STAINED_GLASS = registerBlock("light_blue_glow_stained_glass",
|
||||
() -> new Block(BlockBehaviour.Properties.ofFullCopy(LIME_GLOW_STAINED_GLASS.get())));
|
||||
|
||||
public static final DeferredBlock<Block> BLUE_GLOW_STAINED_GLASS = registerBlock("blue_glow_stained_glass",
|
||||
() -> new Block(BlockBehaviour.Properties.ofFullCopy(LIME_GLOW_STAINED_GLASS.get())));
|
||||
|
||||
public static final DeferredBlock<Block> PURPLE_GLOW_STAINED_GLASS = registerBlock("purple_glow_stained_glass",
|
||||
() -> new Block(BlockBehaviour.Properties.ofFullCopy(LIME_GLOW_STAINED_GLASS.get())));
|
||||
|
||||
public static final DeferredBlock<Block> MAGENTA_GLOW_STAINED_GLASS = registerBlock("magenta_glow_stained_glass",
|
||||
() -> new Block(BlockBehaviour.Properties.ofFullCopy(LIME_GLOW_STAINED_GLASS.get())));
|
||||
|
||||
public static final DeferredBlock<Block> PINK_GLOW_STAINED_GLASS = registerBlock("pink_glow_stained_glass",
|
||||
() -> new Block(BlockBehaviour.Properties.ofFullCopy(LIME_GLOW_STAINED_GLASS.get())));
|
||||
|
||||
|
||||
private static <T extends Block> DeferredBlock<T> registerBlock(String name, Supplier<T> block) {
|
||||
DeferredBlock<T> toReturn = BLOCKS.register(name, block);
|
||||
registerBlockItem(name, toReturn);
|
||||
|
||||
@@ -17,6 +17,22 @@ public class ModBlockLootTableProvider extends BlockLootSubProvider {
|
||||
@Override
|
||||
protected void generate() {
|
||||
//dropSelf(ModBlocks.OBSIDIAN_BRICKS.get());
|
||||
dropWhenSilkTouch(ModBlocks.LIME_GLOW_STAINED_GLASS.get());
|
||||
dropWhenSilkTouch(ModBlocks.WHITE_GLOW_STAINED_GLASS.get());
|
||||
dropWhenSilkTouch(ModBlocks.GRAY_GLOW_STAINED_GLASS.get());
|
||||
dropWhenSilkTouch(ModBlocks.LIGHT_GRAY_GLOW_STAINED_GLASS.get());
|
||||
dropWhenSilkTouch(ModBlocks.BLACK_GLOW_STAINED_GLASS.get());
|
||||
dropWhenSilkTouch(ModBlocks.BROWN_GLOW_STAINED_GLASS.get());
|
||||
dropWhenSilkTouch(ModBlocks.RED_GLOW_STAINED_GLASS.get());
|
||||
dropWhenSilkTouch(ModBlocks.ORANGE_GLOW_STAINED_GLASS.get());
|
||||
dropWhenSilkTouch(ModBlocks.YELLOW_GLOW_STAINED_GLASS.get());
|
||||
dropWhenSilkTouch(ModBlocks.GREEN_GLOW_STAINED_GLASS.get());
|
||||
dropWhenSilkTouch(ModBlocks.CYAN_GLOW_STAINED_GLASS.get());
|
||||
dropWhenSilkTouch(ModBlocks.LIGHT_BLUE_GLOW_STAINED_GLASS.get());
|
||||
dropWhenSilkTouch(ModBlocks.BLUE_GLOW_STAINED_GLASS.get());
|
||||
dropWhenSilkTouch(ModBlocks.PURPLE_GLOW_STAINED_GLASS.get());
|
||||
dropWhenSilkTouch(ModBlocks.MAGENTA_GLOW_STAINED_GLASS.get());
|
||||
dropWhenSilkTouch(ModBlocks.PINK_GLOW_STAINED_GLASS.get());
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import net.neoforged.neoforge.client.model.generators.BlockStateProvider;
|
||||
import net.neoforged.neoforge.common.data.ExistingFileHelper;
|
||||
import net.neoforged.neoforge.registries.DeferredBlock;
|
||||
import ovh.glitchlabs.ornamentum.Ornamentum;
|
||||
import ovh.glitchlabs.ornamentum.blocks.ModBlocks;
|
||||
|
||||
public class ModBlockStateProvider extends BlockStateProvider {
|
||||
public ModBlockStateProvider(PackOutput output, ExistingFileHelper exFileHelper) {
|
||||
@@ -13,7 +14,23 @@ public class ModBlockStateProvider extends BlockStateProvider {
|
||||
|
||||
@Override
|
||||
protected void registerStatesAndModels() {
|
||||
// blockWithItem(ModBlocks.POLISHED_OBSIDIAN);
|
||||
//GLOW GLASS
|
||||
blockWithItem(ModBlocks.LIME_GLOW_STAINED_GLASS);
|
||||
blockWithItem(ModBlocks.WHITE_GLOW_STAINED_GLASS);
|
||||
blockWithItem(ModBlocks.GRAY_GLOW_STAINED_GLASS);
|
||||
blockWithItem(ModBlocks.LIGHT_GRAY_GLOW_STAINED_GLASS);
|
||||
blockWithItem(ModBlocks.BLACK_GLOW_STAINED_GLASS);
|
||||
blockWithItem(ModBlocks.BROWN_GLOW_STAINED_GLASS);
|
||||
blockWithItem(ModBlocks.RED_GLOW_STAINED_GLASS);
|
||||
blockWithItem(ModBlocks.ORANGE_GLOW_STAINED_GLASS);
|
||||
blockWithItem(ModBlocks.YELLOW_GLOW_STAINED_GLASS);
|
||||
blockWithItem(ModBlocks.GREEN_GLOW_STAINED_GLASS);
|
||||
blockWithItem(ModBlocks.CYAN_GLOW_STAINED_GLASS);
|
||||
blockWithItem(ModBlocks.LIGHT_BLUE_GLOW_STAINED_GLASS);
|
||||
blockWithItem(ModBlocks.BLUE_GLOW_STAINED_GLASS);
|
||||
blockWithItem(ModBlocks.PURPLE_GLOW_STAINED_GLASS);
|
||||
blockWithItem(ModBlocks.MAGENTA_GLOW_STAINED_GLASS);
|
||||
blockWithItem(ModBlocks.PINK_GLOW_STAINED_GLASS);
|
||||
}
|
||||
|
||||
private void blockWithItem(DeferredBlock<?> deferredBlock) {
|
||||
|
||||
Reference in New Issue
Block a user