Skip to content

Commit

Permalink
cleanup getCaps
Browse files Browse the repository at this point in the history
  • Loading branch information
IThundxr committed Apr 20, 2024
1 parent 8bac28d commit 4209635
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,14 @@ public VendorBlockEntityCapabilities(BlockEntityType<?> type, BlockPos pos, Bloc

@Override
public <T> @NotNull LazyOptional<T> getCapability(@NotNull Capability<T> capability, @Nullable Direction facing) {
if (remove || facing == null || capability != ForgeCapabilities.ITEM_HANDLER) {
return super.getCapability(capability, facing);
} else if (facing == Direction.UP) {
return numismatics$handlers[0].cast();
} else {
return facing == Direction.DOWN ? numismatics$handlers[1].cast() : numismatics$handlers[2].cast();
if (capability == ForgeCapabilities.ITEM_HANDLER && facing != null && !remove) {
return switch (facing) {
case UP -> numismatics$handlers[0].cast();
case DOWN -> numismatics$handlers[1].cast();
default -> numismatics$handlers[2].cast();
};
}
return super.getCapability(capability, facing);
}

@Override
Expand Down

0 comments on commit 4209635

Please sign in to comment.