Compare commits

...

2 Commits

Author SHA1 Message Date
Justin Parsell 0c93573d81 Added leaves coloration and cleaned up imports 2021-02-26 01:43:07 -05:00
Justin Parsell e9a194e875 Updated .gitignore 2021-02-26 01:42:47 -05:00
7 changed files with 25 additions and 55 deletions

View File

@ -1,41 +0,0 @@
# Automatically build the project and run any configured tests for every push
# and submitted pull request. This can help catch issues that only occur on
# certain platforms or Java versions, and provides a first line of defence
# against bad commits.
name: build
on: [pull_request, push]
jobs:
build:
strategy:
matrix:
# Use these Java versions
java: [
1.8, # Minimum supported by Minecraft
11, # Current Java LTS
15 # Latest version
]
# and run on both Linux and Windows
os: [ubuntu-20.04, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: checkout repository
uses: actions/checkout@v2
- name: validate gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: setup jdk ${{ matrix.java }}
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
- name: make gradle wrapper executable
if: ${{ runner.os != 'Windows' }}
run: chmod +x ./gradlew
- name: build
run: ./gradlew build
- name: capture build artifacts
if: ${{ runner.os == 'Linux' && matrix.java == '11' }} # Only upload artifacts built from LTS java on one OS
uses: actions/upload-artifact@v2
with:
name: Artifacts
path: build/libs/

4
.gitignore vendored
View File

@ -31,3 +31,7 @@ bin/
# fabric
run/
# github
.github/

View File

@ -1,6 +1,9 @@
package net.parsell.cherry;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.client.rendering.v1.ColorProviderRegistry;
import net.minecraft.block.Block;
import net.minecraft.block.Blocks;
import net.parsell.cherry.core.*;
public class Cherry implements ModInitializer {
@ -14,6 +17,5 @@ public class Cherry implements ModInitializer {
CherryBlocks.init();
CherryItems.init();
CherryFeatures.init();
}
}

View File

@ -1,5 +1,6 @@
package net.parsell.cherry.core;
import net.fabricmc.fabric.api.client.rendering.v1.ColorProviderRegistry;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.fabricmc.fabric.api.registry.FlammableBlockRegistry;
import net.minecraft.block.Block;
@ -11,16 +12,19 @@ import net.minecraft.util.registry.Registry;
public class CherryBlocks {
public static final Block CHERRYLOG = new PillarBlock(FabricBlockSettings.copyOf(Blocks.OAK_LOG));
public static final Block CHERRYLEAVES = new LeavesBlock(FabricBlockSettings.copyOf(Blocks.OAK_LEAVES));
public static final Block CHERRYLEAVES = new LeavesBlock(FabricBlockSettings.copyOf(Blocks.OAK_LEAVES));
private static void registerBlocks(){
private static void registerBlocks() {
System.out.println("Adding blocks...");
Registry.register(Registry.BLOCK, new Identifier("cherry", "cherry_log"), CHERRYLOG);
Registry.register(Registry.BLOCK, new Identifier("cherry", "cherry_leaves"), CHERRYLEAVES);
System.out.println("Successfully added blocks!");
Registry.register(Registry.BLOCK, new Identifier("cherry", "cherry_log"), CHERRYLOG);
Registry.register(Registry.BLOCK, new Identifier("cherry", "cherry_leaves"), CHERRYLEAVES);
System.out.println("Successfully added blocks!");
System.out.println("Setting flammability...");
FlammableBlockRegistry.getDefaultInstance().add(CHERRYLOG, 5, 5);
FlammableBlockRegistry.getDefaultInstance().add(CHERRYLEAVES, 30, 60);
ColorProviderRegistry.BLOCK.register((state, world, pos, tintIndex) -> {
return 6649929;
}, CHERRYLEAVES);
}
public static void init(){

View File

@ -12,22 +12,16 @@ import net.minecraft.util.registry.RegistryKey;
import net.minecraft.world.biome.BiomeKeys;
import net.minecraft.world.gen.GenerationStep;
import net.minecraft.world.gen.UniformIntDistribution;
import net.minecraft.world.gen.decorator.ChanceDecoratorConfig;
import net.minecraft.world.gen.decorator.CountExtraDecoratorConfig;
import net.minecraft.world.gen.decorator.Decorator;
import net.minecraft.world.gen.feature.ConfiguredFeature;
import net.minecraft.world.gen.feature.ConfiguredFeatures;
import net.minecraft.world.gen.feature.DefaultFeatureConfig;
import net.minecraft.world.gen.feature.Feature;
import net.minecraft.world.gen.feature.FeatureConfig;
import net.minecraft.world.gen.feature.RandomFeatureConfig;
import net.minecraft.world.gen.feature.TreeFeature;
import net.minecraft.world.gen.feature.TreeFeatureConfig;
import net.minecraft.world.gen.feature.TreeFeatureConfig.Builder;
import net.minecraft.world.gen.feature.size.FeatureSize;
import net.minecraft.world.gen.feature.size.TwoLayersFeatureSize;
import net.minecraft.world.gen.foliage.BlobFoliagePlacer;
import net.minecraft.world.gen.foliage.FoliagePlacer;
import net.minecraft.world.gen.stateprovider.SimpleBlockStateProvider;
import net.minecraft.world.gen.trunk.StraightTrunkPlacer;
import net.parsell.cherry.common.features.CherryTree;

View File

@ -1,5 +1,6 @@
package net.parsell.cherry.core;
import net.fabricmc.fabric.api.client.rendering.v1.ColorProviderRegistry;
import net.fabricmc.fabric.api.item.v1.FabricItemSettings;
import net.minecraft.item.BlockItem;
import net.minecraft.item.ItemGroup;
@ -7,11 +8,17 @@ import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry;
public class CherryItems {
public static BlockItem CHERRYLEAVES_I = new BlockItem(CherryBlocks.CHERRYLEAVES, new FabricItemSettings().group(ItemGroup.BUILDING_BLOCKS));
private static void registerBlockItems(){
System.out.println("Adding items...");
Registry.register(Registry.ITEM, new Identifier("cherry", "cherry_log"), new BlockItem(CherryBlocks.CHERRYLOG, new FabricItemSettings().group(ItemGroup.BUILDING_BLOCKS)));
Registry.register(Registry.ITEM, new Identifier("cherry", "cherry_leaves"), new BlockItem(CherryBlocks.CHERRYLEAVES, new FabricItemSettings().group(ItemGroup.BUILDING_BLOCKS)));
Registry.register(Registry.ITEM, new Identifier("cherry", "cherry_leaves"), CHERRYLEAVES_I);
System.out.println("Successfully added items!");
ColorProviderRegistry.ITEM.register((stack, tintIndex) -> {
return 6649929;
}, CherryBlocks.CHERRYLEAVES
);
}
public static void init(){

View File

@ -1,5 +1,5 @@
{
"parent": "block/cube_all",
"parent": "block/leaves",
"textures": {
"all": "cherry:block/cherry_leaves"
}