Compare commits

...

2 commits

Author SHA1 Message Date
8f1af13933 Integrate screwdriver 2024-03-07 12:23:21 +03:00
1b290d9169 Add some post lamp crafting recipes 2024-03-07 12:22:51 +03:00
18 changed files with 520 additions and 7 deletions

View file

@ -65,9 +65,10 @@ Due to sheer amount of changes, some may be undocumented. We hope you enjoy this
* Star
* Grain
* Added USSR anthem music disc
* Added a new screwdriver tool for tinkering with blocks
* Added a new antenna item to improve radio electronics recipes
* Parquet improvements
* Separated oak and dark oak parquet in naming
* Separated oak and dark oak parquet
* Added a few new types
* Siren improvements
* Now uses screwdriver to change sound

View file

@ -0,0 +1,48 @@
{
"parent": "minecraft:recipes/root",
"criteria": {
"has_lamp_post_base": {
"conditions": {
"items": [
{
"items": [
"new_soviet:lamp_post_base"
]
}
]
},
"trigger": "minecraft:inventory_changed"
},
"has_redstone_lamp": {
"conditions": {
"items": [
{
"items": [
"minecraft:redstone_lamp"
]
}
]
},
"trigger": "minecraft:inventory_changed"
},
"has_the_recipe": {
"conditions": {
"recipe": "new_soviet:big_post_lamp_redstone_lamp"
},
"trigger": "minecraft:recipe_unlocked"
}
},
"requirements": [
[
"has_lamp_post_base",
"has_redstone_lamp",
"has_the_recipe"
]
],
"rewards": {
"recipes": [
"new_soviet:big_post_lamp_redstone_lamp"
]
},
"sends_telemetry_event": false
}

View file

@ -0,0 +1,48 @@
{
"parent": "minecraft:recipes/root",
"criteria": {
"has_lamp_post_base": {
"conditions": {
"items": [
{
"items": [
"new_soviet:lamp_post_base"
]
}
]
},
"trigger": "minecraft:inventory_changed"
},
"has_sea_lantern": {
"conditions": {
"items": [
{
"items": [
"minecraft:sea_lantern"
]
}
]
},
"trigger": "minecraft:inventory_changed"
},
"has_the_recipe": {
"conditions": {
"recipe": "new_soviet:big_post_lamp_sea_lantern"
},
"trigger": "minecraft:recipe_unlocked"
}
},
"requirements": [
[
"has_lamp_post_base",
"has_sea_lantern",
"has_the_recipe"
]
],
"rewards": {
"recipes": [
"new_soviet:big_post_lamp_sea_lantern"
]
},
"sends_telemetry_event": false
}

View file

@ -27,7 +27,7 @@
},
"has_the_recipe": {
"conditions": {
"recipe": "new_soviet:big_post_lamp"
"recipe": "new_soviet:big_post_lamp_shroomlight"
},
"trigger": "minecraft:recipe_unlocked"
}
@ -41,7 +41,7 @@
],
"rewards": {
"recipes": [
"new_soviet:big_post_lamp"
"new_soviet:big_post_lamp_shroomlight"
]
},
"sends_telemetry_event": false

View file

@ -0,0 +1,61 @@
{
"parent": "minecraft:recipes/root",
"criteria": {
"has_iron_nugget": {
"conditions": {
"items": [
{
"items": [
"minecraft:iron_nugget"
]
}
]
},
"trigger": "minecraft:inventory_changed"
},
"has_lamp_post_base": {
"conditions": {
"items": [
{
"items": [
"new_soviet:lamp_post_base"
]
}
]
},
"trigger": "minecraft:inventory_changed"
},
"has_lantern": {
"conditions": {
"items": [
{
"items": [
"minecraft:lantern"
]
}
]
},
"trigger": "minecraft:inventory_changed"
},
"has_the_recipe": {
"conditions": {
"recipe": "new_soviet:caged_post_lamp"
},
"trigger": "minecraft:recipe_unlocked"
}
},
"requirements": [
[
"has_lamp_post_base",
"has_lantern",
"has_iron_nugget",
"has_the_recipe"
]
],
"rewards": {
"recipes": [
"new_soviet:caged_post_lamp"
]
},
"sends_telemetry_event": false
}

View file

@ -0,0 +1,61 @@
{
"parent": "minecraft:recipes/root",
"criteria": {
"has_caged_post_lamp": {
"conditions": {
"items": [
{
"items": [
"new_soviet:vintage_post_lamp"
]
}
]
},
"trigger": "minecraft:inventory_changed"
},
"has_iron_ingot": {
"conditions": {
"items": [
{
"items": [
"new_soviet:vintage_post_lamp"
]
}
]
},
"trigger": "minecraft:inventory_changed"
},
"has_the_recipe": {
"conditions": {
"recipe": "new_soviet:vintage_post_lamp_add_ingot"
},
"trigger": "minecraft:recipe_unlocked"
},
"has_vintage_post_lamp": {
"conditions": {
"items": [
{
"items": [
"new_soviet:vintage_post_lamp"
]
}
]
},
"trigger": "minecraft:inventory_changed"
}
},
"requirements": [
[
"has_vintage_post_lamp",
"has_caged_post_lamp",
"has_iron_ingot",
"has_the_recipe"
]
],
"rewards": {
"recipes": [
"new_soviet:vintage_post_lamp_add_ingot"
]
},
"sends_telemetry_event": false
}

View file

@ -0,0 +1,74 @@
{
"parent": "minecraft:recipes/root",
"criteria": {
"has_iron_ingot": {
"conditions": {
"items": [
{
"items": [
"minecraft:iron_ingot"
]
}
]
},
"trigger": "minecraft:inventory_changed"
},
"has_iron_nugget": {
"conditions": {
"items": [
{
"items": [
"minecraft:iron_nugget"
]
}
]
},
"trigger": "minecraft:inventory_changed"
},
"has_lamp_post_base": {
"conditions": {
"items": [
{
"items": [
"new_soviet:lamp_post_base"
]
}
]
},
"trigger": "minecraft:inventory_changed"
},
"has_lantern": {
"conditions": {
"items": [
{
"items": [
"minecraft:lantern"
]
}
]
},
"trigger": "minecraft:inventory_changed"
},
"has_the_recipe": {
"conditions": {
"recipe": "new_soviet:vintage_post_lamp_basic"
},
"trigger": "minecraft:recipe_unlocked"
}
},
"requirements": [
[
"has_lamp_post_base",
"has_lantern",
"has_iron_ingot",
"has_iron_nugget",
"has_the_recipe"
]
],
"rewards": {
"recipes": [
"new_soviet:vintage_post_lamp_basic"
]
},
"sends_telemetry_event": false
}

View file

@ -0,0 +1,48 @@
{
"parent": "minecraft:recipes/root",
"criteria": {
"has_iron_ingot": {
"conditions": {
"items": [
{
"items": [
"minecraft:iron_ingot"
]
}
]
},
"trigger": "minecraft:inventory_changed"
},
"has_stick": {
"conditions": {
"items": [
{
"items": [
"minecraft:stick"
]
}
]
},
"trigger": "minecraft:inventory_changed"
},
"has_the_recipe": {
"conditions": {
"recipe": "new_soviet:screwdriver"
},
"trigger": "minecraft:recipe_unlocked"
}
},
"requirements": [
[
"has_iron_ingot",
"has_stick",
"has_the_recipe"
]
],
"rewards": {
"recipes": [
"new_soviet:screwdriver"
]
},
"sends_telemetry_event": false
}

View file

@ -0,0 +1,21 @@
{
"type": "minecraft:crafting_shaped",
"category": "misc",
"key": {
"P": {
"item": "new_soviet:lamp_post_base"
},
"S": {
"item": "minecraft:redstone_lamp"
}
},
"pattern": [
" S ",
" P ",
" "
],
"result": {
"item": "new_soviet:big_post_lamp"
},
"show_notification": true
}

View file

@ -0,0 +1,21 @@
{
"type": "minecraft:crafting_shaped",
"category": "misc",
"key": {
"P": {
"item": "new_soviet:lamp_post_base"
},
"S": {
"item": "minecraft:sea_lantern"
}
},
"pattern": [
" S ",
" P ",
" "
],
"result": {
"item": "new_soviet:big_post_lamp"
},
"show_notification": true
}

View file

@ -0,0 +1,23 @@
{
"type": "minecraft:crafting_shaped",
"category": "misc",
"key": {
"L": {
"item": "minecraft:lantern"
},
"N": {
"item": "minecraft:iron_nugget"
},
"P": {
"item": "new_soviet:lamp_post_base"
}
},
"pattern": [
" N",
"LP"
],
"result": {
"item": "new_soviet:caged_post_lamp"
},
"show_notification": true
}

View file

@ -0,0 +1,20 @@
{
"type": "minecraft:crafting_shaped",
"category": "equipment",
"key": {
"I": {
"item": "minecraft:iron_ingot"
},
"S": {
"item": "minecraft:stick"
}
},
"pattern": [
"I",
"S"
],
"result": {
"item": "new_soviet:screwdriver"
},
"show_notification": true
}

View file

@ -0,0 +1,15 @@
{
"type": "minecraft:crafting_shapeless",
"category": "misc",
"ingredients": [
{
"item": "new_soviet:caged_post_lamp"
},
{
"item": "minecraft:iron_ingot"
}
],
"result": {
"item": "new_soviet:vintage_post_lamp"
}
}

View file

@ -0,0 +1,26 @@
{
"type": "minecraft:crafting_shaped",
"category": "misc",
"key": {
"I": {
"item": "minecraft:iron_ingot"
},
"L": {
"item": "minecraft:lantern"
},
"N": {
"item": "minecraft:iron_nugget"
},
"P": {
"item": "new_soviet:lamp_post_base"
}
},
"pattern": [
"IN",
"LP"
],
"result": {
"item": "new_soviet:vintage_post_lamp"
},
"show_notification": true
}

View file

@ -13,6 +13,7 @@ import net.minecraft.server.world.ServerWorld;
import net.minecraft.sound.BlockSoundGroup;
import net.minecraft.sound.SoundCategory;
import net.minecraft.sound.SoundEvent;
import net.minecraft.stat.Stats;
import net.minecraft.state.StateManager;
import net.minecraft.state.property.BooleanProperty;
import net.minecraft.state.property.IntProperty;
@ -88,6 +89,7 @@ public class SirenBlock extends HorizontalFacingBlock implements Waterloggable {
world.playSound(null, pos.getX(), pos.getY(), pos.getZ(), NSE_Sounds.SCREWDRIVER_SOUND, SoundCategory.BLOCKS, 1.0f, (float) NewSoviet.RANDOM.nextBetween(8, 11) / 10);
player.sendMessage(Text.translatable("block.new_soviet.siren.set").append(Text.translatable("block.new_soviet.siren.sound." + SIREN_SOUNDS.get(world.getBlockState(pos).get(SOUND_INDEX)).translation_key()).formatted(Formatting.YELLOW)), true);
player.incrementStat(Stats.USED.getOrCreateStat(NSE_Items.SCREWDRIVER));
return ActionResult.SUCCESS;
}
return super.onUse(state, world, pos, player, hand, hit);

View file

@ -12,6 +12,7 @@ import net.minecraft.item.ItemPlacementContext;
import net.minecraft.item.ItemStack;
import net.minecraft.sound.SoundCategory;
import net.minecraft.sound.SoundEvents;
import net.minecraft.stat.Stats;
import net.minecraft.state.StateManager;
import net.minecraft.state.property.BooleanProperty;
import net.minecraft.state.property.EnumProperty;
@ -86,6 +87,7 @@ public class WindowBlock extends HorizontalFacingBlock {
player.sendMessage(Text.translatable("block.new_soviet.window.unfixed").formatted(Formatting.BOLD), true);
}
world.setBlockState(pos, state.with(CLOSED, !state.get(CLOSED)), 2);
player.incrementStat(Stats.USED.getOrCreateStat(NSE_Items.SCREWDRIVER));
return ActionResult.SUCCESS;
}
return super.onUse(state, world, pos, player, hand, hit);

View file

@ -5,14 +5,12 @@ import com.google.common.collect.Lists;
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
import net.fabricmc.fabric.api.datagen.v1.provider.FabricRecipeProvider;
import net.minecraft.block.*;
import net.minecraft.data.server.recipe.RecipeJsonProvider;
import net.minecraft.data.server.recipe.RecipeProvider;
import net.minecraft.data.server.recipe.ShapedRecipeJsonBuilder;
import net.minecraft.data.server.recipe.ShapelessRecipeJsonBuilder;
import net.minecraft.data.server.recipe.*;
import net.minecraft.item.ItemConvertible;
import net.minecraft.item.Items;
import net.minecraft.recipe.Ingredient;
import net.minecraft.recipe.book.RecipeCategory;
import net.minecraft.registry.Registries;
import net.minecraft.registry.tag.ItemTags;
import net.minecraft.util.Util;
import su.a71.new_soviet.registration.NSE_Blocks;
@ -586,8 +584,45 @@ public class RecipeGenerator extends FabricRecipeProvider {
.pattern(" S ").pattern(" P ").pattern(" ")
.criterion(hasItem(NSE_Custom.LAMP_POST_BASE), conditionsFromItem(NSE_Custom.LAMP_POST_BASE))
.criterion(hasItem(Blocks.SHROOMLIGHT), conditionsFromItem(Blocks.SHROOMLIGHT))
.offerTo(exporter, Registries.ITEM.getId(NSE_Custom.BIG_POST_LAMP.asItem()) + "_shroomlight");
ShapedRecipeJsonBuilder.create(RecipeCategory.DECORATIONS, NSE_Custom.BIG_POST_LAMP, 1)
.input('P', NSE_Custom.LAMP_POST_BASE).input('S', Blocks.SEA_LANTERN)
.pattern(" S ").pattern(" P ").pattern(" ")
.criterion(hasItem(NSE_Custom.LAMP_POST_BASE), conditionsFromItem(NSE_Custom.LAMP_POST_BASE))
.criterion(hasItem(Blocks.SEA_LANTERN), conditionsFromItem(Blocks.SEA_LANTERN))
.offerTo(exporter, Registries.ITEM.getId(NSE_Custom.BIG_POST_LAMP.asItem()) + "_sea_lantern");
ShapedRecipeJsonBuilder.create(RecipeCategory.DECORATIONS, NSE_Custom.BIG_POST_LAMP, 1)
.input('P', NSE_Custom.LAMP_POST_BASE).input('S', Blocks.REDSTONE_LAMP)
.pattern(" S ").pattern(" P ").pattern(" ")
.criterion(hasItem(NSE_Custom.LAMP_POST_BASE), conditionsFromItem(NSE_Custom.LAMP_POST_BASE))
.criterion(hasItem(Blocks.REDSTONE_LAMP), conditionsFromItem(Blocks.REDSTONE_LAMP))
.offerTo(exporter, Registries.ITEM.getId(NSE_Custom.BIG_POST_LAMP.asItem()) + "_redstone_lamp");
ShapedRecipeJsonBuilder.create(RecipeCategory.DECORATIONS, NSE_Custom.CAGED_POST_LAMP, 1)
.input('P', NSE_Custom.LAMP_POST_BASE).input('N', Items.IRON_NUGGET).input('L', Blocks.LANTERN)
.pattern(" N").pattern("LP")
.criterion(hasItem(NSE_Custom.LAMP_POST_BASE), conditionsFromItem(NSE_Custom.LAMP_POST_BASE))
.criterion(hasItem(Blocks.LANTERN), conditionsFromItem(Blocks.LANTERN))
.criterion(hasItem(Items.IRON_NUGGET), conditionsFromItem(Items.IRON_NUGGET))
.offerTo(exporter);
ShapedRecipeJsonBuilder.create(RecipeCategory.DECORATIONS, NSE_Custom.VINTAGE_POST_LAMP, 1)
.input('P', NSE_Custom.LAMP_POST_BASE).input('N', Items.IRON_NUGGET).input('I', Items.IRON_INGOT).input('L', Blocks.LANTERN)
.pattern("IN").pattern("LP")
.criterion(hasItem(NSE_Custom.LAMP_POST_BASE), conditionsFromItem(NSE_Custom.LAMP_POST_BASE))
.criterion(hasItem(Blocks.LANTERN), conditionsFromItem(Blocks.LANTERN))
.criterion(hasItem(Items.IRON_INGOT), conditionsFromItem(Items.IRON_INGOT))
.criterion(hasItem(Items.IRON_NUGGET), conditionsFromItem(Items.IRON_NUGGET))
.offerTo(exporter, Registries.ITEM.getId(NSE_Custom.VINTAGE_POST_LAMP.asItem()) + "_basic");
ShapelessRecipeJsonBuilder.create(RecipeCategory.DECORATIONS, NSE_Custom.VINTAGE_POST_LAMP).input(NSE_Custom.CAGED_POST_LAMP).input(Items.IRON_INGOT).criterion(FabricRecipeProvider.hasItem(NSE_Custom.VINTAGE_POST_LAMP),
FabricRecipeProvider.conditionsFromItem(NSE_Custom.VINTAGE_POST_LAMP)).criterion(FabricRecipeProvider.hasItem(NSE_Custom.CAGED_POST_LAMP),
FabricRecipeProvider.conditionsFromItem(NSE_Custom.VINTAGE_POST_LAMP)).criterion(FabricRecipeProvider.hasItem(Items.IRON_INGOT),
FabricRecipeProvider.conditionsFromItem(NSE_Custom.VINTAGE_POST_LAMP)).offerTo(exporter, Registries.ITEM.getId(NSE_Custom.VINTAGE_POST_LAMP.asItem()) + "_add_ingot");
ShapedRecipeJsonBuilder.create(RecipeCategory.DECORATIONS, NSE_Custom.SIREN, 1)
.input('R', Items.REDSTONE).input('N', Blocks.NOTE_BLOCK).input('I', Items.IRON_NUGGET)
.pattern(" ").pattern("IRI").pattern("NIN")
@ -871,5 +906,12 @@ public class RecipeGenerator extends FabricRecipeProvider {
List.of(NSE_Blocks.GREEN_LINOLEUM.asItem(), NSE_Blocks.ORANGE_LINOLEUM.asItem(), NSE_Blocks.BLUE_LINOLEUM.asItem(),
NSE_Blocks.RED_LINOLEUM.asItem(), NSE_Blocks.GRAY_LINOLEUM.asItem(), NSE_Blocks.BROWN_LINOLEUM.asItem(), NSE_Blocks.CYAN_LINOLEUM.asItem()),
"linoleum");
ShapedRecipeJsonBuilder.create(RecipeCategory.TOOLS, NSE_Items.SCREWDRIVER, 1)
.input('I', Items.IRON_INGOT).input('S', Items.STICK)
.pattern("I").pattern("S")
.criterion(hasItem(Items.IRON_INGOT), conditionsFromItem(Items.IRON_INGOT))
.criterion(hasItem(Items.STICK), conditionsFromItem(Items.STICK))
.offerTo(exporter);
}
}