Fix minor bugs

This commit is contained in:
Andrew-71 2024-04-30 17:45:00 +03:00
parent 0f7b1616e1
commit 3114d9a3e1
7 changed files with 28 additions and 19 deletions

View file

@ -1,4 +1,6 @@
### Changelog 0.1 -> 0.2
# Changelog
## Changelog 0.1 -> 0.2
* Added new "Dirt Road" block
* Made by tilling coarse dirt with a rake. Right now you get 1 flint out of the process as a placeholder drop
@ -27,7 +29,7 @@
* Updated one of authors' nicks in credits
* Moved to newer versions of Yarn, Loom, Fabric loader & API
### Changelog 0.2 -> 0.3
## Changelog 0.2 -> 0.3
This version focuses on QOL and bug fixes
* Added Russian (ru_ru) and pre-reform Russian (ru_rpr) translations
@ -50,7 +52,7 @@ This version focuses on QOL and bug fixes
* Deleted various unused files - code, textures and models
* Bumped Fabric API, loader and mappings versions
### Changelog 0.3 -> 0.4.0
## Changelog 0.3 -> 0.4.0
Due to sheer amount of changes, many may be undocumented. We hope you enjoy this update! :D
* Added dozens of new blocks
@ -85,6 +87,7 @@ Due to sheer amount of changes, many may be undocumented. We hope you enjoy this
* Stone-cutting recipe for slabs now gives 2 blocks
* Fixed typos in Russian translation
* Cigarettes are now less broken (and more numerous)
* TVs now stay broken when picked up as items (use glass pane to repair)
* Fixed a few missing drops/tags/recipes related to concrete
* Concrete with bars is now pickaxe mine-able
* Fixed some concrete blocks missing drops
@ -93,4 +96,10 @@ Due to sheer amount of changes, many may be undocumented. We hope you enjoy this
* Changed parts of file structure for models and textures
* Removed some unused textures intended for later updates
* Moved to newer Fabric, Loom etc. versions. Took a while to figure out how to update Gradle :D
* Source-sets main and client have been merged to fix mixins
* Source-sets main and client have been merged to fix mixins
## Changelog 0.4.0 -> 0.4.1
This is a *minor* update fixing some bugs
* Barbed wire now damages foxes and bees
* Purple goo now slows down properly

10
TODO.md
View file

@ -7,4 +7,12 @@
* Po-2 wall and crate...? - missing
* Rusty blue iron bars - missing
* Nutrient block - missing by design
* Chess & Checkers figurines - missing
* Chess & Checkers figurines - missing
## 0.4.1 aims
* Fix WindowBlock class!!!
* Boundary markers should keep and display their dye as items
* Overall clean-up code where possible
* Paintings/Posters?
* Whitewashing should be done like a proper tool

View file

@ -4,7 +4,6 @@ import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.LivingEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
@ -16,7 +15,7 @@ public class BarbedWireBlock extends Block {
}
public void onEntityCollision(BlockState state, World world, BlockPos pos, Entity entity) {
if (entity instanceof LivingEntity && entity.getType() != EntityType.FOX && entity.getType() != EntityType.BEE) {
if (entity instanceof LivingEntity) {
entity.slowMovement(state, new Vec3d(0.200000011920929, 0.25, 0.200000011920929));
if (!world.isClient && (entity.lastRenderX != entity.getX() || entity.lastRenderZ != entity.getZ())) {
double d = Math.abs(entity.getX() - entity.lastRenderX);

View file

@ -9,10 +9,8 @@ import su.a71.new_soviet.registration.NSE_Sounds;
public class GooBlock extends SnowBlock {
private final double entity_speed;
public GooBlock(Settings settings, double entity_speed) {
public GooBlock(Settings settings) {
super(settings.sounds(NSE_Sounds.GOO_SOUNDS).pistonBehavior(PistonBehavior.DESTROY));
this.entity_speed = entity_speed;
this.setDefaultState(this.stateManager.getDefaultState().with(LAYERS, 1));
}

View file

@ -31,17 +31,14 @@ public class WallpaperBlock extends Block {
@Override
public void neighborUpdate(BlockState state, World world, BlockPos pos, Block block, BlockPos fromPos, boolean notify) {
BlockState updatedBlockState = state.with(HAS_BASEBOARD, isFullBlock(world, pos));
world.setBlockState(pos, updatedBlockState);
}
private boolean isFullBlock(WorldAccess world, BlockPos pos) {
pos = pos.down();
BlockState state = world.getBlockState(pos);
Block block = state.getBlock();
//return (!state.getCollisionShape(world, pos).getFace(Direction.UP).isEmpty() || state.isSideSolidFullSquare(world, pos, Direction.UP)) && !(block instanceof WallpaperBlock);
return block.isShapeFullCube(state, world, pos) && !(block instanceof WallpaperBlock) && (!block.isTransparent(state, world, pos));
return state.isFullCube(world, pos) && !(block instanceof WallpaperBlock) && (!block.isTransparent(state, world, pos));
}
}

View file

@ -39,6 +39,7 @@ import su.a71.new_soviet.util.Shapes;
import java.util.List;
import java.util.Objects;
// FIXME: This whole class is horrifying, and has bugs!!! -Andrew71 30.04.2024
public class WindowBlock extends HorizontalFacingBlock {
public static final IntProperty WINDOW_TYPE = IntProperty.of("window_type", 0, 3);
public static final BooleanProperty BROKEN = Properties.CRACKED;
@ -54,9 +55,6 @@ public class WindowBlock extends HorizontalFacingBlock {
public static final Shapes.HorizontalShape PANE_FRAME_SHAPE;
private final boolean pane;
@Nullable
private Item cachedItem;
public WindowBlock(Settings settings, boolean pane) {
super(settings);
this.pane = pane;
@ -355,7 +353,7 @@ public class WindowBlock extends HorizontalFacingBlock {
}
}
}
BlockState updatedBlockState = state;
BlockState updatedBlockState;
if (!state.get(CLOSED)) {
updatedBlockState = state
.with(WINDOW_TYPE, window_type)

View file

@ -591,7 +591,7 @@ public class NSE_Blocks extends NSE_BaseRegistration {
public static final Block MEAT = new Block(FabricBlockSettings.create().velocityMultiplier(0.8f).sounds(NSE_Sounds.MEAT_SOUNDS).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 GooBlock PURPLE_GOO = new GooBlock(FabricBlockSettings.copy(MEAT).mapColor(MapColor.PURPLE).hardness(1.2f), 0.5f);
public static final GooBlock PURPLE_GOO = new GooBlock(FabricBlockSettings.copy(MEAT).mapColor(MapColor.PURPLE).hardness(1.2f).velocityMultiplier(0.5f));
public static final Block ACACIA_WINDOW = new WindowBlock(FabricBlockSettings.copy(Blocks.OAK_DOOR), false);
public static final Block ACACIA_PANE_WINDOW = new WindowBlock(FabricBlockSettings.copy(NSE_Blocks.ACACIA_WINDOW), true);