diff --git a/src/main/java/su/a71/new_soviet/blocks/FUNC_IDEAS b/src/main/java/su/a71/new_soviet/blocks/FUNC_IDEAS index 674942b..43672b2 100644 --- a/src/main/java/su/a71/new_soviet/blocks/FUNC_IDEAS +++ b/src/main/java/su/a71/new_soviet/blocks/FUNC_IDEAS @@ -1,13 +1,5 @@ Ideas for block functionality -Radio: Inventory where you can put music disks, and a UI to play, shuffle (and pause?) them. Like a jukebox on steroids +Radio: Like a jukebox on steroids. Maybe container for disks, maybe a way to connect to real radio. Who knows. TV: CC compatible peripheral which combines a speaker and an 8x8 monitor -Crate: Inventory, like a barrel but smaller -Air Raid Siren: when powered (?), plays chosen frequency in chosen way at chosen sound. CC Peripheral attached -Lamp: Both bedside and ceiling are one block, Lamp, that functions sort of like a lantern - -Landmine: -попали -> кабум -тронули не лопатой -> кабум 80% -тронули лопатой(сломали) -> 25% кабум -обезвредили лопатой (ПКМ задержать) -> не кабум \ No newline at end of file +Crate: Like a shulker box but much smaller (but cheaper!) \ No newline at end of file diff --git a/src/main/java/su/a71/new_soviet/blocks/LightBulbBlock.java b/src/main/java/su/a71/new_soviet/blocks/LightBulbBlock.java index 2fe414a..85307c5 100644 --- a/src/main/java/su/a71/new_soviet/blocks/LightBulbBlock.java +++ b/src/main/java/su/a71/new_soviet/blocks/LightBulbBlock.java @@ -26,6 +26,7 @@ import net.minecraft.world.WorldAccess; import net.minecraft.world.WorldView; import org.jetbrains.annotations.Nullable; import su.a71.new_soviet.registration.NSE_Custom; +import su.a71.new_soviet.registration.NSE_Items; public class LightBulbBlock extends Block implements Waterloggable { protected static final VoxelShape SHAPE; @@ -69,9 +70,12 @@ public class LightBulbBlock extends Block implements Waterloggable { @Override public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) { -// if (!world.isClient && !state.get(BROKEN)) { -// world.setBlockState(pos, (BlockState)state.with(ON, !state.get(ON)), 1); -// } + if (!world.isClient && state.get(BROKEN) && player.getInventory().getMainHandStack().getItem() == NSE_Items.LIGHT_BULB) { + if (!player.isCreative()) + player.getInventory().getMainHandStack().decrement(1); + world.setBlockState(pos, (BlockState)state.with(BROKEN, false) + .with(ON, world.isReceivingRedstonePower(pos)), 2); + } return super.onUse(state, world, pos, player, hand, hit); } diff --git a/src/main/java/su/a71/new_soviet/registration/NSE_Custom.java b/src/main/java/su/a71/new_soviet/registration/NSE_Custom.java index aeccdde..22a08de 100644 --- a/src/main/java/su/a71/new_soviet/registration/NSE_Custom.java +++ b/src/main/java/su/a71/new_soviet/registration/NSE_Custom.java @@ -29,7 +29,7 @@ public class NSE_Custom { public static final TVBlock BROWN_TV = new TVBlock(FabricBlockSettings.create().mapColor(MapColor.TERRACOTTA_BROWN)); public static final RadioBlock RADIO = new RadioBlock(); public static final LampBlock LAMP = new LampBlock(FabricBlockSettings.create().sounds(BlockSoundGroup.LANTERN).strength(1f, 1.5f).mapColor(MapColor.WHITE)); - public static final LightBulbBlock LIGHT_BULB = new LightBulbBlock(FabricBlockSettings.create().sounds(BlockSoundGroup.LANTERN).strength(1f, 1.5f).mapColor(MapColor.WHITE)); + public static final LightBulbBlock LIGHT_BULB = new LightBulbBlock(FabricBlockSettings.create().sounds(BlockSoundGroup.GLASS).strength(1f, 1.5f).mapColor(MapColor.WHITE)); public static final SoundEvent LIGHT_BULB_BROKEN_SOUND = SoundEvent.of(new Identifier("new_soviet", "light_bulb_broken_sound")); public static final CeilingFanBlock CEILING_FAN = new CeilingFanBlock(FabricBlockSettings.create().sounds(BlockSoundGroup.METAL).strength(1f, 1.5f).mapColor(MapColor.WHITE)); diff --git a/src/main/java/su/a71/new_soviet/registration/NSE_Items.java b/src/main/java/su/a71/new_soviet/registration/NSE_Items.java index ee923f4..434f549 100644 --- a/src/main/java/su/a71/new_soviet/registration/NSE_Items.java +++ b/src/main/java/su/a71/new_soviet/registration/NSE_Items.java @@ -28,16 +28,16 @@ public class NSE_Items { // Like an iron axe but a hoe and slightly faster (-2.8f vs -3.1f) and a bit weaker (6 vs 6.5 damage) public static final ToolItem SICKLE = new HoeItem(ToolMaterials.IRON, 6, -2.8F, new Item.Settings()); - // TODO: Currently same as golden apple public static final FoodComponent COCONUT_FC = (new FoodComponent.Builder()).hunger(4).saturationModifier(1.2F).statusEffect(new StatusEffectInstance(StatusEffects.REGENERATION, 100, 1), 1.0F).statusEffect(new StatusEffectInstance(StatusEffects.ABSORPTION, 2400, 0), 1.0F).alwaysEdible().build(); public static final Item COCONUT = new Item(new Item.Settings().food(COCONUT_FC).rarity(Rarity.EPIC)); public static final DiceItem DICE_D6 = new DiceItem(new Item.Settings().maxCount(6)); public static final DiceD4Item DICE_D4 = new DiceD4Item(new Item.Settings().maxCount(6)); public static final DiceD20Item DICE_D20 = new DiceD20Item(new Item.Settings().maxCount(6)); - public static final SoundEvent DICE_SOUND = SoundEvent.of(new Identifier("new_soviet", "dice_sound")); + public static final Item LIGHT_BULB = new Item(new Item.Settings()); + private static final ItemGroup NSE_ITEMS_TAB = FabricItemGroup.builder() .icon(() -> new ItemStack(SICKLE)) .displayName(Text.translatable("itemGroup.new_soviet.items")) @@ -60,6 +60,7 @@ public class NSE_Items { register("dice_d6", () -> DICE_D6, NSE_ITEMS_TAB); register("dice_d4", () -> DICE_D4, NSE_ITEMS_TAB); register("dice_d20", () -> DICE_D20, NSE_ITEMS_TAB); + register("light_bulb_item", () -> LIGHT_BULB, NSE_ITEMS_TAB); Registry.register(Registries.SOUND_EVENT, new Identifier("new_soviet", "dice_sound"), DICE_SOUND); } diff --git a/src/main/resources/assets/new_soviet/lang/en_us.json b/src/main/resources/assets/new_soviet/lang/en_us.json index 69ffd03..850aa9e 100644 --- a/src/main/resources/assets/new_soviet/lang/en_us.json +++ b/src/main/resources/assets/new_soviet/lang/en_us.json @@ -150,5 +150,6 @@ "block.new_soviet.blue_concrete_with_bars": "Blue Concrete With Bars", "block.new_soviet.red_concrete_with_bars": "Red Concrete With Bars", "subtitles.new_soviet.light_bulb_broken": "Light bulb breaks", - "block.new_soviet.light_bulb": "Light Bulb" + "block.new_soviet.light_bulb": "Light Bulb Lamp", + "item.new_soviet.light_bulb_item": "Light Bulb" } \ No newline at end of file diff --git a/src/main/resources/assets/new_soviet/models/item/light_bulb_item.json b/src/main/resources/assets/new_soviet/models/item/light_bulb_item.json new file mode 100644 index 0000000..d12d23a --- /dev/null +++ b/src/main/resources/assets/new_soviet/models/item/light_bulb_item.json @@ -0,0 +1,7 @@ +{ + "credit": "Karoter2", + "parent": "item/generated", + "textures": { + "layer0": "new_soviet:item/bulb" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/new_soviet/textures/item/bulb.png b/src/main/resources/assets/new_soviet/textures/item/bulb.png new file mode 100644 index 0000000..fa266fd Binary files /dev/null and b/src/main/resources/assets/new_soviet/textures/item/bulb.png differ