Skip to content

Commit

Permalink
Tier2 Soil
Browse files Browse the repository at this point in the history
  • Loading branch information
Direwolf20-MC committed Mar 10, 2024
1 parent dfc9a25 commit d8e573b
Show file tree
Hide file tree
Showing 38 changed files with 255 additions and 100 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// 1.20.4 2024-03-03T19:23:22.4374836 JustDireThings Tags
// 1.20.4 2024-03-09T21:52:58.7342424 JustDireThings Tags
5b5cbf374921a9647606a861d5a8c35ea64cc9c7 data/forge/tags/blocks/ores.json
2d8e1cc89c55f97e9aa87799af87ddd8a74b2e34 data/justdirethings/tags/blocks/lawnmowerable.json
dff9db68e86925ee97c0161c983644c87debb3c3 data/minecraft/tags/blocks/mineable/pickaxe.json
11232a655ecdf0e32c632d145759b8a0de2e09fa data/minecraft/tags/blocks/mineable/shovel.json
533f1800814b8d517f2881a258e26ccb769f519d data/minecraft/tags/blocks/mineable/shovel.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// 1.20.4 2024-03-01T15:36:16.4003748 Loot Tables
// 1.20.4 2024-03-09T21:52:58.739246 Loot Tables
16a0ab61513717ab1cb8c1df9718722a643d9728 data/justdirethings/loot_tables/blocks/blazegold_block.json
1374ed53b2d6c1462b64a99f3ca1b290388d36c5 data/justdirethings/loot_tables/blocks/ferricore_block.json
9d62cc762313305bbe032473310bafd15bcdb8bd data/justdirethings/loot_tables/blocks/gooblock_tier1.json
7e92782ed4881463b836c32c2504d92fee72cbfb data/justdirethings/loot_tables/blocks/gooblock_tier2.json
fcef2a947be7443c277f0bc8a7ac5379f2084822 data/justdirethings/loot_tables/blocks/goopatternblock.json
9c8536a418114b2885b7662a77029757c8da8152 data/justdirethings/loot_tables/blocks/goosoil.json
ec24d4e64ad8c73bb13ad3153e02193c0c4e286d data/justdirethings/loot_tables/blocks/goosoil_tier1.json
dbc0b95e979a373cff9226804660f79e55dead0b data/justdirethings/loot_tables/blocks/goosoil_tier2.json
817a643c3ef7d120e72236ffc75349531a290d80 data/justdirethings/loot_tables/blocks/raw_blazegold_ore.json
9a3a9b5226f317f041d8b874ca09fd6b8925b2ef data/justdirethings/loot_tables/blocks/raw_ferricore_ore.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// 1.20.4 2024-03-05T19:07:15.4315617 Item Models: justdirethings
// 1.20.4 2024-03-09T21:52:58.7362439 Item Models: justdirethings
e530754217cfc9d79b595014f8a7294671c0f345 assets/justdirethings/models/item/blazegold_axe.json
6396fb6e503760080534bc26337236d4d09a4cb8 assets/justdirethings/models/item/blazegold_block.json
a9dbf1f41c07660828db2afb102a20050d32295e assets/justdirethings/models/item/blazegold_hoe.json
Expand All @@ -16,7 +16,8 @@ d929e8867b0fced0126a66427167ef08a3df6bbf assets/justdirethings/models/item/ferri
af62c31381c904f86fde9370e374e01d828fa643 assets/justdirethings/models/item/fuel_canister.json
2ec271fed6a1fb15d49837326283ca1f0e269689 assets/justdirethings/models/item/gooblock_tier1.json
8e2f93de57bf331b80c25882febe5601d1b9d26a assets/justdirethings/models/item/gooblock_tier2.json
de261131b33ee1467338424bba8245c0bb5b6f4f assets/justdirethings/models/item/goosoil.json
a48cecdb5ad78ee95ffb4e98458804d64cd1f608 assets/justdirethings/models/item/goosoil_tier1.json
d42f004ad7ff6b67416aa3265ce45f6c3ec717f4 assets/justdirethings/models/item/goosoil_tier2.json
3f50e98f22d6abc6b3edab6c01b82deec145ec78 assets/justdirethings/models/item/pocket_generator.json
d8ea68a75b8b49f7765e715d62ad23c2f1939281 assets/justdirethings/models/item/raw_blazegold.json
0eb4cfb03ddec169426214f46beb6f8781ce9421 assets/justdirethings/models/item/raw_blazegold_ore.json
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// 1.20.4 2024-03-09T14:31:39.473594 Languages: en_us for mod: justdirethings
849e5ae81619b2635b0a25b5b194d9d06d4c347c assets/justdirethings/lang/en_us.json
// 1.20.4 2024-03-09T21:52:58.7387455 Languages: en_us for mod: justdirethings
243b57187e30ef76fca33c103e7bdaf0ce241e9a assets/justdirethings/lang/en_us.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
// 1.20.4 2024-03-01T16:24:13.7903886 Block States: justdirethings
// 1.20.4 2024-03-09T21:52:58.7372445 Block States: justdirethings
e5976480ed9485e0bae43d4edde0c8aecaabe8a5 assets/justdirethings/blockstates/blazegold_block.json
81a237aa7f50c82d19f0cbf52a672edf3d805e23 assets/justdirethings/blockstates/ferricore_block.json
5a4cd222f3bde8915594a1363e2758ee5208517c assets/justdirethings/blockstates/gooblock_tier1.json
cc1d5dd5cf3cdaf4e89a9b0dae5372b43c27b88c assets/justdirethings/blockstates/gooblock_tier2.json
2c7ba1dbdfd5b10ee0de988f03472b4af57f9378 assets/justdirethings/blockstates/goopatternblock.json
88515fd4ddc08d1b37d3fe81a75eff122a88d619 assets/justdirethings/blockstates/goosoil.json
300a9bc0ba5c6d9ccf96b6298623bb234c619510 assets/justdirethings/blockstates/goosoil_tier1.json
f221904a483d33a577cfa1060d4b8f9063e2812e assets/justdirethings/blockstates/goosoil_tier2.json
a684d58dade9e2961c5c6b994704e43321dd2d30 assets/justdirethings/blockstates/raw_blazegold_ore.json
a7d2fa74c5e65b5a5f46b68932e99144d08123ee assets/justdirethings/blockstates/raw_ferricore_ore.json
9bd3946cfa107459786529b2af21eb125a901fb7 assets/justdirethings/models/block/blazegold_block.json
Expand All @@ -23,7 +24,9 @@ de99198085ba7892b69b20c7fba7574aa387c99b assets/justdirethings/models/block/goop
1017892293e8c2c1fbd6668493696513da801921 assets/justdirethings/models/block/goopatternblock7.json
7c4b15daa716408edd217af3bdd5f4d40a507116 assets/justdirethings/models/block/goopatternblock8.json
a8285d4ea09e26951b3019b6e96a43d3d4654269 assets/justdirethings/models/block/goopatternblock9.json
6a4d0e24bd9ac92cd5fd15f26a930cba6e778d16 assets/justdirethings/models/block/goosoil.json
6f7e47c9f9bf6134e91de480860ccc2f8484cbba assets/justdirethings/models/block/goosoil_moist.json
9a4d7110374d1a05d593786e2cf864da76477041 assets/justdirethings/models/block/goosoil_tier1.json
a905d0dad2e7f408bd554686e039b2ab93d787ee assets/justdirethings/models/block/goosoil_tier1_moist.json
b7f500b582c2c244d307821a53c6556a72bde30b assets/justdirethings/models/block/goosoil_tier2.json
df80ed5f99586f5ba72ceab178c2e6fdd5b542b1 assets/justdirethings/models/block/goosoil_tier2_moist.json
934652a811b9657b7fc80acc101da40b37d14315 assets/justdirethings/models/block/raw_blazegold_ore.json
382857a602e9f295c8e682db8c4cbc5299701263 assets/justdirethings/models/block/raw_ferricore_ore.json

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"variants": {
"moisture=0": {
"model": "justdirethings:block/goosoil_tier1"
},
"moisture=1": {
"model": "justdirethings:block/goosoil_tier1"
},
"moisture=2": {
"model": "justdirethings:block/goosoil_tier1"
},
"moisture=3": {
"model": "justdirethings:block/goosoil_tier1"
},
"moisture=4": {
"model": "justdirethings:block/goosoil_tier1"
},
"moisture=5": {
"model": "justdirethings:block/goosoil_tier1"
},
"moisture=6": {
"model": "justdirethings:block/goosoil_tier1"
},
"moisture=7": {
"model": "justdirethings:block/goosoil_tier1_moist"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"variants": {
"moisture=0": {
"model": "justdirethings:block/goosoil_tier2"
},
"moisture=1": {
"model": "justdirethings:block/goosoil_tier2"
},
"moisture=2": {
"model": "justdirethings:block/goosoil_tier2"
},
"moisture=3": {
"model": "justdirethings:block/goosoil_tier2"
},
"moisture=4": {
"model": "justdirethings:block/goosoil_tier2"
},
"moisture=5": {
"model": "justdirethings:block/goosoil_tier2"
},
"moisture=6": {
"model": "justdirethings:block/goosoil_tier2"
},
"moisture=7": {
"model": "justdirethings:block/goosoil_tier2_moist"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"block.justdirethings.ferricore_block": "Ferricore Block",
"block.justdirethings.gooblock_tier1": "Primogel Goo",
"block.justdirethings.gooblock_tier2": "Blazebloom Goo",
"block.justdirethings.goosoil": "Goo Soil",
"block.justdirethings.goosoil_tier1": "Goo Soil Tier1",
"block.justdirethings.goosoil_tier2": "Goo Soil Tier2",
"block.justdirethings.raw_blazegold_ore": "Raw Blazegold Ore",
"block.justdirethings.raw_ferricore_ore": "Raw Ferricore Ore",
"item.justdirethings.blazegold_axe": "Blazegold Axe",
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"parent": "minecraft:block/template_farmland",
"textures": {
"dirt": "justdirethings:block/goosoilside_tier1",
"top": "justdirethings:block/goofarmland_tier1"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"parent": "minecraft:block/template_farmland",
"textures": {
"dirt": "justdirethings:block/goosoilside_tier1",
"top": "justdirethings:block/goofarmland_tier1_moist"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"parent": "minecraft:block/template_farmland",
"textures": {
"dirt": "justdirethings:block/goosoilside_tier2",
"top": "justdirethings:block/goofarmland_tier2"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"parent": "minecraft:block/template_farmland",
"textures": {
"dirt": "justdirethings:block/goosoilside_tier2",
"top": "justdirethings:block/goofarmland_tier2_moist"
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"parent": "justdirethings:block/goosoil_tier1"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"parent": "justdirethings:block/goosoil_tier2"
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@
"rolls": 1.0
}
],
"random_sequence": "justdirethings:blocks/goosoil"
"random_sequence": "justdirethings:blocks/goosoil_tier1"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"type": "minecraft:block",
"pools": [
{
"bonus_rolls": 0.0,
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
],
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:dirt"
}
],
"rolls": 1.0
}
],
"random_sequence": "justdirethings:blocks/goosoil_tier2"
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"values": [
"justdirethings:gooblock_tier1",
"justdirethings:gooblock_tier2"
"justdirethings:gooblock_tier2",
"justdirethings:goosoil_tier1",
"justdirethings:goosoil_tier2"
]
}
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
package com.direwolf20.justdirethings.common.blocks;
package com.direwolf20.justdirethings.common.blocks.soil;

import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.util.RandomSource;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.item.ItemEntity;
import net.minecraft.world.item.BlockItem;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.CropBlock;
import net.minecraft.world.level.block.FarmBlock;
import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.block.*;
import net.minecraft.world.level.block.state.BlockState;
import net.neoforged.neoforge.common.IPlantable;

public class GooSoil extends FarmBlock {
public GooSoil() {
import java.util.List;

public class GooSoilBase extends FarmBlock {
public GooSoilBase() {
super(Properties.of()
.sound(SoundType.GRAVEL)
.strength(2.0f)
Expand All @@ -29,7 +32,7 @@ public boolean canSustainPlant(BlockState blockState, BlockGetter level, BlockPo

@Override
public void fallOn(Level pLevel, BlockState pState, BlockPos pPos, Entity pEntity, float pFallDistance) {
//pEntity.causeFallDamage(pFallDistance, 1.0F, pEntity.damageSources().fall()); // Todo should I do this?
pEntity.causeFallDamage(pFallDistance, 1.0F, pEntity.damageSources().fall());
}

@Override
Expand All @@ -43,27 +46,31 @@ public void tick(BlockState pState, ServerLevel pLevel, BlockPos pPos, RandomSou
@Override
public void randomTick(BlockState pState, ServerLevel pLevel, BlockPos pPos, RandomSource pRandom) {
super.randomTick(pState, pLevel, pPos, pRandom);
}

/**
* @param odds The chance of bonemeal occuring, 1 in odds chance - lower == more likely
*/
public static void bonemealMe(ServerLevel pLevel, BlockPos pPos, RandomSource pRandom, int odds) {
BlockPos cropPos = pPos.above();
BlockState crop = pLevel.getBlockState(cropPos);
if (crop.getBlock() instanceof CropBlock cropBlock) {
if (crop.isRandomlyTicking()) {
float f = 2;
if (cropBlock.isValidBonemealTarget(pLevel, cropPos, crop) && pRandom.nextInt((int) (25.0F / f) + 1) == 0) {
if (cropBlock.isValidBonemealTarget(pLevel, cropPos, crop) && pRandom.nextInt(odds) == 0) {
cropBlock.performBonemeal(pLevel, pRandom, cropPos, crop);
pLevel.levelEvent(1505, cropPos, 0); //Does Bonemeal Particles
}
}
/*if (cropBlock.isMaxAge(crop)) { // Todo: Tier 2
BlockState state = pLevel.getBlockState(cropPos);
LootParams.Builder lootparams$builder = new LootParams.Builder(pLevel)
.withParameter(LootContextParams.ORIGIN, Vec3.atCenterOf(cropPos))
.withParameter(LootContextParams.BLOCK_STATE, crop)
.withParameter(LootContextParams.TOOL, new ItemStack(Registration.FerricoreHoe.get()));
// If specific block conditions are needed, set them in the LootContext builder.
}
}

public static void autoHarvest(ServerLevel pLevel, BlockPos pPos) {
BlockPos cropPos = pPos.above();
BlockState crop = pLevel.getBlockState(cropPos);
if (crop.getBlock() instanceof CropBlock cropBlock) {
if (cropBlock.isMaxAge(crop)) {
BlockState placeState = Blocks.AIR.defaultBlockState();
List<ItemStack> drops = state.getDrops(lootparams$builder);
List<ItemStack> drops = Block.getDrops(crop, pLevel, cropPos, null);
for (ItemStack drop : drops) {
if (drop.getItem() instanceof BlockItem blockItem) {
placeState = blockItem.getBlock().defaultBlockState();
Expand All @@ -76,12 +83,12 @@ public void randomTick(BlockState pState, ServerLevel pLevel, BlockPos pPos, Ran
pLevel.destroyBlock(cropPos, false);
for (ItemStack drop : drops) {
ItemEntity itemEntity = new ItemEntity(pLevel, cropPos.getX(), cropPos.getY(), cropPos.getZ(), drop);
itemEntity.setPickUpDelay(40);
itemEntity.lifespan = 40;
pLevel.addFreshEntity(itemEntity);
}
pLevel.setBlockAndUpdate(cropPos, placeState);
}
}*/
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.direwolf20.justdirethings.common.blocks.soil;

import net.minecraft.core.BlockPos;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.util.RandomSource;
import net.minecraft.world.level.block.state.BlockState;

public class GooSoilTier1 extends GooSoilBase {
public GooSoilTier1() {
super();
}

/**
* Performs a random tick on a block.
*/
@Override
public void randomTick(BlockState pState, ServerLevel pLevel, BlockPos pPos, RandomSource pRandom) {
super.randomTick(pState, pLevel, pPos, pRandom);
bonemealMe(pLevel, pPos, pRandom, 13); //1 in 13 chance of the random tick causing a bonemeal
}
}
Loading

0 comments on commit d8e573b

Please sign in to comment.