diff --git a/CHANGES.txt b/CHANGES.txt deleted file mode 100644 index cd7a044..0000000 --- a/CHANGES.txt +++ /dev/null @@ -1,5 +0,0 @@ -Изменения от изначальной загрузки - -* правила пирата номер 1, никогда не говори что украл. "Лицензию" звуков убрал -* вернул улучшенную мину -* SwitchBlock это на 90% LeverBlock, добавил иерархию ООП. Также починил пару вещей связанных с ним. diff --git a/TODO.md b/TODO.md index 34b1548..3941465 100644 --- a/TODO.md +++ b/TODO.md @@ -1,9 +1,10 @@ === Andrew71 agenda (14.08.23) === * Minotaur publishing -* Set up curse page and make something like minotaur there +* Set up curse page and make something like minotaur there. NB: Check cursegradle? * Set up gitea maven * Fix GitHub mirror * Make good README.md stuff +* Revise all new code for issues === STUFF TO ADD/FIX === * Add slab and stair variations diff --git a/src/main/java/su/a71/new_soviet/Materials/NSE_ToolMaterials.java b/src/main/java/su/a71/new_soviet/Materials/NSE_ToolMaterials.java index 09334b9..213d571 100644 --- a/src/main/java/su/a71/new_soviet/Materials/NSE_ToolMaterials.java +++ b/src/main/java/su/a71/new_soviet/Materials/NSE_ToolMaterials.java @@ -4,7 +4,6 @@ import net.fabricmc.yarn.constants.MiningLevels; import net.minecraft.item.Items; import net.minecraft.item.ToolMaterial; import net.minecraft.recipe.Ingredient; -import net.minecraft.registry.tag.ItemTags; import net.minecraft.util.Lazy; import java.util.function.Supplier; diff --git a/src/main/java/su/a71/new_soviet/blocks/CeilingFanBlock.java b/src/main/java/su/a71/new_soviet/blocks/CeilingFanBlock.java index 16f8838..fcb4aab 100644 --- a/src/main/java/su/a71/new_soviet/blocks/CeilingFanBlock.java +++ b/src/main/java/su/a71/new_soviet/blocks/CeilingFanBlock.java @@ -19,8 +19,6 @@ import net.minecraft.world.World; import net.minecraft.world.WorldAccess; import net.minecraft.world.WorldView; -import net.minecraft.block.RedstoneLampBlock; -import net.minecraft.block.TorchBlock; import org.jetbrains.annotations.Nullable; public class CeilingFanBlock extends Block implements Waterloggable { diff --git a/src/main/java/su/a71/new_soviet/blocks/LampBlock.java b/src/main/java/su/a71/new_soviet/blocks/LampBlock.java index 510799e..4865a50 100644 --- a/src/main/java/su/a71/new_soviet/blocks/LampBlock.java +++ b/src/main/java/su/a71/new_soviet/blocks/LampBlock.java @@ -16,9 +16,8 @@ import net.minecraft.util.shape.VoxelShapes; import net.minecraft.world.BlockView; import net.minecraft.world.WorldAccess; import net.minecraft.world.WorldView; -import org.jetbrains.annotations.Nullable; -import java.util.function.ToIntFunction; +import org.jetbrains.annotations.Nullable; public class LampBlock extends Block implements Waterloggable { public static final BooleanProperty HANGING; diff --git a/src/main/java/su/a71/new_soviet/blocks/LandMineBlock.java b/src/main/java/su/a71/new_soviet/blocks/LandMineBlock.java index a519d6f..1a72186 100644 --- a/src/main/java/su/a71/new_soviet/blocks/LandMineBlock.java +++ b/src/main/java/su/a71/new_soviet/blocks/LandMineBlock.java @@ -23,10 +23,10 @@ import net.minecraft.world.World; import net.minecraft.world.WorldAccess; import net.minecraft.world.WorldView; import net.minecraft.world.explosion.Explosion; + import org.jetbrains.annotations.Nullable; import su.a71.new_soviet.NewSoviet; - public class LandMineBlock extends HorizontalFacingBlock implements Waterloggable { public static final BooleanProperty WATERLOGGED; protected static final VoxelShape SHAPE; 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 d72d240..4562b7b 100644 --- a/src/main/java/su/a71/new_soviet/blocks/LightBulbBlock.java +++ b/src/main/java/su/a71/new_soviet/blocks/LightBulbBlock.java @@ -1,7 +1,6 @@ package su.a71.new_soviet.blocks; import net.minecraft.block.*; -import net.minecraft.particle.DustParticleEffect; import net.minecraft.text.Text; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.projectile.ProjectileEntity; @@ -26,10 +25,12 @@ import net.minecraft.world.BlockView; import net.minecraft.world.World; import net.minecraft.world.WorldAccess; import net.minecraft.world.WorldView; + import org.jetbrains.annotations.Nullable; import su.a71.new_soviet.NewSoviet; import su.a71.new_soviet.registration.NSE_Custom; import su.a71.new_soviet.registration.NSE_Items; +import su.a71.new_soviet.registration.NSE_Sounds; public class LightBulbBlock extends Block implements Waterloggable { protected static final VoxelShape SHAPE; @@ -98,7 +99,7 @@ public class LightBulbBlock extends Block implements Waterloggable { @Override public void onProjectileHit(World world, BlockState state, BlockHitResult hit, ProjectileEntity projectile) { if (!state.get(BROKEN)) { - world.playSound((PlayerEntity)null, hit.getBlockPos().getX(), hit.getBlockPos().getY(), hit.getBlockPos().getZ(), NSE_Custom.LIGHT_BULB_BROKEN_SOUND, SoundCategory.NEUTRAL, 0.8f, 1f); + world.playSound((PlayerEntity)null, hit.getBlockPos().getX(), hit.getBlockPos().getY(), hit.getBlockPos().getZ(), NSE_Sounds.LIGHT_BULB_BROKEN_SOUND, SoundCategory.NEUTRAL, 0.8f, 1f); } world.setBlockState(hit.getBlockPos(), (BlockState)state.with(BROKEN, true).with(ON, false), 2); super.onProjectileHit(world, state, hit, projectile); diff --git a/src/main/java/su/a71/new_soviet/blocks/SirenBlock.java b/src/main/java/su/a71/new_soviet/blocks/SirenBlock.java index 9368d05..ae84777 100644 --- a/src/main/java/su/a71/new_soviet/blocks/SirenBlock.java +++ b/src/main/java/su/a71/new_soviet/blocks/SirenBlock.java @@ -19,11 +19,11 @@ import net.minecraft.util.math.random.Random; import net.minecraft.util.shape.VoxelShape; import net.minecraft.util.shape.VoxelShapes; import net.minecraft.world.BlockView; - import net.minecraft.world.World; import net.minecraft.world.WorldAccess; import net.minecraft.world.WorldView; -import su.a71.new_soviet.registration.NSE_Custom; + +import su.a71.new_soviet.registration.NSE_Sounds; public class SirenBlock extends HorizontalFacingBlock implements Waterloggable { public static final BooleanProperty ON; @@ -46,7 +46,7 @@ public class SirenBlock extends HorizontalFacingBlock implements Waterloggable { if (bl) { world.scheduleBlockTick(pos, this, 4); } else { - world.playSound((PlayerEntity)null, pos.getX(), pos.getY(), pos.getZ(), NSE_Custom.SIREN_SOUND, SoundCategory.NEUTRAL, getSirenVolume(world, pos), 1f); + world.playSound((PlayerEntity)null, pos.getX(), pos.getY(), pos.getZ(), NSE_Sounds.SIREN_SOUND, SoundCategory.NEUTRAL, getSirenVolume(world, pos), 1f); world.setBlockState(pos, (BlockState)state.cycle(ON), 2); world.scheduleBlockTick(pos, this, 140); } @@ -90,7 +90,7 @@ public class SirenBlock extends HorizontalFacingBlock implements Waterloggable { if ((Boolean)state.get(ON) && !world.isReceivingRedstonePower(pos)) { world.setBlockState(pos, (BlockState)state.cycle(ON), 2); } else { - world.playSound((PlayerEntity)null, pos.getX(), pos.getY(), pos.getZ(), NSE_Custom.SIREN_SOUND, SoundCategory.NEUTRAL, getSirenVolume(world, pos), 1f); + world.playSound((PlayerEntity)null, pos.getX(), pos.getY(), pos.getZ(), NSE_Sounds.SIREN_SOUND, SoundCategory.NEUTRAL, getSirenVolume(world, pos), 1f); world.scheduleBlockTick(pos, this, 140); } } diff --git a/src/main/java/su/a71/new_soviet/blocks/StoveBlock.java b/src/main/java/su/a71/new_soviet/blocks/StoveBlock.java index 78d0892..5aa8b40 100644 --- a/src/main/java/su/a71/new_soviet/blocks/StoveBlock.java +++ b/src/main/java/su/a71/new_soviet/blocks/StoveBlock.java @@ -16,6 +16,7 @@ import net.minecraft.util.math.Direction; import net.minecraft.util.shape.VoxelShape; import net.minecraft.util.shape.VoxelShapes; import net.minecraft.world.BlockView; + import org.jetbrains.annotations.Nullable; public class StoveBlock extends BlockWithEntity { diff --git a/src/main/java/su/a71/new_soviet/blocks/SwitchBlock.java b/src/main/java/su/a71/new_soviet/blocks/SwitchBlock.java index 95dee14..0a26a95 100644 --- a/src/main/java/su/a71/new_soviet/blocks/SwitchBlock.java +++ b/src/main/java/su/a71/new_soviet/blocks/SwitchBlock.java @@ -9,7 +9,6 @@ import net.minecraft.entity.player.PlayerEntity; import net.minecraft.particle.DustParticleEffect; import net.minecraft.sound.BlockSoundGroup; import net.minecraft.sound.SoundCategory; -import net.minecraft.sound.SoundEvents; import net.minecraft.state.StateManager; import net.minecraft.state.property.BooleanProperty; import net.minecraft.state.property.Properties; @@ -23,10 +22,9 @@ import net.minecraft.util.shape.VoxelShape; import net.minecraft.world.BlockView; import net.minecraft.world.World; import net.minecraft.world.WorldAccess; -import net.minecraft.world.WorldView; import net.minecraft.world.event.GameEvent; -import su.a71.new_soviet.NewSoviet; -import su.a71.new_soviet.sounds.Sounds; + +import su.a71.new_soviet.registration.NSE_Sounds; public class SwitchBlock extends LeverBlock { public static final BooleanProperty POWERED = Properties.POWERED; @@ -86,7 +84,7 @@ public class SwitchBlock extends LeverBlock { } BlockState blockState = this.togglePower(state, world, pos); float f = blockState.get(POWERED) != false ? 1f : 0.9f; - world.playSound(null, pos, Sounds.SWITCH_PRESS, SoundCategory.BLOCKS, 0.6f, f); + world.playSound(null, pos, NSE_Sounds.SWITCH_PRESS, SoundCategory.BLOCKS, 0.6f, f); world.emitGameEvent((Entity)player, blockState.get(POWERED) != false ? GameEvent.BLOCK_ACTIVATE : GameEvent.BLOCK_DEACTIVATE, pos); return ActionResult.CONSUME; } diff --git a/src/main/java/su/a71/new_soviet/blocks/TVBlock.java b/src/main/java/su/a71/new_soviet/blocks/TVBlock.java index 13976c1..d350e79 100644 --- a/src/main/java/su/a71/new_soviet/blocks/TVBlock.java +++ b/src/main/java/su/a71/new_soviet/blocks/TVBlock.java @@ -12,6 +12,7 @@ import net.minecraft.util.math.Direction; import net.minecraft.util.shape.VoxelShape; import net.minecraft.util.shape.VoxelShapes; import net.minecraft.world.BlockView; + import su.a71.new_soviet.entity.TVBlockEntity; public class TVBlock extends HorizontalFacingBlock implements BlockEntityProvider { diff --git a/src/main/java/su/a71/new_soviet/entity/TVBlockEntity.java b/src/main/java/su/a71/new_soviet/entity/TVBlockEntity.java index 1d27136..4cc51e9 100644 --- a/src/main/java/su/a71/new_soviet/entity/TVBlockEntity.java +++ b/src/main/java/su/a71/new_soviet/entity/TVBlockEntity.java @@ -1,18 +1,16 @@ package su.a71.new_soviet.entity; -import io.netty.channel.unix.Errors; import net.minecraft.block.BlockState; import net.minecraft.block.entity.BlockEntity; -import net.minecraft.block.entity.BlockEntityType; import net.minecraft.nbt.NbtCompound; import net.minecraft.network.listener.ClientPlayPacketListener; import net.minecraft.network.packet.Packet; import net.minecraft.network.packet.s2c.play.BlockEntityUpdateS2CPacket; import net.minecraft.util.math.BlockPos; -import org.jetbrains.annotations.Nullable; -import su.a71.new_soviet.registration.NSE_Custom; +import org.jetbrains.annotations.Nullable; import java.util.Arrays; +import su.a71.new_soviet.registration.NSE_Custom; public class TVBlockEntity extends BlockEntity { /* diff --git a/src/main/java/su/a71/new_soviet/items/DiceItem.java b/src/main/java/su/a71/new_soviet/items/DiceItem.java index 65ecbaa..d5bcf22 100644 --- a/src/main/java/su/a71/new_soviet/items/DiceItem.java +++ b/src/main/java/su/a71/new_soviet/items/DiceItem.java @@ -10,11 +10,11 @@ import net.minecraft.text.Text; import net.minecraft.util.Hand; import net.minecraft.util.TypedActionResult; import net.minecraft.world.World; -import org.jetbrains.annotations.Nullable; -import su.a71.new_soviet.NewSoviet; -import su.a71.new_soviet.sounds.Sounds; +import org.jetbrains.annotations.Nullable; import java.util.List; +import su.a71.new_soviet.NewSoviet; +import su.a71.new_soviet.registration.NSE_Sounds; public class DiceItem extends Item { private final int sides; @@ -32,7 +32,7 @@ public class DiceItem extends Item { if (!world.isClient) { StringBuilder output = new StringBuilder(); for (var i = 0; i < itemStack.getCount(); i++) { - world.playSound((PlayerEntity)null, user.getX(), user.getY(), user.getZ(), Sounds.DICE_SOUND, SoundCategory.NEUTRAL, 0.5F, 0.4F / (world.getRandom().nextFloat() * 0.4F + 0.8F)); + world.playSound((PlayerEntity)null, user.getX(), user.getY(), user.getZ(), NSE_Sounds.DICE_SOUND, SoundCategory.NEUTRAL, 0.5F, 0.4F / (world.getRandom().nextFloat() * 0.4F + 0.8F)); output.append(NewSoviet.RANDOM.nextBetween(1, this.getSides())).append(", "); } user.sendMessage(Text.translatable(itemStack.getCount() == 1 ? "item.new_soviet.dice.thrown" : "item.new_soviet.dice.thrown_multiple").append(" " + output.subSequence(0, output.length() - 2))); diff --git a/src/main/java/su/a71/new_soviet/items/RakeItem.java b/src/main/java/su/a71/new_soviet/items/RakeItem.java index 6b37dc1..5063726 100644 --- a/src/main/java/su/a71/new_soviet/items/RakeItem.java +++ b/src/main/java/su/a71/new_soviet/items/RakeItem.java @@ -14,15 +14,13 @@ 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.sounds.Sounds; +import su.a71.new_soviet.registration.NSE_Sounds; import su.a71.new_soviet.util.NSE_Tags; import java.util.Map; import java.util.function.Consumer; import java.util.function.Predicate; - - public class RakeItem extends MiningToolItem { protected static final Map, Consumer>> 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)))); @@ -41,7 +39,7 @@ public class RakeItem extends MiningToolItem { Consumer consumer = pair.getSecond(); if (predicate.test(context)) { PlayerEntity playerEntity = context.getPlayer(); - world.playSound(playerEntity, blockPos, Sounds.ITEM_RAKE_TILL, SoundCategory.BLOCKS, 1.0f, 1.0f); + world.playSound(playerEntity, blockPos, NSE_Sounds.ITEM_RAKE_TILL, SoundCategory.BLOCKS, 1.0f, 1.0f); if (!world.isClient) { consumer.accept(context); if (playerEntity != null) { diff --git a/src/main/java/su/a71/new_soviet/registration/NSE_BaseRegistration.java b/src/main/java/su/a71/new_soviet/registration/NSE_BaseRegistration.java index 11a0e49..94f62ce 100644 --- a/src/main/java/su/a71/new_soviet/registration/NSE_BaseRegistration.java +++ b/src/main/java/su/a71/new_soviet/registration/NSE_BaseRegistration.java @@ -9,11 +9,12 @@ import net.minecraft.item.ItemGroup; import net.minecraft.registry.Registries; import net.minecraft.registry.Registry; import net.minecraft.registry.RegistryKey; +import net.minecraft.sound.SoundEvent; import net.minecraft.util.Identifier; -import su.a71.new_soviet.NewSoviet; import java.util.Optional; import java.util.function.Supplier; +import su.a71.new_soviet.NewSoviet; public class NSE_BaseRegistration { @@ -33,5 +34,10 @@ public class NSE_BaseRegistration { registerItem(name, () -> blockItem, tab); } + public static SoundEvent registerSoundEvent(String name) { + Identifier id = new Identifier(NewSoviet.MOD_ID, name); + return Registry.register(Registries.SOUND_EVENT, id, SoundEvent.of(id)); + } + public static void init() {} } diff --git a/src/main/java/su/a71/new_soviet/registration/NSE_Blocks.java b/src/main/java/su/a71/new_soviet/registration/NSE_Blocks.java index 6d3d88f..39bcbdf 100644 --- a/src/main/java/su/a71/new_soviet/registration/NSE_Blocks.java +++ b/src/main/java/su/a71/new_soviet/registration/NSE_Blocks.java @@ -14,12 +14,11 @@ import net.minecraft.util.DyeColor; import net.minecraft.util.Identifier; import su.a71.new_soviet.blocks.ConcreteWithBarsBlock; -import su.a71.new_soviet.sounds.Sounds; public class NSE_Blocks extends NSE_BaseRegistration { // BUILDING BRICKS/TILES ==================== - public static final Block SAND_TILES = new Block(FabricBlockSettings.create().sounds(Sounds.SAND_TILES_SOUNDS).hardness(1.5f).requiresTool().resistance(6f).mapColor(MapColor.TERRACOTTA_BROWN)); + public static final Block SAND_TILES = new Block(FabricBlockSettings.create().sounds(NSE_Sounds.SAND_TILES_SOUNDS).hardness(1.5f).requiresTool().resistance(6f).mapColor(MapColor.TERRACOTTA_BROWN)); public static final StairsBlock SAND_TILES_STAIRS = new StairsBlock(SAND_TILES.getDefaultState(), FabricBlockSettings.copy(SAND_TILES)); public static final Block CRACKED_SAND_TILES = new Block(FabricBlockSettings.copy(SAND_TILES)); public static final Block MOSSY_SAND_TILES = new Block(FabricBlockSettings.copy(SAND_TILES)); @@ -163,24 +162,24 @@ public class NSE_Blocks extends NSE_BaseRegistration { public static final ConcreteWithBarsBlock GREEN_CONCRETE_WITH_BARS = new ConcreteWithBarsBlock(FabricBlockSettings.copy(WHITE_CONCRETE).mapColor(MapColor.TERRACOTTA_GREEN)); // WOOD/FLOOR ========== - public static final Block HERRINGBONE_ACACIA_PLANKS = new Block(FabricBlockSettings.copy(Blocks.ACACIA_PLANKS).sounds(Sounds.PARQUET_SOUNDS)); - public static final Block CROSS_ACACIA_PLANKS = new Block(FabricBlockSettings.copy(Blocks.ACACIA_PLANKS).sounds(Sounds.PARQUET_SOUNDS)); - public static final Block HERRINGBONE_OAK_PLANKS = new Block(FabricBlockSettings.copy(Blocks.OAK_PLANKS).sounds(Sounds.PARQUET_SOUNDS)); - public static final Block CROSS_OAK_PLANKS = new Block(FabricBlockSettings.copy(Blocks.OAK_PLANKS).sounds(Sounds.PARQUET_SOUNDS)); - public static final Block HERRINGBONE_BIRCH_PLANKS = new Block(FabricBlockSettings.copy(Blocks.BIRCH_PLANKS).sounds(Sounds.PARQUET_SOUNDS)); - public static final Block CROSS_BIRCH_PLANKS = new Block(FabricBlockSettings.copy(Blocks.BIRCH_PLANKS).sounds(Sounds.PARQUET_SOUNDS)); - public static final Block HERRINGBONE_CRIMSON_PLANKS = new Block(FabricBlockSettings.copy(Blocks.CRIMSON_PLANKS).sounds(Sounds.PARQUET_SOUNDS)); - public static final Block CROSS_CRIMSON_PLANKS = new Block(FabricBlockSettings.copy(Blocks.CRIMSON_PLANKS).sounds(Sounds.PARQUET_SOUNDS)); - public static final Block HERRINGBONE_DARK_OAK_PLANKS = new Block(FabricBlockSettings.copy(Blocks.DARK_OAK_PLANKS).sounds(Sounds.PARQUET_SOUNDS)); - public static final Block CROSS_DARK_OAK_PLANKS = new Block(FabricBlockSettings.copy(Blocks.DARK_OAK_PLANKS).sounds(Sounds.PARQUET_SOUNDS)); - public static final Block HERRINGBONE_JUNGLE_PLANKS = new Block(FabricBlockSettings.copy(Blocks.JUNGLE_PLANKS).sounds(Sounds.PARQUET_SOUNDS)); - public static final Block CROSS_JUNGLE_PLANKS = new Block(FabricBlockSettings.copy(Blocks.JUNGLE_PLANKS).sounds(Sounds.PARQUET_SOUNDS)); - public static final Block HERRINGBONE_MANGROVE_PLANKS = new Block(FabricBlockSettings.copy(Blocks.MANGROVE_PLANKS).sounds(Sounds.PARQUET_SOUNDS)); - public static final Block CROSS_MANGROVE_PLANKS = new Block(FabricBlockSettings.copy(Blocks.MANGROVE_PLANKS).sounds(Sounds.PARQUET_SOUNDS)); - public static final Block HERRINGBONE_SPRUCE_PLANKS = new Block(FabricBlockSettings.copy(Blocks.SPRUCE_PLANKS).sounds(Sounds.PARQUET_SOUNDS)); - public static final Block CROSS_SPRUCE_PLANKS = new Block(FabricBlockSettings.copy(Blocks.SPRUCE_PLANKS).sounds(Sounds.PARQUET_SOUNDS)); + public static final Block HERRINGBONE_ACACIA_PLANKS = new Block(FabricBlockSettings.copy(Blocks.ACACIA_PLANKS).sounds(NSE_Sounds.PARQUET_SOUNDS)); + public static final Block CROSS_ACACIA_PLANKS = new Block(FabricBlockSettings.copy(Blocks.ACACIA_PLANKS).sounds(NSE_Sounds.PARQUET_SOUNDS)); + public static final Block HERRINGBONE_OAK_PLANKS = new Block(FabricBlockSettings.copy(Blocks.OAK_PLANKS).sounds(NSE_Sounds.PARQUET_SOUNDS)); + public static final Block CROSS_OAK_PLANKS = new Block(FabricBlockSettings.copy(Blocks.OAK_PLANKS).sounds(NSE_Sounds.PARQUET_SOUNDS)); + public static final Block HERRINGBONE_BIRCH_PLANKS = new Block(FabricBlockSettings.copy(Blocks.BIRCH_PLANKS).sounds(NSE_Sounds.PARQUET_SOUNDS)); + public static final Block CROSS_BIRCH_PLANKS = new Block(FabricBlockSettings.copy(Blocks.BIRCH_PLANKS).sounds(NSE_Sounds.PARQUET_SOUNDS)); + public static final Block HERRINGBONE_CRIMSON_PLANKS = new Block(FabricBlockSettings.copy(Blocks.CRIMSON_PLANKS).sounds(NSE_Sounds.PARQUET_SOUNDS)); + public static final Block CROSS_CRIMSON_PLANKS = new Block(FabricBlockSettings.copy(Blocks.CRIMSON_PLANKS).sounds(NSE_Sounds.PARQUET_SOUNDS)); + public static final Block HERRINGBONE_DARK_OAK_PLANKS = new Block(FabricBlockSettings.copy(Blocks.DARK_OAK_PLANKS).sounds(NSE_Sounds.PARQUET_SOUNDS)); + public static final Block CROSS_DARK_OAK_PLANKS = new Block(FabricBlockSettings.copy(Blocks.DARK_OAK_PLANKS).sounds(NSE_Sounds.PARQUET_SOUNDS)); + public static final Block HERRINGBONE_JUNGLE_PLANKS = new Block(FabricBlockSettings.copy(Blocks.JUNGLE_PLANKS).sounds(NSE_Sounds.PARQUET_SOUNDS)); + public static final Block CROSS_JUNGLE_PLANKS = new Block(FabricBlockSettings.copy(Blocks.JUNGLE_PLANKS).sounds(NSE_Sounds.PARQUET_SOUNDS)); + public static final Block HERRINGBONE_MANGROVE_PLANKS = new Block(FabricBlockSettings.copy(Blocks.MANGROVE_PLANKS).sounds(NSE_Sounds.PARQUET_SOUNDS)); + public static final Block CROSS_MANGROVE_PLANKS = new Block(FabricBlockSettings.copy(Blocks.MANGROVE_PLANKS).sounds(NSE_Sounds.PARQUET_SOUNDS)); + public static final Block HERRINGBONE_SPRUCE_PLANKS = new Block(FabricBlockSettings.copy(Blocks.SPRUCE_PLANKS).sounds(NSE_Sounds.PARQUET_SOUNDS)); + public static final Block CROSS_SPRUCE_PLANKS = new Block(FabricBlockSettings.copy(Blocks.SPRUCE_PLANKS).sounds(NSE_Sounds.PARQUET_SOUNDS)); - public static final Block HERRINGBONE_PARQUET = new Block(FabricBlockSettings.create().sounds(Sounds.PARQUET_SOUNDS).strength(2f, 3f).mapColor(MapColor.OAK_TAN)); + public static final Block HERRINGBONE_PARQUET = new Block(FabricBlockSettings.create().sounds(NSE_Sounds.PARQUET_SOUNDS).strength(2f, 3f).mapColor(MapColor.OAK_TAN)); public static final Block STRAIGHT_PARQUET = new Block(FabricBlockSettings.copy(HERRINGBONE_PARQUET)); public static final Block SEPARATED_PARQUET = new Block(FabricBlockSettings.copy(HERRINGBONE_PARQUET)); @@ -220,12 +219,12 @@ public class NSE_Blocks extends NSE_BaseRegistration { public static final WallBlock CONCRETE_WALL = new WallBlock(FabricBlockSettings.create().sounds(BlockSoundGroup.STONE).mapColor(MapColor.STONE_GRAY)); // WALLPAPER BLOCKS ========== - public static final Block GREEN_WALLPAPER = new Block(FabricBlockSettings.create().sounds(Sounds.WALLPAPER_BLOCK_SOUNDS).nonOpaque().mapColor(MapColor.DARK_GREEN).hardness(10f)); + public static final Block GREEN_WALLPAPER = new Block(FabricBlockSettings.create().sounds(NSE_Sounds.WALLPAPER_BLOCK_SOUNDS).nonOpaque().mapColor(MapColor.DARK_GREEN).hardness(10f)); public static final Block BROWN_WALLPAPER = new Block(FabricBlockSettings.copy(GREEN_WALLPAPER).mapColor(MapColor.BROWN)); public static final Block BEIGE_WALLPAPER = new Block(FabricBlockSettings.copy(GREEN_WALLPAPER).mapColor(MapColor.DIRT_BROWN)); // MEAT (cursed...) ========== - public static final Block MEAT = new Block(FabricBlockSettings.create().velocityMultiplier(0.8f).sounds(Sounds.MEAT_SOUNDS).nonOpaque().mapColor(MapColor.DARK_RED).hardness(8f)); + public static final Block MEAT = new Block(FabricBlockSettings.create().velocityMultiplier(0.8f).sounds(NSE_Sounds.MEAT_SOUNDS).nonOpaque().mapColor(MapColor.DARK_RED).hardness(8f)); public static final Block MEAT_EYE = new Block(FabricBlockSettings.copy(MEAT)); public static final Block MEAT_TEETH = new Block(FabricBlockSettings.copy(MEAT)); public static final SnowBlock PURPLE_GOO = new SnowBlock(FabricBlockSettings.copy(MEAT).hardness(1.2f).nonOpaque()); 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 4e3e934..4b5caf5 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 @@ -34,12 +34,10 @@ public class NSE_Custom extends NSE_BaseRegistration { public static final SwitchBlock SWITCH = new SwitchBlock(FabricBlockSettings.create().sounds(BlockSoundGroup.METAL).notSolid().pistonBehavior(PistonBehavior.DESTROY).strength(1f, 2f).mapColor(MapColor.TERRACOTTA_WHITE)); 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.GLASS).strength(1f, 1.5f).mapColor(MapColor.WHITE)); - public static final SoundEvent LIGHT_BULB_BROKEN_SOUND = SoundEvent.of(new Identifier(NewSoviet.MOD_ID, "light_bulb_broken_sound")); public static final CeilingFanBlock CEILING_FAN = new CeilingFanBlock(FabricBlockSettings.create().sounds(BlockSoundGroup.METAL).strength(1f, 1.5f).mapColor(MapColor.WHITE)); public static final SirenBlock SIREN = new SirenBlock(); - public static final SoundEvent SIREN_SOUND = SoundEvent.of(new Identifier(NewSoviet.MOD_ID, "siren_sound")); public static final SoundEvent ELECTRIC_HIT = SoundEvent.of(new Identifier(NewSoviet.MOD_ID, "electric_hit")); @@ -62,8 +60,5 @@ public class NSE_Custom extends NSE_BaseRegistration { registerBlock("siren", () -> SIREN, NSE_CUSTOM_TAB); registerBlock("landmine", () -> LANDMINE, NSE_CUSTOM_TAB); registerBlock("switch", () -> SWITCH, NSE_CUSTOM_TAB); - - Registry.register(Registries.SOUND_EVENT, new Identifier(NewSoviet.MOD_ID, "siren_sound"), SIREN_SOUND); - Registry.register(Registries.SOUND_EVENT, new Identifier(NewSoviet.MOD_ID, "light_bulb_broken_sound"), LIGHT_BULB_BROKEN_SOUND); } } \ No newline at end of file diff --git a/src/main/java/su/a71/new_soviet/sounds/Sounds.java b/src/main/java/su/a71/new_soviet/registration/NSE_Sounds.java similarity index 63% rename from src/main/java/su/a71/new_soviet/sounds/Sounds.java rename to src/main/java/su/a71/new_soviet/registration/NSE_Sounds.java index 4ea99a0..c29db12 100644 --- a/src/main/java/su/a71/new_soviet/sounds/Sounds.java +++ b/src/main/java/su/a71/new_soviet/registration/NSE_Sounds.java @@ -1,45 +1,34 @@ -package su.a71.new_soviet.sounds; +package su.a71.new_soviet.registration; -import net.minecraft.block.Blocks; -import net.minecraft.sound.SoundEvents; -import su.a71.new_soviet.NewSoviet; -import net.minecraft.registry.Registries; -import net.minecraft.registry.Registry; import net.minecraft.sound.BlockSoundGroup; import net.minecraft.sound.SoundEvent; -import net.minecraft.util.Identifier; -public class Sounds { - //dice sound +public class NSE_Sounds extends NSE_BaseRegistration { public static SoundEvent DICE_SOUND = registerSoundEvent("dice_sound"); - //parquet sounds + public static SoundEvent PARQUET_WALK = registerSoundEvent("parquet_walk"); public static final BlockSoundGroup PARQUET_SOUNDS = new BlockSoundGroup(1f, 1f, - BlockSoundGroup.CHERRY_WOOD.getBreakSound(), Sounds.PARQUET_WALK, BlockSoundGroup.CHERRY_WOOD.getPlaceSound(), - BlockSoundGroup.CHERRY_WOOD.getHitSound(), Sounds.PARQUET_WALK); + BlockSoundGroup.CHERRY_WOOD.getBreakSound(), NSE_Sounds.PARQUET_WALK, BlockSoundGroup.CHERRY_WOOD.getPlaceSound(), + BlockSoundGroup.CHERRY_WOOD.getHitSound(), NSE_Sounds.PARQUET_WALK); - //meat sounds public static final BlockSoundGroup MEAT_SOUNDS = new BlockSoundGroup(1f, 1f, BlockSoundGroup.MUD.getBreakSound(), BlockSoundGroup.HONEY.getStepSound(), BlockSoundGroup.MUD.getPlaceSound(), BlockSoundGroup.MUD.getHitSound(), BlockSoundGroup.HONEY.getStepSound()); - //switch sound public static SoundEvent SWITCH_PRESS = registerSoundEvent("switch_press"); - //sand tiles sounds public static final BlockSoundGroup SAND_TILES_SOUNDS = new BlockSoundGroup(1f, 0.8f, BlockSoundGroup.MUD_BRICKS.getBreakSound(), BlockSoundGroup.DECORATED_POT.getStepSound(), BlockSoundGroup.MUD_BRICKS.getPlaceSound(), BlockSoundGroup.MUD_BRICKS.getHitSound(), BlockSoundGroup.DECORATED_POT.getStepSound()); - //wallpaper block sounds public static final BlockSoundGroup WALLPAPER_BLOCK_SOUNDS = new BlockSoundGroup(1f, 0.7f, BlockSoundGroup.BAMBOO_WOOD.getBreakSound(), BlockSoundGroup.WOOL.getStepSound(), BlockSoundGroup.BAMBOO_WOOD.getPlaceSound(), BlockSoundGroup.WOOL.getHitSound(), BlockSoundGroup.WOOL.getStepSound()); - //rake sound + public static SoundEvent ITEM_RAKE_TILL = registerSoundEvent("item_rake_till"); - private static SoundEvent registerSoundEvent(String name) { - Identifier id = new Identifier(NewSoviet.MOD_ID, name); - return Registry.register(Registries.SOUND_EVENT, id, SoundEvent.of(id)); - } + public static final SoundEvent SIREN_SOUND = registerSoundEvent("siren_sound"); + + public static final SoundEvent LIGHT_BULB_BROKEN_SOUND = registerSoundEvent("light_bulb_broken_sound"); + } \ No newline at end of file