mirror of
https://github.com/xzeldon/ChromaBlocks.git
synced 2025-07-17 00:06:04 +03:00
initial commit
This commit is contained in:
19
src/main/java/ru/xzeldon/greenscreenmod/GreenScreenMod.java
Normal file
19
src/main/java/ru/xzeldon/greenscreenmod/GreenScreenMod.java
Normal file
@ -0,0 +1,19 @@
|
||||
package ru.xzeldon.greenscreenmod;
|
||||
|
||||
import net.fabricmc.api.ModInitializer;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import ru.xzeldon.greenscreenmod.block.ModBlocks;
|
||||
|
||||
public class GreenScreenMod implements ModInitializer {
|
||||
// This logger is used to write text to the console and the log file.
|
||||
// It is considered best practice to use your mod id as the logger's name.
|
||||
// That way, it's clear which mod wrote info, warnings, and errors.
|
||||
public static final String MOD_ID = "greenscreenmod";
|
||||
public static final Logger LOGGER = LoggerFactory.getLogger("greenscreenmod");
|
||||
|
||||
@Override
|
||||
public void onInitialize() {
|
||||
ModBlocks.registerModBlocks();
|
||||
}
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package ru.xzeldon.greenscreenmod.block;
|
||||
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Material;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.BlockView;
|
||||
|
||||
public class GreenScreenBlock extends Block {
|
||||
public GreenScreenBlock() {
|
||||
super(FabricBlockSettings.of(Material.METAL)
|
||||
.breakInstantly()
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getAmbientOcclusionLightLevel(BlockState state, BlockView world, BlockPos pos) {
|
||||
return 1;
|
||||
}
|
||||
}
|
29
src/main/java/ru/xzeldon/greenscreenmod/block/ModBlocks.java
Normal file
29
src/main/java/ru/xzeldon/greenscreenmod/block/ModBlocks.java
Normal file
@ -0,0 +1,29 @@
|
||||
package ru.xzeldon.greenscreenmod.block;
|
||||
|
||||
import net.fabricmc.fabric.api.item.v1.FabricItemSettings;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.BlockItem;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemGroup;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
import ru.xzeldon.greenscreenmod.GreenScreenMod;
|
||||
import net.minecraft.block.AbstractGlassBlock;
|
||||
|
||||
public class ModBlocks {
|
||||
public static final Block GREEN_SCREEN_BLOCK = registerBlock("green_screen_block", new GreenScreenBlock(), ItemGroup.MISC);
|
||||
|
||||
private static Block registerBlock(String name, Block block, ItemGroup group) {
|
||||
registerBlockItem(name, block, group);
|
||||
return Registry.register(Registry.BLOCK, new Identifier(GreenScreenMod.MOD_ID, name), block);
|
||||
}
|
||||
|
||||
private static Item registerBlockItem(String name, Block block, ItemGroup group) {
|
||||
return Registry.register(Registry.ITEM, new Identifier(GreenScreenMod.MOD_ID, name),
|
||||
new BlockItem(block, new FabricItemSettings().group(group)));
|
||||
}
|
||||
|
||||
public static void registerModBlocks() {
|
||||
GreenScreenMod.LOGGER.info("Registering ModBlocks for " + GreenScreenMod.MOD_ID);
|
||||
}
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
{
|
||||
"variants": {
|
||||
"": {
|
||||
"model": "greenscreenmod:block/green_screen_block"
|
||||
}
|
||||
}
|
||||
}
|
BIN
src/main/resources/assets/greenscreenmod/icon.png
Normal file
BIN
src/main/resources/assets/greenscreenmod/icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 162 B |
3
src/main/resources/assets/greenscreenmod/lang/en_us.json
Normal file
3
src/main/resources/assets/greenscreenmod/lang/en_us.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"block.greenscreenmod.green_screen_block": "Green Screen Block"
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "block/cube_all",
|
||||
"textures": {
|
||||
"all": "greenscreenmod:block/green_screen_block"
|
||||
}
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"parent": "greenscreenmod:block/green_screen_block"
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 162 B |
36
src/main/resources/fabric.mod.json
Normal file
36
src/main/resources/fabric.mod.json
Normal file
@ -0,0 +1,36 @@
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"id": "greenscreenmod",
|
||||
"version": "${version}",
|
||||
|
||||
"name": "Green Screen Mod",
|
||||
"description": "This mod add green screen block to Minecraft",
|
||||
"authors": [
|
||||
"xzeldon"
|
||||
],
|
||||
"contact": {
|
||||
"homepage": "https://zeldon.ru/",
|
||||
"sources": "https://github.com/xzeldon/green-screen-mod"
|
||||
},
|
||||
|
||||
"license": "MIT",
|
||||
"icon": "assets/greenscreenmod/icon.png",
|
||||
|
||||
"environment": "*",
|
||||
"entrypoints": {
|
||||
"main": [
|
||||
"ru.xzeldon.greenscreenmod.GreenScreenMod"
|
||||
]
|
||||
},
|
||||
"mixins": [],
|
||||
|
||||
"depends": {
|
||||
"fabricloader": ">=0.13.3",
|
||||
"fabric": "*",
|
||||
"minecraft": "~1.18.2",
|
||||
"java": ">=17"
|
||||
},
|
||||
"suggests": {
|
||||
"another-mod": "*"
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user