Compare commits
4 commits
3ccd39e51a
...
25348f5e72
Author | SHA1 | Date | |
---|---|---|---|
25348f5e72 | |||
a166e94656 | |||
ca2c5aa93e | |||
2dcf58e405 |
28 changed files with 333 additions and 175 deletions
|
@ -1,5 +0,0 @@
|
|||
Изменения от изначальной загрузки
|
||||
|
||||
* правила пирата номер 1, никогда не говори что украл. "Лицензию" звуков убрал
|
||||
* вернул улучшенную мину
|
||||
* SwitchBlock это на 90% LeverBlock, добавил иерархию ООП. Также починил пару вещей связанных с ним.
|
38
TODO.md
38
TODO.md
|
@ -1,38 +1,16 @@
|
|||
# Блоки и функционал
|
||||
## Высокий приоритет
|
||||
Это критично прямо сейчас
|
||||
* Добавить коричневые, жёлтые, красные и зелёные блоки.
|
||||
* Сделать datagen для ступеней и полублоков, затем добавить их
|
||||
=== Andrew71 agenda (14.08.23) ===
|
||||
* Minotaur publishing
|
||||
* Fix GitHub mirror
|
||||
* Make good README.md stuff
|
||||
* Revise all new code for issues
|
||||
|
||||
## Средний приоритет
|
||||
Нужно до 1.0, но не полностью ломает мод
|
||||
* Механика окон
|
||||
* Двери с ключами
|
||||
* Духовка
|
||||
|
||||
## Низкий приоритет
|
||||
* Терминал
|
||||
|
||||
|
||||
=== ADD BLOCKS/FEATURES ===
|
||||
* Add brown+yellow+red+green blocks
|
||||
=== STUFF TO ADD/FIX ===
|
||||
* Add slab and stair variations
|
||||
* Add doors and fences
|
||||
* Add fences
|
||||
* Add windows
|
||||
* Add (with functionality) present appliance/furniture/electronics textures
|
||||
* Figure out what to do with "NII wall", nii floor, tilled block
|
||||
* Add achievement criterion for dice and advancements
|
||||
|
||||
=== FIX STUFF ===
|
||||
* PO2 wall
|
||||
* Crate (likely cheap shulker box with small capacity)
|
||||
|
||||
=== NON-GAME CHANGES ===
|
||||
* Minotaur publishing to modrinth and something similar for curse
|
||||
* git.a71.su maven
|
||||
* Good README.md and icon, assets, screenshots etc.
|
||||
* PO2 wall (fix)
|
||||
|
||||
=== ACHIEVEMENTS ===
|
||||
Kolkhoz warrior - kill a zombie, skeleton, creeper and spider with a sickle
|
||||
|
||||
=== Блоки и функционал ===
|
||||
|
|
26
build.gradle
26
build.gradle
|
@ -1,6 +1,8 @@
|
|||
plugins {
|
||||
id 'fabric-loom' version '1.2-SNAPSHOT'
|
||||
id 'maven-publish'
|
||||
|
||||
id "com.modrinth.minotaur" version "2.+"
|
||||
}
|
||||
|
||||
version = project.mod_version
|
||||
|
@ -79,7 +81,7 @@ jar {
|
|||
}
|
||||
}
|
||||
|
||||
// configure the maven publication
|
||||
// Configure the maven publication
|
||||
publishing {
|
||||
publications {
|
||||
mavenJava(MavenPublication) {
|
||||
|
@ -89,9 +91,23 @@ publishing {
|
|||
|
||||
// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
|
||||
repositories {
|
||||
// Add repositories to publish to here.
|
||||
// Notice: This block does NOT have the same function as the block in the top level.
|
||||
// The repositories here will be used for publishing your artifact, not for
|
||||
// retrieving dependencies.
|
||||
}
|
||||
}
|
||||
|
||||
// Publishing to Modrinth
|
||||
modrinth {
|
||||
token = System.getenv(modrinth_token) // DO NOT REVEAL THE TOKEN!!!
|
||||
projectId = mod_id
|
||||
versionNumber = mod_version
|
||||
versionType = "beta" // `release`, `beta`, `alpha`
|
||||
uploadFile = remapJar // With Loom, this MUST be set to `remapJar` instead of `jar`!
|
||||
gameVersions = ["1.20", "1.20.1"]
|
||||
loaders = ["fabric"]
|
||||
dependencies {
|
||||
// scope.type
|
||||
// The scope can be `required`, `optional`, `incompatible`, or `embedded`
|
||||
// The type can either be `project` or `version`
|
||||
required.project "fabric-api" // Creates a new required dependency on Fabric API
|
||||
// optional.version "sodium", "mc1.19.3-0.4.8" // Creates a new optional dependency on this specific version of Sodium
|
||||
}
|
||||
}
|
|
@ -15,3 +15,6 @@ mod_id=new_soviet
|
|||
|
||||
# Dependencies
|
||||
fabric_version=0.83.0+1.20.1
|
||||
|
||||
# Modrinth publishing
|
||||
modrinth_token=tokenhere
|
|
@ -2,21 +2,65 @@ package su.a71.new_soviet;
|
|||
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.SignBlock;
|
||||
import net.minecraft.block.entity.SignText;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.font.TextRenderer;
|
||||
import net.minecraft.client.render.VertexConsumerProvider;
|
||||
import net.minecraft.client.render.block.entity.BlockEntityRenderer;
|
||||
import net.minecraft.client.render.block.entity.BlockEntityRendererFactory;
|
||||
import net.minecraft.client.render.block.entity.SignBlockEntityRenderer;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.text.OrderedText;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.RotationAxis;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import org.joml.Matrix4f;
|
||||
import su.a71.new_soviet.entity.TVBlockEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Environment(EnvType.CLIENT)
|
||||
public class TVBlockEntityRenderer implements BlockEntityRenderer<TVBlockEntity> {
|
||||
public TVBlockEntityRenderer(BlockEntityRendererFactory.Context ctx) {}
|
||||
private static TextRenderer textRenderer;
|
||||
private static final Vec3d TEXT_OFFSET = new Vec3d(0.0, 0.3333333432674408, 0.046666666865348816);
|
||||
|
||||
|
||||
public TVBlockEntityRenderer(BlockEntityRendererFactory.Context ctx) {
|
||||
textRenderer = ctx.getTextRenderer();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(TVBlockEntity blockEntity, float tickDelta, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, int overlay) {
|
||||
matrices.push();
|
||||
// Rendering stuff here
|
||||
// this.setTextAngles(matrices, true, TEXT_OFFSET);
|
||||
// textRenderer.draw("Test amogus", 0, 0, 999999, false, matrices.peek().getPositionMatrix(), vertexConsumers, TextRenderer.TextLayerType.POLYGON_OFFSET, 19999, light);
|
||||
matrices.pop();
|
||||
|
||||
}
|
||||
|
||||
public float getScale() {
|
||||
return 0.6666667F;
|
||||
}
|
||||
|
||||
|
||||
void setAngles(MatrixStack matrices, float rotationDegrees, BlockState state) {
|
||||
matrices.translate(0.5F, 0.75F * this.getScale(), 0.5F);
|
||||
matrices.multiply(RotationAxis.POSITIVE_Y.rotationDegrees(rotationDegrees));
|
||||
if (!(state.getBlock() instanceof SignBlock)) {
|
||||
matrices.translate(0.0F, -0.3125F, -0.4375F);
|
||||
}
|
||||
}
|
||||
|
||||
private void setTextAngles(MatrixStack matrices, boolean front, Vec3d translation) {
|
||||
if (!front) {
|
||||
matrices.multiply(RotationAxis.POSITIVE_Y.rotationDegrees(180.0F));
|
||||
}
|
||||
|
||||
float f = 0.015625F * this.getScale();
|
||||
matrices.translate(translation.x, translation.y, translation.z);
|
||||
matrices.scale(f, -f, f);
|
||||
}
|
||||
}
|
55
src/main/java/su/a71/new_soviet/Config.java
Normal file
55
src/main/java/su/a71/new_soviet/Config.java
Normal file
|
@ -0,0 +1,55 @@
|
|||
package su.a71.new_soviet;
|
||||
|
||||
import java.io.*;
|
||||
|
||||
public class Config {
|
||||
private boolean invert_lamps = false;
|
||||
|
||||
public static Config INSTANCE;
|
||||
|
||||
public Config() {
|
||||
INSTANCE = this;
|
||||
}
|
||||
|
||||
public boolean shouldInvertLamps() {
|
||||
return invert_lamps;
|
||||
}
|
||||
|
||||
|
||||
private static void generateDefault() {
|
||||
File file = new File("config/new_soviet.json");
|
||||
if(!file.getParentFile().exists()) {
|
||||
file.getParentFile().mkdirs();
|
||||
}
|
||||
INSTANCE = new Config();
|
||||
try {
|
||||
FileWriter writer = new FileWriter(file);
|
||||
writer.write(NewSoviet.GSON.toJson(INSTANCE));
|
||||
writer.close();
|
||||
} catch (Exception e) {
|
||||
INSTANCE = new Config();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void load() {
|
||||
// Generate config if it doesn't exist
|
||||
File file = new File("config/new_soviet.json");
|
||||
if(!file.exists()) {
|
||||
generateDefault();
|
||||
}
|
||||
|
||||
try {
|
||||
BufferedReader reader = new BufferedReader(new FileReader(file));
|
||||
StringBuilder sb = new StringBuilder();
|
||||
String s;
|
||||
while((s = reader.readLine()) != null)
|
||||
sb.append(s);
|
||||
reader.close();
|
||||
|
||||
INSTANCE = NewSoviet.GSON.fromJson(sb.toString(), Config.class);
|
||||
} catch(Exception e) {
|
||||
INSTANCE = new Config();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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;
|
||||
|
|
|
@ -26,6 +26,8 @@ public class NewSoviet implements ModInitializer {
|
|||
|
||||
@Override
|
||||
public void onInitialize() {
|
||||
Config.load();
|
||||
|
||||
NSE_Blocks.init();
|
||||
NSE_Items.init();
|
||||
NSE_Custom.init();
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -2,33 +2,49 @@ package su.a71.new_soviet.blocks;
|
|||
|
||||
import net.minecraft.block.*;
|
||||
import net.minecraft.entity.ai.pathing.NavigationType;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.fluid.FluidState;
|
||||
import net.minecraft.fluid.Fluids;
|
||||
import net.minecraft.item.ItemPlacementContext;
|
||||
import net.minecraft.server.world.ServerWorld;
|
||||
import net.minecraft.state.StateManager;
|
||||
import net.minecraft.state.property.BooleanProperty;
|
||||
import net.minecraft.state.property.Properties;
|
||||
import net.minecraft.state.property.Property;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.hit.BlockHitResult;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Direction;
|
||||
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 org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.function.ToIntFunction;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import su.a71.new_soviet.Config;
|
||||
|
||||
public class LampBlock extends Block implements Waterloggable {
|
||||
public static final BooleanProperty HANGING;
|
||||
public static final BooleanProperty ON;
|
||||
public static final BooleanProperty INVERTED;
|
||||
public static final BooleanProperty WATERLOGGED;
|
||||
protected static final VoxelShape STANDING_SHAPE;
|
||||
protected static final VoxelShape HANGING_SHAPE;
|
||||
protected static final VoxelShape SHAPE;
|
||||
|
||||
public LampBlock(AbstractBlock.Settings settings) {
|
||||
super(settings.luminance((BlockState state) -> 12));
|
||||
this.setDefaultState(this.stateManager.getDefaultState().with(HANGING, false).with(WATERLOGGED, false));
|
||||
super(settings.luminance((BlockState state) -> {
|
||||
if (!state.get(INVERTED)) {
|
||||
return state.get(ON) ? 12 : 0;
|
||||
} else {
|
||||
return state.get(ON) ? 0 : 12;
|
||||
}
|
||||
}));
|
||||
this.setDefaultState(this.stateManager.getDefaultState()
|
||||
.with(INVERTED, false)
|
||||
.with(WATERLOGGED, false)
|
||||
.with(ON, false));
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
@ -37,7 +53,9 @@ public class LampBlock extends Block implements Waterloggable {
|
|||
Direction[] directions = ctx.getPlacementDirections();
|
||||
for (Direction direction : directions) {
|
||||
if (direction.getAxis() == Direction.Axis.Y) {
|
||||
BlockState blockState = this.getDefaultState().with(HANGING, direction == Direction.UP);
|
||||
BlockState blockState = this.getDefaultState()
|
||||
.with(INVERTED, Config.INSTANCE.shouldInvertLamps())
|
||||
.with(ON, ctx.getWorld().isReceivingRedstonePower(ctx.getBlockPos()));
|
||||
if (blockState.canPlaceAt(ctx.getWorld(), ctx.getBlockPos())) {
|
||||
return blockState.with(WATERLOGGED, fluidState.getFluid() == Fluids.WATER);
|
||||
}
|
||||
|
@ -46,12 +64,19 @@ public class LampBlock extends Block implements Waterloggable {
|
|||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) {
|
||||
if (world.isClient) return super.onUse(state, world, pos, player, hand, hit);
|
||||
// world.setBlockState(pos, state.cycle(INVERTED));
|
||||
return super.onUse(state, world, pos, player, hand, hit);
|
||||
}
|
||||
|
||||
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) {
|
||||
return state.get(HANGING) ? HANGING_SHAPE : STANDING_SHAPE;
|
||||
return SHAPE;
|
||||
}
|
||||
|
||||
protected void appendProperties(StateManager.Builder<Block, BlockState> builder) {
|
||||
builder.add(new Property[]{HANGING, WATERLOGGED});
|
||||
builder.add(new Property[]{ON, WATERLOGGED, INVERTED});
|
||||
}
|
||||
|
||||
public boolean canPlaceAt(BlockState state, WorldView world, BlockPos pos) {
|
||||
|
@ -60,7 +85,7 @@ public class LampBlock extends Block implements Waterloggable {
|
|||
}
|
||||
|
||||
protected static Direction attachedDirection(BlockState state) {
|
||||
return state.get(HANGING) ? Direction.DOWN : Direction.UP;
|
||||
return Direction.UP;
|
||||
}
|
||||
|
||||
public BlockState getStateForNeighborUpdate(BlockState state, Direction direction, BlockState neighborState, WorldAccess world, BlockPos pos, BlockPos neighborPos) {
|
||||
|
@ -68,7 +93,7 @@ public class LampBlock extends Block implements Waterloggable {
|
|||
world.scheduleFluidTick(pos, Fluids.WATER, Fluids.WATER.getTickRate(world));
|
||||
}
|
||||
|
||||
return attachedDirection(state).getOpposite() == direction && !state.canPlaceAt(world, pos) ? Blocks.AIR.getDefaultState() : super.getStateForNeighborUpdate(state, direction, neighborState, world, pos, neighborPos);
|
||||
return Direction.DOWN == direction && !state.canPlaceAt(world, pos) ? Blocks.AIR.getDefaultState() : super.getStateForNeighborUpdate(state, direction, neighborState, world, pos, neighborPos);
|
||||
}
|
||||
|
||||
public FluidState getFluidState(BlockState state) {
|
||||
|
@ -79,14 +104,23 @@ public class LampBlock extends Block implements Waterloggable {
|
|||
return false;
|
||||
}
|
||||
|
||||
public static VoxelShape getHangingShape(){
|
||||
VoxelShape shape = VoxelShapes.empty();
|
||||
shape = VoxelShapes.union(shape, VoxelShapes.cuboid(0.34375, -0.221875, 0.34375, 0.65625, 0.090625, 0.65625));
|
||||
shape = VoxelShapes.union(shape, VoxelShapes.cuboid(0.125, 0.0625, 0.125, 0.875, 0.4375, 0.875));
|
||||
shape = VoxelShapes.union(shape, VoxelShapes.cuboid(0.5, 0.5, 0.125, 0.5, 0.875, 0.875));
|
||||
shape = VoxelShapes.union(shape, VoxelShapes.cuboid(0.125, 0.5, 0.5, 0.875, 0.875, 0.5));
|
||||
shape.simplify();
|
||||
return shape;
|
||||
public void neighborUpdate(BlockState state, World world, BlockPos pos, Block sourceBlock, BlockPos sourcePos, boolean notify) {
|
||||
if (!world.isClient) {
|
||||
boolean bl = (Boolean)state.get(ON);
|
||||
if (bl != world.isReceivingRedstonePower(pos)) {
|
||||
if (bl) {
|
||||
world.scheduleBlockTick(pos, this, 4);
|
||||
} else {
|
||||
world.setBlockState(pos, (BlockState)state.cycle(ON), 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void scheduledTick(BlockState state, ServerWorld world, BlockPos pos, Random random) {
|
||||
if ((Boolean)state.get(ON) && !world.isReceivingRedstonePower(pos)) {
|
||||
world.setBlockState(pos, (BlockState)state.cycle(ON), 2);
|
||||
}
|
||||
}
|
||||
|
||||
public static VoxelShape getStandingShape(){
|
||||
|
@ -100,9 +134,9 @@ public class LampBlock extends Block implements Waterloggable {
|
|||
}
|
||||
|
||||
static {
|
||||
HANGING = Properties.HANGING;
|
||||
SHAPE = getStandingShape();
|
||||
ON = RedstoneTorchBlock.LIT;
|
||||
WATERLOGGED = Properties.WATERLOGGED;
|
||||
STANDING_SHAPE = getStandingShape();
|
||||
HANGING_SHAPE = getHangingShape();
|
||||
INVERTED = Properties.INVERTED;
|
||||
}
|
||||
}
|
|
@ -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;
|
||||
|
|
|
@ -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,20 +25,35 @@ 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.Config;
|
||||
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;
|
||||
public static final BooleanProperty ON;
|
||||
public static final BooleanProperty INVERTED;
|
||||
public static final BooleanProperty BROKEN;
|
||||
public static final BooleanProperty WATERLOGGED;
|
||||
|
||||
public LightBulbBlock(Block.Settings settings) {
|
||||
super(settings.luminance((BlockState state) -> state.get(ON) && !state.get(BROKEN) ? 12 : 0));
|
||||
this.setDefaultState((BlockState)this.getDefaultState().with(ON, false).with(BROKEN, false).with(WATERLOGGED, false));
|
||||
super(settings.luminance(((BlockState state) -> {
|
||||
if (state.get(BROKEN)) return 0;
|
||||
if (!state.get(INVERTED)) {
|
||||
return state.get(ON) ? 12 : 0;
|
||||
} else {
|
||||
return state.get(ON) ? 0 : 12;
|
||||
}
|
||||
})));
|
||||
this.setDefaultState((BlockState)this.getDefaultState()
|
||||
.with(ON, false)
|
||||
.with(BROKEN, false)
|
||||
.with(WATERLOGGED, false)
|
||||
.with(INVERTED, false));
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
@ -47,6 +61,7 @@ public class LightBulbBlock extends Block implements Waterloggable {
|
|||
return (BlockState)this.getDefaultState()
|
||||
.with(ON, ctx.getWorld().isReceivingRedstonePower(ctx.getBlockPos()))
|
||||
.with(BROKEN, false)
|
||||
.with(INVERTED, Config.INSTANCE.shouldInvertLamps())
|
||||
.with(WATERLOGGED, ctx.getWorld().getFluidState(ctx.getBlockPos()).getFluid() == Fluids.WATER);
|
||||
}
|
||||
|
||||
|
@ -71,26 +86,30 @@ public class LightBulbBlock extends Block implements Waterloggable {
|
|||
return direction == Direction.UP && !state.canPlaceAt(world, pos) ? Blocks.AIR.getDefaultState() : super.getStateForNeighborUpdate(state, direction, neighborState, world, pos, neighborPos);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) {
|
||||
if (!world.isClient && state.get(BROKEN) && player.getInventory().getMainHandStack().getItem() == NSE_Items.LIGHT_BULB && !world.isReceivingRedstonePower(pos)) {
|
||||
if (world.isClient) return super.onUse(state, world, pos, player, hand, hit);
|
||||
// if (!state.get(BROKEN)) {
|
||||
// world.setBlockState(pos, state.cycle(INVERTED));
|
||||
// return ActionResult.CONSUME;
|
||||
// }
|
||||
|
||||
if (state.get(BROKEN) && player.getInventory().getMainHandStack().getItem() == NSE_Items.LIGHT_BULB && !player.getItemCooldownManager().isCoolingDown(NSE_Items.LIGHT_BULB)) {
|
||||
if (world.isReceivingRedstonePower(pos) == state.get(INVERTED) || (NewSoviet.RANDOM.nextBetween(1, 32) == 1)) {
|
||||
if (!player.isCreative())
|
||||
player.getInventory().getMainHandStack().decrement(1);
|
||||
world.setBlockState(pos, (BlockState)state.with(BROKEN, false));
|
||||
//.with(ON, world.isReceivingRedstonePower(pos)), 2);
|
||||
} else if (!world.isClient && state.get(BROKEN) && player.getInventory().getMainHandStack().getItem() == NSE_Items.LIGHT_BULB) {
|
||||
return ActionResult.CONSUME;
|
||||
} else {
|
||||
player.getItemCooldownManager().set(NSE_Items.LIGHT_BULB, 10);
|
||||
player.sendMessage(Text.translatable("block.new_soviet.light_bulb_block.energized"));
|
||||
world.playSound((PlayerEntity)null, pos.getX(), pos.getY(), pos.getZ(), NSE_Custom.ELECTRIC_HIT, SoundCategory.AMBIENT, 0.8f, 1f);
|
||||
if (!player.isCreative()) {
|
||||
player.heal(-1 * NewSoviet.RANDOM.nextBetween(1, 4));
|
||||
}
|
||||
if (NewSoviet.RANDOM.nextBetween(1, 32) == 1){
|
||||
if (!player.isCreative())
|
||||
player.getInventory().getMainHandStack().decrement(1);
|
||||
world.setBlockState(pos, (BlockState)state.with(BROKEN, false)
|
||||
.with(ON, world.isReceivingRedstonePower(pos)), 2);
|
||||
player.damage(world.getDamageSources().lightningBolt(), NewSoviet.RANDOM.nextBetween(1, 4));
|
||||
}
|
||||
}
|
||||
return ActionResult.CONSUME;
|
||||
}
|
||||
|
||||
return super.onUse(state, world, pos, player, hand, hit);
|
||||
}
|
||||
|
||||
|
@ -98,9 +117,9 @@ 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);
|
||||
world.setBlockState(hit.getBlockPos(), (BlockState)state.with(BROKEN, true), 2);
|
||||
super.onProjectileHit(world, state, hit, projectile);
|
||||
}
|
||||
|
||||
|
@ -111,7 +130,7 @@ public class LightBulbBlock extends Block implements Waterloggable {
|
|||
}
|
||||
|
||||
protected void appendProperties(StateManager.Builder<Block, BlockState> builder) {
|
||||
builder.add(new Property[]{ON, BROKEN, WATERLOGGED});
|
||||
builder.add(new Property[]{ON, BROKEN, WATERLOGGED, INVERTED});
|
||||
}
|
||||
|
||||
public FluidState getFluidState(BlockState state) {
|
||||
|
@ -136,5 +155,6 @@ public class LightBulbBlock extends Block implements Waterloggable {
|
|||
ON = RedstoneTorchBlock.LIT;
|
||||
BROKEN = Properties.CRACKED;
|
||||
WATERLOGGED = Properties.WATERLOGGED;
|
||||
INVERTED = Properties.INVERTED;
|
||||
}
|
||||
}
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
/*
|
||||
|
|
|
@ -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)));
|
||||
|
|
|
@ -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<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))));
|
||||
|
@ -41,7 +39,7 @@ public class RakeItem extends MiningToolItem {
|
|||
Consumer<ItemUsageContext> 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) {
|
||||
|
|
|
@ -2,18 +2,23 @@ package su.a71.new_soviet.registration;
|
|||
|
||||
import net.fabricmc.fabric.api.item.v1.FabricItemSettings;
|
||||
import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents;
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.entity.FabricBlockEntityTypeBuilder;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.block.entity.BlockEntityType;
|
||||
import net.minecraft.item.BlockItem;
|
||||
import net.minecraft.item.Item;
|
||||
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;
|
||||
import su.a71.new_soviet.entity.TVBlockEntity;
|
||||
|
||||
public class NSE_BaseRegistration {
|
||||
|
||||
|
@ -33,5 +38,17 @@ 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 <T extends BlockEntityType> T registerBlockEntity(String name, FabricBlockEntityTypeBuilder.Factory<? extends BlockEntity> factory, net.minecraft.block.Block... blocks) {
|
||||
return (T) Registry.register(
|
||||
Registries.BLOCK_ENTITY_TYPE,
|
||||
new Identifier(NewSoviet.MOD_ID, name),
|
||||
FabricBlockEntityTypeBuilder.create(factory, blocks).build());
|
||||
}
|
||||
|
||||
public static void init() {}
|
||||
}
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -2,7 +2,6 @@ package su.a71.new_soviet.registration;
|
|||
|
||||
import net.fabricmc.fabric.api.itemgroup.v1.FabricItemGroup;
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.entity.FabricBlockEntityTypeBuilder;
|
||||
import net.minecraft.block.AbstractBlock;
|
||||
import net.minecraft.block.MapColor;
|
||||
import net.minecraft.block.entity.BlockEntityType;
|
||||
|
@ -24,22 +23,17 @@ 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 = Registry.register(
|
||||
Registries.BLOCK_ENTITY_TYPE,
|
||||
new Identifier(NewSoviet.MOD_ID, "tv_block_entity"),
|
||||
FabricBlockEntityTypeBuilder.create(TVBlockEntity::new, TV, RED_TV, BROWN_TV).build()
|
||||
);
|
||||
public static final BlockEntityType<TVBlockEntity> TV_BLOCK_ENTITY = registerBlockEntity("tv_block_entity", TVBlockEntity::new, TV, RED_TV, BROWN_TV);
|
||||
|
||||
public static final RadioBlock RADIO = new RadioBlock();
|
||||
|
||||
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 +56,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);
|
||||
}
|
||||
}
|
|
@ -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");
|
||||
|
||||
}
|
|
@ -1,10 +1,10 @@
|
|||
{
|
||||
"variants": {
|
||||
"hanging=false": {
|
||||
"inverted=true": {
|
||||
"model": "new_soviet:block/table_lamp"
|
||||
},
|
||||
"hanging=true": {
|
||||
"model": "new_soviet:block/ceiling_lamp"
|
||||
"inverted=false": {
|
||||
"model": "new_soviet:block/table_lamp"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,15 +1,27 @@
|
|||
{
|
||||
"variants": {
|
||||
"lit=true,cracked=true": {
|
||||
"lit=true,cracked=true,inverted=false": {
|
||||
"model": "new_soviet:block/light_bulb_broken"
|
||||
},
|
||||
"lit=true,cracked=false": {
|
||||
"lit=true,cracked=false,inverted=false": {
|
||||
"model": "new_soviet:block/light_bulb_on"
|
||||
},
|
||||
"lit=false,cracked=false": {
|
||||
"lit=false,cracked=false,inverted=false": {
|
||||
"model": "new_soviet:block/light_bulb_off"
|
||||
},
|
||||
"lit=false,cracked=true": {
|
||||
"lit=false,cracked=true,inverted=false": {
|
||||
"model": "new_soviet:block/light_bulb_broken"
|
||||
},
|
||||
"lit=true,cracked=true,inverted=true": {
|
||||
"model": "new_soviet:block/light_bulb_broken"
|
||||
},
|
||||
"lit=true,cracked=false,inverted=true": {
|
||||
"model": "new_soviet:block/light_bulb_off"
|
||||
},
|
||||
"lit=false,cracked=false,inverted=true": {
|
||||
"model": "new_soviet:block/light_bulb_on"
|
||||
},
|
||||
"lit=false,cracked=true,inverted=true": {
|
||||
"model": "new_soviet:block/light_bulb_broken"
|
||||
}
|
||||
}
|
||||
|
|
BIN
src/main/resources/assets/new_soviet/icon.png
Normal file
BIN
src/main/resources/assets/new_soviet/icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 177 KiB |
|
@ -204,5 +204,6 @@
|
|||
"block.new_soviet.brown_wallpaper": "Brown Wallpaper Block",
|
||||
"block.new_soviet.beige_wallpaper": "Beige Wallpaper Block",
|
||||
"block.new_soviet.purple_goo": "Purple Goo",
|
||||
"subtitles.new_soviet.switch_press": "Switch clicks"
|
||||
"subtitles.new_soviet.switch_press": "Switch clicks",
|
||||
"subtitles.new_soviet.electric_hit": "Electric sparks"
|
||||
}
|
|
@ -12,7 +12,7 @@
|
|||
"homepage": "https://nse.a71.su/",
|
||||
"sources": "https://git.a71.su/Ethyl/New-Soviet-Era"
|
||||
},
|
||||
"license": "All rights reserved",
|
||||
"license": "Mixed: All rights reserved assets & MIT code",
|
||||
"icon": "assets/new_soviet/icon.png",
|
||||
"environment": "*",
|
||||
"entrypoints": {
|
||||
|
@ -31,5 +31,14 @@
|
|||
"minecraft": "~1.20.1",
|
||||
"java": ">=17",
|
||||
"fabric-api": "*"
|
||||
},
|
||||
|
||||
"custom": {
|
||||
"modmenu": {
|
||||
"links": {
|
||||
"modmenu.discord": "https://discord.gg/D46vGJeCfj"
|
||||
},
|
||||
"update_checker": true
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue