Compare commits

...

10 Commits

Author SHA1 Message Date
25917552e4
update readme 2022-08-23 16:00:15 +03:00
156a401bd7
More blocks!
* - Refactoring
- Add black, blue, cyan, purple, red, white and yellow chroma blocks
- Rename mod
2022-08-11 10:51:02 +03:00
52ae854280
1.19.2 2022-08-11 06:54:48 +03:00
1a2955dfc2
cleanup 2022-06-08 00:13:47 +03:00
303659fef8
1.19 2022-06-08 00:02:23 +03:00
28aadb77ce
Added compability instructions for Sodium 2022-05-25 02:16:04 +03:00
32fce3726f
Merge branch 'master' of github.com:xzeldon/GreenScreenMod 2022-05-25 01:38:16 +03:00
92499e5111
version bump (1.1.0) 2022-05-25 01:34:31 +03:00
85a48ba186
some new features
- Added new green screen block with glow
- Added GreenScreenBlockModel for fine-tune the block
- Diffuse Shading and Ambient Occlusion has been removed from GreenScreenBlockModel
- GreenScreenBlockModel also ignores the lightmap
2022-05-25 01:33:01 +03:00
8556980119
cosmetic changes
- add fabric download link to readme
- replace repo links according to the new repo name
2022-05-21 08:32:26 +03:00
53 changed files with 675 additions and 109 deletions

View File

@ -1,9 +1,15 @@
# Green Screen Mod
# ChromaBlocks
This mod just adds a green block to the miscellaneous tab.
![img](https://i.imgur.com/WmOq3tm.png)
ChromaBlocks is a mod for Minecraft that adds a various chroma key blocks.
# Download
Download last version from [releases](https://github.com/xzeldon/green-screen-mod/releases).
Mirror on my [<img src="https://git.zeldon.ru/assets/img/logo.svg" align="center" width="20" height="20"/> Git](https://git.zeldon.ru/zeldon/ChromaBlocks)
# Download
Download last version from [releases](https://github.com/xzeldon/chromablocks/releases).
# Install
Place `.jar` file to the `mods` folder.
Download and install [Fabric](https://fabricmc.net/use/installer/) then place `.jar` file to the `mods` folder.
> For compability with [Sodium](https://modrinth.com/mod/sodium) install [Indium](https://modrinth.com/mod/indium)

View File

@ -1,5 +1,5 @@
plugins {
id 'fabric-loom' version '0.11-SNAPSHOT'
id 'fabric-loom' version '0.12-SNAPSHOT'
id 'maven-publish'
}

View File

@ -2,15 +2,15 @@
org.gradle.jvmargs=-Xmx1G
# Fabric Properties
# check these on https://fabricmc.net/develop
minecraft_version=1.18.2
yarn_mappings=1.18.2+build.1
loader_version=0.13.3
# check these on https://fabricmc.net/develop
minecraft_version=1.19.2
yarn_mappings=1.19.2+build.1
loader_version=0.14.9
# Mod Properties
mod_version = 1.0.0-1.18.2
maven_group = ru.xzeldon.greenscreenmod
archives_base_name = greenscreenmod
mod_version = 2.0.0-1.19.2
maven_group = ru.xzeldon.chromablocks
archives_base_name = chromablocks
# Dependencies
fabric_version=0.47.8+1.18.2
fabric_version=0.59.0+1.19.2

View File

@ -0,0 +1,16 @@
package ru.xzeldon.chromablocks;
import net.fabricmc.api.ModInitializer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import ru.xzeldon.chromablocks.block.ChromaBlocksBlockRegister;
public class ChromaBlocks implements ModInitializer {
public static final String MOD_ID = "chromablocks";
public static final Logger LOGGER = LoggerFactory.getLogger("chromablocks");
@Override
public void onInitialize() {
ChromaBlocksBlockRegister.registerBlocks();
}
}

View File

@ -0,0 +1,12 @@
package ru.xzeldon.chromablocks;
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.client.model.ModelLoadingRegistry;
import ru.xzeldon.chromablocks.model.ChromaBlockModelProvider;
public class ChromaBlocksClient implements ClientModInitializer {
@Override
public void onInitializeClient() {
ModelLoadingRegistry.INSTANCE.registerResourceProvider(rm -> new ChromaBlockModelProvider());
}
}

View File

@ -0,0 +1,117 @@
package ru.xzeldon.chromablocks.block;
import net.fabricmc.fabric.api.item.v1.FabricItemSettings;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.Block;
import net.minecraft.block.Material;
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.chromablocks.ChromaBlocks;
import ru.xzeldon.chromablocks.item.ChromaBlocksItemsGroup;
public class ChromaBlocksBlockRegister {
public static final Block CHROMA_GREEN = registerBlock("chroma_green",
new Block(FabricBlockSettings.of(Material.METAL)
.breakInstantly()
.luminance(15)
), ChromaBlocksItemsGroup.GREENSCREEN);
public static final Block CHROMA_GREEN_DIM = registerBlock("chroma_green_dim",
new Block(FabricBlockSettings.of(Material.METAL)
.breakInstantly()
), ChromaBlocksItemsGroup.GREENSCREEN);
public static final Block CHROMA_BLACK = registerBlock("chroma_black",
new Block(FabricBlockSettings.of(Material.METAL)
.breakInstantly()
.luminance(15)
), ChromaBlocksItemsGroup.GREENSCREEN);
public static final Block CHROMA_BLACK_DIM = registerBlock("chroma_black_dim",
new Block(FabricBlockSettings.of(Material.METAL)
.breakInstantly()
), ChromaBlocksItemsGroup.GREENSCREEN);
public static final Block CHROMA_BLUE = registerBlock("chroma_blue",
new Block(FabricBlockSettings.of(Material.METAL)
.breakInstantly()
.luminance(15)
), ChromaBlocksItemsGroup.GREENSCREEN);
public static final Block CHROMA_BLUE_DIM = registerBlock("chroma_blue_dim",
new Block(FabricBlockSettings.of(Material.METAL)
.breakInstantly()
), ChromaBlocksItemsGroup.GREENSCREEN);
public static final Block CHROMA_CYAN = registerBlock("chroma_cyan",
new Block(FabricBlockSettings.of(Material.METAL)
.breakInstantly()
.luminance(15)
), ChromaBlocksItemsGroup.GREENSCREEN);
public static final Block CHROMA_CYAN_DIM = registerBlock("chroma_cyan_dim",
new Block(FabricBlockSettings.of(Material.METAL)
.breakInstantly()
), ChromaBlocksItemsGroup.GREENSCREEN);
public static final Block CHROMA_PURPLE = registerBlock("chroma_purple",
new Block(FabricBlockSettings.of(Material.METAL)
.breakInstantly()
.luminance(15)
), ChromaBlocksItemsGroup.GREENSCREEN);
public static final Block CHROMA_PURPLE_DIM = registerBlock("chroma_purple_dim",
new Block(FabricBlockSettings.of(Material.METAL)
.breakInstantly()
), ChromaBlocksItemsGroup.GREENSCREEN);
public static final Block CHROMA_RED = registerBlock("chroma_red",
new Block(FabricBlockSettings.of(Material.METAL)
.breakInstantly()
.luminance(15)
), ChromaBlocksItemsGroup.GREENSCREEN);
public static final Block CHROMA_RED_DIM = registerBlock("chroma_red_dim",
new Block(FabricBlockSettings.of(Material.METAL)
.breakInstantly()
), ChromaBlocksItemsGroup.GREENSCREEN);
public static final Block CHROMA_WHITE = registerBlock("chroma_white",
new Block(FabricBlockSettings.of(Material.METAL)
.breakInstantly()
.luminance(15)
), ChromaBlocksItemsGroup.GREENSCREEN);
public static final Block CHROMA_WHITE_DIM = registerBlock("chroma_white_dim",
new Block(FabricBlockSettings.of(Material.METAL)
.breakInstantly()
), ChromaBlocksItemsGroup.GREENSCREEN);
public static final Block CHROMA_YELLOW = registerBlock("chroma_yellow",
new Block(FabricBlockSettings.of(Material.METAL)
.breakInstantly()
.luminance(15)
), ChromaBlocksItemsGroup.GREENSCREEN);
public static final Block CHROMA_YELLOW_DIM = registerBlock("chroma_yellow_dim",
new Block(FabricBlockSettings.of(Material.METAL)
.breakInstantly()
), ChromaBlocksItemsGroup.GREENSCREEN);
private static Block registerBlock(String name, Block block, ItemGroup group) {
registerBlockItem(name, block, group);
return Registry.register(Registry.BLOCK, new Identifier(ChromaBlocks.MOD_ID, name), block);
}
private static Item registerBlockItem(String name, Block block, ItemGroup group) {
return Registry.register(Registry.ITEM, new Identifier(ChromaBlocks.MOD_ID, name),
new BlockItem(block, new FabricItemSettings().group(group)));
}
public static void registerBlocks() {
ChromaBlocks.LOGGER.info("Registering ModBlocks for " + ChromaBlocks.MOD_ID);
}
}

View File

@ -0,0 +1,17 @@
package ru.xzeldon.chromablocks.block.custom;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.BlockView;
public class ChromaBlock extends Block {
public ChromaBlock(Settings settings) {
super(settings);
}
@Override
public float getAmbientOcclusionLightLevel(BlockState state, BlockView world, BlockPos pos) {
return 1.0F;
}
}

View File

@ -0,0 +1,7 @@
package ru.xzeldon.chromablocks.block.custom;
public class ChromaBlockDim extends ChromaBlock {
public ChromaBlockDim(Settings settings) {
super(settings);
}
}

View File

@ -0,0 +1,13 @@
package ru.xzeldon.chromablocks.item;
import net.fabricmc.fabric.api.client.itemgroup.FabricItemGroupBuilder;
import net.minecraft.item.ItemGroup;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Identifier;
import ru.xzeldon.chromablocks.ChromaBlocks;
import ru.xzeldon.chromablocks.block.ChromaBlocksBlockRegister;
public class ChromaBlocksItemsGroup {
public static final ItemGroup GREENSCREEN = FabricItemGroupBuilder.build(new Identifier(ChromaBlocks.MOD_ID, "chroma_blocks"),
()-> new ItemStack(ChromaBlocksBlockRegister.CHROMA_GREEN));
}

View File

@ -0,0 +1,139 @@
package ru.xzeldon.chromablocks.model;
import com.mojang.datafixers.util.Pair;
import net.fabricmc.fabric.api.renderer.v1.Renderer;
import net.fabricmc.fabric.api.renderer.v1.RendererAccess;
import net.fabricmc.fabric.api.renderer.v1.material.RenderMaterial;
import net.fabricmc.fabric.api.renderer.v1.mesh.Mesh;
import net.fabricmc.fabric.api.renderer.v1.mesh.MeshBuilder;
import net.fabricmc.fabric.api.renderer.v1.mesh.MutableQuadView;
import net.fabricmc.fabric.api.renderer.v1.mesh.QuadEmitter;
import net.fabricmc.fabric.api.renderer.v1.model.FabricBakedModel;
import net.fabricmc.fabric.api.renderer.v1.render.RenderContext;
import net.minecraft.block.BlockState;
import net.minecraft.client.render.model.*;
import net.minecraft.client.render.model.json.JsonUnbakedModel;
import net.minecraft.client.render.model.json.ModelOverrideList;
import net.minecraft.client.render.model.json.ModelTransformation;
import net.minecraft.client.texture.Sprite;
import net.minecraft.client.texture.SpriteAtlasTexture;
import net.minecraft.client.util.SpriteIdentifier;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.util.math.random.Random;
import net.minecraft.world.BlockRenderView;
import org.jetbrains.annotations.Nullable;
import ru.xzeldon.chromablocks.ChromaBlocks;
import java.util.*;
import java.util.function.Function;
import java.util.function.Supplier;
public class ChromaBlockModel implements UnbakedModel, BakedModel, FabricBakedModel {
protected final SpriteIdentifier SPRITE_ID;
private static final Identifier DEFAULT_BLOCK_MODEL = new Identifier("minecraft:block/block");
private final Sprite[] SPRITES = new Sprite[1];
private static final Renderer renderer = RendererAccess.INSTANCE.getRenderer();
private ModelTransformation transformation;
private Mesh mesh;
public ChromaBlockModel(String color) {
this.SPRITE_ID = new SpriteIdentifier(SpriteAtlasTexture.BLOCK_ATLAS_TEXTURE, new Identifier(ChromaBlocks.MOD_ID + ":block/" + color));
}
@Override
public boolean isVanillaAdapter() {
return false;
}
@Override
public void emitBlockQuads(BlockRenderView blockView, BlockState state, BlockPos pos, Supplier<Random> randomSupplier, RenderContext context) {
context.meshConsumer().accept(mesh);
}
@Override
public void emitItemQuads(ItemStack stack, Supplier<Random> randomSupplier, RenderContext context) {
context.meshConsumer().accept(mesh);
}
@Override
public Collection<Identifier> getModelDependencies() {
return List.of(DEFAULT_BLOCK_MODEL);
}
@Override
public Collection<SpriteIdentifier> getTextureDependencies(Function<Identifier, UnbakedModel> unbakedModelGetter, Set<Pair<String, String>> unresolvedTextureReferences) {
return List.of(SPRITE_ID);
}
@Nullable
@Override
public BakedModel bake(ModelLoader loader, Function<SpriteIdentifier, Sprite> textureGetter, ModelBakeSettings rotationContainer, Identifier modelId) {
JsonUnbakedModel defaultBlockModel = (JsonUnbakedModel) loader.getOrLoadModel(DEFAULT_BLOCK_MODEL);
transformation = defaultBlockModel.getTransformations();
SPRITES[0] = textureGetter.apply(SPRITE_ID);
RenderMaterial material = renderer.materialFinder()
.disableAo(0, true)
.disableDiffuse(0, true)
.emissive(0, true)
.find();
MeshBuilder builder = renderer.meshBuilder();
QuadEmitter emitter = builder.getEmitter();
for (Direction direction : Direction.values()) {
emitter.square(direction, 0.0f, 0.0f, 1.0f, 1.0f, 0.0f);
emitter.spriteBake(0, SPRITES[0], MutableQuadView.BAKE_LOCK_UV);
emitter.spriteColor(0, -1, -1, -1, -1);
emitter.material(material);
emitter.emit();
}
mesh = builder.build();
return this;
}
@Override
public List<BakedQuad> getQuads(@Nullable BlockState state, @Nullable Direction face, Random random) {
return Collections.emptyList();
}
@Override
public boolean useAmbientOcclusion() {
return false;
}
@Override
public boolean hasDepth() {
return false;
}
@Override
public boolean isSideLit() {
return true;
}
@Override
public boolean isBuiltin() {
return false;
}
@Override
public Sprite getParticleSprite() {
return SPRITES[0];
}
@Override
public ModelTransformation getTransformation() {
return transformation;
}
@Override
public ModelOverrideList getOverrides() {
return ModelOverrideList.EMPTY;
}
}

View File

@ -0,0 +1,119 @@
package ru.xzeldon.chromablocks.model;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.client.model.ModelProviderContext;
import net.fabricmc.fabric.api.client.model.ModelProviderException;
import net.fabricmc.fabric.api.client.model.ModelResourceProvider;
import net.minecraft.client.render.model.UnbakedModel;
import net.minecraft.util.Identifier;
import org.jetbrains.annotations.Nullable;
import ru.xzeldon.chromablocks.ChromaBlocks;
import ru.xzeldon.chromablocks.model.custom.*;
@Environment(EnvType.CLIENT)
public class ChromaBlockModelProvider implements ModelResourceProvider {
public static final Identifier CHROMA_MODEL_GREEN = new Identifier(ChromaBlocks.MOD_ID + ":block/chroma_green");
public static final Identifier CHROMA_MODEL_GREEN_DIM = new Identifier(ChromaBlocks.MOD_ID + ":block/chroma_green_dim");
public static final Identifier CHROMA_MODEL_GREEN_ITEM = new Identifier(ChromaBlocks.MOD_ID + ":item/chroma_green");
public static final Identifier CHROMA_MODEL_GREEN_ITEM_DIM = new Identifier(ChromaBlocks.MOD_ID + ":item/chroma_green_dim");
public static final Identifier CHROMA_MODEL_BLACK = new Identifier(ChromaBlocks.MOD_ID + ":block/chroma_black");
public static final Identifier CHROMA_MODEL_BLACK_DIM = new Identifier(ChromaBlocks.MOD_ID + ":block/chroma_black_dim");
public static final Identifier CHROMA_MODEL_BLACK_ITEM = new Identifier(ChromaBlocks.MOD_ID + ":item/chroma_black");
public static final Identifier CHROMA_MODEL_BLACK_ITEM_DIM = new Identifier(ChromaBlocks.MOD_ID + ":item/chroma_black_dim");
public static final Identifier CHROMA_MODEL_BLUE = new Identifier(ChromaBlocks.MOD_ID + ":block/chroma_blue");
public static final Identifier CHROMA_MODEL_BLUE_DIM = new Identifier(ChromaBlocks.MOD_ID + ":block/chroma_blue_dim");
public static final Identifier CHROMA_MODEL_BLUE_ITEM = new Identifier(ChromaBlocks.MOD_ID + ":item/chroma_blue");
public static final Identifier CHROMA_MODEL_BLUE_ITEM_DIM = new Identifier(ChromaBlocks.MOD_ID + ":item/chroma_blue_dim");
public static final Identifier CHROMA_MODEL_CYAN = new Identifier(ChromaBlocks.MOD_ID + ":block/chroma_cyan");
public static final Identifier CHROMA_MODEL_CYAN_DIM = new Identifier(ChromaBlocks.MOD_ID + ":block/chroma_cyan_dim");
public static final Identifier CHROMA_MODEL_CYAN_ITEM = new Identifier(ChromaBlocks.MOD_ID + ":item/chroma_cyan");
public static final Identifier CHROMA_MODEL_CYAN_ITEM_DIM = new Identifier(ChromaBlocks.MOD_ID + ":item/chroma_cyan_dim");
public static final Identifier CHROMA_MODEL_PURPLE = new Identifier(ChromaBlocks.MOD_ID + ":block/chroma_purple");
public static final Identifier CHROMA_MODEL_PURPLE_DIM = new Identifier(ChromaBlocks.MOD_ID + ":block/chroma_purple_dim");
public static final Identifier CHROMA_MODEL_PURPLE_ITEM = new Identifier(ChromaBlocks.MOD_ID + ":item/chroma_purple");
public static final Identifier CHROMA_MODEL_PURPLE_ITEM_DIM = new Identifier(ChromaBlocks.MOD_ID + ":item/chroma_purple_dim");
public static final Identifier CHROMA_MODEL_RED = new Identifier(ChromaBlocks.MOD_ID + ":block/chroma_red");
public static final Identifier CHROMA_MODEL_RED_DIM = new Identifier(ChromaBlocks.MOD_ID + ":block/chroma_red_dim");
public static final Identifier CHROMA_MODEL_RED_ITEM = new Identifier(ChromaBlocks.MOD_ID + ":item/chroma_red");
public static final Identifier CHROMA_MODEL_RED_ITEM_DIM = new Identifier(ChromaBlocks.MOD_ID + ":item/chroma_red_dim");
public static final Identifier CHROMA_MODEL_WHITE = new Identifier(ChromaBlocks.MOD_ID + ":block/chroma_white");
public static final Identifier CHROMA_MODEL_WHITE_DIM = new Identifier(ChromaBlocks.MOD_ID + ":block/chroma_white_dim");
public static final Identifier CHROMA_MODEL_WHITE_ITEM = new Identifier(ChromaBlocks.MOD_ID + ":item/chroma_white");
public static final Identifier CHROMA_MODEL_WHITE_ITEM_DIM = new Identifier(ChromaBlocks.MOD_ID + ":item/chroma_white_dim");
public static final Identifier CHROMA_MODEL_YELLOW = new Identifier(ChromaBlocks.MOD_ID + ":block/chroma_yellow");
public static final Identifier CHROMA_MODEL_YELLOW_DIM = new Identifier(ChromaBlocks.MOD_ID + ":block/chroma_yellow_dim");
public static final Identifier CHROMA_MODEL_YELLOW_ITEM = new Identifier(ChromaBlocks.MOD_ID + ":item/chroma_yellow");
public static final Identifier CHROMA_MODEL_YELLOW_ITEM_DIM = new Identifier(ChromaBlocks.MOD_ID + ":item/chroma_yellow_dim");
@Override
public @Nullable UnbakedModel loadModelResource(Identifier resourceId, ModelProviderContext context) throws ModelProviderException {
if (
resourceId.equals(CHROMA_MODEL_GREEN) ||
resourceId.equals(CHROMA_MODEL_GREEN_DIM) ||
resourceId.equals(CHROMA_MODEL_GREEN_ITEM) ||
resourceId.equals(CHROMA_MODEL_GREEN_ITEM_DIM)
) {
return new GreenChromaBlockModel();
} else if (
resourceId.equals(CHROMA_MODEL_BLACK) ||
resourceId.equals(CHROMA_MODEL_BLACK_DIM) ||
resourceId.equals(CHROMA_MODEL_BLACK_ITEM) ||
resourceId.equals(CHROMA_MODEL_BLACK_ITEM_DIM)
) {
return new BlackChromaBlockModel();
} else if (
resourceId.equals(CHROMA_MODEL_BLUE) ||
resourceId.equals(CHROMA_MODEL_BLUE_DIM) ||
resourceId.equals(CHROMA_MODEL_BLUE_ITEM) ||
resourceId.equals(CHROMA_MODEL_BLUE_ITEM_DIM)
) {
return new BlueChromaBlockModel();
} else if (
resourceId.equals(CHROMA_MODEL_CYAN) ||
resourceId.equals(CHROMA_MODEL_CYAN_DIM) ||
resourceId.equals(CHROMA_MODEL_CYAN_ITEM) ||
resourceId.equals(CHROMA_MODEL_CYAN_ITEM_DIM)
) {
return new CyanChromaBlockModel();
} else if (
resourceId.equals(CHROMA_MODEL_PURPLE) ||
resourceId.equals(CHROMA_MODEL_PURPLE_DIM) ||
resourceId.equals(CHROMA_MODEL_PURPLE_ITEM) ||
resourceId.equals(CHROMA_MODEL_PURPLE_ITEM_DIM)
) {
return new PurpleChromaBlockModel();
} else if (
resourceId.equals(CHROMA_MODEL_RED) ||
resourceId.equals(CHROMA_MODEL_RED_DIM) ||
resourceId.equals(CHROMA_MODEL_RED_ITEM) ||
resourceId.equals(CHROMA_MODEL_RED_ITEM_DIM)
) {
return new RedChromaBlockModel();
} else if (
resourceId.equals(CHROMA_MODEL_WHITE) ||
resourceId.equals(CHROMA_MODEL_WHITE_DIM) ||
resourceId.equals(CHROMA_MODEL_WHITE_ITEM) ||
resourceId.equals(CHROMA_MODEL_WHITE_ITEM_DIM)
) {
return new WhiteChromaBlockModel();
} else if (
resourceId.equals(CHROMA_MODEL_YELLOW) ||
resourceId.equals(CHROMA_MODEL_YELLOW_DIM) ||
resourceId.equals(CHROMA_MODEL_YELLOW_ITEM) ||
resourceId.equals(CHROMA_MODEL_YELLOW_ITEM_DIM)
) {
return new YellowChromaBlockModel();
} else {
return null;
}
}
}

View File

@ -0,0 +1,9 @@
package ru.xzeldon.chromablocks.model.custom;
import ru.xzeldon.chromablocks.model.ChromaBlockModel;
public class BlackChromaBlockModel extends ChromaBlockModel {
public BlackChromaBlockModel() {
super("black");
}
}

View File

@ -0,0 +1,9 @@
package ru.xzeldon.chromablocks.model.custom;
import ru.xzeldon.chromablocks.model.ChromaBlockModel;
public class BlueChromaBlockModel extends ChromaBlockModel {
public BlueChromaBlockModel() {
super("blue");
}
}

View File

@ -0,0 +1,9 @@
package ru.xzeldon.chromablocks.model.custom;
import ru.xzeldon.chromablocks.model.ChromaBlockModel;
public class CyanChromaBlockModel extends ChromaBlockModel {
public CyanChromaBlockModel() {
super("cyan");
}
}

View File

@ -0,0 +1,9 @@
package ru.xzeldon.chromablocks.model.custom;
import ru.xzeldon.chromablocks.model.ChromaBlockModel;
public class GreenChromaBlockModel extends ChromaBlockModel {
public GreenChromaBlockModel() {
super("green");
}
}

View File

@ -0,0 +1,9 @@
package ru.xzeldon.chromablocks.model.custom;
import ru.xzeldon.chromablocks.model.ChromaBlockModel;
public class PurpleChromaBlockModel extends ChromaBlockModel {
public PurpleChromaBlockModel() {
super("purple");
}
}

View File

@ -0,0 +1,9 @@
package ru.xzeldon.chromablocks.model.custom;
import ru.xzeldon.chromablocks.model.ChromaBlockModel;
public class RedChromaBlockModel extends ChromaBlockModel {
public RedChromaBlockModel() {
super("red");
}
}

View File

@ -0,0 +1,9 @@
package ru.xzeldon.chromablocks.model.custom;
import ru.xzeldon.chromablocks.model.ChromaBlockModel;
public class WhiteChromaBlockModel extends ChromaBlockModel {
public WhiteChromaBlockModel() {
super("white");
}
}

View File

@ -0,0 +1,9 @@
package ru.xzeldon.chromablocks.model.custom;
import ru.xzeldon.chromablocks.model.ChromaBlockModel;
public class YellowChromaBlockModel extends ChromaBlockModel {
public YellowChromaBlockModel() {
super("yellow");
}
}

View File

@ -1,19 +0,0 @@
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();
}
}

View File

@ -1,21 +0,0 @@
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;
}
}

View File

@ -1,29 +0,0 @@
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);
}
}

View File

@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "chromablocks:block/chroma_black"
}
}
}

View File

@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "chromablocks:block/chroma_black"
}
}
}

View File

@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "chromablocks:block/chroma_blue"
}
}
}

View File

@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "chromablocks:block/chroma_blue"
}
}
}

View File

@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "chromablocks:block/chroma_cyan"
}
}
}

View File

@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "chromablocks:block/chroma_cyan"
}
}
}

View File

@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "chromablocks:block/chroma_green"
}
}
}

View File

@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "chromablocks:block/chroma_green"
}
}
}

View File

@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "chromablocks:block/chroma_purple"
}
}
}

View File

@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "chromablocks:block/chroma_purple"
}
}
}

View File

@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "chromablocks:block/chroma_red"
}
}
}

View File

@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "chromablocks:block/chroma_red"
}
}
}

View File

@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "chromablocks:block/chroma_white"
}
}
}

View File

@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "chromablocks:block/chroma_white"
}
}
}

View File

@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "chromablocks:block/chroma_yellow"
}
}
}

View File

@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "chromablocks:block/chroma_yellow"
}
}
}

View File

Before

Width:  |  Height:  |  Size: 162 B

After

Width:  |  Height:  |  Size: 162 B

View File

@ -0,0 +1,20 @@
{
"block.chromablocks.chroma_green": "Green Chroma Block",
"block.chromablocks.chroma_green_dim": "Green Chroma Block Dim",
"block.chromablocks.chroma_black": "Black Chroma Block",
"block.chromablocks.chroma_black_dim": "Black Chroma Block Dim",
"block.chromablocks.chroma_blue": "Blue Chroma Block",
"block.chromablocks.chroma_blue_dim": "Blue Chroma Block Dim",
"block.chromablocks.chroma_cyan": "Cyan Chroma Block",
"block.chromablocks.chroma_cyan_dim": "Cyan Chroma Block Dim",
"block.chromablocks.chroma_purple": "Purple Chroma Block",
"block.chromablocks.chroma_purple_dim": "Purple Chroma Block Dim",
"block.chromablocks.chroma_red": "Red Chroma Block",
"block.chromablocks.chroma_red_dim": "Red Chroma Block Dim",
"block.chromablocks.chroma_white": "White Chroma Block",
"block.chromablocks.chroma_white_dim": "White Chroma Block Dim",
"block.chromablocks.chroma_yellow": "Yellow Chroma Block",
"block.chromablocks.chroma_yellow_dim": "Yellow Chroma Block Dim",
"itemGroup.chromablocks.chroma_blocks": "Chroma blocks"
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 946 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 959 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 960 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 957 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 956 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 953 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 958 B

View File

@ -1,7 +0,0 @@
{
"variants": {
"": {
"model": "greenscreenmod:block/green_screen_block"
}
}
}

View File

@ -1,3 +0,0 @@
{
"block.greenscreenmod.green_screen_block": "Green Screen Block"
}

View File

@ -1,6 +0,0 @@
{
"parent": "block/cube_all",
"textures": {
"all": "greenscreenmod:block/green_screen_block"
}
}

View File

@ -1,3 +0,0 @@
{
"parent": "greenscreenmod:block/green_screen_block"
}

View File

@ -1,25 +1,29 @@
{
"schemaVersion": 1,
"id": "greenscreenmod",
"id": "chromablocks",
"version": "${version}",
"name": "Green Screen Mod",
"description": "This mod add green screen block to Minecraft",
"name": "Chroma Blocks",
"description": "Chroma key in Minecraft!",
"authors": [
"xzeldon"
],
"contact": {
"homepage": "https://zeldon.ru/",
"sources": "https://github.com/xzeldon/green-screen-mod"
"sources": "https://github.com/xzeldon/chromablocks"
},
"license": "MIT",
"icon": "assets/greenscreenmod/icon.png",
"icon": "assets/chromablocks/icon.png",
"environment": "*",
"entrypoints": {
"main": [
"ru.xzeldon.greenscreenmod.GreenScreenMod"
"ru.xzeldon.chromablocks.ChromaBlocks"
],
"client": [
"ru.xzeldon.chromablocks.ChromaBlocksClient"
]
},
"mixins": [],
@ -27,7 +31,7 @@
"depends": {
"fabricloader": ">=0.13.3",
"fabric": "*",
"minecraft": "~1.18.2",
"minecraft": "~1.19",
"java": ">=17"
},
"suggests": {