Add dirt road, made with rake

This commit is contained in:
Andrew-71 2023-10-17 09:43:18 +03:00
parent 3893470712
commit c78eba73b0
14 changed files with 156 additions and 2 deletions

View file

@ -9,7 +9,6 @@
* no wallpaper recipes (intended?) * no wallpaper recipes (intended?)
* no nutrient block recipe (intended? compressed bread?) * no nutrient block recipe (intended? compressed bread?)
* cigarette recipe * cigarette recipe
* siren recipe
* switch recipe * switch recipe
* checkers and chess recipe * checkers and chess recipe
* post lamps recipes * post lamps recipes

View file

@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "new_soviet:block/dirt_road"
}
}
}

View file

@ -0,0 +1,6 @@
{
"parent": "minecraft:block/cube_all",
"textures": {
"all": "new_soviet:block/floor/dirt_road"
}
}

View file

@ -0,0 +1,3 @@
{
"parent": "new_soviet:block/dirt_road"
}

View file

@ -0,0 +1,74 @@
{
"parent": "minecraft:recipes/root",
"criteria": {
"has_gold_ingot": {
"conditions": {
"items": [
{
"items": [
"minecraft:gold_ingot"
]
}
]
},
"trigger": "minecraft:inventory_changed"
},
"has_gold_nugget": {
"conditions": {
"items": [
{
"items": [
"minecraft:gold_nugget"
]
}
]
},
"trigger": "minecraft:inventory_changed"
},
"has_green_wool": {
"conditions": {
"items": [
{
"items": [
"minecraft:green_wool"
]
}
]
},
"trigger": "minecraft:inventory_changed"
},
"has_light_bulb_item": {
"conditions": {
"items": [
{
"items": [
"new_soviet:light_bulb_item"
]
}
]
},
"trigger": "minecraft:inventory_changed"
},
"has_the_recipe": {
"conditions": {
"recipe": "new_soviet:golden_table_lamp"
},
"trigger": "minecraft:recipe_unlocked"
}
},
"requirements": [
[
"has_light_bulb_item",
"has_gold_nugget",
"has_gold_ingot",
"has_green_wool",
"has_the_recipe"
]
],
"rewards": {
"recipes": [
"new_soviet:golden_table_lamp"
]
},
"sends_telemetry_event": false
}

View file

@ -0,0 +1,20 @@
{
"type": "minecraft:block",
"pools": [
{
"bonus_rolls": 0.0,
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
],
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:dirt"
}
],
"rolls": 1.0
}
]
}

View file

@ -0,0 +1,27 @@
{
"type": "minecraft:crafting_shaped",
"category": "misc",
"key": {
"G": {
"item": "minecraft:gold_ingot"
},
"N": {
"item": "minecraft:gold_nugget"
},
"W": {
"item": "minecraft:green_wool"
},
"Z": {
"item": "new_soviet:light_bulb_item"
}
},
"pattern": [
"WZW",
" N ",
"GGG"
],
"result": {
"item": "new_soviet:golden_table_lamp"
},
"show_notification": true
}

View file

@ -3,6 +3,7 @@ package su.a71.new_soviet.datagen;
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput; import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
import net.fabricmc.fabric.api.datagen.v1.provider.FabricBlockLootTableProvider; import net.fabricmc.fabric.api.datagen.v1.provider.FabricBlockLootTableProvider;
import net.minecraft.block.Blocks;
import net.minecraft.item.Items; import net.minecraft.item.Items;
import su.a71.new_soviet.registration.NSE_Blocks; import su.a71.new_soviet.registration.NSE_Blocks;
import su.a71.new_soviet.registration.NSE_Custom; import su.a71.new_soviet.registration.NSE_Custom;
@ -430,6 +431,7 @@ public class BlockLootTables extends FabricBlockLootTableProvider {
addDrop(NSE_Blocks.METAL_PLATING_SLAB); addDrop(NSE_Blocks.METAL_PLATING_SLAB);
addDrop(NSE_Blocks.METAL_PLATING_STAIRS); addDrop(NSE_Blocks.METAL_PLATING_STAIRS);
addDrop(NSE_Blocks.BARBED_WIRE, Items.IRON_NUGGET); addDrop(NSE_Blocks.BARBED_WIRE, Items.IRON_NUGGET);
addDrop(NSE_Blocks.DIRT_ROAD, Blocks.DIRT);
addDropWithSilkTouch(NSE_Custom.LIGHT_BULB_LAMP); addDropWithSilkTouch(NSE_Custom.LIGHT_BULB_LAMP);
addDropWithSilkTouch(NSE_Blocks.BARBED_WIRE); addDropWithSilkTouch(NSE_Blocks.BARBED_WIRE);

View file

@ -199,6 +199,7 @@ public class ModelGenerator extends FabricModelProvider {
registerCubeWithSlabStairs(blockStateModelGenerator, NSE_Blocks.GREEN_CONCRETE, NSE_Blocks.GREEN_CONCRETE_STAIRS, NSE_Blocks.GREEN_CONCRETE_SLAB, "concrete"); registerCubeWithSlabStairs(blockStateModelGenerator, NSE_Blocks.GREEN_CONCRETE, NSE_Blocks.GREEN_CONCRETE_STAIRS, NSE_Blocks.GREEN_CONCRETE_SLAB, "concrete");
registerCubeWithSlabStairs(blockStateModelGenerator, NSE_Blocks.CRACKED_GREEN_CONCRETE, NSE_Blocks.CRACKED_GREEN_CONCRETE_STAIRS, NSE_Blocks.CRACKED_GREEN_CONCRETE_SLAB, "concrete"); registerCubeWithSlabStairs(blockStateModelGenerator, NSE_Blocks.CRACKED_GREEN_CONCRETE, NSE_Blocks.CRACKED_GREEN_CONCRETE_STAIRS, NSE_Blocks.CRACKED_GREEN_CONCRETE_SLAB, "concrete");
registerCubeWithSlabStairs(blockStateModelGenerator, NSE_Blocks.NII_FLOOR, NSE_Blocks.NII_FLOOR_STAIRS, NSE_Blocks.NII_FLOOR_SLAB, "research_institute"); registerCubeWithSlabStairs(blockStateModelGenerator, NSE_Blocks.NII_FLOOR, NSE_Blocks.NII_FLOOR_STAIRS, NSE_Blocks.NII_FLOOR_SLAB, "research_institute");
registerCube(blockStateModelGenerator, NSE_Blocks.DIRT_ROAD, "floor");
registerCubeWithSlabStairs(blockStateModelGenerator, NSE_Blocks.HERRINGBONE_ACACIA_PLANKS, NSE_Blocks.HERRINGBONE_ACACIA_PLANKS_STAIRS, NSE_Blocks.HERRINGBONE_ACACIA_PLANKS_SLAB, "floor/planks"); registerCubeWithSlabStairs(blockStateModelGenerator, NSE_Blocks.HERRINGBONE_ACACIA_PLANKS, NSE_Blocks.HERRINGBONE_ACACIA_PLANKS_STAIRS, NSE_Blocks.HERRINGBONE_ACACIA_PLANKS_SLAB, "floor/planks");
registerCubeWithSlabStairs(blockStateModelGenerator, NSE_Blocks.CROSS_ACACIA_PLANKS, NSE_Blocks.CROSS_ACACIA_PLANKS_STAIRS, NSE_Blocks.CROSS_ACACIA_PLANKS_SLAB, "floor/planks"); registerCubeWithSlabStairs(blockStateModelGenerator, NSE_Blocks.CROSS_ACACIA_PLANKS, NSE_Blocks.CROSS_ACACIA_PLANKS_STAIRS, NSE_Blocks.CROSS_ACACIA_PLANKS_SLAB, "floor/planks");
registerCubeWithSlabStairs(blockStateModelGenerator, NSE_Blocks.HERRINGBONE_OAK_PLANKS, NSE_Blocks.HERRINGBONE_OAK_PLANKS_STAIRS, NSE_Blocks.HERRINGBONE_OAK_PLANKS_SLAB, "floor/planks"); registerCubeWithSlabStairs(blockStateModelGenerator, NSE_Blocks.HERRINGBONE_OAK_PLANKS, NSE_Blocks.HERRINGBONE_OAK_PLANKS_STAIRS, NSE_Blocks.HERRINGBONE_OAK_PLANKS_SLAB, "floor/planks");

View file

@ -559,6 +559,15 @@ public class RecipeGenerator extends FabricRecipeProvider {
.criterion(hasItem(Items.IRON_NUGGET), conditionsFromItem(Items.IRON_NUGGET)) .criterion(hasItem(Items.IRON_NUGGET), conditionsFromItem(Items.IRON_NUGGET))
.offerTo(exporter); .offerTo(exporter);
ShapedRecipeJsonBuilder.create(RecipeCategory.DECORATIONS, NSE_Custom.GOLDEN_LAMP, 1)
.input('G', Items.GOLD_INGOT).input('N', Items.GOLD_NUGGET).input('Z', NSE_Items.LIGHT_BULB).input('W', Blocks.GREEN_WOOL)
.pattern("WZW").pattern(" N ").pattern("GGG")
.criterion(hasItem(NSE_Items.LIGHT_BULB), conditionsFromItem(NSE_Items.LIGHT_BULB))
.criterion(hasItem(Items.GOLD_NUGGET), conditionsFromItem(Items.GOLD_NUGGET))
.criterion(hasItem(Items.GOLD_INGOT), conditionsFromItem(Items.GOLD_INGOT))
.criterion(hasItem(Blocks.GREEN_WOOL), conditionsFromItem(Blocks.GREEN_WOOL))
.offerTo(exporter);
ShapedRecipeJsonBuilder.create(RecipeCategory.DECORATIONS, NSE_Custom.BIG_POST_LAMP, 1) ShapedRecipeJsonBuilder.create(RecipeCategory.DECORATIONS, NSE_Custom.BIG_POST_LAMP, 1)
.input('P', NSE_Custom.LAMP_POST_BASE).input('S', Blocks.SHROOMLIGHT) .input('P', NSE_Custom.LAMP_POST_BASE).input('S', Blocks.SHROOMLIGHT)
.pattern(" S ").pattern(" P ").pattern(" ") .pattern(" S ").pattern(" P ").pattern(" ")

View file

@ -14,6 +14,7 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction; import net.minecraft.util.math.Direction;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraft.world.event.GameEvent; import net.minecraft.world.event.GameEvent;
import su.a71.new_soviet.registration.NSE_Blocks;
import su.a71.new_soviet.registration.NSE_Sounds; import su.a71.new_soviet.registration.NSE_Sounds;
import su.a71.new_soviet.registration.NSE_Tags; import su.a71.new_soviet.registration.NSE_Tags;
@ -23,7 +24,7 @@ import java.util.function.Predicate;
public class RakeItem extends MiningToolItem { public class RakeItem extends MiningToolItem {
protected static final Map<Block, Pair<Predicate<ItemUsageContext>, Consumer<ItemUsageContext>>> TILLING_ACTIONS = Maps.newHashMap(ImmutableMap.of(Blocks.GRASS_BLOCK, Pair.of(HoeItem::canTillFarmland, RakeItem.createTillAction(Blocks.FARMLAND.getDefaultState())), Blocks.DIRT_PATH, Pair.of(HoeItem::canTillFarmland, RakeItem.createTillAction(Blocks.FARMLAND.getDefaultState())), Blocks.DIRT, Pair.of(HoeItem::canTillFarmland, RakeItem.createTillAction(Blocks.FARMLAND.getDefaultState())), Blocks.COARSE_DIRT, Pair.of(RakeItem::canTillFarmland, RakeItem.createTillAction(Blocks.DIRT.getDefaultState())), Blocks.ROOTED_DIRT, Pair.of(itemUsageContext -> true, RakeItem.createTillAndDropAction(Blocks.DIRT.getDefaultState(), Items.HANGING_ROOTS)))); protected static final Map<Block, Pair<Predicate<ItemUsageContext>, Consumer<ItemUsageContext>>> TILLING_ACTIONS = Maps.newHashMap(ImmutableMap.of(Blocks.GRASS_BLOCK, Pair.of(HoeItem::canTillFarmland, RakeItem.createTillAction(Blocks.FARMLAND.getDefaultState())), Blocks.DIRT_PATH, Pair.of(HoeItem::canTillFarmland, RakeItem.createTillAction(Blocks.FARMLAND.getDefaultState())), Blocks.DIRT, Pair.of(HoeItem::canTillFarmland, RakeItem.createTillAction(Blocks.FARMLAND.getDefaultState())), Blocks.COARSE_DIRT, Pair.of(RakeItem::canTillFarmland, RakeItem.createTillAndDropAction(NSE_Blocks.DIRT_ROAD.getDefaultState(), Items.FLINT)), Blocks.ROOTED_DIRT, Pair.of(itemUsageContext -> true, RakeItem.createTillAndDropAction(Blocks.DIRT.getDefaultState(), Items.HANGING_ROOTS))));
public RakeItem(ToolMaterial material, int attackDamage, float attackSpeed, Settings settings) { public RakeItem(ToolMaterial material, int attackDamage, float attackSpeed, Settings settings) {
super(attackDamage, attackSpeed, material, NSE_Tags.Blocks.RAKE_MINEABLE, settings); super(attackDamage, attackSpeed, material, NSE_Tags.Blocks.RAKE_MINEABLE, settings);
} }

View file

@ -312,6 +312,8 @@ public class NSE_Blocks extends NSE_BaseRegistration {
public static final SlabBlock CRACKED_GREEN_CONCRETE_SLAB = new SlabBlock(FabricBlockSettings.copy(CRACKED_GREEN_CONCRETE)); public static final SlabBlock CRACKED_GREEN_CONCRETE_SLAB = new SlabBlock(FabricBlockSettings.copy(CRACKED_GREEN_CONCRETE));
public static final ConcreteWithBarsBlock GREEN_CONCRETE_WITH_BARS = new ConcreteWithBarsBlock(FabricBlockSettings.copy(GREEN_CONCRETE)); public static final ConcreteWithBarsBlock GREEN_CONCRETE_WITH_BARS = new ConcreteWithBarsBlock(FabricBlockSettings.copy(GREEN_CONCRETE));
public static final GravelBlock DIRT_ROAD = new GravelBlock(FabricBlockSettings.copy(Blocks.GRAVEL));
// WOOD/FLOOR ========== // WOOD/FLOOR ==========
public static final Block HERRINGBONE_ACACIA_PLANKS = new Block(FabricBlockSettings.copy(Blocks.ACACIA_PLANKS)); public static final Block HERRINGBONE_ACACIA_PLANKS = new Block(FabricBlockSettings.copy(Blocks.ACACIA_PLANKS));
public static final StairsBlock HERRINGBONE_ACACIA_PLANKS_STAIRS = new StairsBlock(HERRINGBONE_ACACIA_PLANKS.getDefaultState(), FabricBlockSettings.copy(HERRINGBONE_ACACIA_PLANKS)); public static final StairsBlock HERRINGBONE_ACACIA_PLANKS_STAIRS = new StairsBlock(HERRINGBONE_ACACIA_PLANKS.getDefaultState(), FabricBlockSettings.copy(HERRINGBONE_ACACIA_PLANKS));
@ -763,6 +765,8 @@ public class NSE_Blocks extends NSE_BaseRegistration {
registerBlock("nii_floor_stairs", () -> NII_FLOOR_STAIRS, NSE_BUILDING_TAB); registerBlock("nii_floor_stairs", () -> NII_FLOOR_STAIRS, NSE_BUILDING_TAB);
registerBlock("nii_floor_slab", () -> NII_FLOOR_SLAB, NSE_BUILDING_TAB); registerBlock("nii_floor_slab", () -> NII_FLOOR_SLAB, NSE_BUILDING_TAB);
registerBlock("dirt_road", () -> DIRT_ROAD, NSE_BUILDING_TAB);
registerBlock("herringbone_acacia_planks", () -> HERRINGBONE_ACACIA_PLANKS, NSE_BUILDING_TAB); registerBlock("herringbone_acacia_planks", () -> HERRINGBONE_ACACIA_PLANKS, NSE_BUILDING_TAB);
registerBlock("herringbone_acacia_planks_stairs", () -> HERRINGBONE_ACACIA_PLANKS_STAIRS, NSE_BUILDING_TAB); registerBlock("herringbone_acacia_planks_stairs", () -> HERRINGBONE_ACACIA_PLANKS_STAIRS, NSE_BUILDING_TAB);
registerBlock("herringbone_acacia_planks_slab", () -> HERRINGBONE_ACACIA_PLANKS_SLAB, NSE_BUILDING_TAB); registerBlock("herringbone_acacia_planks_slab", () -> HERRINGBONE_ACACIA_PLANKS_SLAB, NSE_BUILDING_TAB);

View file

@ -467,6 +467,7 @@
"block.new_soviet.orange_boundary_marker": "Orange Boundary Marker", "block.new_soviet.orange_boundary_marker": "Orange Boundary Marker",
"block.new_soviet.cyan_boundary_marker": "Cyan Boundary Marker", "block.new_soviet.cyan_boundary_marker": "Cyan Boundary Marker",
"block.new_soviet.barbed_wire": "Barbed Wire", "block.new_soviet.barbed_wire": "Barbed Wire",
"block.new_soviet.dirt_road": "Dirt Road",
"advancement.new_soviet.root.name": "A New Era", "advancement.new_soviet.root.name": "A New Era",
"advancement.new_soviet.root.desc": "Time to create something great", "advancement.new_soviet.root.desc": "Time to create something great",

Binary file not shown.

After

Width:  |  Height:  |  Size: 548 B