Skip to content

Commit

Permalink
EnhancedQuarry 1.2.0-RC5
Browse files Browse the repository at this point in the history
  • Loading branch information
PTOM76 committed Oct 9, 2021
1 parent 476aa04 commit 7ecc9a3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ loader_version=0.11.6

fabric_version=0.40.1+1.16

mod_version = 1.2.0_RC4
mod_version = 1.2.0_RC6
maven_group = ml.pkom
archives_base_name = EnhancedQuarries-1.16.5
8 changes: 8 additions & 0 deletions src/main/java/ml/pkom/enhancedquarries/block/Frame.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.*;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemPlacementContext;
import net.minecraft.state.StateManager;
import net.minecraft.state.property.BooleanProperty;
Expand Down Expand Up @@ -91,6 +92,7 @@ public static BlockState getPlacementStateDefine(World world, BlockPos pos) {

@Override
public BlockState getStateForNeighborUpdate(BlockState state, Direction direction, BlockState neighborState, WorldAccess world, BlockPos pos, BlockPos neighborPos) {
if (world.isClient()) return super.getStateForNeighborUpdate(state, direction, neighborState, world, pos, neighborPos);
return state.with(ConnectingBlock.FACING_PROPERTIES.get(direction), canConnect(world, pos.offset(direction)));
}

Expand All @@ -102,6 +104,12 @@ public static boolean canConnect(World world, BlockPos blockPos) {
return world.getBlockState(blockPos).getBlock() == getBlock();
}

@Override
public void onBreak(World world, BlockPos pos, BlockState state, PlayerEntity player) {
super.onBreak(world, pos, state, player);
breakConnectFrames(world, pos);
}

public static void breakConnectFrames(World world, BlockPos pos) {
if (!world.isClient()) {
if (!(world.getBlockState(pos).getBlock() instanceof Frame)) return;
Expand Down

0 comments on commit 7ecc9a3

Please sign in to comment.