From 3114d9a3e10ddf7536e05f11a36c609b523c7649 Mon Sep 17 00:00:00 2001 From: Andrew-71 Date: Tue, 30 Apr 2024 17:45:00 +0300 Subject: [PATCH] Fix minor bugs --- CHANGELOG | 17 +++++++++++++---- TODO.md | 10 +++++++++- .../a71/new_soviet/blocks/BarbedWireBlock.java | 3 +-- .../java/su/a71/new_soviet/blocks/GooBlock.java | 4 +--- .../a71/new_soviet/blocks/WallpaperBlock.java | 5 +---- .../su/a71/new_soviet/blocks/WindowBlock.java | 6 ++---- .../a71/new_soviet/registration/NSE_Blocks.java | 2 +- 7 files changed, 28 insertions(+), 19 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 62a939d..b022a3e 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -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 \ No newline at end of file + * 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 \ No newline at end of file diff --git a/TODO.md b/TODO.md index f827560..b1f41cc 100644 --- a/TODO.md +++ b/TODO.md @@ -7,4 +7,12 @@ * Po-2 wall and crate...? - missing * Rusty blue iron bars - missing * Nutrient block - missing by design -* Chess & Checkers figurines - missing \ No newline at end of file +* 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 \ No newline at end of file diff --git a/src/main/java/su/a71/new_soviet/blocks/BarbedWireBlock.java b/src/main/java/su/a71/new_soviet/blocks/BarbedWireBlock.java index 7f399d5..206e095 100644 --- a/src/main/java/su/a71/new_soviet/blocks/BarbedWireBlock.java +++ b/src/main/java/su/a71/new_soviet/blocks/BarbedWireBlock.java @@ -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); diff --git a/src/main/java/su/a71/new_soviet/blocks/GooBlock.java b/src/main/java/su/a71/new_soviet/blocks/GooBlock.java index 858ffda..368bcc5 100644 --- a/src/main/java/su/a71/new_soviet/blocks/GooBlock.java +++ b/src/main/java/su/a71/new_soviet/blocks/GooBlock.java @@ -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)); } diff --git a/src/main/java/su/a71/new_soviet/blocks/WallpaperBlock.java b/src/main/java/su/a71/new_soviet/blocks/WallpaperBlock.java index 3bedb8f..325640b 100644 --- a/src/main/java/su/a71/new_soviet/blocks/WallpaperBlock.java +++ b/src/main/java/su/a71/new_soviet/blocks/WallpaperBlock.java @@ -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)); } } \ No newline at end of file diff --git a/src/main/java/su/a71/new_soviet/blocks/WindowBlock.java b/src/main/java/su/a71/new_soviet/blocks/WindowBlock.java index b07f07c..eb89857 100644 --- a/src/main/java/su/a71/new_soviet/blocks/WindowBlock.java +++ b/src/main/java/su/a71/new_soviet/blocks/WindowBlock.java @@ -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) 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 3594bf3..6bd9b5c 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 @@ -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);