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

@ -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.provider.FabricBlockLootTableProvider;
import net.minecraft.block.Blocks;
import net.minecraft.item.Items;
import su.a71.new_soviet.registration.NSE_Blocks;
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_STAIRS);
addDrop(NSE_Blocks.BARBED_WIRE, Items.IRON_NUGGET);
addDrop(NSE_Blocks.DIRT_ROAD, Blocks.DIRT);
addDropWithSilkTouch(NSE_Custom.LIGHT_BULB_LAMP);
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.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");
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.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");

View file

@ -559,6 +559,15 @@ public class RecipeGenerator extends FabricRecipeProvider {
.criterion(hasItem(Items.IRON_NUGGET), conditionsFromItem(Items.IRON_NUGGET))
.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)
.input('P', NSE_Custom.LAMP_POST_BASE).input('S', Blocks.SHROOMLIGHT)
.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.world.World;
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_Tags;
@ -23,7 +24,7 @@ import java.util.function.Predicate;
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) {
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 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 ==========
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));
@ -763,6 +765,8 @@ public class NSE_Blocks extends NSE_BaseRegistration {
registerBlock("nii_floor_stairs", () -> NII_FLOOR_STAIRS, 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_stairs", () -> HERRINGBONE_ACACIA_PLANKS_STAIRS, NSE_BUILDING_TAB);
registerBlock("herringbone_acacia_planks_slab", () -> HERRINGBONE_ACACIA_PLANKS_SLAB, NSE_BUILDING_TAB);