Add antenna and crude Green TV

This commit is contained in:
Andrew-71 2023-10-31 21:34:54 +03:00
parent 4873b24911
commit b37e62cc47
49 changed files with 596 additions and 39 deletions

View file

@ -40,7 +40,7 @@ public class Advancements implements Consumer<Consumer<Advancement>> {
false, // Announcement
false // Hidden
)
.criterion("got_dirt", InventoryChangedCriterion.Conditions.items(Items.DIRT))
.criterion("got_dirt", InventoryChangedCriterion.Conditions.items(Items.DIRT)) // Just a basic criterion
.build(consumer, NewSoviet.MOD_ID + "/root");
// Make a sickle
@ -95,7 +95,7 @@ public class Advancements implements Consumer<Consumer<Advancement>> {
ItemPredicate.Builder.create().tag(NSE_Tags.Items.DICE)))
.build(consumer, NewSoviet.MOD_ID + "/gambler");
// Throw a die 1000 times
// Throw a die 1000 times
Advancement serious_addiction = Advancement.Builder.create()
.display(
NSE_Items.DICE_D20,
@ -126,5 +126,21 @@ public class Advancements implements Consumer<Consumer<Advancement>> {
.parent(gambler)
.criterion("rolled_100_perfect", UsingItemCriterion.Conditions.create(EntityPredicate.Builder.create().type(EntityType.PLAYER).typeSpecific(PlayerPredicate.Builder.create().stat(Stats.CUSTOM.getOrCreateStat(NSE_Stats.ROLL_PERFECT_DICE), NumberRange.IntRange.atLeast(100)).build()), ItemPredicate.Builder.create().tag(NSE_Tags.Items.DICE)))
.build(consumer, NewSoviet.MOD_ID + "/lucky_throw");
// Craft an antenna
Advancement antenna = Advancement.Builder.create()
.display(
NSE_Items.ANTENNA,
Text.translatable("advancement.new_soviet.antenna.name"),
Text.translatable("advancement.new_soviet.antenna.desc"),
new Identifier("textures/gui/advancements/backgrounds/adventure.png"),
AdvancementFrame.TASK,
true, // Toast
true, // Announcement
false // Hidden
)
.parent(root)
.criterion("got_antenna", InventoryChangedCriterion.Conditions.items(NSE_Items.ANTENNA))
.build(consumer, NewSoviet.MOD_ID + "/antenna");
}
}

View file

@ -427,7 +427,8 @@ public class BlockTagGenerator extends FabricTagProvider.BlockTagProvider {
getOrCreateTagBuilder(NSE_Tags.Blocks.TV)
.add(NSE_Custom.TV)
.add(NSE_Custom.RED_TV)
.add(NSE_Custom.BROWN_TV);
.add(NSE_Custom.BROWN_TV)
.add(NSE_Custom.GREEN_TV);
getOrCreateTagBuilder(NSE_Tags.Blocks.SWITCHES)
.add(NSE_Custom.SWITCH)

View file

@ -166,15 +166,21 @@ public class RecipeGenerator extends FabricRecipeProvider {
private void tvRecipe(Consumer<RecipeJsonProvider> exporter, ItemConvertible output, ItemConvertible dye) {
ShapedRecipeJsonBuilder.create(RecipeCategory.DECORATIONS, output, 1)
.pattern("N N")
.pattern("DGD")
.pattern("DRD")
.pattern("TAT")
.pattern("IGI")
.pattern("RDR")
.input('D', dye)
.input('N', Items.IRON_NUGGET)
.input('A', NSE_Items.ANTENNA)
.input('I', Items.IRON_INGOT)
.input('T', Items.IRON_TRAPDOOR)
.input('R', Items.REDSTONE)
.input('G', Items.GLASS_PANE)
.criterion(RecipeProvider.hasItem(Items.IRON_NUGGET),
RecipeProvider.conditionsFromItem(Items.IRON_NUGGET))
.criterion(RecipeProvider.hasItem(Items.IRON_INGOT),
RecipeProvider.conditionsFromItem(Items.IRON_INGOT))
.criterion(RecipeProvider.hasItem(Items.IRON_TRAPDOOR),
RecipeProvider.conditionsFromItem(Items.IRON_TRAPDOOR))
.criterion(RecipeProvider.hasItem(NSE_Items.ANTENNA),
RecipeProvider.conditionsFromItem(NSE_Items.ANTENNA))
.criterion(RecipeProvider.hasItem(Items.GLASS_PANE),
RecipeProvider.conditionsFromItem(Items.GLASS_PANE))
.criterion(RecipeProvider.hasItem(Items.REDSTONE),
@ -204,6 +210,7 @@ public class RecipeGenerator extends FabricRecipeProvider {
tvRecipe(exporter, NSE_Custom.TV, Items.ORANGE_DYE);
tvRecipe(exporter, NSE_Custom.BROWN_TV, Items.BROWN_DYE);
tvRecipe(exporter, NSE_Custom.RED_TV, Items.RED_DYE);
tvRecipe(exporter, NSE_Custom.GREEN_TV, Items.GREEN_DYE);
// Cracked blocks
offerCrackingRecipe(exporter, NSE_Blocks.CRACKED_BRICK_TILES, NSE_Blocks.BRICK_TILES);
@ -542,6 +549,13 @@ public class RecipeGenerator extends FabricRecipeProvider {
.criterion(hasItem(Items.GLOWSTONE_DUST), conditionsFromItem(Items.GLOWSTONE_DUST))
.offerTo(exporter);
ShapedRecipeJsonBuilder.create(RecipeCategory.MISC, NSE_Items.ANTENNA, 1)
.input('I', Items.IRON_INGOT).input('N', Items.IRON_NUGGET)
.pattern("N N").pattern("N N").pattern(" I ")
.criterion(hasItem(Items.IRON_INGOT), conditionsFromItem(Items.IRON_INGOT))
.criterion(hasItem(Items.IRON_NUGGET), conditionsFromItem(Items.IRON_NUGGET))
.offerTo(exporter);
ShapedRecipeJsonBuilder.create(RecipeCategory.DECORATIONS, NSE_Custom.LIGHT_BULB_LAMP, 1)
.input('X', Items.IRON_INGOT).input('Y', Items.IRON_NUGGET).input('Z', NSE_Items.LIGHT_BULB)
.pattern(" X ").pattern(" Y ").pattern(" Z ")

View file

@ -35,7 +35,8 @@ public class NSE_Custom extends NSE_BaseRegistration {
public static final TVBlock TV = new TVBlock(FabricBlockSettings.create().mapColor(MapColor.TERRACOTTA_YELLOW));
public static final TVBlock RED_TV = new TVBlock(FabricBlockSettings.create().mapColor(MapColor.TERRACOTTA_RED));
public static final TVBlock BROWN_TV = new TVBlock(FabricBlockSettings.create().mapColor(MapColor.TERRACOTTA_BROWN));
public static final BlockEntityType<TVBlockEntity> TV_BLOCK_ENTITY = registerBlockEntity("tv_block_entity", TVBlockEntity::new, TV, RED_TV, BROWN_TV);
public static final TVBlock GREEN_TV = new TVBlock(FabricBlockSettings.create().mapColor(MapColor.TERRACOTTA_GREEN));
public static final BlockEntityType<TVBlockEntity> TV_BLOCK_ENTITY = registerBlockEntity("tv_block_entity", TVBlockEntity::new, TV, RED_TV, BROWN_TV, GREEN_TV);
public static final RadioReceiverBlock RADIO_RECEIVER = new RadioReceiverBlock();
@ -103,6 +104,8 @@ public class NSE_Custom extends NSE_BaseRegistration {
registerBlock("tv", () -> TV, NSE_CUSTOM_TAB);
registerBlock("red_tv", () -> RED_TV, NSE_CUSTOM_TAB);
registerBlock("brown_tv", () -> BROWN_TV, NSE_CUSTOM_TAB);
registerBlock("green_tv", () -> GREEN_TV, NSE_CUSTOM_TAB);
registerBlock("radio_receiver", () -> RADIO_RECEIVER, NSE_CUSTOM_TAB);
registerBlock("table_lamp", () -> TABLE_LAMP, NSE_CUSTOM_TAB);
registerBlock("golden_table_lamp", () -> GOLDEN_LAMP, NSE_CUSTOM_TAB);

View file

@ -30,10 +30,11 @@ public class NSE_Items extends NSE_BaseRegistration {
public static final DiceItem DICE_D20 = new DiceItem(20, "item.new_soviet.dice_d20.tooltip", new Item.Settings().maxCount(6));
public static final Item LIGHT_BULB = new Item(new Item.Settings());
public static final Item ANTENNA = new Item(new Item.Settings());
public static final Item CIGARETTE_BUTT = new Item(new Item.Settings());
public static final CigaretteItem CIGARETTE = new CigaretteItem(200, NSE_Items.CIGARETTE_BUTT, "item.new_soviet.tooltip.salute", new Item.Settings());
// public static final MusicDiscItem BATTLE_IS_GOING_AGAIN = new MusicDiscItem(1, NSE_Sounds.MUSIC_LENIN, 123)
// public static final MusicDiscItem BATTLE_IS_GOING_AGAIN = new MusicDiscItem(1, NSE_Sounds.MUSIC_LENIN, 123) TODO: Music pls?
private static final ItemGroup NSE_ITEMS_TAB = FabricItemGroup.builder()
.icon(() -> new ItemStack(SICKLE))
@ -50,6 +51,7 @@ public class NSE_Items extends NSE_BaseRegistration {
registerItem("dice_d4", () -> DICE_D4, NSE_ITEMS_TAB);
registerItem("dice_d20", () -> DICE_D20, NSE_ITEMS_TAB);
registerItem("light_bulb_item", () -> LIGHT_BULB, NSE_ITEMS_TAB);
registerItem("antenna", () -> ANTENNA, NSE_ITEMS_TAB);
registerItem("cigarette", ()-> CIGARETTE, NSE_ITEMS_TAB);
registerItem("cigarette_butt", ()-> CIGARETTE_BUTT, NSE_ITEMS_TAB);
}