init commit

This commit is contained in:
2021-02-24 20:28:38 -05:00
parent ec430e4f9d
commit cf841a04f6
32 changed files with 934 additions and 0 deletions
@@ -0,0 +1,18 @@
package net.parsell.cherry;
import net.fabricmc.api.ModInitializer;
import net.parsell.cherry.core.*;
public class Cherry implements ModInitializer {
@Override
public void onInitialize() {
// This code runs as soon as Minecraft is in a mod-load-ready state.
// However, some things (like resources) may still be uninitialized.
// Proceed with mild caution.
System.out.println("Cherry Initilizating...");
CherryBlocks.init();
CherryItems.init();
}
}
@@ -0,0 +1,25 @@
package net.parsell.cherry.core;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.Block;
import net.minecraft.block.Blocks;
import net.minecraft.block.LeavesBlock;
import net.minecraft.block.PillarBlock;
import net.minecraft.util.Identifier;
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));
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!");
}
public static void init(){
registerBlocks();
}
}
@@ -0,0 +1,20 @@
package net.parsell.cherry.core;
import net.fabricmc.fabric.api.item.v1.FabricItemSettings;
import net.minecraft.item.BlockItem;
import net.minecraft.item.ItemGroup;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry;
public class CherryItems {
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)));
System.out.println("Successfully added items!");
}
public static void init(){
registerBlockItems();
}
}
@@ -0,0 +1,15 @@
package net.parsell.cherry.mixin;
import net.minecraft.client.gui.screen.TitleScreen;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(TitleScreen.class)
public class CherryMixin {
@Inject(at = @At("HEAD"), method = "init()V")
private void init(CallbackInfo info) {
System.out.println("This line is printed by an example mod mixin!");
}
}
@@ -0,0 +1,6 @@
{
"variants": {
"": { "model": "cherry:block/cherry_leaves" }
}
}
@@ -0,0 +1,16 @@
{
"variants": {
"axis=y": {
"model": "cherry:block/cherry_log"
},
"axis=z": {
"model": "cherry:block/cherry_log",
"x": 90
},
"axis=x": {
"model": "cherry:block/cherry_log",
"x": 90,
"y": 90
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 453 B

@@ -0,0 +1,4 @@
{
"block.cherry.cherry_log": "Cherry Log",
"block.cherry.cherry_leaves": "Cherry Leaves"
}
@@ -0,0 +1,6 @@
{
"parent": "block/cube_all",
"textures": {
"all": "cherry:block/cherry_leaves"
}
}
@@ -0,0 +1,7 @@
{
"parent": "block/cube_column",
"textures": {
"end": "cherry:block/cherry_log_top",
"side": "cherry:block/cherry_log"
}
}
@@ -0,0 +1,4 @@
{
"parent": "cherry:block/cherry_leaves"
}
@@ -0,0 +1,4 @@
{
"parent": "cherry:block/cherry_log"
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 261 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 267 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 318 B

+14
View File
@@ -0,0 +1,14 @@
{
"required": true,
"minVersion": "0.8",
"package": "net.parsell.cherry.mixin",
"compatibilityLevel": "JAVA_8",
"mixins": [
],
"client": [
"CherryMixin"
],
"injectors": {
"defaultRequire": 1
}
}
@@ -0,0 +1,128 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:alternatives",
"children": [
{
"type": "minecraft:item",
"conditions": [
{
"condition": "minecraft:alternative",
"terms": [
{
"condition": "minecraft:match_tool",
"predicate": {
"item": "minecraft:shears"
}
},
{
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
]
}
],
"name": "cherry:cherry_leaves"
},
{
"type": "minecraft:item",
"conditions": [
{
"condition": "minecraft:survives_explosion"
},
{
"condition": "minecraft:table_bonus",
"enchantment": "minecraft:fortune",
"chances": [
0.05,
0.0625,
0.083333336,
0.1
]
}
],
"name": "cherry:cherry_leaves"
}
]
}
]
},
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"conditions": [
{
"condition": "minecraft:table_bonus",
"enchantment": "minecraft:fortune",
"chances": [
0.02,
0.022222223,
0.025,
0.033333335,
0.1
]
}
],
"functions": [
{
"function": "minecraft:set_count",
"count": {
"min": 1.0,
"max": 2.0,
"type": "minecraft:uniform"
}
},
{
"function": "minecraft:explosion_decay"
}
],
"name": "minecraft:stick"
}
],
"conditions": [
{
"condition": "minecraft:inverted",
"term": {
"condition": "minecraft:alternative",
"terms": [
{
"condition": "minecraft:match_tool",
"predicate": {
"item": "minecraft:shears"
}
},
{
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
]
}
}
]
}
]
}
@@ -0,0 +1,20 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "cherry:cherry_log"
}
],
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
]
}
]
}
@@ -0,0 +1,6 @@
{
"replace": false,
"values": [
"cherry:cherry_log"
]
}
@@ -0,0 +1,6 @@
{
"replace": false,
"values": [
"cherry:cherry_leaves"
]
}
@@ -0,0 +1,6 @@
{
"replace": false,
"values": [
"#cherry:cherry_wood"
]
}
+37
View File
@@ -0,0 +1,37 @@
{
"schemaVersion": 1,
"id": "cherry",
"version": "${version}",
"name": "Cherry",
"description": "This mod adds a bunch of different tree's, and their respective variants",
"authors": [
"Ganku (Code), yurisuika (Textures)"
],
"contact": {
"homepage": "https://fabricmc.net/",
"sources": "https://github.com/FabricMC/fabric-example-mod"
},
"license": "MIT",
"icon": "assets/cherry/icon.png",
"environment": "*",
"entrypoints": {
"main": [
"net.parsell.cherry.Cherry"
]
},
"mixins": [
"cherry.mixins.json"
],
"depends": {
"fabricloader": ">=0.7.4",
"fabric": "*",
"minecraft": "1.16.x"
},
"suggests": {
"another-mod": "*"
}
}