Skip to content

Commit

Permalink
fix: facade issues
Browse files Browse the repository at this point in the history
- remove facades when removing the block
- fix facade dupe
- remove unused code
  • Loading branch information
ferriarnus committed Dec 30, 2024
1 parent cb5d016 commit ff23e13
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,6 @@ public class ConduitClientSetup {
public static final ModelResourceLocation CONDUIT_IO_OUT = loc("block/io/output");
public static final ModelResourceLocation CONDUIT_IO_REDSTONE = loc("block/io/redstone");

public static final ModelResourceLocation CONDUIT_FACADE = loc("block/conduit_facade");
public static final ModelResourceLocation CONDUIT_FACADE_HARDENED = loc("block/conduit_facade_hardened");
public static final ModelResourceLocation CONDUIT_FACADE_TRANSLUCENT = loc("block/conduit_facade_translucent");
public static final ModelResourceLocation CONDUIT_FACADE_TRANSLUCENT_HARDENED = loc(
"block/conduit_facade_translucent_hardened");

private ConduitClientSetup() {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ public Optional<FacadeType> facadeType() {
}

public void facade(ItemStack facadeItem) {
this.facadeItem = facadeItem.copy();
this.facadeItem = facadeItem.copyWithCount(1);
onChanged();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,14 @@ private void onChunkUnloaded(ConduitSavedData savedData, Holder<Conduit<?>> cond
savedData.putUnloadedNodeIdentifier(conduit, this.worldPosition, node);
}

@Override
public void setRemoved() {
super.setRemoved();
if (level != null && level.isClientSide) {
FACADES.remove(worldPosition);
}
}

public void everyTick() {
if (level != null && !level.isClientSide) {
serverTick();
Expand Down

0 comments on commit ff23e13

Please sign in to comment.