partial implementation of cotton crop
- all functionality except loot table for the cotton crop block has been added - textures should be considered placeholders and are subject to change
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
pluginManagement {
|
||||
repositories {
|
||||
jcenter()
|
||||
mavenCentral()
|
||||
maven {
|
||||
name = 'Fabric'
|
||||
url = 'https://maven.fabricmc.net/'
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package net.arcmods.arcteam.terraoriginum;
|
||||
|
||||
import net.arcmods.arcteam.terraoriginum.blocks.cottonCropBlock;
|
||||
import net.arcmods.arcteam.terraoriginum.blocks.crucifix;
|
||||
import net.arcmods.arcteam.terraoriginum.items.cottonItems;
|
||||
import net.arcmods.arcteam.terraoriginum.items.mync_eye;
|
||||
import net.arcmods.arcteam.terraoriginum.items.umbrella;
|
||||
import net.arcmods.arcteam.terraoriginum.registry.modEnchantments;
|
||||
@@ -22,9 +24,13 @@ public class TerraOriginum implements ModInitializer {
|
||||
mync_eye.register();
|
||||
modEnchantments.register();
|
||||
crucifix.register();
|
||||
cottonCropBlock.register();
|
||||
cottonItems.register();
|
||||
|
||||
ItemGroupEvents.modifyEntriesEvent(ItemGroups.TOOLS).register((content) -> content.add(umbrella.UMBRELLA));
|
||||
ItemGroupEvents.modifyEntriesEvent(ItemGroups.FUNCTIONAL).register((content) -> content.add(crucifix.CRUCIFIX));
|
||||
ItemGroupEvents.modifyEntriesEvent(ItemGroups.NATURAL).register((content) -> content.add(cottonItems.COTTON_SEEDS));
|
||||
ItemGroupEvents.modifyEntriesEvent(ItemGroups.INGREDIENTS).register((content) -> content.add(cottonItems.COTTON_BALL));
|
||||
LOGGER.info("man this Origins is " + MOD_ID);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
package net.arcmods.arcteam.terraoriginum.blocks;
|
||||
|
||||
import net.arcmods.arcteam.terraoriginum.items.cottonItems;
|
||||
import net.minecraft.block.AbstractBlock;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.CropBlock;
|
||||
import net.minecraft.block.ShapeContext;
|
||||
import net.minecraft.item.ItemConvertible;
|
||||
import net.minecraft.registry.Registries;
|
||||
import net.minecraft.registry.Registry;
|
||||
import net.minecraft.sound.BlockSoundGroup;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.shape.VoxelShape;
|
||||
import net.minecraft.world.BlockView;
|
||||
|
||||
public class cottonCropBlock extends CropBlock{
|
||||
|
||||
private static final VoxelShape[] AGE_TO_SHAPE = new VoxelShape[]{Block.createCuboidShape(0.0D, 0.0D, 0.0D, 16.0D, 2.0D, 16.0D),
|
||||
Block.createCuboidShape(0.0D, 0.0D, 0.0D, 16.0D, 3.0D, 16.0D),
|
||||
Block.createCuboidShape(0.0D, 0.0D, 0.0D, 16.0D, 4.0D, 16.0D),
|
||||
Block.createCuboidShape(0.0D, 0.0D, 0.0D, 16.0D, 5.0D, 16.0D),
|
||||
Block.createCuboidShape(0.0D, 0.0D, 0.0D, 16.0D, 6.0D, 16.0D),
|
||||
Block.createCuboidShape(0.0D, 0.0D, 0.0D, 16.0D, 7.0D, 16.0D),
|
||||
Block.createCuboidShape(0.0D, 0.0D, 0.0D, 16.0D, 8.0D, 16.0D),
|
||||
Block.createCuboidShape(0.0D, 0.0D, 0.0D, 16.0D, 9.0D, 16.0D)
|
||||
};
|
||||
|
||||
public cottonCropBlock(AbstractBlock.Settings settings) {
|
||||
super(settings);
|
||||
}
|
||||
|
||||
public ItemConvertible getSeedsItem() {
|
||||
return cottonItems.COTTON_SEEDS;
|
||||
}
|
||||
|
||||
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) {
|
||||
return AGE_TO_SHAPE[(Integer)state.get(this.getAgeProperty())];
|
||||
}
|
||||
|
||||
public static final CropBlock COTTON_CROP_BLOCK = new CropBlock(AbstractBlock.Settings.create().nonOpaque().noCollision().ticksRandomly().breakInstantly().sounds(BlockSoundGroup.CROP));
|
||||
|
||||
public static void register() {
|
||||
Registry.register(Registries.BLOCK, new Identifier("terraoriginum", "cotton_crop_block"), COTTON_CROP_BLOCK);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,13 +1,17 @@
|
||||
package net.arcmods.arcteam.terraoriginum.client;
|
||||
|
||||
import net.arcmods.arcteam.terraoriginum.blocks.cottonCropBlock;
|
||||
import net.arcmods.arcteam.terraoriginum.items.umbrella;
|
||||
import net.fabricmc.api.ClientModInitializer;
|
||||
import net.fabricmc.fabric.api.blockrenderlayer.v1.BlockRenderLayerMap;
|
||||
import net.minecraft.client.render.RenderLayer;
|
||||
|
||||
public class layerRenderer implements ClientModInitializer {
|
||||
|
||||
@Override
|
||||
public void onInitializeClient() {
|
||||
umbrella.registerRenderLayers();
|
||||
BlockRenderLayerMap.INSTANCE.putBlocks(RenderLayer.getCutout(), cottonCropBlock.COTTON_CROP_BLOCK);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
package net.arcmods.arcteam.terraoriginum.items;
|
||||
|
||||
import net.arcmods.arcteam.terraoriginum.blocks.cottonCropBlock;
|
||||
import net.minecraft.item.AliasedBlockItem;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.registry.Registries;
|
||||
import net.minecraft.registry.Registry;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
public class cottonItems {
|
||||
|
||||
public static final Item COTTON_SEEDS = new AliasedBlockItem(cottonCropBlock.COTTON_CROP_BLOCK, new Item.Settings());
|
||||
public static final Item COTTON_BALL = new Item(new Item.Settings());
|
||||
|
||||
public static void register() {
|
||||
Registry.register(Registries.ITEM, new Identifier("terraoriginum", "cotton_seeds"), COTTON_SEEDS);
|
||||
Registry.register(Registries.ITEM, new Identifier("terraoriginum", "cotton_ball"), COTTON_BALL);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"variants": {
|
||||
"age=0": {
|
||||
"model": "terraoriginum:block/cotton_crop_stage0"
|
||||
},
|
||||
"age=1": {
|
||||
"model": "terraoriginum:block/cotton_crop_stage0"
|
||||
},
|
||||
"age=2": {
|
||||
"model": "terraoriginum:block/cotton_crop_stage1"
|
||||
},
|
||||
"age=3": {
|
||||
"model": "terraoriginum:block/cotton_crop_stage1"
|
||||
},
|
||||
"age=4": {
|
||||
"model": "terraoriginum:block/cotton_crop_stage2"
|
||||
},
|
||||
"age=5": {
|
||||
"model": "terraoriginum:block/cotton_crop_stage2"
|
||||
},
|
||||
"age=6": {
|
||||
"model": "terraoriginum:block/cotton_crop_stage2"
|
||||
},
|
||||
"age=7": {
|
||||
"model": "terraoriginum:block/cotton_crop_stage3"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,9 @@
|
||||
"item.terraoriginum.mync_eye": "you shouldnt have this",
|
||||
"item.terraoriginum.umbrella": "Umbrella",
|
||||
|
||||
"item.terraoriginum.cotton_seeds": "Cotton Seeds",
|
||||
"item.terraoriginum.cotton_ball": "Cotton ball",
|
||||
|
||||
"death.attack.lack_of_ectoplasm": "%1$s faded away",
|
||||
"death.attack.lack_of_ectoplasm.player": "%1$s faded away whilst trying to escape %2$s",
|
||||
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"parent": "minecraft:block/crop",
|
||||
"textures": {
|
||||
"crop": "terraoriginum:block/cotton_crop_block_stage0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"parent": "minecraft:block/crop",
|
||||
"textures": {
|
||||
"crop": "terraoriginum:block/cotton_crop_block_stage1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"parent": "minecraft:block/crop",
|
||||
"textures": {
|
||||
"crop": "terraoriginum:block/cotton_crop_block_stage2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"parent": "minecraft:block/crop",
|
||||
"textures": {
|
||||
"crop": "terraoriginum:block/cotton_crop_block_stage3"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "item/generated",
|
||||
"textures": {
|
||||
"layer0": "terraoriginum:item/cotton_ball"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "item/generated",
|
||||
"textures": {
|
||||
"layer0": "terraoriginum:item/cotton_seeds"
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 228 B |
Binary file not shown.
|
After Width: | Height: | Size: 316 B |
Binary file not shown.
|
After Width: | Height: | Size: 430 B |
Binary file not shown.
|
After Width: | Height: | Size: 294 B |
Binary file not shown.
|
After Width: | Height: | Size: 248 B |
Binary file not shown.
|
After Width: | Height: | Size: 200 B |
@@ -0,0 +1,68 @@
|
||||
{
|
||||
"type": "minecraft:block",
|
||||
"pools": [
|
||||
{
|
||||
"rolls": 1,
|
||||
"bonus_rolls": 0,
|
||||
"entries": [
|
||||
{
|
||||
"type": "minecraft:alternatives",
|
||||
"children": [
|
||||
{
|
||||
"type": "minecraft:item",
|
||||
"name": "terraoriginum:cotton_ball",
|
||||
"conditions": [
|
||||
{
|
||||
"condition": "minecraft:block_state_property",
|
||||
"block": "terraoriginum:cotton_crop_block",
|
||||
"properties": {
|
||||
"age": "7"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "minecraft:item",
|
||||
"name": "terraoriginum:cotton_seeds"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"rolls": 1,
|
||||
"bonus_rolls": 0,
|
||||
"entries": [
|
||||
{
|
||||
"type": "minecraft:item",
|
||||
"name": "terraoriginum:cotton_seeds",
|
||||
"functions": [
|
||||
{
|
||||
"function": "minecraft:apply_bonus",
|
||||
"enchantment": "minecraft:fortune",
|
||||
"formula": "minecraft:binomial_with_bonus_count",
|
||||
"parameters": {
|
||||
"extra": 3,
|
||||
"probability": 0.5714286
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"conditions": [
|
||||
{
|
||||
"condition": "minecraft:block_state_property",
|
||||
"block": "terraoriginum:cotton_crop_block",
|
||||
"properties": {
|
||||
"age": "7"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"functions": [
|
||||
{
|
||||
"function": "minecraft:explosion_decay"
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user