Skip to content

Commit a5ce525

Browse files
committedFeb 19, 2025··
fix: send neighbor update on side configuration change
also add fabric-data-attachment-api as a dependency
1 parent 5e0d195 commit a5ce525

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed
 

‎build.gradle.kts

+1
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ dependencies {
175175
listOf(
176176
"fabric-api-base",
177177
"fabric-api-lookup-api-v1",
178+
"fabric-data-attachment-api-v1",
178179
"fabric-gametest-api-v1",
179180
"fabric-item-api-v1",
180181
"fabric-model-loading-api-v1",

‎src/main/java/dev/galacticraft/machinelib/api/block/entity/ConfiguredBlockEntity.java

+6
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
import net.minecraft.world.level.block.Blocks;
4747
import net.minecraft.world.level.block.entity.BlockEntityType;
4848
import net.minecraft.world.level.block.state.BlockState;
49+
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
4950
import org.jetbrains.annotations.Contract;
5051
import org.jetbrains.annotations.NotNull;
5152
import org.jetbrains.annotations.Nullable;
@@ -356,6 +357,11 @@ public void setOption(@NotNull ResourceType type, @NotNull ResourceFlow flow) {
356357
this.type = type;
357358
this.flow = flow;
358359

360+
ConfiguredBlockEntity.this.level.neighborChanged(
361+
ConfiguredBlockEntity.this.worldPosition.relative(face.toDirection(ConfiguredBlockEntity.this.getBlockState().getValue(BlockStateProperties.HORIZONTAL_FACING))),
362+
ConfiguredBlockEntity.this.getBlockState().getBlock(),
363+
ConfiguredBlockEntity.this.worldPosition
364+
);
359365
ConfiguredBlockEntity.this.setChanged();
360366
ConfiguredBlockEntity.this.requestRerender();
361367
if (ConfiguredBlockEntity.this.level != null && !ConfiguredBlockEntity.this.level.isClientSide) {

0 commit comments

Comments
 (0)
Please sign in to comment.