Skip to content

Commit

Permalink
match 1.19
Browse files Browse the repository at this point in the history
  • Loading branch information
mrsterner committed Jul 20, 2023
1 parent eaede7a commit 913e0ae
Show file tree
Hide file tree
Showing 10 changed files with 152 additions and 5 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ yarn_mappings=1.20.1+build.9
loader_version=0.14.21

# Mod Properties
mod_version = 0.14.9+1.20.1
mod_version = 0.14.10+1.20.1
maven_group = dev.sterner
archives_base_name = cultural-delights-fabric

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public class CornBlock extends PlantBlock implements Fertilizable {
public static final IntProperty AGE;
public static final BooleanProperty SUPPORTING;
private static final VoxelShape[] SHAPE_BY_AGE;
public static final int GROWTH_CHANCE = 10;

public CornBlock(Settings settings) {
super(settings);
Expand Down Expand Up @@ -133,6 +134,33 @@ public void grow(ServerWorld worldIn, Random rand, BlockPos pos, BlockState stat

}

@Override
public void randomTick(BlockState state, ServerWorld worldIn, BlockPos pos, Random rand) {
super.randomTick(state, worldIn, pos, rand);

if (!worldIn.isRegionLoaded(pos.add(-1, -1, -1), pos.add(1, 1, 1))) {
return;
}

if (worldIn.getLightLevel(pos.up(), 0) >= 6 && this.getAge(state) <= this.getMaxAge() && rand.nextInt(3) == 0) {
randomGrowTick(state, worldIn, pos, rand);
}
}

private void randomGrowTick(BlockState state, ServerWorld worldIn, BlockPos pos, Random rand) {
int currentAge = this.getAge(state);
if (currentAge <= this.getMaxAge() && rand.nextInt((int) (25.0F / GROWTH_CHANCE) + 1) == 0) {
if (currentAge == this.getMaxAge()) {
CornUpperBlock cornUpper = (CornUpperBlock) CDObjects.CORN_UPPER;
if (cornUpper.getDefaultState().canPlaceAt(worldIn, pos.up()) && worldIn.isAir(pos.up())) {
worldIn.setBlockState(pos.up(), cornUpper.getDefaultState());
}
} else {
worldIn.setBlockState(pos, state.with(AGE, this.getAge(state)+1));
}
}
}

static {
AGE = Properties.AGE_3;
SUPPORTING = BooleanProperty.of("supporting");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import net.minecraft.item.AliasedBlockItem;
import net.minecraft.item.BlockItem;
import net.minecraft.item.Item;
import net.minecraft.item.StewItem;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.util.Identifier;
Expand Down Expand Up @@ -58,15 +59,15 @@ public class CDObjects {
public static final Item TORTILLA = register("tortilla", new Item(settings().food(CDFoodComponents.TORTILLA)));
public static final Item TORTILLA_CHIPS = register("tortilla_chips", new Item(settings().food(CDFoodComponents.TORTILLA_CHIPS)));
public static final Item ELOTE = register("elote", new Item(settings().food(CDFoodComponents.ELOTE)));
public static final Item HEARTY_SALAD = register("hearty_salad", new Item(settings().food(CDFoodComponents.HEARTY_SALAD)));
public static final Item HEARTY_SALAD = register("hearty_salad", new StewItem(settings().food(CDFoodComponents.HEARTY_SALAD)));
public static final Item BEEF_BURRITO = register("beef_burrito", new Item(settings().food(CDFoodComponents.BEEF_BURRITO)));
public static final Item MUTTON_SANDWICH = register("mutton_sandwich", new Item(settings().food(CDFoodComponents.MUTTON_SANDWICH)));
public static final Item FRIED_EGGPLANT_PASTA = register("fried_eggplant_pasta", new Item(settings().food(CDFoodComponents.FRIED_EGGPLANT_PASTA)));
public static final Item FRIED_EGGPLANT_PASTA = register("fried_eggplant_pasta", new StewItem(settings().food(CDFoodComponents.FRIED_EGGPLANT_PASTA)));
public static final Item EGGPLANT_BURGER = register("eggplant_burger", new Item(settings().food(CDFoodComponents.EGGPLANT_BURGER)));
public static final Item AVOCADO_TOAST = register("avocado_toast", new Item(settings().food(CDFoodComponents.AVOCADO_TOAST)));
public static final Item CREAMED_CORN = register("creamed_corn", new Item(settings().food(CDFoodComponents.CREAMED_CORN)));
public static final Item CREAMED_CORN = register("creamed_corn", new StewItem(settings().food(CDFoodComponents.CREAMED_CORN)));
public static final Item CHICKEN_TACO = register("chicken_taco", new Item(settings().food(CDFoodComponents.CHICKEN_TACO)));
public static final Item SPICY_CURRY = register("spicy_curry", new Item(settings().food(CDFoodComponents.SPICY_CURRY)));
public static final Item SPICY_CURRY = register("spicy_curry", new StewItem(settings().food(CDFoodComponents.SPICY_CURRY)));
public static final Item PORK_WRAP = register("pork_wrap", new Item(settings().food(CDFoodComponents.PORK_WRAP)));
public static final Item FISH_TACO = register("fish_taco", new Item(settings().food(CDFoodComponents.FISH_TACO)));
public static final Item MIDORI_ROLL = register("midori_roll", new Item(settings().food(CDFoodComponents.MIDORI_ROLL)));
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"type":"create:cutting","fabric:load_conditions":[{"condition":"fabric:all_mods_loaded","values":["create"]}],"ingredients":[{"item":"culturaldelights:avocado_log"}],"processingTime":50,"results":[{"item":"stripped_jungle_log"}]}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"type":"create:cutting","fabric:load_conditions":[{"condition":"fabric:all_mods_loaded","values":["create"]}],"ingredients":[{"item":"culturaldelights:avocado_wood"}],"processingTime":50,"results":[{"item":"stripped_jungle_wood"}]}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"fabric:load_conditions": [
{
"condition": "fabric:all_mods_loaded",
"values": ["create"]
}
],
"type": "create:milling",
"ingredients": [
{
"item": "culturaldelights:wild_corn"
}
],
"results": [
{
"item": "culturaldelights:corn_kernels",
"count": 2
},
{
"item": "culturaldelights:corn_kernels",
"chance": 0.5,
"count": 2
},
{
"item": "green_dye",
"chance": 0.1,
"count": 1
}
],
"processingTime": 50
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"fabric:load_conditions": [
{
"condition": "fabric:all_mods_loaded",
"values": ["create"]
}
],
"type": "create:milling",
"ingredients": [
{
"item": "culturaldelights:wild_cucumbers"
}
],
"results": [
{
"item": "yellow_dye",
"count": 2
},
{
"item": "culturaldelights:cucumber_seeds",
"count": 1
},
{
"item": "yellow_dye",
"chance": 0.2,
"count": 1
}
],
"processingTime": 50
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"fabric:load_conditions": [
{
"condition": "fabric:all_mods_loaded",
"values": ["create"]
}
],
"type": "create:milling",
"ingredients": [
{
"item": "culturaldelights:wild_eggplants"
}
],
"results": [
{
"item": "culturaldelights:eggplant_seeds",
"count": 1
},
{
"item": "light_gray_dye",
"count": 2
},
{
"item": "light_gray_dye",
"chance": 0.2,
"count": 1
}
],
"processingTime": 50
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"type": "farmersdelight:cutting",
"ingredients": [
{
"item": "culturaldelights:avocado_bundle"
}
],
"tool": {
"tag": "c:tools/knives"
},
"result": [
{
"item": "culturaldelights:avocado",
"count": 4
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"replace": false,
"values": [
"culturaldelights:wild_eggplants",
"culturaldelights:wild_corn",
"culturaldelights:wild_cucumbers"
]
}

0 comments on commit 913e0ae

Please sign in to comment.